From xen-changelog-bounces@lists.xenproject.org Tue Apr 01 10:55:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Apr 2025 10:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.933869.1335686 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzZGq-0003dV-E6; Tue, 01 Apr 2025 10:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 933869.1335686; Tue, 01 Apr 2025 10: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 1tzZGq-0003dN-B6; Tue, 01 Apr 2025 10:55:04 +0000
Received: by outflank-mailman (input) for mailman id 933869;
 Tue, 01 Apr 2025 10:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1tzZGo-0003dH-L2
 for xen-changelog@lists.xenproject.org; Tue, 01 Apr 2025 10:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzZGo-005OhG-1I
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 10:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzZGo-00FofQ-14
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 10:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QtQDvnEVFy8AyJx9kSuk0D2btPzgDkTAUSvB9pGlcI8=; b=10ug04tCjidErfoMEXKWLHlPra
	0/s7Sb06b0pmq+hRnIvUHvub2rkdxnpvuwaRZejywOrlGVRcPk/lsVqob/1prtj8ER6mU+QVFpuTs
	HamhjLh9Fp3Jqbbporon2tU2+U7n+SfzcKAyrvr421OGYyC3lySRTOGDL5R0v8x8Wsbc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] Arm32: use new-style entry annotations for MMU code
Message-Id: <E1tzZGo-00FofQ-14@xenbits.xenproject.org>
Date: Tue, 01 Apr 2025 10:55:02 +0000

commit 0ca25bb1be64ae3429ca5c438a787a191dc06e79
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 1 12:42:39 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 1 12:42:39 2025 +0200

    Arm32: use new-style entry annotations for MMU code
    
    Locally override SYM_PUSH_SECTION() to retain the intended section
    association.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Luca Fancellu <luca.fancellu@arm.com> # arm
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/arm32/mmu/head.S | 37 +++++++++++++++++++------------------
 1 file changed, 19 insertions(+), 18 deletions(-)

diff --git a/xen/arch/arm/arm32/mmu/head.S b/xen/arch/arm/arm32/mmu/head.S
index 8fa74bd556..5032e6c075 100644
--- a/xen/arch/arm/arm32/mmu/head.S
+++ b/xen/arch/arm/arm32/mmu/head.S
@@ -174,7 +174,7 @@
  *
  * Clobbers r0 - r5
  */
-create_page_tables:
+FUNC_LOCAL(create_page_tables)
         /* Prepare the page-tables for mapping Xen */
         mov_w r0, XEN_VIRT_START
 
@@ -263,7 +263,7 @@ use_temporary_mapping:
 
         mov   r12, #1                /* r12 := temporary mapping created */
         mov   pc, lr
-ENDPROC(create_page_tables)
+END(create_page_tables)
 
 /*
  * Turn on the Data Cache and the MMU. The function will return
@@ -276,7 +276,7 @@ ENDPROC(create_page_tables)
  *
  * Clobbers r0 - r5
  */
-enable_mmu:
+FUNC_LOCAL(enable_mmu)
         PRINT("- Turning on paging -\r\n")
 
         /* Set up memory attribute type tables */
@@ -361,7 +361,7 @@ enable_mmu:
         teq   r12, #0
         beq   remove_identity_mapping
         b     remove_temporary_mapping
-ENDPROC(enable_mmu)
+END(enable_mmu)
 
 /*
  * Switch to the runtime mapping. The logic depends on whether the
@@ -381,7 +381,7 @@ ENDPROC(enable_mmu)
  *
  * Clobbers r0 - r4
  */
-switch_to_runtime_mapping:
+FUNC_LOCAL(switch_to_runtime_mapping)
         /*
          * Jump to the runtime mapping if the virt and phys are not
          * clashing
@@ -426,7 +426,7 @@ ready_to_switch:
         PRINT_ID("- Jumping to runtime address -\r\n")
 
         mov   pc, lr
-ENDPROC(switch_to_runtime_mapping)
+END(switch_to_runtime_mapping)
 
 /*
  * Enable mm (turn on the data cache and the MMU) for secondary CPUs.
@@ -443,7 +443,7 @@ ENDPROC(switch_to_runtime_mapping)
  *
  * Clobbers r0 - r6
  */
-ENTRY(enable_secondary_cpu_mm)
+FUNC(enable_secondary_cpu_mm)
         mov   r6, lr
 
         bl    create_page_tables
@@ -471,7 +471,7 @@ ENTRY(enable_secondary_cpu_mm)
 
         /* Return to the virtual address requested by the caller. */
         mov   pc, r6
-ENDPROC(enable_secondary_cpu_mm)
+END(enable_secondary_cpu_mm)
 
 /*
  * Enable mm (turn on the data cache and the MMU) for the boot CPU.
@@ -489,7 +489,7 @@ ENDPROC(enable_secondary_cpu_mm)
  *
  * Clobbers r0 - r6
  */
-ENTRY(enable_boot_cpu_mm)
+FUNC(enable_boot_cpu_mm)
         mov   r6, lr
 
 #ifdef CONFIG_EARLY_PRINTK
@@ -506,7 +506,7 @@ ENTRY(enable_boot_cpu_mm)
         /* Address in the runtime mapping to jump to after the MMU is enabled */
         mov   lr, r6
         b     enable_mmu
-ENDPROC(enable_boot_cpu_mm)
+END(enable_boot_cpu_mm)
 
 /*
  * Remove the 1:1 map from the page-tables. It is not easy to keep track
@@ -518,7 +518,7 @@ ENDPROC(enable_boot_cpu_mm)
  *
  * Clobbers r0 - r3
  */
-remove_identity_mapping:
+FUNC_LOCAL(remove_identity_mapping)
         PRINT("- Removing the identity mapping -\r\n")
 
         /* r2:r3 := invalid page-table entry */
@@ -533,14 +533,14 @@ remove_identity_mapping:
 
         flush_xen_tlb_local r0
         mov   pc, lr
-ENDPROC(remove_identity_mapping)
+END(remove_identity_mapping)
 
 /*
  * Remove the temporary mapping of Xen starting at TEMPORARY_XEN_VIRT_START.
  *
  * Clobbers r0 - r3
  */
-remove_temporary_mapping:
+FUNC_LOCAL(remove_temporary_mapping)
         PRINT("- Removing the temporary mapping -\r\n")
 
         /* r2:r3 := invalid page-table entry */
@@ -556,13 +556,14 @@ remove_temporary_mapping:
         flush_xen_tlb_local r0
 
         mov  pc, lr
-ENDPROC(remove_temporary_mapping)
+END(remove_temporary_mapping)
 
 /* Fail-stop */
-fail:   PRINT("- Boot failed -\r\n")
+FUNC_LOCAL(fail)
+        PRINT("- Boot failed -\r\n")
 1:      wfe
         b     1b
-ENDPROC(fail)
+END(fail)
 
 /*
  * Switch TTBR
@@ -570,7 +571,7 @@ ENDPROC(fail)
  *
  * TODO: This code does not comply with break-before-make.
  */
-ENTRY(switch_ttbr)
+FUNC(switch_ttbr)
         dsb                            /* Ensure the flushes happen before
                                         * continuing */
         isb                            /* Ensure synchronization with previous
@@ -594,4 +595,4 @@ ENTRY(switch_ttbr)
         isb
 
         mov pc, lr
-ENDPROC(switch_ttbr)
+END(switch_ttbr)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 01 10:55:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Apr 2025 10:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.933870.1335690 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzZH0-0003fj-GU; Tue, 01 Apr 2025 10:55:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 933870.1335690; Tue, 01 Apr 2025 10: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 1tzZH0-0003fb-Dx; Tue, 01 Apr 2025 10:55:14 +0000
Received: by outflank-mailman (input) for mailman id 933870;
 Tue, 01 Apr 2025 10:55:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1tzZGy-0003fF-HC
 for xen-changelog@lists.xenproject.org; Tue, 01 Apr 2025 10:55:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzZGy-005OhM-1a
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 10:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzZGy-00Foka-1T
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 10:55:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nGvbUTlG1SRgKQeG/5WBotmribvKYsuw2gDj07ps41c=; b=2Jm6NTpWWA3nCPXpH/wluBzijb
	hhpFvJ5WAzkMGHkzY9vSnj0p+sH8PQ8sGhglNcbdUER+rE0NOn0f/hNGJRuQUbs+CMKBZT4uCVcWn
	6yZUdey6y5MdtPI2oBNsgxL9vKBjuT6AmWJmPkCimPGGC9FledHsFoiLXVYHTj5bHR6w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] Arm32: use new-style entry annotations in head.S
Message-Id: <E1tzZGy-00Foka-1T@xenbits.xenproject.org>
Date: Tue, 01 Apr 2025 10:55:12 +0000

commit 98c75f9c3a24afb1128c67827b64353cbabfdc47
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 1 12:43:06 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 1 12:43:06 2025 +0200

    Arm32: use new-style entry annotations in head.S
    
    Locally override SYM_PUSH_SECTION() to retain the intended section
    association.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Luca Fancellu <luca.fancellu@arm.com> # arm
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/arm32/head.S | 48 ++++++++++++++++++++++++-----------------------
 1 file changed, 25 insertions(+), 23 deletions(-)

diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index 50da179f81..63453dd3a3 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -54,7 +54,7 @@
          * It should be linked at XEN_VIRT_START, and loaded at any
          * 4K-aligned address.
          */
-GLOBAL(start)
+FUNC(start)
         /*
          * zImage magic header, see:
          * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
@@ -104,9 +104,9 @@ primary_switched:
         mov   r0, r8                 /* r0 := paddr(FDT) */
         mov_w r1, start_xen
         b     launch
-ENDPROC(start)
+END(start)
 
-GLOBAL(init_secondary)
+FUNC(init_secondary)
         cpsid aif                    /* Disable all interrupts */
 
         /* Find out where we are */
@@ -142,7 +142,7 @@ secondary_switched:
         /* Jump to C world */
         mov_w r1, start_secondary
         b     launch
-ENDPROC(init_secondary)
+END(init_secondary)
 
 /*
  * Check if the CPU supports virtualization extensions and has been booted
@@ -154,7 +154,7 @@ ENDPROC(init_secondary)
  *
  * Clobbers r0 - r3
  */
-check_cpu_mode:
+FUNC_LOCAL(check_cpu_mode)
         /* Check that this CPU has Hyp mode */
         mrc   CP32(r0, ID_PFR1)
         and   r0, r0, #0xf000        /* Bits 12-15 define virt extensions */
@@ -174,14 +174,14 @@ check_cpu_mode:
         PRINT("- Xen must be entered in NS Hyp mode -\r\n")
         PRINT("- Please update the bootloader -\r\n")
         b     fail
-ENDPROC(check_cpu_mode)
+END(check_cpu_mode)
 
 /*
  * Zero BSS
  *
  * Clobbers r0 - r3
  */
-zero_bss:
+FUNC_LOCAL(zero_bss)
         PRINT("- Zero BSS -\r\n")
         mov_w r0, __bss_start        /* r0 := vaddr(__bss_start) */
         mov_w r1, __bss_end          /* r1 := vaddr(__bss_end)   */
@@ -195,9 +195,9 @@ zero_bss:
 
 skip_bss:
         mov   pc, lr
-ENDPROC(zero_bss)
+END(zero_bss)
 
-cpu_init:
+FUNC_LOCAL(cpu_init)
         PRINT("- Setting up control registers -\r\n")
 
         mov   r5, lr                       /* r5 := return address */
@@ -224,7 +224,7 @@ cpu_init_done:
         isb
 
         mov   pc, r5                        /* Return address is in r5 */
-ENDPROC(cpu_init)
+END(cpu_init)
 
 /*
  * Setup the initial stack and jump to the C world
@@ -235,7 +235,7 @@ ENDPROC(cpu_init)
  *
  * Clobbers r3
  */
-launch:
+FUNC_LOCAL(launch)
         mov_w r3, init_data
         add   r3, #INITINFO_stack    /* Find the boot-time stack */
         ldr   sp, [r3]
@@ -244,13 +244,14 @@ launch:
 
         /* Jump to C world */
        bx    r1
-ENDPROC(launch)
+END(launch)
 
 /* Fail-stop */
-fail:   PRINT("- Boot failed -\r\n")
+FUNC_LOCAL(fail)
+        PRINT("- Boot failed -\r\n")
 1:      wfe
         b     1b
-ENDPROC(fail)
+END(fail)
 
 #ifdef CONFIG_EARLY_PRINTK
 /*
@@ -261,14 +262,14 @@ ENDPROC(fail)
  *
  * Clobbers r0 - r3
  */
-init_uart:
+FUNC_LOCAL(init_uart)
         mov_w r11, CONFIG_EARLY_UART_BASE_ADDRESS
 #ifdef CONFIG_EARLY_UART_INIT
         early_uart_init r11, r1, r2
 #endif
         PRINT("- UART enabled -\r\n")
         mov   pc, lr
-ENDPROC(init_uart)
+END(init_uart)
 
 /*
  * Print early debug messages.
@@ -277,14 +278,14 @@ ENDPROC(init_uart)
  * r11: Early UART base address
  * Clobbers r0-r1
  */
-ENTRY(asm_puts)
+FUNC(asm_puts)
         early_uart_ready r11, r1
         ldrb  r1, [r0], #1           /* Load next char */
         teq   r1, #0                 /* Exit on nul */
         moveq pc, lr
         early_uart_transmit r11, r1
         b asm_puts
-ENDPROC(asm_puts)
+END(asm_puts)
 
 /*
  * Print a 32-bit number in hex.
@@ -293,7 +294,7 @@ ENDPROC(asm_puts)
  * r11: Early UART base address
  * Clobbers r0-r3
  */
-ENTRY(asm_putn)
+FUNC(asm_putn)
         adr_l r1, hex
         mov   r3, #8
 1:
@@ -305,18 +306,19 @@ ENTRY(asm_putn)
         subs  r3, r3, #1
         bne   1b
         mov   pc, lr
-ENDPROC(asm_putn)
+END(asm_putn)
 
 RODATA_SECT(.rodata.idmap, hex, "0123456789abcdef")
 
 #endif /* CONFIG_EARLY_PRINTK */
 
 /* This provides a C-API version of __lookup_processor_type */
-ENTRY(lookup_processor_type)
+FUNC(lookup_processor_type)
         stmfd sp!, {r4, lr}
         bl    __lookup_processor_type
         mov r0, r1
         ldmfd sp!, {r4, pc}
+END(lookup_processor_type)
 
 /*
  * Read processor ID register (CP#15, CR0), and Look up in the linker-built
@@ -327,7 +329,7 @@ ENTRY(lookup_processor_type)
  * r1: proc_info pointer
  * Clobbers r2-r4
  */
-__lookup_processor_type:
+FUNC_LOCAL(__lookup_processor_type)
         mrc   CP32(r0, MIDR)                /* r0 := our cpu id */
         adr_l r1, __proc_info_start
         adr_l r2, __proc_info_end
@@ -343,7 +345,7 @@ __lookup_processor_type:
         mov   r1, #0
 2:
         mov   pc, lr
-ENDPROC(__lookup_processor_type)
+END(__lookup_processor_type)
 
 /*
  * Local variables:
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 01 10:55:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Apr 2025 10:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.933871.1335694 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzZH9-0003iZ-I6; Tue, 01 Apr 2025 10:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 933871.1335694; Tue, 01 Apr 2025 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 1tzZH9-0003iP-FM; Tue, 01 Apr 2025 10:55:23 +0000
Received: by outflank-mailman (input) for mailman id 933871;
 Tue, 01 Apr 2025 10:55:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1tzZH8-0003iH-Ji
 for xen-changelog@lists.xenproject.org; Tue, 01 Apr 2025 10:55:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzZH8-005OhQ-1r
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 10:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzZH8-00Fomj-1l
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 10:55:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=FNMEbJ/Fv80t76iiJOJNPufv4dmc8CHY4POBCwbLq8U=; b=fGUsBDTASjom+UeGvMRuWzzuz1
	tqNSOGFXdDKxsXfn9F1LRSac7hrVir+uqG42iBxo/QtrRp8z5a5Bn+hXbS7blYlo4PgsYpclJBRXk
	CrjP0vX7TDdbTQuDttkC1v1a1GkvqxTH9HvOl9vhcwybMEDY2oT0C13c6hH1DdYcz97U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] Arm: purge ENTRY(), ENDPROC(), and ALIGN
Message-Id: <E1tzZH8-00Fomj-1l@xenbits.xenproject.org>
Date: Tue, 01 Apr 2025 10:55:22 +0000

commit 221c66f4f2a49a77eb65cbaaaa3de2a6140fa392
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 1 12:43:35 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 1 12:43:35 2025 +0200

    Arm: purge ENTRY(), ENDPROC(), and ALIGN
    
    They're no longer used. This also makes it unnecessary to #undef two of
    them in the linker script.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Tested-by: Luca Fancellu <luca.fancellu@arm.com> # arm
---
 xen/arch/arm/include/asm/config.h | 8 --------
 xen/arch/arm/xen.lds.S            | 2 --
 2 files changed, 10 deletions(-)

diff --git a/xen/arch/arm/include/asm/config.h b/xen/arch/arm/include/asm/config.h
index 0a51142efd..799bc2a8ac 100644
--- a/xen/arch/arm/include/asm/config.h
+++ b/xen/arch/arm/include/asm/config.h
@@ -53,17 +53,9 @@
 
 /* Linkage for ARM */
 #ifdef __ASSEMBLY__
-#define ALIGN .balign CONFIG_FUNCTION_ALIGNMENT
-#define ENTRY(name)                             \
-  .globl name;                                  \
-  ALIGN;                                        \
-  name:
 #define GLOBAL(name)                            \
   .globl name;                                  \
   name:
-#define ENDPROC(name) \
-  .type name, %function; \
-  END(name)
 #endif
 
 #include <xen/const.h>
diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index bbccff1a03..325b8059fd 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -6,8 +6,6 @@
 #include <xen/lib.h>
 #include <xen/xen.lds.h>
 #include <asm/page.h>
-#undef ENTRY
-#undef ALIGN
 
 ENTRY(start)
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 01 10:55:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Apr 2025 10:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.933872.1335697 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzZHJ-0003lN-JS; Tue, 01 Apr 2025 10:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 933872.1335697; Tue, 01 Apr 2025 10: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 1tzZHJ-0003lF-Gn; Tue, 01 Apr 2025 10:55:33 +0000
Received: by outflank-mailman (input) for mailman id 933872;
 Tue, 01 Apr 2025 10: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 1tzZHI-0003l4-Ne
 for xen-changelog@lists.xenproject.org; Tue, 01 Apr 2025 10: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 1tzZHI-005OhW-2G
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 10:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzZHI-00FopB-23
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 10: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=5kjIiQYWl6FIGdWaY8piS5l+4voTirf038aYFoZ1RxM=; b=DCLEPuKlyzDXYzktPcv5kbGtL+
	q2aRraSjMseSCPRnBOkc8/17AJRHyqaqyl3OXk0Iyp8WYNjGynkELMKPEuwjyQjvpjEmbctquoZCM
	Iq0UbRW3cGOXozTyG9ekazbMW1xMqz1v3mq0FaP9JDyGdnPhr2mDShw9jy67ispQEUow=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: introduce preinit_xen_time()
Message-Id: <E1tzZHI-00FopB-23@xenbits.xenproject.org>
Date: Tue, 01 Apr 2025 10:55:32 +0000

commit 025a9858fe69c6e36fd114501984ecc805cc2c42
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Tue Apr 1 12:44:51 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 1 12:44:51 2025 +0200

    xen/riscv: introduce preinit_xen_time()
    
    preinit_xen_time() does two things:
    1. Parse timebase-frequency properpy of /cpus node to initialize cpu_khz
       variable.
    2. Initialize boot_clock_cycles with the current time counter value to
       have starting point for Xen.
    
    timebase-frequency is read as a uint32_t because it is unlikely that the
    timer will run at more than 4 GHz. If timebase-frequency exceeds 4 GHz,
    a panic() is triggered, since dt_property_read_u32() will return 0 if
    the size of the timebase-frequency property is greater than the size of
    the output variable.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/Makefile           |  1 +
 xen/arch/riscv/include/asm/time.h |  6 ++++++
 xen/arch/riscv/setup.c            |  2 ++
 xen/arch/riscv/stubs.c            |  2 --
 xen/arch/riscv/time.c             | 42 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 51 insertions(+), 2 deletions(-)

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index b0c8270a99..82016a957a 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -9,6 +9,7 @@ obj-y += setup.o
 obj-y += shutdown.o
 obj-y += smp.o
 obj-y += stubs.o
+obj-y += time.o
 obj-y += traps.o
 obj-y += vm_event.o
 
diff --git a/xen/arch/riscv/include/asm/time.h b/xen/arch/riscv/include/asm/time.h
index fc1572e9b4..e8d9ffec57 100644
--- a/xen/arch/riscv/include/asm/time.h
+++ b/xen/arch/riscv/include/asm/time.h
@@ -3,8 +3,12 @@
 #define ASM__RISCV__TIME_H
 
 #include <xen/bug.h>
+#include <xen/types.h>
 #include <asm/csr.h>
 
+/* Clock cycles count at Xen startup */
+extern uint64_t boot_clock_cycles;
+
 struct vcpu;
 
 static inline void force_update_vcpu_system_time(struct vcpu *v)
@@ -19,6 +23,8 @@ static inline cycles_t get_cycles(void)
     return csr_read(CSR_TIME);
 }
 
+void preinit_xen_time(void);
+
 #endif /* ASM__RISCV__TIME_H */
 
 /*
diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c
index b0e587678e..836ad16fed 100644
--- a/xen/arch/riscv/setup.c
+++ b/xen/arch/riscv/setup.c
@@ -126,6 +126,8 @@ void __init noreturn start_xen(unsigned long bootcpu_id,
 
     riscv_fill_hwcap();
 
+    preinit_xen_time();
+
     printk("All set up\n");
 
     machine_halt();
diff --git a/xen/arch/riscv/stubs.c b/xen/arch/riscv/stubs.c
index 5951b0ce91..caa133de84 100644
--- a/xen/arch/riscv/stubs.c
+++ b/xen/arch/riscv/stubs.c
@@ -27,8 +27,6 @@ nodemask_t __read_mostly node_online_map = { { [0] = 1UL } };
 
 /* time.c */
 
-unsigned long __ro_after_init cpu_khz;  /* CPU clock frequency in kHz. */
-
 s_time_t get_s_time(void)
 {
     BUG_ON("unimplemented");
diff --git a/xen/arch/riscv/time.c b/xen/arch/riscv/time.c
new file mode 100644
index 0000000000..905bb13eb4
--- /dev/null
+++ b/xen/arch/riscv/time.c
@@ -0,0 +1,42 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#include <xen/acpi.h>
+#include <xen/device_tree.h>
+#include <xen/init.h>
+#include <xen/lib.h>
+#include <xen/sections.h>
+
+unsigned long __ro_after_init cpu_khz; /* CPU clock frequency in kHz. */
+uint64_t __ro_after_init boot_clock_cycles;
+
+/* Set up the timer on the boot CPU (early init function) */
+static void __init preinit_dt_xen_time(void)
+{
+    static const struct dt_device_match __initconstrel timer_ids[] =
+    {
+        DT_MATCH_PATH("/cpus"),
+        { /* sentinel */ },
+    };
+    struct dt_device_node *timer;
+    uint32_t rate;
+
+    timer = dt_find_matching_node(NULL, timer_ids);
+    if ( !timer )
+        panic("Unable to find a compatible timer in the device tree\n");
+
+    dt_device_set_used_by(timer, DOMID_XEN);
+
+    if ( !dt_property_read_u32(timer, "timebase-frequency", &rate) )
+        panic("Unable to find clock frequency\n");
+
+    cpu_khz = rate / 1000;
+}
+
+void __init preinit_xen_time(void)
+{
+    if ( acpi_disabled )
+        preinit_dt_xen_time();
+    else
+        panic("%s: ACPI isn't supported\n", __func__);
+
+    boot_clock_cycles = get_cycles();
+}
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 01 10:55:43 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Apr 2025 10:55:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.933873.1335702 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzZHT-0003nf-L1; Tue, 01 Apr 2025 10:55:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 933873.1335702; Tue, 01 Apr 2025 10:55:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzZHT-0003nX-IQ; Tue, 01 Apr 2025 10:55:43 +0000
Received: by outflank-mailman (input) for mailman id 933873;
 Tue, 01 Apr 2025 10: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 1tzZHS-0003nP-Qa
 for xen-changelog@lists.xenproject.org; Tue, 01 Apr 2025 10: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 1tzZHS-005Ohc-2Y
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 10:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzZHS-00FoqM-2R
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 10: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=OtE7pgmuhlLRGDpf0vDPBmCDQMR/pINqjdmxNS9QImY=; b=H9jGKatUtVHZJ/WY+5tNI2MBvU
	7p/x+oihDq2PxbeynaWiExOi7PWBGC2GQSflMS+ZT/k58qiEBdLlirpQ2CHCQNYZ3f9TvY5R3e8Qf
	4YtNmD4j+YnS1zbcDj45Mbb2r4AAbyc7b3AlpI4G+D/yebwX/Y6bq1zCVqjN9QjJZwtQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] automation/RISC-V: select APLIC and IMSIC to handle both wired interrupts and MSIs
Message-Id: <E1tzZHS-00FoqM-2R@xenbits.xenproject.org>
Date: Tue, 01 Apr 2025 10:55:42 +0000

commit 470310a41bc2d5c66d7b07ca289fe357e45471a3
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Tue Apr 1 12:45:26 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 1 12:45:26 2025 +0200

    automation/RISC-V: select APLIC and IMSIC to handle both wired interrupts and MSIs
    
    By default, the `aia` option is set to "none" which selects the SiFive PLIC for
    handling wired interrupts. However, since PLIC is now considered obsolete and
    will not be supported by Xen now, APLIC and IMSIC are selected instead to manage
    both wired interrupts and MSIs.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/scripts/qemu-smoke-riscv64.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/automation/scripts/qemu-smoke-riscv64.sh b/automation/scripts/qemu-smoke-riscv64.sh
index 8f755d0a6a..b2e112c942 100755
--- a/automation/scripts/qemu-smoke-riscv64.sh
+++ b/automation/scripts/qemu-smoke-riscv64.sh
@@ -6,7 +6,7 @@ set -ex -o pipefail
 rm -f smoke.serial
 
 export TEST_CMD="qemu-system-riscv64 \
-    -M virt \
+    -M virt,aia=aplic-imsic \
     -smp 1 \
     -nographic \
     -m 2g \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 01 10:55:53 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Apr 2025 10:55:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.933874.1335706 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzZHd-0003pq-Mg; Tue, 01 Apr 2025 10:55:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 933874.1335706; Tue, 01 Apr 2025 10:55:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzZHd-0003pi-Jt; Tue, 01 Apr 2025 10:55:53 +0000
Received: by outflank-mailman (input) for mailman id 933874;
 Tue, 01 Apr 2025 10: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 1tzZHc-0003pa-Tk
 for xen-changelog@lists.xenproject.org; Tue, 01 Apr 2025 10: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 1tzZHc-005Ohh-2p
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 10:55:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzZHc-00FouH-2j
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 10: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=t095bDXTvQXvMEE8go1geyo86dTs9dYPp1n5lSnQ3P0=; b=3MyBrQ8KqRGU5pIQW26YhP1SNy
	MbW32P5dc7nbRiYPnQZvafb67nq2Sy5J0CiXJSLbXoGIYe1eUwTSXjnVh1RRA5udzR5a0btI8zOrD
	T61ZMYb6QhOV6niDcW5tCSJ0f/aN/zp8BrJMgJwExnjDeqghgyBxzhCdDGFtowqCbLDw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: implement basic aplic_preinit()
Message-Id: <E1tzZHc-00FouH-2j@xenbits.xenproject.org>
Date: Tue, 01 Apr 2025 10:55:52 +0000

commit e4ab69031f69020544c6ec5674eeccff09664837
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Tue Apr 1 12:46:07 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 1 12:46:07 2025 +0200

    xen/riscv: implement basic aplic_preinit()
    
    Introduce preinitialization stuff for the RISC-V Advanced Platform-Level
    Interrupt Controller (APLIC) in Xen:
     - Implementing the APLIC pre-initialization function (`aplic_preinit()`),
       ensuring that only one APLIC instance is supported in S mode.
     - Initialize APLIC's correspoinding DT node.
     - Declaring the DT device match table for APLIC.
     - Setting `aplic_info.hw_version` during its declaration.
     - Declaring an APLIC device.
    
    Since Microchip originally developed aplic.c [1], an internal discussion
    with them led to the decision to use the MIT license instead of the default
    GPL-2.0-only.
    
    [1] https://gitlab.com/xen-project/people/olkur/xen/-/commit/7cfb4bd4748ca268142497ac5c327d2766fb342d
    
    Co-developed-by: Romain Caritey <Romain.Caritey@microchip.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/Makefile           |  1 +
 xen/arch/riscv/aplic.c            | 50 +++++++++++++++++++++++++++++++++++++++
 xen/arch/riscv/include/asm/intc.h | 20 ++++++++++++++++
 3 files changed, 71 insertions(+)

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index 82016a957a..dd5fd25c7d 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -1,3 +1,4 @@
+obj-y += aplic.o
 obj-y += cpufeature.o
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
 obj-y += entry.o
diff --git a/xen/arch/riscv/aplic.c b/xen/arch/riscv/aplic.c
new file mode 100644
index 0000000000..caba8f8993
--- /dev/null
+++ b/xen/arch/riscv/aplic.c
@@ -0,0 +1,50 @@
+/* SPDX-License-Identifier: MIT */
+
+/*
+ * xen/arch/riscv/aplic.c
+ *
+ * RISC-V Advanced Platform-Level Interrupt Controller support
+ *
+ * Copyright (c) 2023-2024 Microchip.
+ * Copyright (c) 2024-2025 Vates
+ */
+
+#include <xen/errno.h>
+#include <xen/init.h>
+#include <xen/sections.h>
+#include <xen/types.h>
+
+#include <asm/device.h>
+#include <asm/intc.h>
+
+static struct intc_info __ro_after_init aplic_info = {
+    .hw_version = INTC_APLIC,
+};
+
+static int __init aplic_preinit(struct dt_device_node *node, const void *dat)
+{
+    if ( aplic_info.node )
+    {
+        printk("XEN doesn't support more than one S mode APLIC\n");
+        return -ENODEV;
+    }
+
+    /* don't process if APLIC node is not for S mode */
+    if ( dt_get_property(node, "riscv,children", NULL) )
+        return -ENODEV;
+
+    aplic_info.node = node;
+
+    return 0;
+}
+
+static const struct dt_device_match __initconstrel aplic_dt_match[] =
+{
+    DT_MATCH_COMPATIBLE("riscv,aplic"),
+    { /* sentinel */ },
+};
+
+DT_DEVICE_START(aplic, "APLIC", DEVICE_INTERRUPT_CONTROLLER)
+    .dt_match = aplic_dt_match,
+    .init = aplic_preinit,
+DT_DEVICE_END
diff --git a/xen/arch/riscv/include/asm/intc.h b/xen/arch/riscv/include/asm/intc.h
new file mode 100644
index 0000000000..ff9bb33896
--- /dev/null
+++ b/xen/arch/riscv/include/asm/intc.h
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: MIT */
+
+/*
+ * (c) 2023-2024 Microchip Technology Inc.
+ * (c) 2024 Vates
+ */
+
+#ifndef ASM__RISCV__INTERRUPT_CONTOLLER_H
+#define ASM__RISCV__INTERRUPT_CONTOLLER_H
+
+enum intc_version {
+    INTC_APLIC,
+};
+
+struct intc_info {
+    enum intc_version hw_version;
+    const struct dt_device_node *node;
+};
+
+#endif /* ASM__RISCV__INTERRUPT_CONTOLLER_H */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 01 10:56:03 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Apr 2025 10:56:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.933875.1335710 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzZHn-0003s4-OH; Tue, 01 Apr 2025 10:56:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 933875.1335710; Tue, 01 Apr 2025 10:56: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 1tzZHn-0003ru-LM; Tue, 01 Apr 2025 10:56:03 +0000
Received: by outflank-mailman (input) for mailman id 933875;
 Tue, 01 Apr 2025 10:56:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1tzZHm-0003ro-Vx
 for xen-changelog@lists.xenproject.org; Tue, 01 Apr 2025 10: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 1tzZHm-005OiJ-36
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 10:56:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzZHm-00Fox0-30
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 10: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=79tA97M5PThB1JOzh08wHClsazUM0UUiyYfO3X5CXGY=; b=7KzpRqh5buoEsT8H7cI9L+JUpd
	L4E2rM2LhZjgy5cFkbWruJbkPdixczjwAFE2lWaw8IgXClwTf7aByTMHvRT0Q15zzcsviMDQ7n7qF
	ZGafS8VYnR1o/DSOQ4uOjLpgC2Tmzu0wv2WFyd842+U1qov0pPMUBy5BRQnYyX9huZG8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: introduce intc_preinit()
Message-Id: <E1tzZHm-00Fox0-30@xenbits.xenproject.org>
Date: Tue, 01 Apr 2025 10:56:02 +0000

commit 0e9bda67af4f19fbbe6cc1296e63d4e2b6486846
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Tue Apr 1 12:46:47 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 1 12:46:47 2025 +0200

    xen/riscv: introduce intc_preinit()
    
    Currently, only the device tree method is available to locate and perform
    pre-initialization steps for the interrupt controller (at the moment, only
    one interrupt controller is going to be supported). When `acpi_disabled`
    is true, the system will scan for a node with the "interrupt-controller"
    property and then call `device_init()` to validate if it is an expected
    interrupt controller and if yes then save this node for further usage.
    
    If `acpi_disabled` is false, the system will panic, as ACPI support is not
    yet implemented for RISC-V.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/Makefile           |  1 +
 xen/arch/riscv/include/asm/intc.h |  2 ++
 xen/arch/riscv/intc.c             | 14 ++++++++++++++
 xen/arch/riscv/setup.c            |  3 +++
 4 files changed, 20 insertions(+)

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index dd5fd25c7d..0c6c4a38a3 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -2,6 +2,7 @@ obj-y += aplic.o
 obj-y += cpufeature.o
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
 obj-y += entry.o
+obj-y += intc.o
 obj-y += mm.o
 obj-y += pt.o
 obj-$(CONFIG_RISCV_64) += riscv64/
diff --git a/xen/arch/riscv/include/asm/intc.h b/xen/arch/riscv/include/asm/intc.h
index ff9bb33896..52ba196d87 100644
--- a/xen/arch/riscv/include/asm/intc.h
+++ b/xen/arch/riscv/include/asm/intc.h
@@ -17,4 +17,6 @@ struct intc_info {
     const struct dt_device_node *node;
 };
 
+void intc_preinit(void);
+
 #endif /* ASM__RISCV__INTERRUPT_CONTOLLER_H */
diff --git a/xen/arch/riscv/intc.c b/xen/arch/riscv/intc.c
new file mode 100644
index 0000000000..4061a3c457
--- /dev/null
+++ b/xen/arch/riscv/intc.c
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/acpi.h>
+#include <xen/device_tree.h>
+#include <xen/init.h>
+#include <xen/lib.h>
+
+void __init intc_preinit(void)
+{
+    if ( acpi_disabled )
+        intc_dt_preinit();
+    else
+        panic("ACPI interrupt controller preinit() isn't implemented\n");
+}
diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c
index 836ad16fed..4e416f6e44 100644
--- a/xen/arch/riscv/setup.c
+++ b/xen/arch/riscv/setup.c
@@ -16,6 +16,7 @@
 #include <asm/cpufeature.h>
 #include <asm/early_printk.h>
 #include <asm/fixmap.h>
+#include <asm/intc.h>
 #include <asm/sbi.h>
 #include <asm/setup.h>
 #include <asm/smp.h>
@@ -128,6 +129,8 @@ void __init noreturn start_xen(unsigned long bootcpu_id,
 
     preinit_xen_time();
 
+    intc_preinit();
+
     printk("All set up\n");
 
     machine_halt();
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 01 10:56:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Apr 2025 10:56:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.933876.1335714 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzZHx-0003vk-RB; Tue, 01 Apr 2025 10:56:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 933876.1335714; Tue, 01 Apr 2025 10:56: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 1tzZHx-0003vZ-OQ; Tue, 01 Apr 2025 10:56:13 +0000
Received: by outflank-mailman (input) for mailman id 933876;
 Tue, 01 Apr 2025 10:56:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1tzZHx-0003vO-2Q
 for xen-changelog@lists.xenproject.org; Tue, 01 Apr 2025 10:56:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzZHx-005OiN-0A
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 10:56:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzZHx-00Fp0Z-03
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 10:56:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=F++nhWle3JzsjREdKQCnGoySYFg2J6rW8kammfoo70M=; b=ihpfnG2y1MdV2unzSCf2R4sfJg
	GMumeFBXf5ZM5y35oH5QTW4JPvsTz+y/BYcFE1jxWf7JmIZN7/g2kuHsfNnBhhVvJmKmUYHKFSWgE
	xL70DJ6E9uBqecLwElNXjtlOwKu9OZTcBVkOUS13rd5NnjzzOKHqwvKwV1pIeHs4jKrY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: annotate page tables also with type
Message-Id: <E1tzZHx-00Fp0Z-03@xenbits.xenproject.org>
Date: Tue, 01 Apr 2025 10:56:13 +0000

commit f3cec96658458b1f3b316cc06a2d3ef6b018328f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 1 12:47:44 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 1 12:47:44 2025 +0200

    x86: annotate page tables also with type
    
    Use infrastructure from xen/linkage.h instead of the custom legacy
    macros that we're in the process of phasing out.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/boot/x86_64.S | 46 ++++++++++++++++++++++++----------------------
 1 file changed, 24 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/boot/x86_64.S b/xen/arch/x86/boot/x86_64.S
index 26b9d1c2df..08ae97e261 100644
--- a/xen/arch/x86/boot/x86_64.S
+++ b/xen/arch/x86/boot/x86_64.S
@@ -79,15 +79,18 @@ ENTRY(__high_start)
 .L_bsp:
         tailcall __start_xen
 
+/* Around page tables the fill pattern would better be zero. */
+#undef DATA_FILL
+#define DATA_FILL 0
+
         .section .data.page_aligned, "aw", @progbits
-        .align PAGE_SIZE, 0
 /*
  * Mapping of first 2 megabytes of memory. This is mapped with 4kB mappings
  * to avoid type conflicts with fixed-range MTRRs covering the lowest megabyte
  * of physical memory. In any case the VGA hole should be mapped with type UC.
  * Uses 1x 4k page.
  */
-l1_directmap:
+DATA_LOCAL(l1_directmap, PAGE_SIZE)
         pfn = 0
         .rept L1_PAGETABLE_ENTRIES
         /* VGA hole (0xa0000-0xc0000) should be mapped UC-. */
@@ -98,7 +101,7 @@ l1_directmap:
         .endif
         pfn = pfn + 1
         .endr
-        .size l1_directmap, . - l1_directmap
+END(l1_directmap)
 
 /*
  * __page_tables_{start,end} cover the range of pagetables which need
@@ -111,17 +114,17 @@ GLOBAL(__page_tables_start)
  * Space for 4G worth of 2M mappings, first 2M actually mapped via
  * l1_directmap[].  Uses 4x 4k pages.
  */
-GLOBAL(l2_directmap)
+DATA(l2_directmap, PAGE_SIZE)
         .quad sym_offs(l1_directmap) + __PAGE_HYPERVISOR
         .fill 4 * L2_PAGETABLE_ENTRIES - 1, 8, 0
-        .size l2_directmap, . - l2_directmap
+END(l2_directmap)
 
 /*
  * L2 mapping the Xen text/data/bss region, constructed dynamically.
  * Executable fixmap is hooked up statically.
  * Uses 1x 4k page.
  */
-GLOBAL(l2_xenmap)
+DATA(l2_xenmap, PAGE_SIZE)
         idx = 0
         .rept L2_PAGETABLE_ENTRIES
         .if idx == l2_table_offset(FIXADDR_X_TOP - 1)
@@ -131,10 +134,10 @@ GLOBAL(l2_xenmap)
         .endif
         idx = idx + 1
         .endr
-        .size l2_xenmap, . - l2_xenmap
+END(l2_xenmap)
 
 /* L2 mapping the fixmap.  Uses 1x 4k page. */
-l2_fixmap:
+DATA_LOCAL(l2_fixmap, PAGE_SIZE)
         idx = 0
         .rept L2_PAGETABLE_ENTRIES
         .if idx == l2_table_offset(FIXADDR_TOP - 1)
@@ -144,20 +147,20 @@ l2_fixmap:
         .endif
         idx = idx + 1
         .endr
-        .size l2_fixmap, . - l2_fixmap
+END(l2_fixmap)
 
 /* Direct map, initially covering the 4 l2_directmap tables.  Uses 1x 4k page. */
-l3_directmap:
+DATA_LOCAL(l3_directmap, PAGE_SIZE)
         idx = 0
         .rept 4
         .quad sym_offs(l2_directmap) + (idx << PAGE_SHIFT) + __PAGE_HYPERVISOR
         idx = idx + 1
         .endr
         .fill L3_PAGETABLE_ENTRIES - 4, 8, 0
-        .size l3_directmap, . - l3_directmap
+END(l3_directmap)
 
 /* L3 mapping the fixmap.  Uses 1x 4k page. */
-l3_xenmap:
+DATA_LOCAL(l3_xenmap, PAGE_SIZE)
         idx = 0
         .rept L3_PAGETABLE_ENTRIES
         .if idx == l3_table_offset(XEN_VIRT_START)
@@ -169,10 +172,10 @@ l3_xenmap:
         .endif
         idx = idx + 1
         .endr
-        .size l3_xenmap, . - l3_xenmap
+END(l3_xenmap)
 
 /* Top-level master (and idle-domain) page directory. */
-GLOBAL(idle_pg_table)
+DATA(idle_pg_table, PAGE_SIZE)
         .quad sym_offs(l3_bootmap) + __PAGE_HYPERVISOR
         idx = 1
         .rept L4_PAGETABLE_ENTRIES - 1
@@ -185,22 +188,21 @@ GLOBAL(idle_pg_table)
         .endif
         idx = idx + 1
         .endr
-        .size idle_pg_table, . - idle_pg_table
+END(idle_pg_table)
 
 GLOBAL(__page_tables_end)
 
 /* Init pagetables. Enough page directories to map into 4GB. */
         .section .init.data, "aw", @progbits
-        .align PAGE_SIZE, 0
 
-l1_bootmap:
+DATA_LOCAL(l1_bootmap, PAGE_SIZE)
         .fill L1_PAGETABLE_ENTRIES, 8, 0
-        .size l1_bootmap, . - l1_bootmap
+END(l1_bootmap)
 
-GLOBAL(l2_bootmap)
+DATA(l2_bootmap, PAGE_SIZE)
         .fill 4 * L2_PAGETABLE_ENTRIES, 8, 0
-        .size l2_bootmap, . - l2_bootmap
+END(l2_bootmap)
 
-GLOBAL(l3_bootmap)
+DATA(l3_bootmap, PAGE_SIZE)
         .fill L3_PAGETABLE_ENTRIES, 8, 0
-        .size l3_bootmap, . - l3_bootmap
+END(l3_bootmap)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 01 10:56:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Apr 2025 10:56:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.933877.1335717 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzZI7-0003yU-Sg; Tue, 01 Apr 2025 10:56:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 933877.1335717; Tue, 01 Apr 2025 10:56:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzZI7-0003yM-Pt; Tue, 01 Apr 2025 10:56:23 +0000
Received: by outflank-mailman (input) for mailman id 933877;
 Tue, 01 Apr 2025 10: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 1tzZI7-0003y9-5Q
 for xen-changelog@lists.xenproject.org; Tue, 01 Apr 2025 10:56:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzZI7-005OiR-0R
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 10:56:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzZI7-00Fp2E-0K
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 10:56:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=EbhYXQGV3Ky4nKC3ppUpBtJMdPXfzQP06Dycl3e0kDg=; b=FfKqUkey1A//a5kYOVGmmLfxeW
	RCdqwRq09vEYo3KzMf9ciTMx2pq9fTF/VgRV1GFZ5Sc8zpwyGJEB6yHGSjzkJuMt5Vp13o1Q7YYZl
	jW6TkTGO61aPv/HOPMrzZOANiB8wEqq7egNlWlWsITJON1BPCvoZZTNGADLPhxSfF7rQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86emul: make test harness build again as 32-bit binary
Message-Id: <E1tzZI7-00Fp2E-0K@xenbits.xenproject.org>
Date: Tue, 01 Apr 2025 10:56:23 +0000

commit cff389bca78885447c8cfa381e058c6fb983df9c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 1 12:48:23 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 1 12:48:23 2025 +0200

    x86emul: make test harness build again as 32-bit binary
    
    Adding Q suffixes to FXSAVE/FXRSTOR did break the 32-bit build. Don't go
    back though, as the hand-coded 0x48 there weren't quite right either for
    the 32-bit case (they might well cause confusion when looking at the
    disassembly). Instead arrange for the compiler to DCE respective asm()-s,
    by short-circuiting REX_* to zero.
    
    Fixes: 5a33ea2800c1 ("x86emul: drop open-coding of REX.W prefixes")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/x86_emulate/private.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/xen/arch/x86/x86_emulate/private.h b/xen/arch/x86/x86_emulate/private.h
index ef4745f56e..f33330c787 100644
--- a/xen/arch/x86/x86_emulate/private.h
+++ b/xen/arch/x86/x86_emulate/private.h
@@ -110,11 +110,19 @@ struct operand {
     } mem;
 };
 
+#if defined(__x86_64__)
 #define REX_PREFIX 0x40
 #define REX_B 0x01
 #define REX_X 0x02
 #define REX_R 0x04
 #define REX_W 0x08
+#elif defined(__i386__)
+#define REX_PREFIX 0
+#define REX_B 0
+#define REX_X 0
+#define REX_R 0
+#define REX_W 0
+#endif
 
 enum simd_opsize {
     simd_none,
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 01 12:22:08 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Apr 2025 12:22:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.933956.1335780 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzad1-0001jY-5q; Tue, 01 Apr 2025 12:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 933956.1335780; Tue, 01 Apr 2025 12: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 1tzad1-0001jQ-3C; Tue, 01 Apr 2025 12:22:03 +0000
Received: by outflank-mailman (input) for mailman id 933956;
 Tue, 01 Apr 2025 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 1tzad0-0001jI-Ab
 for xen-changelog@lists.xenproject.org; Tue, 01 Apr 2025 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 1tzad0-005Qdo-0O
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 12:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzad0-00G7hi-0H
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 12:22:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6EaNMfv2AX1VgIThouGpzi/0wkZUw2JIpfVAIKdFsuA=; b=pdi3z0fShL3DILjU/QEzku5Du5
	oTCaWY02K7TGhl4K8cqZn/JW0tihessAmZ4BrIx1xMMUi8bWA1VZZivSpx+CmTJ5N8gj68PhWObni
	r3jy31648P6V7cL+/LEtCPYVlC/GP8T4ITcuCw4961Zta2NVv9ZgJjUcpgXe4HurIH4s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Arm32: use new-style entry annotations for MMU code
Message-Id: <E1tzad0-00G7hi-0H@xenbits.xenproject.org>
Date: Tue, 01 Apr 2025 12:22:02 +0000

commit 0ca25bb1be64ae3429ca5c438a787a191dc06e79
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 1 12:42:39 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 1 12:42:39 2025 +0200

    Arm32: use new-style entry annotations for MMU code
    
    Locally override SYM_PUSH_SECTION() to retain the intended section
    association.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Luca Fancellu <luca.fancellu@arm.com> # arm
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/arm32/mmu/head.S | 37 +++++++++++++++++++------------------
 1 file changed, 19 insertions(+), 18 deletions(-)

diff --git a/xen/arch/arm/arm32/mmu/head.S b/xen/arch/arm/arm32/mmu/head.S
index 8fa74bd556..5032e6c075 100644
--- a/xen/arch/arm/arm32/mmu/head.S
+++ b/xen/arch/arm/arm32/mmu/head.S
@@ -174,7 +174,7 @@
  *
  * Clobbers r0 - r5
  */
-create_page_tables:
+FUNC_LOCAL(create_page_tables)
         /* Prepare the page-tables for mapping Xen */
         mov_w r0, XEN_VIRT_START
 
@@ -263,7 +263,7 @@ use_temporary_mapping:
 
         mov   r12, #1                /* r12 := temporary mapping created */
         mov   pc, lr
-ENDPROC(create_page_tables)
+END(create_page_tables)
 
 /*
  * Turn on the Data Cache and the MMU. The function will return
@@ -276,7 +276,7 @@ ENDPROC(create_page_tables)
  *
  * Clobbers r0 - r5
  */
-enable_mmu:
+FUNC_LOCAL(enable_mmu)
         PRINT("- Turning on paging -\r\n")
 
         /* Set up memory attribute type tables */
@@ -361,7 +361,7 @@ enable_mmu:
         teq   r12, #0
         beq   remove_identity_mapping
         b     remove_temporary_mapping
-ENDPROC(enable_mmu)
+END(enable_mmu)
 
 /*
  * Switch to the runtime mapping. The logic depends on whether the
@@ -381,7 +381,7 @@ ENDPROC(enable_mmu)
  *
  * Clobbers r0 - r4
  */
-switch_to_runtime_mapping:
+FUNC_LOCAL(switch_to_runtime_mapping)
         /*
          * Jump to the runtime mapping if the virt and phys are not
          * clashing
@@ -426,7 +426,7 @@ ready_to_switch:
         PRINT_ID("- Jumping to runtime address -\r\n")
 
         mov   pc, lr
-ENDPROC(switch_to_runtime_mapping)
+END(switch_to_runtime_mapping)
 
 /*
  * Enable mm (turn on the data cache and the MMU) for secondary CPUs.
@@ -443,7 +443,7 @@ ENDPROC(switch_to_runtime_mapping)
  *
  * Clobbers r0 - r6
  */
-ENTRY(enable_secondary_cpu_mm)
+FUNC(enable_secondary_cpu_mm)
         mov   r6, lr
 
         bl    create_page_tables
@@ -471,7 +471,7 @@ ENTRY(enable_secondary_cpu_mm)
 
         /* Return to the virtual address requested by the caller. */
         mov   pc, r6
-ENDPROC(enable_secondary_cpu_mm)
+END(enable_secondary_cpu_mm)
 
 /*
  * Enable mm (turn on the data cache and the MMU) for the boot CPU.
@@ -489,7 +489,7 @@ ENDPROC(enable_secondary_cpu_mm)
  *
  * Clobbers r0 - r6
  */
-ENTRY(enable_boot_cpu_mm)
+FUNC(enable_boot_cpu_mm)
         mov   r6, lr
 
 #ifdef CONFIG_EARLY_PRINTK
@@ -506,7 +506,7 @@ ENTRY(enable_boot_cpu_mm)
         /* Address in the runtime mapping to jump to after the MMU is enabled */
         mov   lr, r6
         b     enable_mmu
-ENDPROC(enable_boot_cpu_mm)
+END(enable_boot_cpu_mm)
 
 /*
  * Remove the 1:1 map from the page-tables. It is not easy to keep track
@@ -518,7 +518,7 @@ ENDPROC(enable_boot_cpu_mm)
  *
  * Clobbers r0 - r3
  */
-remove_identity_mapping:
+FUNC_LOCAL(remove_identity_mapping)
         PRINT("- Removing the identity mapping -\r\n")
 
         /* r2:r3 := invalid page-table entry */
@@ -533,14 +533,14 @@ remove_identity_mapping:
 
         flush_xen_tlb_local r0
         mov   pc, lr
-ENDPROC(remove_identity_mapping)
+END(remove_identity_mapping)
 
 /*
  * Remove the temporary mapping of Xen starting at TEMPORARY_XEN_VIRT_START.
  *
  * Clobbers r0 - r3
  */
-remove_temporary_mapping:
+FUNC_LOCAL(remove_temporary_mapping)
         PRINT("- Removing the temporary mapping -\r\n")
 
         /* r2:r3 := invalid page-table entry */
@@ -556,13 +556,14 @@ remove_temporary_mapping:
         flush_xen_tlb_local r0
 
         mov  pc, lr
-ENDPROC(remove_temporary_mapping)
+END(remove_temporary_mapping)
 
 /* Fail-stop */
-fail:   PRINT("- Boot failed -\r\n")
+FUNC_LOCAL(fail)
+        PRINT("- Boot failed -\r\n")
 1:      wfe
         b     1b
-ENDPROC(fail)
+END(fail)
 
 /*
  * Switch TTBR
@@ -570,7 +571,7 @@ ENDPROC(fail)
  *
  * TODO: This code does not comply with break-before-make.
  */
-ENTRY(switch_ttbr)
+FUNC(switch_ttbr)
         dsb                            /* Ensure the flushes happen before
                                         * continuing */
         isb                            /* Ensure synchronization with previous
@@ -594,4 +595,4 @@ ENTRY(switch_ttbr)
         isb
 
         mov pc, lr
-ENDPROC(switch_ttbr)
+END(switch_ttbr)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 01 12:22:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Apr 2025 12:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.933958.1335784 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzadB-0001lY-7H; Tue, 01 Apr 2025 12:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 933958.1335784; Tue, 01 Apr 2025 12: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 1tzadB-0001lQ-4Y; Tue, 01 Apr 2025 12:22:13 +0000
Received: by outflank-mailman (input) for mailman id 933958;
 Tue, 01 Apr 2025 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 1tzadA-0001lE-8G
 for xen-changelog@lists.xenproject.org; Tue, 01 Apr 2025 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 1tzadA-005Qds-0g
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 12:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzadA-00G7l6-0Z
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 12: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=zmxKGSMzMQoDlf7wcS9VQPIpcvTjvDMlA0mQ08v+mBk=; b=Jr3ZKd3styfQj82LKh+Mw6w/Fc
	f0+TcEsepZAm1BCY0U/quQ9KcUNedEPFkg1hutTiqFoCDbASqYmMBWEuGgKI3QvmTLzlwVm3TSHO7
	u1IZOV+JEazfHDjhLeTNBA/qIbNDKZitW30eUD077ra6jMp/cHPbVm7vKKTs7dpz8Vxo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Arm32: use new-style entry annotations in head.S
Message-Id: <E1tzadA-00G7l6-0Z@xenbits.xenproject.org>
Date: Tue, 01 Apr 2025 12:22:12 +0000

commit 98c75f9c3a24afb1128c67827b64353cbabfdc47
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 1 12:43:06 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 1 12:43:06 2025 +0200

    Arm32: use new-style entry annotations in head.S
    
    Locally override SYM_PUSH_SECTION() to retain the intended section
    association.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Luca Fancellu <luca.fancellu@arm.com> # arm
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/arm32/head.S | 48 ++++++++++++++++++++++++-----------------------
 1 file changed, 25 insertions(+), 23 deletions(-)

diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index 50da179f81..63453dd3a3 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -54,7 +54,7 @@
          * It should be linked at XEN_VIRT_START, and loaded at any
          * 4K-aligned address.
          */
-GLOBAL(start)
+FUNC(start)
         /*
          * zImage magic header, see:
          * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
@@ -104,9 +104,9 @@ primary_switched:
         mov   r0, r8                 /* r0 := paddr(FDT) */
         mov_w r1, start_xen
         b     launch
-ENDPROC(start)
+END(start)
 
-GLOBAL(init_secondary)
+FUNC(init_secondary)
         cpsid aif                    /* Disable all interrupts */
 
         /* Find out where we are */
@@ -142,7 +142,7 @@ secondary_switched:
         /* Jump to C world */
         mov_w r1, start_secondary
         b     launch
-ENDPROC(init_secondary)
+END(init_secondary)
 
 /*
  * Check if the CPU supports virtualization extensions and has been booted
@@ -154,7 +154,7 @@ ENDPROC(init_secondary)
  *
  * Clobbers r0 - r3
  */
-check_cpu_mode:
+FUNC_LOCAL(check_cpu_mode)
         /* Check that this CPU has Hyp mode */
         mrc   CP32(r0, ID_PFR1)
         and   r0, r0, #0xf000        /* Bits 12-15 define virt extensions */
@@ -174,14 +174,14 @@ check_cpu_mode:
         PRINT("- Xen must be entered in NS Hyp mode -\r\n")
         PRINT("- Please update the bootloader -\r\n")
         b     fail
-ENDPROC(check_cpu_mode)
+END(check_cpu_mode)
 
 /*
  * Zero BSS
  *
  * Clobbers r0 - r3
  */
-zero_bss:
+FUNC_LOCAL(zero_bss)
         PRINT("- Zero BSS -\r\n")
         mov_w r0, __bss_start        /* r0 := vaddr(__bss_start) */
         mov_w r1, __bss_end          /* r1 := vaddr(__bss_end)   */
@@ -195,9 +195,9 @@ zero_bss:
 
 skip_bss:
         mov   pc, lr
-ENDPROC(zero_bss)
+END(zero_bss)
 
-cpu_init:
+FUNC_LOCAL(cpu_init)
         PRINT("- Setting up control registers -\r\n")
 
         mov   r5, lr                       /* r5 := return address */
@@ -224,7 +224,7 @@ cpu_init_done:
         isb
 
         mov   pc, r5                        /* Return address is in r5 */
-ENDPROC(cpu_init)
+END(cpu_init)
 
 /*
  * Setup the initial stack and jump to the C world
@@ -235,7 +235,7 @@ ENDPROC(cpu_init)
  *
  * Clobbers r3
  */
-launch:
+FUNC_LOCAL(launch)
         mov_w r3, init_data
         add   r3, #INITINFO_stack    /* Find the boot-time stack */
         ldr   sp, [r3]
@@ -244,13 +244,14 @@ launch:
 
         /* Jump to C world */
        bx    r1
-ENDPROC(launch)
+END(launch)
 
 /* Fail-stop */
-fail:   PRINT("- Boot failed -\r\n")
+FUNC_LOCAL(fail)
+        PRINT("- Boot failed -\r\n")
 1:      wfe
         b     1b
-ENDPROC(fail)
+END(fail)
 
 #ifdef CONFIG_EARLY_PRINTK
 /*
@@ -261,14 +262,14 @@ ENDPROC(fail)
  *
  * Clobbers r0 - r3
  */
-init_uart:
+FUNC_LOCAL(init_uart)
         mov_w r11, CONFIG_EARLY_UART_BASE_ADDRESS
 #ifdef CONFIG_EARLY_UART_INIT
         early_uart_init r11, r1, r2
 #endif
         PRINT("- UART enabled -\r\n")
         mov   pc, lr
-ENDPROC(init_uart)
+END(init_uart)
 
 /*
  * Print early debug messages.
@@ -277,14 +278,14 @@ ENDPROC(init_uart)
  * r11: Early UART base address
  * Clobbers r0-r1
  */
-ENTRY(asm_puts)
+FUNC(asm_puts)
         early_uart_ready r11, r1
         ldrb  r1, [r0], #1           /* Load next char */
         teq   r1, #0                 /* Exit on nul */
         moveq pc, lr
         early_uart_transmit r11, r1
         b asm_puts
-ENDPROC(asm_puts)
+END(asm_puts)
 
 /*
  * Print a 32-bit number in hex.
@@ -293,7 +294,7 @@ ENDPROC(asm_puts)
  * r11: Early UART base address
  * Clobbers r0-r3
  */
-ENTRY(asm_putn)
+FUNC(asm_putn)
         adr_l r1, hex
         mov   r3, #8
 1:
@@ -305,18 +306,19 @@ ENTRY(asm_putn)
         subs  r3, r3, #1
         bne   1b
         mov   pc, lr
-ENDPROC(asm_putn)
+END(asm_putn)
 
 RODATA_SECT(.rodata.idmap, hex, "0123456789abcdef")
 
 #endif /* CONFIG_EARLY_PRINTK */
 
 /* This provides a C-API version of __lookup_processor_type */
-ENTRY(lookup_processor_type)
+FUNC(lookup_processor_type)
         stmfd sp!, {r4, lr}
         bl    __lookup_processor_type
         mov r0, r1
         ldmfd sp!, {r4, pc}
+END(lookup_processor_type)
 
 /*
  * Read processor ID register (CP#15, CR0), and Look up in the linker-built
@@ -327,7 +329,7 @@ ENTRY(lookup_processor_type)
  * r1: proc_info pointer
  * Clobbers r2-r4
  */
-__lookup_processor_type:
+FUNC_LOCAL(__lookup_processor_type)
         mrc   CP32(r0, MIDR)                /* r0 := our cpu id */
         adr_l r1, __proc_info_start
         adr_l r2, __proc_info_end
@@ -343,7 +345,7 @@ __lookup_processor_type:
         mov   r1, #0
 2:
         mov   pc, lr
-ENDPROC(__lookup_processor_type)
+END(__lookup_processor_type)
 
 /*
  * Local variables:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 01 12:22:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Apr 2025 12:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.933959.1335788 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzadL-0001q2-8d; Tue, 01 Apr 2025 12:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 933959.1335788; Tue, 01 Apr 2025 12: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 1tzadL-0001pu-60; Tue, 01 Apr 2025 12:22:23 +0000
Received: by outflank-mailman (input) for mailman id 933959;
 Tue, 01 Apr 2025 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 1tzadK-0001pe-BN
 for xen-changelog@lists.xenproject.org; Tue, 01 Apr 2025 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 1tzadK-005Qe0-12
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 12:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzadK-00G7mI-0r
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 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=cfq5BCh3+BR1ph2PUB2Q27tQOCrzB3De/Ctmq7dckfk=; b=XW6t9ekxUIeNqpzWIjhqvcuCk+
	Ch9wFyl7DY5k1KzE5jCX+BPc9wXfSbBz9y/SjVKI+VcA5Mw9hr1tH3sp9i3AsccBdOcP3CoG9fJsQ
	emyq4wdrrQUDsfi2W2ZO7iLlLaS+Wvr2nDXC2J9eseh4tBidrv/tHgPmEYOhPfDQtups=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Arm: purge ENTRY(), ENDPROC(), and ALIGN
Message-Id: <E1tzadK-00G7mI-0r@xenbits.xenproject.org>
Date: Tue, 01 Apr 2025 12:22:22 +0000

commit 221c66f4f2a49a77eb65cbaaaa3de2a6140fa392
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 1 12:43:35 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 1 12:43:35 2025 +0200

    Arm: purge ENTRY(), ENDPROC(), and ALIGN
    
    They're no longer used. This also makes it unnecessary to #undef two of
    them in the linker script.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Tested-by: Luca Fancellu <luca.fancellu@arm.com> # arm
---
 xen/arch/arm/include/asm/config.h | 8 --------
 xen/arch/arm/xen.lds.S            | 2 --
 2 files changed, 10 deletions(-)

diff --git a/xen/arch/arm/include/asm/config.h b/xen/arch/arm/include/asm/config.h
index 0a51142efd..799bc2a8ac 100644
--- a/xen/arch/arm/include/asm/config.h
+++ b/xen/arch/arm/include/asm/config.h
@@ -53,17 +53,9 @@
 
 /* Linkage for ARM */
 #ifdef __ASSEMBLY__
-#define ALIGN .balign CONFIG_FUNCTION_ALIGNMENT
-#define ENTRY(name)                             \
-  .globl name;                                  \
-  ALIGN;                                        \
-  name:
 #define GLOBAL(name)                            \
   .globl name;                                  \
   name:
-#define ENDPROC(name) \
-  .type name, %function; \
-  END(name)
 #endif
 
 #include <xen/const.h>
diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index bbccff1a03..325b8059fd 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -6,8 +6,6 @@
 #include <xen/lib.h>
 #include <xen/xen.lds.h>
 #include <asm/page.h>
-#undef ENTRY
-#undef ALIGN
 
 ENTRY(start)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 01 12:22:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Apr 2025 12:22:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.933961.1335791 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzadV-0001sd-A3; Tue, 01 Apr 2025 12:22:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 933961.1335791; Tue, 01 Apr 2025 12: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 1tzadV-0001sW-7R; Tue, 01 Apr 2025 12:22:33 +0000
Received: by outflank-mailman (input) for mailman id 933961;
 Tue, 01 Apr 2025 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 1tzadU-0001sM-EK
 for xen-changelog@lists.xenproject.org; Tue, 01 Apr 2025 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 1tzadU-005Qe7-1K
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 12:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzadU-00G7n1-1D
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 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=e8pqUYivBkY1P2nCWSgCY0CW/3vMyzHeDFtZBcsuKGg=; b=E+b+Sz7esdr6TZLXG24FLJ7pVc
	no7qxOOGxKyI+5ZVHqOXTMnZd1Ds6cOkX2zDlntY0aIVCeSovfJxG1QDAEaNpQcbb0flBdWC1sBHK
	GNIq/mtebWZDjC8D4vet2y1y9vJx1gZQ5640gzmTxhIRZM9slyJ3u5vBI49sSgrCEwWE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: introduce preinit_xen_time()
Message-Id: <E1tzadU-00G7n1-1D@xenbits.xenproject.org>
Date: Tue, 01 Apr 2025 12:22:32 +0000

commit 025a9858fe69c6e36fd114501984ecc805cc2c42
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Tue Apr 1 12:44:51 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 1 12:44:51 2025 +0200

    xen/riscv: introduce preinit_xen_time()
    
    preinit_xen_time() does two things:
    1. Parse timebase-frequency properpy of /cpus node to initialize cpu_khz
       variable.
    2. Initialize boot_clock_cycles with the current time counter value to
       have starting point for Xen.
    
    timebase-frequency is read as a uint32_t because it is unlikely that the
    timer will run at more than 4 GHz. If timebase-frequency exceeds 4 GHz,
    a panic() is triggered, since dt_property_read_u32() will return 0 if
    the size of the timebase-frequency property is greater than the size of
    the output variable.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/Makefile           |  1 +
 xen/arch/riscv/include/asm/time.h |  6 ++++++
 xen/arch/riscv/setup.c            |  2 ++
 xen/arch/riscv/stubs.c            |  2 --
 xen/arch/riscv/time.c             | 42 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 51 insertions(+), 2 deletions(-)

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index b0c8270a99..82016a957a 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -9,6 +9,7 @@ obj-y += setup.o
 obj-y += shutdown.o
 obj-y += smp.o
 obj-y += stubs.o
+obj-y += time.o
 obj-y += traps.o
 obj-y += vm_event.o
 
diff --git a/xen/arch/riscv/include/asm/time.h b/xen/arch/riscv/include/asm/time.h
index fc1572e9b4..e8d9ffec57 100644
--- a/xen/arch/riscv/include/asm/time.h
+++ b/xen/arch/riscv/include/asm/time.h
@@ -3,8 +3,12 @@
 #define ASM__RISCV__TIME_H
 
 #include <xen/bug.h>
+#include <xen/types.h>
 #include <asm/csr.h>
 
+/* Clock cycles count at Xen startup */
+extern uint64_t boot_clock_cycles;
+
 struct vcpu;
 
 static inline void force_update_vcpu_system_time(struct vcpu *v)
@@ -19,6 +23,8 @@ static inline cycles_t get_cycles(void)
     return csr_read(CSR_TIME);
 }
 
+void preinit_xen_time(void);
+
 #endif /* ASM__RISCV__TIME_H */
 
 /*
diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c
index b0e587678e..836ad16fed 100644
--- a/xen/arch/riscv/setup.c
+++ b/xen/arch/riscv/setup.c
@@ -126,6 +126,8 @@ void __init noreturn start_xen(unsigned long bootcpu_id,
 
     riscv_fill_hwcap();
 
+    preinit_xen_time();
+
     printk("All set up\n");
 
     machine_halt();
diff --git a/xen/arch/riscv/stubs.c b/xen/arch/riscv/stubs.c
index 5951b0ce91..caa133de84 100644
--- a/xen/arch/riscv/stubs.c
+++ b/xen/arch/riscv/stubs.c
@@ -27,8 +27,6 @@ nodemask_t __read_mostly node_online_map = { { [0] = 1UL } };
 
 /* time.c */
 
-unsigned long __ro_after_init cpu_khz;  /* CPU clock frequency in kHz. */
-
 s_time_t get_s_time(void)
 {
     BUG_ON("unimplemented");
diff --git a/xen/arch/riscv/time.c b/xen/arch/riscv/time.c
new file mode 100644
index 0000000000..905bb13eb4
--- /dev/null
+++ b/xen/arch/riscv/time.c
@@ -0,0 +1,42 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#include <xen/acpi.h>
+#include <xen/device_tree.h>
+#include <xen/init.h>
+#include <xen/lib.h>
+#include <xen/sections.h>
+
+unsigned long __ro_after_init cpu_khz; /* CPU clock frequency in kHz. */
+uint64_t __ro_after_init boot_clock_cycles;
+
+/* Set up the timer on the boot CPU (early init function) */
+static void __init preinit_dt_xen_time(void)
+{
+    static const struct dt_device_match __initconstrel timer_ids[] =
+    {
+        DT_MATCH_PATH("/cpus"),
+        { /* sentinel */ },
+    };
+    struct dt_device_node *timer;
+    uint32_t rate;
+
+    timer = dt_find_matching_node(NULL, timer_ids);
+    if ( !timer )
+        panic("Unable to find a compatible timer in the device tree\n");
+
+    dt_device_set_used_by(timer, DOMID_XEN);
+
+    if ( !dt_property_read_u32(timer, "timebase-frequency", &rate) )
+        panic("Unable to find clock frequency\n");
+
+    cpu_khz = rate / 1000;
+}
+
+void __init preinit_xen_time(void)
+{
+    if ( acpi_disabled )
+        preinit_dt_xen_time();
+    else
+        panic("%s: ACPI isn't supported\n", __func__);
+
+    boot_clock_cycles = get_cycles();
+}
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 01 12:22:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Apr 2025 12:22:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.933962.1335796 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzadg-0001v2-BZ; Tue, 01 Apr 2025 12:22:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 933962.1335796; Tue, 01 Apr 2025 12: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 1tzadg-0001uu-8v; Tue, 01 Apr 2025 12:22:44 +0000
Received: by outflank-mailman (input) for mailman id 933962;
 Tue, 01 Apr 2025 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 1tzade-0001ud-H5
 for xen-changelog@lists.xenproject.org; Tue, 01 Apr 2025 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 1tzade-005QeF-1c
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 12:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzade-00G7r5-1V
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 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=wcO82VlzHGCALAXS5SoRB5PNleNkZNv94F7GLlvscPc=; b=SUVehqLO5ZsejbW6fqlseeMnq/
	8wNKQ/ZNB+WOioDmF54pMUPoFligHoAdEqYK7nDl5bXjqDhurIKqI/b36XUwksOCtqku+9d3SWPAk
	GzHi3nquyCSsBQOPzyEC4kTIONQX1qmd7MSULEeDno6IuF+G4Noj+y5p00LAGg5ok+A8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation/RISC-V: select APLIC and IMSIC to handle both wired interrupts and MSIs
Message-Id: <E1tzade-00G7r5-1V@xenbits.xenproject.org>
Date: Tue, 01 Apr 2025 12:22:42 +0000

commit 470310a41bc2d5c66d7b07ca289fe357e45471a3
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Tue Apr 1 12:45:26 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 1 12:45:26 2025 +0200

    automation/RISC-V: select APLIC and IMSIC to handle both wired interrupts and MSIs
    
    By default, the `aia` option is set to "none" which selects the SiFive PLIC for
    handling wired interrupts. However, since PLIC is now considered obsolete and
    will not be supported by Xen now, APLIC and IMSIC are selected instead to manage
    both wired interrupts and MSIs.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/scripts/qemu-smoke-riscv64.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/automation/scripts/qemu-smoke-riscv64.sh b/automation/scripts/qemu-smoke-riscv64.sh
index 8f755d0a6a..b2e112c942 100755
--- a/automation/scripts/qemu-smoke-riscv64.sh
+++ b/automation/scripts/qemu-smoke-riscv64.sh
@@ -6,7 +6,7 @@ set -ex -o pipefail
 rm -f smoke.serial
 
 export TEST_CMD="qemu-system-riscv64 \
-    -M virt \
+    -M virt,aia=aplic-imsic \
     -smp 1 \
     -nographic \
     -m 2g \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 01 12:22:54 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Apr 2025 12:22:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.933963.1335800 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzadq-0001xF-DE; Tue, 01 Apr 2025 12:22:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 933963.1335800; Tue, 01 Apr 2025 12: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 1tzadq-0001x7-AL; Tue, 01 Apr 2025 12:22:54 +0000
Received: by outflank-mailman (input) for mailman id 933963;
 Tue, 01 Apr 2025 12: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 1tzado-0001wx-Jq
 for xen-changelog@lists.xenproject.org; Tue, 01 Apr 2025 12: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 1tzado-005QeL-1t
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 12:22:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzado-00G7sO-1n
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 12: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=kdlTTbcpU8B+mbxHDjVE9tt5nRj6/l7WMHHEzQzoO48=; b=dWW0Ztjr2mRtZSPNaKbg5xwCwE
	uN0uMazgxfnZOaXU6XjGH4wPlnA5QAqP2LZ+5utvNYwBaLT0FOnnJEdyIe68UtC6mP8rBOLHGVMpA
	a25LtcHExcmIVrwCRqZ/k0n/R7UkYS/JmzCwIxXGoUH966jWh5WMZ0EynCoN8eayqkZQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: implement basic aplic_preinit()
Message-Id: <E1tzado-00G7sO-1n@xenbits.xenproject.org>
Date: Tue, 01 Apr 2025 12:22:52 +0000

commit e4ab69031f69020544c6ec5674eeccff09664837
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Tue Apr 1 12:46:07 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 1 12:46:07 2025 +0200

    xen/riscv: implement basic aplic_preinit()
    
    Introduce preinitialization stuff for the RISC-V Advanced Platform-Level
    Interrupt Controller (APLIC) in Xen:
     - Implementing the APLIC pre-initialization function (`aplic_preinit()`),
       ensuring that only one APLIC instance is supported in S mode.
     - Initialize APLIC's correspoinding DT node.
     - Declaring the DT device match table for APLIC.
     - Setting `aplic_info.hw_version` during its declaration.
     - Declaring an APLIC device.
    
    Since Microchip originally developed aplic.c [1], an internal discussion
    with them led to the decision to use the MIT license instead of the default
    GPL-2.0-only.
    
    [1] https://gitlab.com/xen-project/people/olkur/xen/-/commit/7cfb4bd4748ca268142497ac5c327d2766fb342d
    
    Co-developed-by: Romain Caritey <Romain.Caritey@microchip.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/Makefile           |  1 +
 xen/arch/riscv/aplic.c            | 50 +++++++++++++++++++++++++++++++++++++++
 xen/arch/riscv/include/asm/intc.h | 20 ++++++++++++++++
 3 files changed, 71 insertions(+)

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index 82016a957a..dd5fd25c7d 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -1,3 +1,4 @@
+obj-y += aplic.o
 obj-y += cpufeature.o
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
 obj-y += entry.o
diff --git a/xen/arch/riscv/aplic.c b/xen/arch/riscv/aplic.c
new file mode 100644
index 0000000000..caba8f8993
--- /dev/null
+++ b/xen/arch/riscv/aplic.c
@@ -0,0 +1,50 @@
+/* SPDX-License-Identifier: MIT */
+
+/*
+ * xen/arch/riscv/aplic.c
+ *
+ * RISC-V Advanced Platform-Level Interrupt Controller support
+ *
+ * Copyright (c) 2023-2024 Microchip.
+ * Copyright (c) 2024-2025 Vates
+ */
+
+#include <xen/errno.h>
+#include <xen/init.h>
+#include <xen/sections.h>
+#include <xen/types.h>
+
+#include <asm/device.h>
+#include <asm/intc.h>
+
+static struct intc_info __ro_after_init aplic_info = {
+    .hw_version = INTC_APLIC,
+};
+
+static int __init aplic_preinit(struct dt_device_node *node, const void *dat)
+{
+    if ( aplic_info.node )
+    {
+        printk("XEN doesn't support more than one S mode APLIC\n");
+        return -ENODEV;
+    }
+
+    /* don't process if APLIC node is not for S mode */
+    if ( dt_get_property(node, "riscv,children", NULL) )
+        return -ENODEV;
+
+    aplic_info.node = node;
+
+    return 0;
+}
+
+static const struct dt_device_match __initconstrel aplic_dt_match[] =
+{
+    DT_MATCH_COMPATIBLE("riscv,aplic"),
+    { /* sentinel */ },
+};
+
+DT_DEVICE_START(aplic, "APLIC", DEVICE_INTERRUPT_CONTROLLER)
+    .dt_match = aplic_dt_match,
+    .init = aplic_preinit,
+DT_DEVICE_END
diff --git a/xen/arch/riscv/include/asm/intc.h b/xen/arch/riscv/include/asm/intc.h
new file mode 100644
index 0000000000..ff9bb33896
--- /dev/null
+++ b/xen/arch/riscv/include/asm/intc.h
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: MIT */
+
+/*
+ * (c) 2023-2024 Microchip Technology Inc.
+ * (c) 2024 Vates
+ */
+
+#ifndef ASM__RISCV__INTERRUPT_CONTOLLER_H
+#define ASM__RISCV__INTERRUPT_CONTOLLER_H
+
+enum intc_version {
+    INTC_APLIC,
+};
+
+struct intc_info {
+    enum intc_version hw_version;
+    const struct dt_device_node *node;
+};
+
+#endif /* ASM__RISCV__INTERRUPT_CONTOLLER_H */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 01 12:23:04 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Apr 2025 12:23:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.933964.1335804 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzae0-00020L-GJ; Tue, 01 Apr 2025 12:23:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 933964.1335804; Tue, 01 Apr 2025 12: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 1tzae0-00020D-Dd; Tue, 01 Apr 2025 12:23:04 +0000
Received: by outflank-mailman (input) for mailman id 933964;
 Tue, 01 Apr 2025 12: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 1tzady-000205-Mp
 for xen-changelog@lists.xenproject.org; Tue, 01 Apr 2025 12: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 1tzady-005Qew-2B
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 12:23:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzady-00G7w5-24
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 12: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=W62wBtsIdOyNTn0W1+TxusfaRrH25uxUQT0R446O7qc=; b=UH0SsFNGkzcMeXUFCyrAeUF2Bh
	mqdkRBAjPq5COmM4hsjtg4fcqMP2U8PAxhrZxS4ALhMLvbur99ZKn/bGNo0fVdxKOf6N2bmlA8Yqn
	ziNKUbApfiLS2+7ZzBtASpoBhFy5YGFbKalm2wZR9xjZG/ZYgIlZ27yUmjroTG6W43bA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: introduce intc_preinit()
Message-Id: <E1tzady-00G7w5-24@xenbits.xenproject.org>
Date: Tue, 01 Apr 2025 12:23:02 +0000

commit 0e9bda67af4f19fbbe6cc1296e63d4e2b6486846
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Tue Apr 1 12:46:47 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 1 12:46:47 2025 +0200

    xen/riscv: introduce intc_preinit()
    
    Currently, only the device tree method is available to locate and perform
    pre-initialization steps for the interrupt controller (at the moment, only
    one interrupt controller is going to be supported). When `acpi_disabled`
    is true, the system will scan for a node with the "interrupt-controller"
    property and then call `device_init()` to validate if it is an expected
    interrupt controller and if yes then save this node for further usage.
    
    If `acpi_disabled` is false, the system will panic, as ACPI support is not
    yet implemented for RISC-V.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/Makefile           |  1 +
 xen/arch/riscv/include/asm/intc.h |  2 ++
 xen/arch/riscv/intc.c             | 14 ++++++++++++++
 xen/arch/riscv/setup.c            |  3 +++
 4 files changed, 20 insertions(+)

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index dd5fd25c7d..0c6c4a38a3 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -2,6 +2,7 @@ obj-y += aplic.o
 obj-y += cpufeature.o
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
 obj-y += entry.o
+obj-y += intc.o
 obj-y += mm.o
 obj-y += pt.o
 obj-$(CONFIG_RISCV_64) += riscv64/
diff --git a/xen/arch/riscv/include/asm/intc.h b/xen/arch/riscv/include/asm/intc.h
index ff9bb33896..52ba196d87 100644
--- a/xen/arch/riscv/include/asm/intc.h
+++ b/xen/arch/riscv/include/asm/intc.h
@@ -17,4 +17,6 @@ struct intc_info {
     const struct dt_device_node *node;
 };
 
+void intc_preinit(void);
+
 #endif /* ASM__RISCV__INTERRUPT_CONTOLLER_H */
diff --git a/xen/arch/riscv/intc.c b/xen/arch/riscv/intc.c
new file mode 100644
index 0000000000..4061a3c457
--- /dev/null
+++ b/xen/arch/riscv/intc.c
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/acpi.h>
+#include <xen/device_tree.h>
+#include <xen/init.h>
+#include <xen/lib.h>
+
+void __init intc_preinit(void)
+{
+    if ( acpi_disabled )
+        intc_dt_preinit();
+    else
+        panic("ACPI interrupt controller preinit() isn't implemented\n");
+}
diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c
index 836ad16fed..4e416f6e44 100644
--- a/xen/arch/riscv/setup.c
+++ b/xen/arch/riscv/setup.c
@@ -16,6 +16,7 @@
 #include <asm/cpufeature.h>
 #include <asm/early_printk.h>
 #include <asm/fixmap.h>
+#include <asm/intc.h>
 #include <asm/sbi.h>
 #include <asm/setup.h>
 #include <asm/smp.h>
@@ -128,6 +129,8 @@ void __init noreturn start_xen(unsigned long bootcpu_id,
 
     preinit_xen_time();
 
+    intc_preinit();
+
     printk("All set up\n");
 
     machine_halt();
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 01 12:23:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Apr 2025 12:23:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.933965.1335809 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzaeA-00022s-IX; Tue, 01 Apr 2025 12:23:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 933965.1335809; Tue, 01 Apr 2025 12: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 1tzaeA-00022k-F3; Tue, 01 Apr 2025 12:23:14 +0000
Received: by outflank-mailman (input) for mailman id 933965;
 Tue, 01 Apr 2025 12: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 1tzae8-00022W-Pj
 for xen-changelog@lists.xenproject.org; Tue, 01 Apr 2025 12: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 1tzae8-005Qf0-2S
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 12:23:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzae8-00G7y0-2M
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 12: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=tTKgUvo7VVeyUJcA9tzVA/NgjjTTubmNWLin9yNo/tU=; b=Fr5flzyn/4hEERSnRdEKJmR4su
	+avILL1mkXIwli35DOQweEEA4pccAWl68rE3F3uvrEm274iHjaQ7FXMzRdS20EzKV9CK+dHVRxnMF
	6KhQom/WvfOZAvM6ckK/mVfaKnFZ27YOqcYqPofbwK0T2l3mkj0J1lOUlVK5Dgig0M78=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: annotate page tables also with type
Message-Id: <E1tzae8-00G7y0-2M@xenbits.xenproject.org>
Date: Tue, 01 Apr 2025 12:23:12 +0000

commit f3cec96658458b1f3b316cc06a2d3ef6b018328f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 1 12:47:44 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 1 12:47:44 2025 +0200

    x86: annotate page tables also with type
    
    Use infrastructure from xen/linkage.h instead of the custom legacy
    macros that we're in the process of phasing out.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/boot/x86_64.S | 46 ++++++++++++++++++++++++----------------------
 1 file changed, 24 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/boot/x86_64.S b/xen/arch/x86/boot/x86_64.S
index 26b9d1c2df..08ae97e261 100644
--- a/xen/arch/x86/boot/x86_64.S
+++ b/xen/arch/x86/boot/x86_64.S
@@ -79,15 +79,18 @@ ENTRY(__high_start)
 .L_bsp:
         tailcall __start_xen
 
+/* Around page tables the fill pattern would better be zero. */
+#undef DATA_FILL
+#define DATA_FILL 0
+
         .section .data.page_aligned, "aw", @progbits
-        .align PAGE_SIZE, 0
 /*
  * Mapping of first 2 megabytes of memory. This is mapped with 4kB mappings
  * to avoid type conflicts with fixed-range MTRRs covering the lowest megabyte
  * of physical memory. In any case the VGA hole should be mapped with type UC.
  * Uses 1x 4k page.
  */
-l1_directmap:
+DATA_LOCAL(l1_directmap, PAGE_SIZE)
         pfn = 0
         .rept L1_PAGETABLE_ENTRIES
         /* VGA hole (0xa0000-0xc0000) should be mapped UC-. */
@@ -98,7 +101,7 @@ l1_directmap:
         .endif
         pfn = pfn + 1
         .endr
-        .size l1_directmap, . - l1_directmap
+END(l1_directmap)
 
 /*
  * __page_tables_{start,end} cover the range of pagetables which need
@@ -111,17 +114,17 @@ GLOBAL(__page_tables_start)
  * Space for 4G worth of 2M mappings, first 2M actually mapped via
  * l1_directmap[].  Uses 4x 4k pages.
  */
-GLOBAL(l2_directmap)
+DATA(l2_directmap, PAGE_SIZE)
         .quad sym_offs(l1_directmap) + __PAGE_HYPERVISOR
         .fill 4 * L2_PAGETABLE_ENTRIES - 1, 8, 0
-        .size l2_directmap, . - l2_directmap
+END(l2_directmap)
 
 /*
  * L2 mapping the Xen text/data/bss region, constructed dynamically.
  * Executable fixmap is hooked up statically.
  * Uses 1x 4k page.
  */
-GLOBAL(l2_xenmap)
+DATA(l2_xenmap, PAGE_SIZE)
         idx = 0
         .rept L2_PAGETABLE_ENTRIES
         .if idx == l2_table_offset(FIXADDR_X_TOP - 1)
@@ -131,10 +134,10 @@ GLOBAL(l2_xenmap)
         .endif
         idx = idx + 1
         .endr
-        .size l2_xenmap, . - l2_xenmap
+END(l2_xenmap)
 
 /* L2 mapping the fixmap.  Uses 1x 4k page. */
-l2_fixmap:
+DATA_LOCAL(l2_fixmap, PAGE_SIZE)
         idx = 0
         .rept L2_PAGETABLE_ENTRIES
         .if idx == l2_table_offset(FIXADDR_TOP - 1)
@@ -144,20 +147,20 @@ l2_fixmap:
         .endif
         idx = idx + 1
         .endr
-        .size l2_fixmap, . - l2_fixmap
+END(l2_fixmap)
 
 /* Direct map, initially covering the 4 l2_directmap tables.  Uses 1x 4k page. */
-l3_directmap:
+DATA_LOCAL(l3_directmap, PAGE_SIZE)
         idx = 0
         .rept 4
         .quad sym_offs(l2_directmap) + (idx << PAGE_SHIFT) + __PAGE_HYPERVISOR
         idx = idx + 1
         .endr
         .fill L3_PAGETABLE_ENTRIES - 4, 8, 0
-        .size l3_directmap, . - l3_directmap
+END(l3_directmap)
 
 /* L3 mapping the fixmap.  Uses 1x 4k page. */
-l3_xenmap:
+DATA_LOCAL(l3_xenmap, PAGE_SIZE)
         idx = 0
         .rept L3_PAGETABLE_ENTRIES
         .if idx == l3_table_offset(XEN_VIRT_START)
@@ -169,10 +172,10 @@ l3_xenmap:
         .endif
         idx = idx + 1
         .endr
-        .size l3_xenmap, . - l3_xenmap
+END(l3_xenmap)
 
 /* Top-level master (and idle-domain) page directory. */
-GLOBAL(idle_pg_table)
+DATA(idle_pg_table, PAGE_SIZE)
         .quad sym_offs(l3_bootmap) + __PAGE_HYPERVISOR
         idx = 1
         .rept L4_PAGETABLE_ENTRIES - 1
@@ -185,22 +188,21 @@ GLOBAL(idle_pg_table)
         .endif
         idx = idx + 1
         .endr
-        .size idle_pg_table, . - idle_pg_table
+END(idle_pg_table)
 
 GLOBAL(__page_tables_end)
 
 /* Init pagetables. Enough page directories to map into 4GB. */
         .section .init.data, "aw", @progbits
-        .align PAGE_SIZE, 0
 
-l1_bootmap:
+DATA_LOCAL(l1_bootmap, PAGE_SIZE)
         .fill L1_PAGETABLE_ENTRIES, 8, 0
-        .size l1_bootmap, . - l1_bootmap
+END(l1_bootmap)
 
-GLOBAL(l2_bootmap)
+DATA(l2_bootmap, PAGE_SIZE)
         .fill 4 * L2_PAGETABLE_ENTRIES, 8, 0
-        .size l2_bootmap, . - l2_bootmap
+END(l2_bootmap)
 
-GLOBAL(l3_bootmap)
+DATA(l3_bootmap, PAGE_SIZE)
         .fill L3_PAGETABLE_ENTRIES, 8, 0
-        .size l3_bootmap, . - l3_bootmap
+END(l3_bootmap)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 01 12:23:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Apr 2025 12:23:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.933966.1335812 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzaeK-00025n-J8; Tue, 01 Apr 2025 12:23:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 933966.1335812; Tue, 01 Apr 2025 12: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 1tzaeK-00025f-GW; Tue, 01 Apr 2025 12:23:24 +0000
Received: by outflank-mailman (input) for mailman id 933966;
 Tue, 01 Apr 2025 12: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 1tzaeI-00025P-SB
 for xen-changelog@lists.xenproject.org; Tue, 01 Apr 2025 12: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 1tzaeI-005Qfr-2i
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 12:23:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzaeI-00G81I-2c
 for xen-changelog@lists.xenproject.org;
 Tue, 01 Apr 2025 12: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=nkwjt9y24NuInfzqHslr8oUnJ18QBICswlZ4TlFfTxs=; b=OSl/jHm2yQmucqFh0mqo+eb2gY
	i6M/tkgvACPh9BwqY3w+SgjHmr5ghXkJ9z0ZY6HXGGCub+es+fWq2R++Pmub4/XGOB6B5ycQEudG+
	WjBCZ8ptJfpwFLOQiKWkT/Dv1+/8ZafHOq8fIge6kkkTE8VBWX3F1I0G84tens1Uo2K4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86emul: make test harness build again as 32-bit binary
Message-Id: <E1tzaeI-00G81I-2c@xenbits.xenproject.org>
Date: Tue, 01 Apr 2025 12:23:22 +0000

commit cff389bca78885447c8cfa381e058c6fb983df9c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 1 12:48:23 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 1 12:48:23 2025 +0200

    x86emul: make test harness build again as 32-bit binary
    
    Adding Q suffixes to FXSAVE/FXRSTOR did break the 32-bit build. Don't go
    back though, as the hand-coded 0x48 there weren't quite right either for
    the 32-bit case (they might well cause confusion when looking at the
    disassembly). Instead arrange for the compiler to DCE respective asm()-s,
    by short-circuiting REX_* to zero.
    
    Fixes: 5a33ea2800c1 ("x86emul: drop open-coding of REX.W prefixes")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/x86_emulate/private.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/xen/arch/x86/x86_emulate/private.h b/xen/arch/x86/x86_emulate/private.h
index ef4745f56e..f33330c787 100644
--- a/xen/arch/x86/x86_emulate/private.h
+++ b/xen/arch/x86/x86_emulate/private.h
@@ -110,11 +110,19 @@ struct operand {
     } mem;
 };
 
+#if defined(__x86_64__)
 #define REX_PREFIX 0x40
 #define REX_B 0x01
 #define REX_X 0x02
 #define REX_R 0x04
 #define REX_W 0x08
+#elif defined(__i386__)
+#define REX_PREFIX 0
+#define REX_B 0
+#define REX_X 0
+#define REX_R 0
+#define REX_W 0
+#endif
 
 enum simd_opsize {
     simd_none,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 09:22:11 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 09:22:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935347.1336763 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzuIN-0001Qq-80; Wed, 02 Apr 2025 09:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935347.1336763; Wed, 02 Apr 2025 09: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 1tzuIN-0001Qh-4c; Wed, 02 Apr 2025 09:22:03 +0000
Received: by outflank-mailman (input) for mailman id 935347;
 Wed, 02 Apr 2025 09: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 1tzuIM-0001QN-5K
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 09: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 1tzuIL-007QjR-31
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 09:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzuIL-003W7T-2s
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 09: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=FxrCNmYHnZkw4erx4hywz+JeCwwstcjJZX0P+SZj/rU=; b=NrwyAVwCdhKd/W4mIkCpTFPzgk
	d/iqm33hSr2xNft92v9B/zVAhb6HbmeR3hfr2mroP+fjnHpWlpk/IjxGzfTsMzonQ95xsR9G3P4sM
	ASY1jLPXN7i3fCBtgVkcOXxSJPObMDlqBqslVKSfqrfW0bAcLDMinDLZD8xwf0T5GmOM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: mpu: Use new-style annotations
Message-Id: <E1tzuIL-003W7T-2s@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 09:22:01 +0000

commit 0a90dee970c9b1acee710e7ea007f54104913d5a
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Apr 2 11:02:29 2025 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 2 11:14:55 2025 +0200

    xen/arm: mpu: Use new-style annotations
    
    When purging old-style annotations, MPU code was left unmodified. Fix
    it.
    
    Fixes: 221c66f4f2a4 ("Arm: purge ENTRY(), ENDPROC(), and ALIGN")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/arm/arm64/mpu/head.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/arm64/mpu/head.S b/xen/arch/arm/arm64/mpu/head.S
index 4d00de4869..ed01993d85 100644
--- a/xen/arch/arm/arm64/mpu/head.S
+++ b/xen/arch/arm/arm64/mpu/head.S
@@ -158,11 +158,11 @@ END(enable_boot_cpu_mm)
  * We don't yet support secondary CPUs bring-up. Implement a dummy helper to
  * please the common code.
  */
-ENTRY(enable_secondary_cpu_mm)
+FUNC(enable_secondary_cpu_mm)
     PRINT("- SMP not enabled yet -\r\n")
 1:  wfe
     b 1b
-ENDPROC(enable_secondary_cpu_mm)
+END(enable_secondary_cpu_mm)
 
 /*
  * Local variables:
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 09:22:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 09:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935355.1336766 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzuIX-0001h5-8y; Wed, 02 Apr 2025 09:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935355.1336766; Wed, 02 Apr 2025 09: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 1tzuIX-0001gx-5t; Wed, 02 Apr 2025 09:22:13 +0000
Received: by outflank-mailman (input) for mailman id 935355;
 Wed, 02 Apr 2025 09: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 1tzuIW-0001f6-2M
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 09: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 1tzuIW-007QjV-08
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 09:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzuIV-003WA9-3C
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 09: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=k/TDGy2N0hphVrq6LEwTHcH7cEQdipVZOSQFkrR1uGg=; b=2zH0GKIWOM4j7CeERja/3SKoKH
	AOVepQMpo2pI7zHF/jiirDy9KgyiJJlYSklWTByiFo5i77LSOew6rOkuNwOcGcQv+XFQgOD+R1j+1
	aSgKXA7773ezJiiGa5JK6jnWwQFKYkk5L4pqYFUNq2jEX6Ker4fZZ9pzw+PWIyJXJs8U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] arm/mpu: Add HYPERVISOR_VIRT_START and avoid a check in xen.lds.S
Message-Id: <E1tzuIV-003WA9-3C@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 09:22:11 +0000

commit db72a5b2d2eaebc1e050def3fb9b73f43d10cdb0
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Tue Apr 1 09:58:52 2025 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 2 11:15:10 2025 +0200

    arm/mpu: Add HYPERVISOR_VIRT_START and avoid a check in xen.lds.S
    
    The define HYPERVISOR_VIRT_START is required by the common code,
    even if MPU system doesn't use virtual memory, define it in
    mpu/layout.h in order to reuse existing code.
    
    Disable a check in the linker script for arm for !MMU systems.
    
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/mpu/layout.h | 2 ++
 xen/arch/arm/xen.lds.S                | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/xen/arch/arm/include/asm/mpu/layout.h b/xen/arch/arm/include/asm/mpu/layout.h
index d6d397f4c2..248e55f888 100644
--- a/xen/arch/arm/include/asm/mpu/layout.h
+++ b/xen/arch/arm/include/asm/mpu/layout.h
@@ -22,6 +22,8 @@
  */
 #define XEN_VIRT_START         _AT(paddr_t, XEN_START_ADDRESS)
 
+#define HYPERVISOR_VIRT_START  XEN_VIRT_START
+
 #endif /* __ARM_MPU_LAYOUT_H__ */
 /*
  * Local variables:
diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index 325b8059fd..86a6e311cf 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -237,4 +237,6 @@ ASSERT(IS_ALIGNED(__bss_start,      POINTER_ALIGN), "__bss_start is misaligned")
 ASSERT(IS_ALIGNED(__bss_end,        POINTER_ALIGN), "__bss_end is misaligned")
 /* To simplify the logic in head.S, we want to _end to be page aligned */
 ASSERT(IS_ALIGNED(_end,             PAGE_SIZE), "_end is not page aligned")
+#ifdef CONFIG_MMU
 ASSERT((_end - _start) <= XEN_VIRT_SIZE, "Xen is too big")
+#endif
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 09:22:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 09:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935360.1336769 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzuIh-0001t9-AO; Wed, 02 Apr 2025 09:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935360.1336769; Wed, 02 Apr 2025 09: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 1tzuIh-0001t1-7J; Wed, 02 Apr 2025 09:22:23 +0000
Received: by outflank-mailman (input) for mailman id 935360;
 Wed, 02 Apr 2025 09: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 1tzuIg-0001rT-5F
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 09: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 1tzuIg-007Qjw-0Q
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 09:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzuIg-003WBN-0J
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 09: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=uOnwquNTDRHIWuDBQWZk0LR5kgwBwddDs/qJZS1FvRU=; b=iON8AO3TmKxZDzFTSNNn7jvKLg
	wC3G+Y9SV6gQLOOH7e+ywPJ9bT8/pqhALDyvyBQVYinyubos6fB3w9vRVaQwHWTjv3JrZRkrEv92t
	FeXeARZQNjK7BHIUzumkMiFOT8ci0G9tdLs79XMSKxmK4ajPgJBERbCqqkFHD/7BG1mw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: Implement virt/maddr conversion in MPU system
Message-Id: <E1tzuIg-003WBN-0J@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 09:22:22 +0000

commit 8523954fc54ed97a8e98f748a7c9c0c976e1f6dd
Author:     Penny Zheng <Penny.Zheng@arm.com>
AuthorDate: Tue Apr 1 09:58:53 2025 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 2 11:15:10 2025 +0200

    xen/arm: Implement virt/maddr conversion in MPU system
    
    virt_to_maddr and maddr_to_virt are used widely in Xen code. So
    even there is no VMSA in MPU system, we keep the interface in MPU to
    to avoid changing the existing common code.
    
    In order to do that, move the virt_to_maddr() and maddr_to_virt()
    definitions to mmu/mm.h, move the include of memory management
    subsystems (MMU/MPU) on a different place because the mentioned
    helpers needs visibility of some macro in asm/mm.h.
    
    Finally implement virt_to_maddr() and maddr_to_virt() for MPU systems
    under mpu/mm.h, the MPU version of virt/maddr conversion is simple since
    VA==PA.
    
    Signed-off-by: Penny Zheng <penny.zheng@arm.com>
    Signed-off-by: Wei Chen <wei.chen@arm.com>
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/mm.h     | 64 ++++++---------------------------------
 xen/arch/arm/include/asm/mmu/mm.h | 56 ++++++++++++++++++++++++++++++++++
 xen/arch/arm/include/asm/mpu/mm.h | 27 +++++++++++++++++
 3 files changed, 92 insertions(+), 55 deletions(-)

diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index a0d8e5afe9..444fd03823 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -14,12 +14,6 @@
 # error "unknown ARM variant"
 #endif
 
-#if defined(CONFIG_MMU)
-# include <asm/mmu/mm.h>
-#elif !defined(CONFIG_MPU)
-# error "Unknown memory management layout"
-#endif
-
 /* Align Xen to a 2 MiB boundary. */
 #define XEN_PADDR_ALIGN (1 << 21)
 
@@ -261,55 +255,6 @@ static inline void __iomem *ioremap_wc(paddr_t start, size_t len)
 /* Page-align address and convert to frame number format */
 #define paddr_to_pfn_aligned(paddr)    paddr_to_pfn(PAGE_ALIGN(paddr))
 
-#define virt_to_maddr(va) ({                                        \
-    vaddr_t va_ = (vaddr_t)(va);                                    \
-    (paddr_t)((va_to_par(va_) & PADDR_MASK & PAGE_MASK) | (va_ & ~PAGE_MASK)); \
-})
-
-#ifdef CONFIG_ARM_32
-/**
- * Find the virtual address corresponding to a machine address
- *
- * Only memory backing the XENHEAP has a corresponding virtual address to
- * be found. This is so we can save precious virtual space, as it's in
- * short supply on arm32. This mapping is not subject to PDX compression
- * because XENHEAP is known to be physically contiguous and can't hence
- * jump over the PDX hole. This means we can avoid the roundtrips
- * converting to/from pdx.
- *
- * @param ma Machine address
- * @return Virtual address mapped to `ma`
- */
-static inline void *maddr_to_virt(paddr_t ma)
-{
-    ASSERT(is_xen_heap_mfn(maddr_to_mfn(ma)));
-    ma -= mfn_to_maddr(directmap_mfn_start);
-    return (void *)(unsigned long) ma + XENHEAP_VIRT_START;
-}
-#else
-/**
- * Find the virtual address corresponding to a machine address
- *
- * The directmap covers all conventional memory accesible by the
- * hypervisor. This means it's subject to PDX compression.
- *
- * Note there's an extra offset applied (directmap_base_pdx) on top of the
- * regular PDX compression logic. Its purpose is to skip over the initial
- * range of non-existing memory, should there be one.
- *
- * @param ma Machine address
- * @return Virtual address mapped to `ma`
- */
-static inline void *maddr_to_virt(paddr_t ma)
-{
-    ASSERT((mfn_to_pdx(maddr_to_mfn(ma)) - directmap_base_pdx) <
-           (DIRECTMAP_SIZE >> PAGE_SHIFT));
-    return (void *)(XENHEAP_VIRT_START -
-                    (directmap_base_pdx << PAGE_SHIFT) +
-                    maddr_to_directmapoff(ma));
-}
-#endif
-
 /*
  * Translate a guest virtual address to a machine address.
  * Return the fault information if the translation has failed else 0.
@@ -340,6 +285,15 @@ static inline uint64_t gvirt_to_maddr(vaddr_t va, paddr_t *pa,
 #define virt_to_mfn(va)     __virt_to_mfn(va)
 #define mfn_to_virt(mfn)    __mfn_to_virt(mfn)
 
+/* Memory management subsystem header placed here to see the above macros */
+#if defined(CONFIG_MMU)
+# include <asm/mmu/mm.h>
+#elif defined(CONFIG_MPU)
+# include <asm/mpu/mm.h>
+#else
+#error "Unknown memory management layout"
+#endif
+
 /* Convert between Xen-heap virtual addresses and page-info structures. */
 static inline struct page_info *virt_to_page(const void *v)
 {
diff --git a/xen/arch/arm/include/asm/mmu/mm.h b/xen/arch/arm/include/asm/mmu/mm.h
index f5a00558c4..6737c3ede7 100644
--- a/xen/arch/arm/include/asm/mmu/mm.h
+++ b/xen/arch/arm/include/asm/mmu/mm.h
@@ -2,6 +2,13 @@
 #ifndef __ARM_MMU_MM_H__
 #define __ARM_MMU_MM_H__
 
+#include <xen/bug.h>
+#include <xen/pdx.h>
+#include <xen/types.h>
+#include <asm/mm.h>
+#include <asm/mmu/layout.h>
+#include <asm/page.h>
+
 /* Non-boot CPUs use this to find the correct pagetables. */
 extern uint64_t init_ttbr;
 
@@ -14,6 +21,55 @@ extern unsigned long directmap_base_pdx;
 
 #define frame_table ((struct page_info *)FRAMETABLE_VIRT_START)
 
+#define virt_to_maddr(va) ({                                                   \
+    vaddr_t va_ = (vaddr_t)(va);                                               \
+    (paddr_t)((va_to_par(va_) & PADDR_MASK & PAGE_MASK) | (va_ & ~PAGE_MASK)); \
+})
+
+#ifdef CONFIG_ARM_32
+/**
+ * Find the virtual address corresponding to a machine address
+ *
+ * Only memory backing the XENHEAP has a corresponding virtual address to
+ * be found. This is so we can save precious virtual space, as it's in
+ * short supply on arm32. This mapping is not subject to PDX compression
+ * because XENHEAP is known to be physically contiguous and can't hence
+ * jump over the PDX hole. This means we can avoid the roundtrips
+ * converting to/from pdx.
+ *
+ * @param ma Machine address
+ * @return Virtual address mapped to `ma`
+ */
+static inline void *maddr_to_virt(paddr_t ma)
+{
+    ASSERT(is_xen_heap_mfn(maddr_to_mfn(ma)));
+    ma -= mfn_to_maddr(directmap_mfn_start);
+    return (void *)(unsigned long) ma + XENHEAP_VIRT_START;
+}
+#else
+/**
+ * Find the virtual address corresponding to a machine address
+ *
+ * The directmap covers all conventional memory accesible by the
+ * hypervisor. This means it's subject to PDX compression.
+ *
+ * Note there's an extra offset applied (directmap_base_pdx) on top of the
+ * regular PDX compression logic. Its purpose is to skip over the initial
+ * range of non-existing memory, should there be one.
+ *
+ * @param ma Machine address
+ * @return Virtual address mapped to `ma`
+ */
+static inline void *maddr_to_virt(paddr_t ma)
+{
+    ASSERT((mfn_to_pdx(maddr_to_mfn(ma)) - directmap_base_pdx) <
+           (DIRECTMAP_SIZE >> PAGE_SHIFT));
+    return (void *)(XENHEAP_VIRT_START -
+                    (directmap_base_pdx << PAGE_SHIFT) +
+                    maddr_to_directmapoff(ma));
+}
+#endif
+
 /*
  * Print a walk of a page table or p2m
  *
diff --git a/xen/arch/arm/include/asm/mpu/mm.h b/xen/arch/arm/include/asm/mpu/mm.h
new file mode 100644
index 0000000000..6cfd0f5cd2
--- /dev/null
+++ b/xen/arch/arm/include/asm/mpu/mm.h
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef __ARM_MPU_MM_H__
+#define __ARM_MPU_MM_H__
+
+#include <xen/macros.h>
+#include <xen/page-size.h>
+#include <xen/types.h>
+
+#define virt_to_maddr(va) ((paddr_t)((vaddr_t)(va) & PADDR_MASK))
+
+/* On MPU systems there is no translation, ma == va. */
+static inline void *maddr_to_virt(paddr_t ma)
+{
+    return _p(ma);
+}
+
+#endif /* __ARM_MPU_MM_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 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 Apr 02 09:22:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 09:22:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935362.1336773 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzuIr-0001yh-Dc; Wed, 02 Apr 2025 09:22:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935362.1336773; Wed, 02 Apr 2025 09: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 1tzuIr-0001ya-Av; Wed, 02 Apr 2025 09:22:33 +0000
Received: by outflank-mailman (input) for mailman id 935362;
 Wed, 02 Apr 2025 09: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 1tzuIq-0001yA-88
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 09: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 1tzuIq-007Qk4-0i
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 09:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzuIq-003WDC-0c
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 09: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=vkFtlRQxuR1bXmJRggvqKPyzW6AjX9oTxNQQALJMtcE=; b=U3amTEeGbTFPMa8zXk/83lpbF7
	EQFl2txBM6MwMYuIZnRfauTFf8v0iNBl5qXKjED38HJE8/YWKHQY3nh9di9tvLvAQ9cTKaiE5zfdc
	vJ3Gk6Jr1pY3IFyMl2G53uGZCDCCvbVJuW9ExQAdm6P0XXuHoZ4wC0Iqqe2xmg43AONM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: Introduce frame_table and virt_to_page
Message-Id: <E1tzuIq-003WDC-0c@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 09:22:32 +0000

commit 64e059c9d0454e531610463db44e9ab7908995fa
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Tue Apr 1 09:58:54 2025 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 2 11:15:10 2025 +0200

    xen/arm: Introduce frame_table and virt_to_page
    
    Introduce frame_table in order to provide the implementation of
    virt_to_page for MPU system, move the MMU variant in mmu/mm.h.
    
    Introduce FRAMETABLE_NR that is required for 'pdx_group_valid' in
    pdx.c, but leave the initialisation of the frame table to a later
    stage.
    Define FRAMETABLE_SIZE for MPU to support up to 1TB of ram at this
    stage, as the only current implementation of armv8-r aarch64, which
    is cortex R82, can support 1TB or 256TB (r82 TRM r3p1
    ID_AA64MMFR0_EL1.PARange).
    
    Take the occasion to sort alphabetically the headers following
    the Xen code style and add the emacs footer in mpu/mm.c.
    
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/mm.h         | 14 --------------
 xen/arch/arm/include/asm/mmu/mm.h     | 14 ++++++++++++++
 xen/arch/arm/include/asm/mpu/layout.h |  3 +++
 xen/arch/arm/include/asm/mpu/mm.h     | 14 ++++++++++++++
 xen/arch/arm/mpu/mm.c                 | 14 +++++++++++++-
 5 files changed, 44 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index 444fd03823..fbffaccef4 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -294,20 +294,6 @@ static inline uint64_t gvirt_to_maddr(vaddr_t va, paddr_t *pa,
 #error "Unknown memory management layout"
 #endif
 
-/* Convert between Xen-heap virtual addresses and page-info structures. */
-static inline struct page_info *virt_to_page(const void *v)
-{
-    unsigned long va = (unsigned long)v;
-    unsigned long pdx;
-
-    ASSERT(va >= XENHEAP_VIRT_START);
-    ASSERT(va < directmap_virt_end);
-
-    pdx = (va - XENHEAP_VIRT_START) >> PAGE_SHIFT;
-    pdx += mfn_to_pdx(directmap_mfn_start);
-    return frame_table + pdx - frametable_base_pdx;
-}
-
 static inline void *page_to_virt(const struct page_info *pg)
 {
     return mfn_to_virt(mfn_x(page_to_mfn(pg)));
diff --git a/xen/arch/arm/include/asm/mmu/mm.h b/xen/arch/arm/include/asm/mmu/mm.h
index 6737c3ede7..caba987edc 100644
--- a/xen/arch/arm/include/asm/mmu/mm.h
+++ b/xen/arch/arm/include/asm/mmu/mm.h
@@ -70,6 +70,20 @@ static inline void *maddr_to_virt(paddr_t ma)
 }
 #endif
 
+/* Convert between Xen-heap virtual addresses and page-info structures. */
+static inline struct page_info *virt_to_page(const void *v)
+{
+    unsigned long va = (unsigned long)v;
+    unsigned long pdx;
+
+    ASSERT(va >= XENHEAP_VIRT_START);
+    ASSERT(va < directmap_virt_end);
+
+    pdx = (va - XENHEAP_VIRT_START) >> PAGE_SHIFT;
+    pdx += mfn_to_pdx(directmap_mfn_start);
+    return frame_table + pdx - frametable_base_pdx;
+}
+
 /*
  * Print a walk of a page table or p2m
  *
diff --git a/xen/arch/arm/include/asm/mpu/layout.h b/xen/arch/arm/include/asm/mpu/layout.h
index 248e55f888..c331d1feaa 100644
--- a/xen/arch/arm/include/asm/mpu/layout.h
+++ b/xen/arch/arm/include/asm/mpu/layout.h
@@ -3,6 +3,9 @@
 #ifndef __ARM_MPU_LAYOUT_H__
 #define __ARM_MPU_LAYOUT_H__
 
+#define FRAMETABLE_SIZE   GB(16)
+#define FRAMETABLE_NR     (FRAMETABLE_SIZE / sizeof(*frame_table))
+
 #define XEN_START_ADDRESS CONFIG_XEN_START_ADDRESS
 
 /*
diff --git a/xen/arch/arm/include/asm/mpu/mm.h b/xen/arch/arm/include/asm/mpu/mm.h
index 6cfd0f5cd2..86f33d9836 100644
--- a/xen/arch/arm/include/asm/mpu/mm.h
+++ b/xen/arch/arm/include/asm/mpu/mm.h
@@ -3,9 +3,13 @@
 #ifndef __ARM_MPU_MM_H__
 #define __ARM_MPU_MM_H__
 
+#include <xen/bug.h>
 #include <xen/macros.h>
 #include <xen/page-size.h>
 #include <xen/types.h>
+#include <asm/mm.h>
+
+extern struct page_info *frame_table;
 
 #define virt_to_maddr(va) ((paddr_t)((vaddr_t)(va) & PADDR_MASK))
 
@@ -15,6 +19,16 @@ static inline void *maddr_to_virt(paddr_t ma)
     return _p(ma);
 }
 
+/* Convert between virtual address to page-info structure. */
+static inline struct page_info *virt_to_page(const void *v)
+{
+    mfn_t mfn = _mfn(virt_to_mfn(v));
+
+    ASSERT(mfn_valid(mfn));
+
+    return mfn_to_page(mfn);
+}
+
 #endif /* __ARM_MPU_MM_H__ */
 
 /*
diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
index 0b8748e575..3632011c10 100644
--- a/xen/arch/arm/mpu/mm.c
+++ b/xen/arch/arm/mpu/mm.c
@@ -1,9 +1,12 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#include <xen/lib.h>
 #include <xen/init.h>
+#include <xen/lib.h>
+#include <xen/mm.h>
 #include <xen/sizes.h>
 
+struct page_info *frame_table;
+
 static void __init __maybe_unused build_assertions(void)
 {
     /*
@@ -13,3 +16,12 @@ static void __init __maybe_unused build_assertions(void)
      */
     BUILD_BUG_ON(PAGE_SIZE != SZ_4K);
 }
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 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 Apr 02 09:22:43 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 09:22:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935365.1336777 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzuJ1-00022q-F1; Wed, 02 Apr 2025 09:22:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935365.1336777; Wed, 02 Apr 2025 09: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 1tzuJ1-00022i-CS; Wed, 02 Apr 2025 09:22:43 +0000
Received: by outflank-mailman (input) for mailman id 935365;
 Wed, 02 Apr 2025 09: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 1tzuJ0-00022L-Aw
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 09: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 1tzuJ0-007QkE-0z
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 09:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzuJ0-003WHa-0s
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 09: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=JBrpUzens+LW5CDzn6zT6VsNfmQvt0OnUTx49Mf9wYk=; b=Jv9Te9Nh6YfcGOWvTpOJobOShH
	KjD+hWiG/UC3rRlu8LX3b1mAp/gBCsztJRtvKPS+jhdhUE5Vug0wXYy5+D9EHNFnsUQllmj+SE0Bp
	hZZTWLTKGjbak7/H+ShClktscSjnMs8UmgVzD9VDj1N2sG1kD8VOszcaJSU6Pd3SIBTo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] arm/mpu: Kconfig symbols for MPU build
Message-Id: <E1tzuJ0-003WHa-0s@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 09:22:42 +0000

commit 2244da28fc08ea6678e7f337b09c72a2c411ef05
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Tue Apr 1 09:58:55 2025 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 2 11:15:10 2025 +0200

    arm/mpu: Kconfig symbols for MPU build
    
    The MPU system requires static memory to work, select that
    when building this memory management subsystem.
    
    While there, provide a restriction for the ARM_EFI Kconfig
    parameter to be built only when !MPU, the EFI stub is not
    used as there are no implementation of UEFI services for
    armv8-r.
    
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 466b7db63c..7a7658812d 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -85,6 +85,7 @@ config MMU
 
 config MPU
 	bool "MPU" if UNSUPPORTED
+	select STATIC_MEMORY
 	help
 	  Memory Protection Unit (MPU). Select if you plan to run Xen on ARMv8-R
 	  systems supporting EL2. (UNSUPPORTED)
@@ -102,7 +103,7 @@ config ACPI
 
 config ARM_EFI
 	bool "UEFI boot service support"
-	depends on ARM_64
+	depends on ARM_64 && !MPU
 	default y
 	help
 	  This option provides support for boot services through
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 09:22:53 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 09:22:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935366.1336783 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzuJB-00026p-Hy; Wed, 02 Apr 2025 09:22:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935366.1336783; Wed, 02 Apr 2025 09: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 1tzuJB-00026c-Dm; Wed, 02 Apr 2025 09:22:53 +0000
Received: by outflank-mailman (input) for mailman id 935366;
 Wed, 02 Apr 2025 09: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 1tzuJA-00025c-EF
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 09: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 1tzuJA-007QkK-1K
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 09:22:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzuJA-003WKM-1A
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 09: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=BBgMZtSFUxtFTPLmpmXfnaMWzVCb9oJNYBNhFV86bz0=; b=N5xT+l3nl1DwcNd7I4yPv1blwg
	i1tPynCBcrfWG9EhTiFSoP8O055t6UPxKu/ODXF6w/1eivkG9nKfaezqowTS8kK0LqXOhkwxAJOgg
	OSDKWv+uQSSW7f8HxANlWY+OdIk39qzHTpf/lvJVNsgsrzEgFPE5Ro0ZwD0KfML93msI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] arm/mpu: Implement stubs for ioremap_attr on MPU
Message-Id: <E1tzuJA-003WKM-1A@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 09:22:52 +0000

commit 2cd02c27d3277b0fe664040e10445818a48b6492
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Tue Apr 1 09:58:56 2025 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 2 11:15:10 2025 +0200

    arm/mpu: Implement stubs for ioremap_attr on MPU
    
    Implement ioremap_attr() stub for MPU system; the
    implementation of ioremap() is the same between MMU
    and MPU system, and it relies on ioremap_attr(), so
    move the definition from mmu/pt.c to arm/mm.c.
    
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/mm.c     | 5 +++++
 xen/arch/arm/mmu/pt.c | 5 -----
 xen/arch/arm/mpu/mm.c | 6 ++++++
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index a56e20ba2b..5a52f0c623 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -395,6 +395,11 @@ unsigned long get_upper_mfn_bound(void)
     return max_page - 1;
 }
 
+void *ioremap(paddr_t pa, size_t len)
+{
+    return ioremap_attr(pa, len, PAGE_HYPERVISOR_NOCACHE);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/arm/mmu/pt.c b/xen/arch/arm/mmu/pt.c
index da28d669e7..11cb1c66da 100644
--- a/xen/arch/arm/mmu/pt.c
+++ b/xen/arch/arm/mmu/pt.c
@@ -223,11 +223,6 @@ void *ioremap_attr(paddr_t start, size_t len, unsigned int attributes)
     return ptr + offs;
 }
 
-void *ioremap(paddr_t pa, size_t len)
-{
-    return ioremap_attr(pa, len, PAGE_HYPERVISOR_NOCACHE);
-}
-
 static int create_xen_table(lpae_t *entry)
 {
     mfn_t mfn;
diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
index 3632011c10..4e9a2405d8 100644
--- a/xen/arch/arm/mpu/mm.c
+++ b/xen/arch/arm/mpu/mm.c
@@ -17,6 +17,12 @@ static void __init __maybe_unused build_assertions(void)
     BUILD_BUG_ON(PAGE_SIZE != SZ_4K);
 }
 
+void __iomem *ioremap_attr(paddr_t start, size_t len, unsigned int flags)
+{
+    BUG_ON("unimplemented");
+    return NULL;
+}
+
 /*
  * Local variables:
  * mode: C
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 09:23:03 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 09:23:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935367.1336785 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzuJL-0002AP-Hi; Wed, 02 Apr 2025 09:23:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935367.1336785; Wed, 02 Apr 2025 09: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 1tzuJL-0002AH-F8; Wed, 02 Apr 2025 09:23:03 +0000
Received: by outflank-mailman (input) for mailman id 935367;
 Wed, 02 Apr 2025 09: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 1tzuJK-0002A9-HI
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 09: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 1tzuJK-007Qkp-1c
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 09:23:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzuJK-003WLa-1W
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 09: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=p6pcnoAVd5qYjFWxM5yPCAy8ixqKzBNxJ6vh1rXwP0I=; b=4jAPPIvTIegzDch957osC4yNj3
	qS1ntxuNDovkgBY6yEqQ1q1SkQzSlkRQVHtzlCan6Ui/FsxjxD3PGoaiqB8WFhGWFr15WlN45Vcgm
	x3LNVs/X7hePBDXMdA4PpozgVsnq2NIxf+cuOfHBUm2yKPiyWP9BgBPzkkKN/zL5vcrQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: introduce Kconfig ARCH_PAGING_MEMPOOL
Message-Id: <E1tzuJK-003WLa-1W@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 09:23:02 +0000

commit 2705f1adb9df93ee632a52651cf2b6bb86d9ca35
Author:     Penny Zheng <Penny.Zheng@arm.com>
AuthorDate: Tue Apr 1 09:58:57 2025 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 2 11:15:10 2025 +0200

    xen: introduce Kconfig ARCH_PAGING_MEMPOOL
    
    ARM MPU system doesn't need to use paging memory pool, as MPU memory
    mapping table at most takes only one 4KB page, which is enough to
    manage the maximum 255 MPU memory regions, for all EL2 stage 1
    translation and EL1 stage 2 translation.
    
    Introduce ARCH_PAGING_MEMPOOL Kconfig common symbol, selected for Arm
    MMU systems and x86. Removed stubs from RISC-V now that the common code
    provide them and the functions are not gonna be used.
    
    Wrap the code inside 'construct_domU' that deal with p2m paging
    allocation in a new function 'domain_p2m_set_allocation', protected
    by ARCH_PAGING_MEMPOOL, this is done in this way to prevent polluting
    the former function with #ifdefs and improve readability
    
    Introduce arch_{get,set}_paging_mempool_size stubs for architecture
    with !ARCH_PAGING_MEMPOOL.
    
    Remove 'struct paging_domain' from Arm 'struct arch_domain' when the
    field is not required.
    
    Signed-off-by: Penny Zheng <penny.zheng@arm.com>
    Signed-off-by: Wei Chen <wei.chen@arm.com>
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com> # arm
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> # riscv
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/arm/Kconfig              |  1 +
 xen/arch/arm/dom0less-build.c     | 70 ++++++++++++++++++++++++---------------
 xen/arch/arm/include/asm/domain.h |  2 ++
 xen/arch/riscv/stubs.c            | 11 ------
 xen/arch/x86/Kconfig              |  1 +
 xen/common/Kconfig                |  3 ++
 xen/include/xen/domain.h          | 17 ++++++++++
 7 files changed, 68 insertions(+), 37 deletions(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 7a7658812d..565f288331 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -75,6 +75,7 @@ choice
 
 config MMU
 	bool "MMU"
+	select ARCH_PAGING_MEMPOOL
 	select HAS_LLC_COLORING if !NUMA && ARM_64
 	select HAS_PMAP
 	select HAS_VMAP
diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index 573b0d25ae..bd15563750 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -673,21 +673,6 @@ static int __init prepare_dtb_domU(struct domain *d, struct kernel_info *kinfo)
     return -EINVAL;
 }
 
-static unsigned long __init domain_p2m_pages(unsigned long maxmem_kb,
-                                             unsigned int smp_cpus)
-{
-    /*
-     * Keep in sync with libxl__get_required_paging_memory().
-     * 256 pages (1MB) per vcpu, plus 1 page per MiB of RAM for the P2M map,
-     * plus 128 pages to cover extended regions.
-     */
-    unsigned long memkb = 4 * (256 * smp_cpus + (maxmem_kb / 1024) + 128);
-
-    BUILD_BUG_ON(PAGE_SIZE != SZ_4K);
-
-    return DIV_ROUND_UP(memkb, 1024) << (20 - PAGE_SHIFT);
-}
-
 static int __init alloc_xenstore_evtchn(struct domain *d)
 {
     evtchn_alloc_unbound_t alloc;
@@ -841,6 +826,49 @@ static void __init domain_vcpu_affinity(struct domain *d,
     }
 }
 
+#ifdef CONFIG_ARCH_PAGING_MEMPOOL
+static unsigned long __init domain_p2m_pages(unsigned long maxmem_kb,
+                                             unsigned int smp_cpus)
+{
+    /*
+     * Keep in sync with libxl__get_required_paging_memory().
+     * 256 pages (1MB) per vcpu, plus 1 page per MiB of RAM for the P2M map,
+     * plus 128 pages to cover extended regions.
+     */
+    unsigned long memkb = 4 * (256 * smp_cpus + (maxmem_kb / 1024) + 128);
+
+    BUILD_BUG_ON(PAGE_SIZE != SZ_4K);
+
+    return DIV_ROUND_UP(memkb, 1024) << (20 - PAGE_SHIFT);
+}
+
+static int __init domain_p2m_set_allocation(struct domain *d, uint64_t mem,
+                                            const struct dt_device_node *node)
+{
+    unsigned long p2m_pages;
+    uint32_t p2m_mem_mb;
+    int rc;
+
+    rc = dt_property_read_u32(node, "xen,domain-p2m-mem-mb", &p2m_mem_mb);
+    /* If xen,domain-p2m-mem-mb is not specified, use the default value. */
+    p2m_pages = rc ?
+                p2m_mem_mb << (20 - PAGE_SHIFT) :
+                domain_p2m_pages(mem, d->max_vcpus);
+
+    spin_lock(&d->arch.paging.lock);
+    rc = p2m_set_allocation(d, p2m_pages, NULL);
+    spin_unlock(&d->arch.paging.lock);
+
+    return rc;
+}
+#else /* !CONFIG_ARCH_PAGING_MEMPOOL */
+static inline int domain_p2m_set_allocation(struct domain *d, uint64_t mem,
+                                            const struct dt_device_node *node)
+{
+    return 0;
+}
+#endif /* CONFIG_ARCH_PAGING_MEMPOOL */
+
 static int __init construct_domU(struct domain *d,
                                  const struct dt_device_node *node)
 {
@@ -848,8 +876,6 @@ static int __init construct_domU(struct domain *d,
     const char *dom0less_enhanced;
     int rc;
     u64 mem;
-    u32 p2m_mem_mb;
-    unsigned long p2m_pages;
 
     rc = dt_property_read_u64(node, "memory", &mem);
     if ( !rc )
@@ -859,15 +885,7 @@ static int __init construct_domU(struct domain *d,
     }
     kinfo.unassigned_mem = (paddr_t)mem * SZ_1K;
 
-    rc = dt_property_read_u32(node, "xen,domain-p2m-mem-mb", &p2m_mem_mb);
-    /* If xen,domain-p2m-mem-mb is not specified, use the default value. */
-    p2m_pages = rc ?
-                p2m_mem_mb << (20 - PAGE_SHIFT) :
-                domain_p2m_pages(mem, d->max_vcpus);
-
-    spin_lock(&d->arch.paging.lock);
-    rc = p2m_set_allocation(d, p2m_pages, NULL);
-    spin_unlock(&d->arch.paging.lock);
+    rc = domain_p2m_set_allocation(d, mem, node);
     if ( rc != 0 )
         return rc;
 
diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h
index 50b6a4b009..a3487ca713 100644
--- a/xen/arch/arm/include/asm/domain.h
+++ b/xen/arch/arm/include/asm/domain.h
@@ -75,7 +75,9 @@ struct arch_domain
 
     struct hvm_domain hvm;
 
+#ifdef CONFIG_ARCH_PAGING_MEMPOOL
     struct paging_domain paging;
+#endif
 
     struct vmmio vmmio;
 
diff --git a/xen/arch/riscv/stubs.c b/xen/arch/riscv/stubs.c
index caa133de84..a1d64534cd 100644
--- a/xen/arch/riscv/stubs.c
+++ b/xen/arch/riscv/stubs.c
@@ -333,11 +333,6 @@ void arch_do_physinfo(struct xen_sysctl_physinfo *pi)
 
 /* p2m.c */
 
-int arch_set_paging_mempool_size(struct domain *d, uint64_t size)
-{
-    BUG_ON("unimplemented");
-}
-
 int unmap_mmio_regions(struct domain *d,
                        gfn_t start_gfn,
                        unsigned long nr,
@@ -360,12 +355,6 @@ int set_foreign_p2m_entry(struct domain *d, const struct domain *fd,
     BUG_ON("unimplemented");
 }
 
-/* Return the size of the pool, in bytes. */
-int arch_get_paging_mempool_size(struct domain *d, uint64_t *size)
-{
-    BUG_ON("unimplemented");
-}
-
 int guest_physmap_remove_page(struct domain *d, gfn_t gfn, mfn_t mfn,
                               unsigned int page_order)
 {
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index 18efdb2e31..de2fa37f08 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -9,6 +9,7 @@ config X86
 	select ACPI_NUMA
 	select ALTERNATIVE_CALL
 	select ARCH_MAP_DOMAIN_PAGE
+	select ARCH_PAGING_MEMPOOL
 	select ARCH_SUPPORTS_INT128
 	imply CORE_PARKING
 	select FUNCTION_ALIGNMENT_16B
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index a6aa2c5c14..218357d593 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -44,6 +44,9 @@ config ALTERNATIVE_CALL
 config ARCH_MAP_DOMAIN_PAGE
 	bool
 
+config ARCH_PAGING_MEMPOOL
+	bool
+
 config GENERIC_BUG_FRAME
 	bool
 
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index 83069de501..a34daa7d10 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -2,6 +2,7 @@
 #ifndef __XEN_DOMAIN_H__
 #define __XEN_DOMAIN_H__
 
+#include <xen/errno.h>
 #include <xen/numa.h>
 #include <xen/types.h>
 
@@ -114,9 +115,25 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c);
 int arch_initialise_vcpu(struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg);
 int default_initialise_vcpu(struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg);
 
+#ifdef CONFIG_ARCH_PAGING_MEMPOOL
+
 int arch_get_paging_mempool_size(struct domain *d, uint64_t *size /* bytes */);
 int arch_set_paging_mempool_size(struct domain *d, uint64_t size /* bytes */);
 
+#else /* !CONFIG_ARCH_PAGING_MEMPOOL */
+
+static inline int arch_get_paging_mempool_size(struct domain *d, uint64_t *size)
+{
+    return -EOPNOTSUPP;
+}
+
+static inline int arch_set_paging_mempool_size(struct domain *d, uint64_t size)
+{
+    return -EOPNOTSUPP;
+}
+
+#endif /* CONFIG_ARCH_PAGING_MEMPOOL */
+
 bool update_runstate_area(struct vcpu *v);
 
 int domain_relinquish_resources(struct domain *d);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 09:23:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 09:23:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935368.1336789 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzuJW-0002Cp-JR; Wed, 02 Apr 2025 09:23:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935368.1336789; Wed, 02 Apr 2025 09: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 1tzuJW-0002Ch-Gh; Wed, 02 Apr 2025 09:23:14 +0000
Received: by outflank-mailman (input) for mailman id 935368;
 Wed, 02 Apr 2025 09: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 1tzuJU-0002CU-KA
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 09: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 1tzuJU-007Qkv-1u
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 09:23:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzuJU-003WNI-1o
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 09: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=daihIyV11zQFgZ08fdC685waBHFU870RazRT3VHhgfE=; b=OpAUpTqcLb5zpGaNTOiGuRzUzN
	rc3Id2vDmZdMMMwuIbj6qBaghmhm2oYx+xhHmYC2CqYqlupDM6lQmLSZVYvZVz4xwRMyH+F2b7ExZ
	Xx0gNXJNFJEZz5wO7LQ9Tksavq7U/uDw2qMwR+AR/7Wg6jUwo5tmTGwPE9mwkQeRBpus=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] arm/mpu: Create the skeleton for MPU compilation
Message-Id: <E1tzuJU-003WNI-1o@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 09:23:12 +0000

commit 5d9610f9149a67e8fc3d9934e93e8b968832c43c
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Tue Apr 1 09:58:58 2025 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 2 11:15:10 2025 +0200

    arm/mpu: Create the skeleton for MPU compilation
    
    This commit introduces the skeleton for the MPU memory management
    subsystem that allows the compilation on Arm64.
    
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/arm64/mpu/Makefile    |  2 +
 xen/arch/arm/arm64/mpu/p2m.c       | 19 +++++++++
 xen/arch/arm/arm64/mpu/smpboot.c   | 26 ++++++++++++
 xen/arch/arm/include/asm/mpu/p2m.h | 21 ++++++++++
 xen/arch/arm/include/asm/p2m.h     |  2 +-
 xen/arch/arm/mpu/Makefile          |  3 ++
 xen/arch/arm/mpu/mm.c              | 25 ++++++++++++
 xen/arch/arm/mpu/p2m.c             | 84 ++++++++++++++++++++++++++++++++++++++
 xen/arch/arm/mpu/setup.c           | 40 ++++++++++++++++++
 xen/arch/arm/mpu/vmap.c            | 26 ++++++++++++
 10 files changed, 247 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/arm64/mpu/Makefile b/xen/arch/arm/arm64/mpu/Makefile
index 3340058c08..cf0540aecc 100644
--- a/xen/arch/arm/arm64/mpu/Makefile
+++ b/xen/arch/arm/arm64/mpu/Makefile
@@ -1 +1,3 @@
 obj-y += head.o
+obj-y += p2m.o
+obj-y += smpboot.o
diff --git a/xen/arch/arm/arm64/mpu/p2m.c b/xen/arch/arm/arm64/mpu/p2m.c
new file mode 100644
index 0000000000..b6d8b2777b
--- /dev/null
+++ b/xen/arch/arm/arm64/mpu/p2m.c
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/bug.h>
+#include <xen/init.h>
+#include <asm/p2m.h>
+
+void __init setup_virt_paging(void)
+{
+    BUG_ON("unimplemented");
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/arm64/mpu/smpboot.c b/xen/arch/arm/arm64/mpu/smpboot.c
new file mode 100644
index 0000000000..5090f443f5
--- /dev/null
+++ b/xen/arch/arm/arm64/mpu/smpboot.c
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/bug.h>
+#include <xen/errno.h>
+#include <xen/mm.h>
+#include <xen/stdbool.h>
+
+int prepare_secondary_mm(int cpu)
+{
+    BUG_ON("unimplemented");
+    return -EINVAL;
+}
+
+void update_boot_mapping(bool enable)
+{
+    BUG_ON("unimplemented");
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/include/asm/mpu/p2m.h b/xen/arch/arm/include/asm/mpu/p2m.h
new file mode 100644
index 0000000000..e46d9e757a
--- /dev/null
+++ b/xen/arch/arm/include/asm/mpu/p2m.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef __ARM_MPU_P2M_H__
+#define __ARM_MPU_P2M_H__
+
+struct p2m_domain;
+
+static inline void p2m_clear_root_pages(struct p2m_domain *p2m) {}
+
+static inline void p2m_tlb_flush_sync(struct p2m_domain *p2m) {}
+
+#endif /* __ARM_MPU_P2M_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/include/asm/p2m.h b/xen/arch/arm/include/asm/p2m.h
index 594dc40041..2d53bf9b61 100644
--- a/xen/arch/arm/include/asm/p2m.h
+++ b/xen/arch/arm/include/asm/p2m.h
@@ -168,7 +168,7 @@ typedef enum {
 #if defined(CONFIG_MMU)
 # include <asm/mmu/p2m.h>
 #else
-# error "Unknown memory management layout"
+# include <asm/mpu/p2m.h>
 #endif
 
 static inline bool arch_acquire_resource_check(struct domain *d)
diff --git a/xen/arch/arm/mpu/Makefile b/xen/arch/arm/mpu/Makefile
index b18cec4836..21bbc517b5 100644
--- a/xen/arch/arm/mpu/Makefile
+++ b/xen/arch/arm/mpu/Makefile
@@ -1 +1,4 @@
 obj-y += mm.o
+obj-y += p2m.o
+obj-y += setup.init.o
+obj-y += vmap.o
diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
index 4e9a2405d8..07c8959f4e 100644
--- a/xen/arch/arm/mpu/mm.c
+++ b/xen/arch/arm/mpu/mm.c
@@ -1,9 +1,12 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
+#include <xen/bug.h>
+#include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/mm.h>
 #include <xen/sizes.h>
+#include <xen/types.h>
 
 struct page_info *frame_table;
 
@@ -17,6 +20,28 @@ static void __init __maybe_unused build_assertions(void)
     BUILD_BUG_ON(PAGE_SIZE != SZ_4K);
 }
 
+void __init setup_mm(void)
+{
+    BUG_ON("unimplemented");
+}
+
+int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
+{
+    BUG_ON("unimplemented");
+    return -EINVAL;
+}
+
+void dump_hyp_walk(vaddr_t addr)
+{
+    BUG_ON("unimplemented");
+}
+
+/* Release all __init and __initdata ranges to be reused */
+void free_init_memory(void)
+{
+    BUG_ON("unimplemented");
+}
+
 void __iomem *ioremap_attr(paddr_t start, size_t len, unsigned int flags)
 {
     BUG_ON("unimplemented");
diff --git a/xen/arch/arm/mpu/p2m.c b/xen/arch/arm/mpu/p2m.c
new file mode 100644
index 0000000000..f7fb58ab6a
--- /dev/null
+++ b/xen/arch/arm/mpu/p2m.c
@@ -0,0 +1,84 @@
+
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/bug.h>
+#include <xen/domain.h>
+#include <xen/errno.h>
+#include <xen/mm-frame.h>
+#include <xen/sched.h>
+#include <xen/types.h>
+#include <asm/p2m.h>
+
+int p2m_set_entry(struct p2m_domain *p2m, gfn_t sgfn, unsigned long nr,
+                  mfn_t smfn, p2m_type_t t, p2m_access_t a)
+{
+    BUG_ON("unimplemented");
+    return -EINVAL;
+}
+
+mfn_t p2m_get_entry(struct p2m_domain *p2m, gfn_t gfn, p2m_type_t *t,
+                    p2m_access_t *a, unsigned int *page_order, bool *valid)
+{
+    BUG_ON("unimplemented");
+    return INVALID_MFN;
+}
+
+void p2m_dump_info(struct domain *d)
+{
+    BUG_ON("unimplemented");
+}
+
+int p2m_init(struct domain *d)
+{
+    BUG_ON("unimplemented");
+    return -EINVAL;
+}
+
+void p2m_save_state(struct vcpu *p)
+{
+    BUG_ON("unimplemented");
+}
+
+void p2m_restore_state(struct vcpu *n)
+{
+    BUG_ON("unimplemented");
+}
+
+void p2m_final_teardown(struct domain *d)
+{
+    BUG_ON("unimplemented");
+}
+
+bool p2m_resolve_translation_fault(struct domain *d, gfn_t gfn)
+{
+    BUG_ON("unimplemented");
+    return false;
+}
+
+void p2m_flush_vm(struct vcpu *v) {}
+
+int relinquish_p2m_mapping(struct domain *d)
+{
+    return 0;
+}
+
+void p2m_domain_creation_finished(struct domain *d) {}
+
+int p2m_teardown(struct domain *d)
+{
+    return 0;
+}
+
+int p2m_teardown_allocation(struct domain *d)
+{
+    return 0;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/mpu/setup.c b/xen/arch/arm/mpu/setup.c
new file mode 100644
index 0000000000..b4da77003f
--- /dev/null
+++ b/xen/arch/arm/mpu/setup.c
@@ -0,0 +1,40 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/bug.h>
+#include <xen/init.h>
+#include <xen/mm.h>
+#include <xen/types.h>
+#include <asm/setup.h>
+
+void __init setup_pagetables(void) {}
+
+void * __init early_fdt_map(paddr_t fdt_paddr)
+{
+    BUG_ON("unimplemented");
+    return NULL;
+}
+
+/*
+ * copy_from_paddr - copy data from a physical address
+ * @dst: destination virtual address
+ * @paddr: source physical address
+ * @len: length to copy
+ */
+void __init copy_from_paddr(void *dst, paddr_t paddr, unsigned long len)
+{
+    BUG_ON("unimplemented");
+}
+
+void __init remove_early_mappings(void)
+{
+    BUG_ON("unimplemented");
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/mpu/vmap.c b/xen/arch/arm/mpu/vmap.c
new file mode 100644
index 0000000000..f977b79cd4
--- /dev/null
+++ b/xen/arch/arm/mpu/vmap.c
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/bug.h>
+#include <xen/mm-frame.h>
+#include <xen/types.h>
+#include <xen/vmap.h>
+
+void *vmap_contig(mfn_t mfn, unsigned int nr)
+{
+    BUG_ON("unimplemented");
+    return NULL;
+}
+
+void vunmap(const void *va)
+{
+    BUG_ON("unimplemented");
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 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 Apr 02 10:22:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 10:22:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935592.1336964 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzvEQ-0001vC-TL; Wed, 02 Apr 2025 10:22:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935592.1336964; Wed, 02 Apr 2025 10: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 1tzvEQ-0001v4-Pd; Wed, 02 Apr 2025 10:22:02 +0000
Received: by outflank-mailman (input) for mailman id 935592;
 Wed, 02 Apr 2025 10: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 1tzvEP-0001uw-Kw
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 10:22:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzvEP-007SEp-1R
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 10:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzvEP-003f6L-1J
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 10:22:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mYsP/To/xU+pfpqzuOsXD0c+OXOcDLJwyiViLCUSRgk=; b=DEZpDkBn4HlqNTnsA+W9sndym2
	d7pPya3vH7wkZTKrSTVflDtO8v/1wTEE/sf0HMPdr0BfFFLoAJYtz1irMzvrHW2sdM4paVWFmyxt1
	jtE53VJZyVDGLEftXVZVqfd7JKBIagzxWR/+5wTIKlGx+RhE/RADBHU5UvVbRs6wO8Ms=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: simplify bitmap_to_xenctl_bitmap for little endian
Message-Id: <E1tzvEP-003f6L-1J@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 10:22:01 +0000

commit 288c4641c80d63169d65687a7723a0003327c8e9
Author:     Stefano Stabellini <stefano.stabellini@amd.com>
AuthorDate: Wed Apr 2 12:14:40 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 2 12:14:40 2025 +0200

    xen: simplify bitmap_to_xenctl_bitmap for little endian
    
    The little endian implementation of bitmap_to_xenctl_bitmap leads to
    unnecessary xmallocs and xfrees. Given that Xen only supports little
    endian architectures, it is worth optimizing.
    
    This patch removes the need for the xmalloc on little endian
    architectures.
    
    Remove clamp_last_byte as it is only called once and only needs to
    modify one byte. Inline it.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/bitmap.c | 65 +++++++++++++++++++++++++++++------------------------
 1 file changed, 36 insertions(+), 29 deletions(-)

diff --git a/xen/common/bitmap.c b/xen/common/bitmap.c
index 3da63a32a6..6c4af09c18 100644
--- a/xen/common/bitmap.c
+++ b/xen/common/bitmap.c
@@ -40,21 +40,6 @@
  * for the best explanations of this ordering.
  */
 
-/*
- * If a bitmap has a number of bits which is not a multiple of 8 then
- * the last few bits of the last byte of the bitmap can be
- * unexpectedly set which can confuse consumers (e.g. in the tools)
- * who also round up their loops to 8 bits. Ensure we clear those left
- * over bits so as to prevent surprises.
- */
-static void clamp_last_byte(uint8_t *bp, unsigned int nbits)
-{
-	unsigned int remainder = nbits % 8;
-
-	if (remainder)
-		bp[nbits/8] &= (1U << remainder) - 1;
-}
-
 int __bitmap_empty(const unsigned long *bitmap, unsigned int bits)
 {
 	int k, lim = bits/BITS_PER_LONG;
@@ -338,7 +323,6 @@ static void bitmap_long_to_byte(uint8_t *bp, const unsigned long *lp,
 			nbits -= 8;
 		}
 	}
-	clamp_last_byte(bp, nbits);
 }
 
 static void bitmap_byte_to_long(unsigned long *lp, const uint8_t *bp,
@@ -359,12 +343,11 @@ static void bitmap_byte_to_long(unsigned long *lp, const uint8_t *bp,
 
 #elif defined(__LITTLE_ENDIAN)
 
-static void bitmap_long_to_byte(uint8_t *bp, const unsigned long *lp,
-				unsigned int nbits)
-{
-	memcpy(bp, lp, DIV_ROUND_UP(nbits, BITS_PER_BYTE));
-	clamp_last_byte(bp, nbits);
-}
+#define LITTLE_ENDIAN 1 /* For IS_ENABLED(). */
+
+/* Unused function, but a declaration is needed. */
+void bitmap_long_to_byte(uint8_t *bp, const unsigned long *lp,
+			 unsigned int nbits);
 
 static void bitmap_byte_to_long(unsigned long *lp, const uint8_t *bp,
 				unsigned int nbits)
@@ -384,22 +367,46 @@ int bitmap_to_xenctl_bitmap(struct xenctl_bitmap *xenctl_bitmap,
     uint8_t zero = 0;
     int err = 0;
     unsigned int xen_bytes = DIV_ROUND_UP(nbits, BITS_PER_BYTE);
-    uint8_t *bytemap = xmalloc_array(uint8_t, xen_bytes);
+    const uint8_t *bytemap;
+    uint8_t last, *buf = NULL;
 
-    if ( !bytemap )
-        return -ENOMEM;
+    if ( !IS_ENABLED(LITTLE_ENDIAN) )
+    {
+        buf = xmalloc_array(uint8_t, xen_bytes);
+        if ( !buf )
+            return -ENOMEM;
+
+        bitmap_long_to_byte(buf, bitmap, nbits);
+
+        bytemap = buf;
+    }
+    else
+        bytemap = (const uint8_t *)bitmap;
 
     guest_bytes = DIV_ROUND_UP(xenctl_bitmap->nr_bits, BITS_PER_BYTE);
     copy_bytes  = min(guest_bytes, xen_bytes);
 
-    bitmap_long_to_byte(bytemap, bitmap, nbits);
+    if ( copy_bytes > 1 &&
+         copy_to_guest(xenctl_bitmap->bitmap, bytemap, copy_bytes - 1) )
+        err = -EFAULT;
+
+    /*
+     * If a bitmap has a number of bits which is not a multiple of 8 then the
+     * last few bits of the last byte of the bitmap can be unexpectedly set,
+     * which can confuse consumers (e.g. in the tools), who also may round up
+     * their loops to 8 bits. Ensure we clear those left over bits so as to
+     * prevent surprises.
+     */
+    last = bytemap[nbits / 8];
+    if ( nbits % 8 )
+        last &= (1U << (nbits % 8)) - 1;
+
+    xfree(buf);
 
     if ( copy_bytes &&
-         copy_to_guest(xenctl_bitmap->bitmap, bytemap, copy_bytes) )
+         copy_to_guest_offset(xenctl_bitmap->bitmap, copy_bytes - 1, &last, 1) )
         err = -EFAULT;
 
-    xfree(bytemap);
-
     for ( i = copy_bytes; !err && i < guest_bytes; i++ )
         if ( copy_to_guest_offset(xenctl_bitmap->bitmap, i, &zero, 1) )
             err = -EFAULT;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 10:33:04 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 10:33:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935632.1336996 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzvP4-0006zV-8F; Wed, 02 Apr 2025 10:33:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935632.1336996; Wed, 02 Apr 2025 10: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 1tzvP4-0006zO-5n; Wed, 02 Apr 2025 10:33:02 +0000
Received: by outflank-mailman (input) for mailman id 935632;
 Wed, 02 Apr 2025 10: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 1tzvP3-0006zI-Pb
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 10: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 1tzvP3-007SUX-2S
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 10:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzvP3-003gz7-2L
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 10: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=oE7aR369DC6GyvpRQQ7xqc/L3YMBMU+eMRpZR4RGaa8=; b=Y16ePni6TfQMZHvyqzrlSa9Qai
	DytbHm8y5kOp+TRNhL7qUdRcXH0p9ElBGG/TFj0VhKyV64PFKUOogLf4SbchqhrpqVS1/7kr9rTRg
	dFz0HnBYHdgQTVQD0y7clojYFR3TjqpOseTO88aYixlRSGK+0TN5y9gKvaQiMfeM+LkM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: Include xen/vmap.h in mm.c
Message-Id: <E1tzvP3-003gz7-2L@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 10:33:01 +0000

commit a613df24a6f1712ea4581fe48ad1eb5386b3b2ae
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Apr 2 12:10:13 2025 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 2 12:25:10 2025 +0200

    xen/arm: Include xen/vmap.h in mm.c
    
    As reported by ECLAIR scan, MISRA requires declaration to be visible
    (R8.4). This is not the case for ioremap().
    
    Fixes: 2cd02c27d327 ("arm/mpu: Implement stubs for ioremap_attr on MPU")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/arm/mm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 5a52f0c623..0613c19169 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -12,6 +12,7 @@
 #include <xen/grant_table.h>
 #include <xen/guest_access.h>
 #include <xen/mm.h>
+#include <xen/vmap.h>
 
 #include <xsm/xsm.h>
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 11:44:11 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 11:44:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935664.1337021 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzwVo-0008P5-Hk; Wed, 02 Apr 2025 11:44:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935664.1337021; Wed, 02 Apr 2025 11: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 1tzwVo-0008Ov-Eu; Wed, 02 Apr 2025 11:44:04 +0000
Received: by outflank-mailman (input) for mailman id 935664;
 Wed, 02 Apr 2025 11:44: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 1tzwVn-0008Op-6w
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 11:44: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 1tzwVm-007U7h-0s
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 11:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzwVm-003q9i-0j
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 11: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=kBiaSkOEqh9yQr9RR/qKbzzhnXLRYa8zIhPZbr0akWk=; b=JX7TZ+xVLkVKypbUQRsnelRkyv
	mbUebHGD2g/W5mdLwgqT2oXLi4+eGiStE/fRhJfGBaGvsrPKkjs+khvTBBBUFgKG72qrW1bZdRP5L
	rgh6wKsHyRUWpkROK/PXC2IfUTUXtNThLmu49xixHebMyqvWSqMXMXtETcuV0yMxDb1A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: mpu: Use new-style annotations
Message-Id: <E1tzwVm-003q9i-0j@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 11:44:02 +0000

commit 0a90dee970c9b1acee710e7ea007f54104913d5a
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Apr 2 11:02:29 2025 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 2 11:14:55 2025 +0200

    xen/arm: mpu: Use new-style annotations
    
    When purging old-style annotations, MPU code was left unmodified. Fix
    it.
    
    Fixes: 221c66f4f2a4 ("Arm: purge ENTRY(), ENDPROC(), and ALIGN")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/arm/arm64/mpu/head.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/arm64/mpu/head.S b/xen/arch/arm/arm64/mpu/head.S
index 4d00de4869..ed01993d85 100644
--- a/xen/arch/arm/arm64/mpu/head.S
+++ b/xen/arch/arm/arm64/mpu/head.S
@@ -158,11 +158,11 @@ END(enable_boot_cpu_mm)
  * We don't yet support secondary CPUs bring-up. Implement a dummy helper to
  * please the common code.
  */
-ENTRY(enable_secondary_cpu_mm)
+FUNC(enable_secondary_cpu_mm)
     PRINT("- SMP not enabled yet -\r\n")
 1:  wfe
     b 1b
-ENDPROC(enable_secondary_cpu_mm)
+END(enable_secondary_cpu_mm)
 
 /*
  * Local variables:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 11:44:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 11:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935665.1337024 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzwVx-0008QV-Ia; Wed, 02 Apr 2025 11:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935665.1337024; Wed, 02 Apr 2025 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 1tzwVx-0008QO-GD; Wed, 02 Apr 2025 11:44:13 +0000
Received: by outflank-mailman (input) for mailman id 935665;
 Wed, 02 Apr 2025 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 1tzwVw-0008QI-Cn
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 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 1tzwVw-007U7p-1B
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 11:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzwVw-003qB6-13
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 11:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=62q4ChaQ0EIQnmpdKBRIfvfNAlYUzXQ7aZIIon+Xqlk=; b=rbNE7xNQijnRcShaF8lgoUgjAL
	ReETuMvJNA5SUqOSpJy5jxupBsxhyYVjOjTt1eZWtJtLbLP7Lu53YGnJZjObXIrE7mcWYN+UB7gGQ
	eKIq3x6tly+nwFF7clfsALmVOgh7dbJS+q4tZwFvk8w45Y9lGExBDG4/IvKs6TOaE5lw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/mpu: Add HYPERVISOR_VIRT_START and avoid a check in xen.lds.S
Message-Id: <E1tzwVw-003qB6-13@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 11:44:12 +0000

commit db72a5b2d2eaebc1e050def3fb9b73f43d10cdb0
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Tue Apr 1 09:58:52 2025 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 2 11:15:10 2025 +0200

    arm/mpu: Add HYPERVISOR_VIRT_START and avoid a check in xen.lds.S
    
    The define HYPERVISOR_VIRT_START is required by the common code,
    even if MPU system doesn't use virtual memory, define it in
    mpu/layout.h in order to reuse existing code.
    
    Disable a check in the linker script for arm for !MMU systems.
    
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/mpu/layout.h | 2 ++
 xen/arch/arm/xen.lds.S                | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/xen/arch/arm/include/asm/mpu/layout.h b/xen/arch/arm/include/asm/mpu/layout.h
index d6d397f4c2..248e55f888 100644
--- a/xen/arch/arm/include/asm/mpu/layout.h
+++ b/xen/arch/arm/include/asm/mpu/layout.h
@@ -22,6 +22,8 @@
  */
 #define XEN_VIRT_START         _AT(paddr_t, XEN_START_ADDRESS)
 
+#define HYPERVISOR_VIRT_START  XEN_VIRT_START
+
 #endif /* __ARM_MPU_LAYOUT_H__ */
 /*
  * Local variables:
diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index 325b8059fd..86a6e311cf 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -237,4 +237,6 @@ ASSERT(IS_ALIGNED(__bss_start,      POINTER_ALIGN), "__bss_start is misaligned")
 ASSERT(IS_ALIGNED(__bss_end,        POINTER_ALIGN), "__bss_end is misaligned")
 /* To simplify the logic in head.S, we want to _end to be page aligned */
 ASSERT(IS_ALIGNED(_end,             PAGE_SIZE), "_end is not page aligned")
+#ifdef CONFIG_MMU
 ASSERT((_end - _start) <= XEN_VIRT_SIZE, "Xen is too big")
+#endif
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 11:44:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 11:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935666.1337029 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzwW7-0008T8-KP; Wed, 02 Apr 2025 11:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935666.1337029; Wed, 02 Apr 2025 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 1tzwW7-0008T0-He; Wed, 02 Apr 2025 11:44:23 +0000
Received: by outflank-mailman (input) for mailman id 935666;
 Wed, 02 Apr 2025 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 1tzwW6-0008Sk-Ha
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 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 1tzwW6-007U8C-1f
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 11:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzwW6-003qCf-1M
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 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=+QotJoFUljC3H1gqnNSSPa6gaNvVDFZ70Fb3JvYyTUs=; b=EVqKRSsv7N4MlbQD98FYeNSZ7x
	3+C7S4At1KdEvgxwL5enUeTu7yo4VWMOK6K0DuA6/rUQotKpelbqklUTAoxscQT32QoW2vEt1JXD/
	B33+221YT3EvALAcRNibvCWEtFGHGy2/kxcuDqcb2PcEI9nbVhGE3/VbOPy0Vcr5GnEs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Implement virt/maddr conversion in MPU system
Message-Id: <E1tzwW6-003qCf-1M@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 11:44:22 +0000

commit 8523954fc54ed97a8e98f748a7c9c0c976e1f6dd
Author:     Penny Zheng <Penny.Zheng@arm.com>
AuthorDate: Tue Apr 1 09:58:53 2025 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 2 11:15:10 2025 +0200

    xen/arm: Implement virt/maddr conversion in MPU system
    
    virt_to_maddr and maddr_to_virt are used widely in Xen code. So
    even there is no VMSA in MPU system, we keep the interface in MPU to
    to avoid changing the existing common code.
    
    In order to do that, move the virt_to_maddr() and maddr_to_virt()
    definitions to mmu/mm.h, move the include of memory management
    subsystems (MMU/MPU) on a different place because the mentioned
    helpers needs visibility of some macro in asm/mm.h.
    
    Finally implement virt_to_maddr() and maddr_to_virt() for MPU systems
    under mpu/mm.h, the MPU version of virt/maddr conversion is simple since
    VA==PA.
    
    Signed-off-by: Penny Zheng <penny.zheng@arm.com>
    Signed-off-by: Wei Chen <wei.chen@arm.com>
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/mm.h     | 64 ++++++---------------------------------
 xen/arch/arm/include/asm/mmu/mm.h | 56 ++++++++++++++++++++++++++++++++++
 xen/arch/arm/include/asm/mpu/mm.h | 27 +++++++++++++++++
 3 files changed, 92 insertions(+), 55 deletions(-)

diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index a0d8e5afe9..444fd03823 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -14,12 +14,6 @@
 # error "unknown ARM variant"
 #endif
 
-#if defined(CONFIG_MMU)
-# include <asm/mmu/mm.h>
-#elif !defined(CONFIG_MPU)
-# error "Unknown memory management layout"
-#endif
-
 /* Align Xen to a 2 MiB boundary. */
 #define XEN_PADDR_ALIGN (1 << 21)
 
@@ -261,55 +255,6 @@ static inline void __iomem *ioremap_wc(paddr_t start, size_t len)
 /* Page-align address and convert to frame number format */
 #define paddr_to_pfn_aligned(paddr)    paddr_to_pfn(PAGE_ALIGN(paddr))
 
-#define virt_to_maddr(va) ({                                        \
-    vaddr_t va_ = (vaddr_t)(va);                                    \
-    (paddr_t)((va_to_par(va_) & PADDR_MASK & PAGE_MASK) | (va_ & ~PAGE_MASK)); \
-})
-
-#ifdef CONFIG_ARM_32
-/**
- * Find the virtual address corresponding to a machine address
- *
- * Only memory backing the XENHEAP has a corresponding virtual address to
- * be found. This is so we can save precious virtual space, as it's in
- * short supply on arm32. This mapping is not subject to PDX compression
- * because XENHEAP is known to be physically contiguous and can't hence
- * jump over the PDX hole. This means we can avoid the roundtrips
- * converting to/from pdx.
- *
- * @param ma Machine address
- * @return Virtual address mapped to `ma`
- */
-static inline void *maddr_to_virt(paddr_t ma)
-{
-    ASSERT(is_xen_heap_mfn(maddr_to_mfn(ma)));
-    ma -= mfn_to_maddr(directmap_mfn_start);
-    return (void *)(unsigned long) ma + XENHEAP_VIRT_START;
-}
-#else
-/**
- * Find the virtual address corresponding to a machine address
- *
- * The directmap covers all conventional memory accesible by the
- * hypervisor. This means it's subject to PDX compression.
- *
- * Note there's an extra offset applied (directmap_base_pdx) on top of the
- * regular PDX compression logic. Its purpose is to skip over the initial
- * range of non-existing memory, should there be one.
- *
- * @param ma Machine address
- * @return Virtual address mapped to `ma`
- */
-static inline void *maddr_to_virt(paddr_t ma)
-{
-    ASSERT((mfn_to_pdx(maddr_to_mfn(ma)) - directmap_base_pdx) <
-           (DIRECTMAP_SIZE >> PAGE_SHIFT));
-    return (void *)(XENHEAP_VIRT_START -
-                    (directmap_base_pdx << PAGE_SHIFT) +
-                    maddr_to_directmapoff(ma));
-}
-#endif
-
 /*
  * Translate a guest virtual address to a machine address.
  * Return the fault information if the translation has failed else 0.
@@ -340,6 +285,15 @@ static inline uint64_t gvirt_to_maddr(vaddr_t va, paddr_t *pa,
 #define virt_to_mfn(va)     __virt_to_mfn(va)
 #define mfn_to_virt(mfn)    __mfn_to_virt(mfn)
 
+/* Memory management subsystem header placed here to see the above macros */
+#if defined(CONFIG_MMU)
+# include <asm/mmu/mm.h>
+#elif defined(CONFIG_MPU)
+# include <asm/mpu/mm.h>
+#else
+#error "Unknown memory management layout"
+#endif
+
 /* Convert between Xen-heap virtual addresses and page-info structures. */
 static inline struct page_info *virt_to_page(const void *v)
 {
diff --git a/xen/arch/arm/include/asm/mmu/mm.h b/xen/arch/arm/include/asm/mmu/mm.h
index f5a00558c4..6737c3ede7 100644
--- a/xen/arch/arm/include/asm/mmu/mm.h
+++ b/xen/arch/arm/include/asm/mmu/mm.h
@@ -2,6 +2,13 @@
 #ifndef __ARM_MMU_MM_H__
 #define __ARM_MMU_MM_H__
 
+#include <xen/bug.h>
+#include <xen/pdx.h>
+#include <xen/types.h>
+#include <asm/mm.h>
+#include <asm/mmu/layout.h>
+#include <asm/page.h>
+
 /* Non-boot CPUs use this to find the correct pagetables. */
 extern uint64_t init_ttbr;
 
@@ -14,6 +21,55 @@ extern unsigned long directmap_base_pdx;
 
 #define frame_table ((struct page_info *)FRAMETABLE_VIRT_START)
 
+#define virt_to_maddr(va) ({                                                   \
+    vaddr_t va_ = (vaddr_t)(va);                                               \
+    (paddr_t)((va_to_par(va_) & PADDR_MASK & PAGE_MASK) | (va_ & ~PAGE_MASK)); \
+})
+
+#ifdef CONFIG_ARM_32
+/**
+ * Find the virtual address corresponding to a machine address
+ *
+ * Only memory backing the XENHEAP has a corresponding virtual address to
+ * be found. This is so we can save precious virtual space, as it's in
+ * short supply on arm32. This mapping is not subject to PDX compression
+ * because XENHEAP is known to be physically contiguous and can't hence
+ * jump over the PDX hole. This means we can avoid the roundtrips
+ * converting to/from pdx.
+ *
+ * @param ma Machine address
+ * @return Virtual address mapped to `ma`
+ */
+static inline void *maddr_to_virt(paddr_t ma)
+{
+    ASSERT(is_xen_heap_mfn(maddr_to_mfn(ma)));
+    ma -= mfn_to_maddr(directmap_mfn_start);
+    return (void *)(unsigned long) ma + XENHEAP_VIRT_START;
+}
+#else
+/**
+ * Find the virtual address corresponding to a machine address
+ *
+ * The directmap covers all conventional memory accesible by the
+ * hypervisor. This means it's subject to PDX compression.
+ *
+ * Note there's an extra offset applied (directmap_base_pdx) on top of the
+ * regular PDX compression logic. Its purpose is to skip over the initial
+ * range of non-existing memory, should there be one.
+ *
+ * @param ma Machine address
+ * @return Virtual address mapped to `ma`
+ */
+static inline void *maddr_to_virt(paddr_t ma)
+{
+    ASSERT((mfn_to_pdx(maddr_to_mfn(ma)) - directmap_base_pdx) <
+           (DIRECTMAP_SIZE >> PAGE_SHIFT));
+    return (void *)(XENHEAP_VIRT_START -
+                    (directmap_base_pdx << PAGE_SHIFT) +
+                    maddr_to_directmapoff(ma));
+}
+#endif
+
 /*
  * Print a walk of a page table or p2m
  *
diff --git a/xen/arch/arm/include/asm/mpu/mm.h b/xen/arch/arm/include/asm/mpu/mm.h
new file mode 100644
index 0000000000..6cfd0f5cd2
--- /dev/null
+++ b/xen/arch/arm/include/asm/mpu/mm.h
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef __ARM_MPU_MM_H__
+#define __ARM_MPU_MM_H__
+
+#include <xen/macros.h>
+#include <xen/page-size.h>
+#include <xen/types.h>
+
+#define virt_to_maddr(va) ((paddr_t)((vaddr_t)(va) & PADDR_MASK))
+
+/* On MPU systems there is no translation, ma == va. */
+static inline void *maddr_to_virt(paddr_t ma)
+{
+    return _p(ma);
+}
+
+#endif /* __ARM_MPU_MM_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 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 Apr 02 11:44:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 11:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935667.1337033 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzwWH-0008WE-Lj; Wed, 02 Apr 2025 11:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935667.1337033; Wed, 02 Apr 2025 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 1tzwWH-0008W6-J4; Wed, 02 Apr 2025 11:44:33 +0000
Received: by outflank-mailman (input) for mailman id 935667;
 Wed, 02 Apr 2025 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 1tzwWG-0008Vy-MG
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 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 1tzwWG-007U8G-28
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 11:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzwWG-003qDI-1q
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 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=gmbd6g6uaBEWgkiBjnHrgsvnhBrfciIQ9jCiFzb8XbQ=; b=TQVWz4KHPwxp8iRpjhMxzuN9XI
	9LWrKIBnVhdvXb4aHzYAaNrLEN8cRWH7HIlSwll3J2yx3P2Q+GpZS58ziJH+kWTIO4nRStbzr4bYW
	GAATAzt/OH5jUSsO3YtD9nTiJUR9fkuA5AEsPsZGVVF7rjZmiXbP94CRqG295MpgOed4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Introduce frame_table and virt_to_page
Message-Id: <E1tzwWG-003qDI-1q@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 11:44:32 +0000

commit 64e059c9d0454e531610463db44e9ab7908995fa
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Tue Apr 1 09:58:54 2025 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 2 11:15:10 2025 +0200

    xen/arm: Introduce frame_table and virt_to_page
    
    Introduce frame_table in order to provide the implementation of
    virt_to_page for MPU system, move the MMU variant in mmu/mm.h.
    
    Introduce FRAMETABLE_NR that is required for 'pdx_group_valid' in
    pdx.c, but leave the initialisation of the frame table to a later
    stage.
    Define FRAMETABLE_SIZE for MPU to support up to 1TB of ram at this
    stage, as the only current implementation of armv8-r aarch64, which
    is cortex R82, can support 1TB or 256TB (r82 TRM r3p1
    ID_AA64MMFR0_EL1.PARange).
    
    Take the occasion to sort alphabetically the headers following
    the Xen code style and add the emacs footer in mpu/mm.c.
    
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/mm.h         | 14 --------------
 xen/arch/arm/include/asm/mmu/mm.h     | 14 ++++++++++++++
 xen/arch/arm/include/asm/mpu/layout.h |  3 +++
 xen/arch/arm/include/asm/mpu/mm.h     | 14 ++++++++++++++
 xen/arch/arm/mpu/mm.c                 | 14 +++++++++++++-
 5 files changed, 44 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index 444fd03823..fbffaccef4 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -294,20 +294,6 @@ static inline uint64_t gvirt_to_maddr(vaddr_t va, paddr_t *pa,
 #error "Unknown memory management layout"
 #endif
 
-/* Convert between Xen-heap virtual addresses and page-info structures. */
-static inline struct page_info *virt_to_page(const void *v)
-{
-    unsigned long va = (unsigned long)v;
-    unsigned long pdx;
-
-    ASSERT(va >= XENHEAP_VIRT_START);
-    ASSERT(va < directmap_virt_end);
-
-    pdx = (va - XENHEAP_VIRT_START) >> PAGE_SHIFT;
-    pdx += mfn_to_pdx(directmap_mfn_start);
-    return frame_table + pdx - frametable_base_pdx;
-}
-
 static inline void *page_to_virt(const struct page_info *pg)
 {
     return mfn_to_virt(mfn_x(page_to_mfn(pg)));
diff --git a/xen/arch/arm/include/asm/mmu/mm.h b/xen/arch/arm/include/asm/mmu/mm.h
index 6737c3ede7..caba987edc 100644
--- a/xen/arch/arm/include/asm/mmu/mm.h
+++ b/xen/arch/arm/include/asm/mmu/mm.h
@@ -70,6 +70,20 @@ static inline void *maddr_to_virt(paddr_t ma)
 }
 #endif
 
+/* Convert between Xen-heap virtual addresses and page-info structures. */
+static inline struct page_info *virt_to_page(const void *v)
+{
+    unsigned long va = (unsigned long)v;
+    unsigned long pdx;
+
+    ASSERT(va >= XENHEAP_VIRT_START);
+    ASSERT(va < directmap_virt_end);
+
+    pdx = (va - XENHEAP_VIRT_START) >> PAGE_SHIFT;
+    pdx += mfn_to_pdx(directmap_mfn_start);
+    return frame_table + pdx - frametable_base_pdx;
+}
+
 /*
  * Print a walk of a page table or p2m
  *
diff --git a/xen/arch/arm/include/asm/mpu/layout.h b/xen/arch/arm/include/asm/mpu/layout.h
index 248e55f888..c331d1feaa 100644
--- a/xen/arch/arm/include/asm/mpu/layout.h
+++ b/xen/arch/arm/include/asm/mpu/layout.h
@@ -3,6 +3,9 @@
 #ifndef __ARM_MPU_LAYOUT_H__
 #define __ARM_MPU_LAYOUT_H__
 
+#define FRAMETABLE_SIZE   GB(16)
+#define FRAMETABLE_NR     (FRAMETABLE_SIZE / sizeof(*frame_table))
+
 #define XEN_START_ADDRESS CONFIG_XEN_START_ADDRESS
 
 /*
diff --git a/xen/arch/arm/include/asm/mpu/mm.h b/xen/arch/arm/include/asm/mpu/mm.h
index 6cfd0f5cd2..86f33d9836 100644
--- a/xen/arch/arm/include/asm/mpu/mm.h
+++ b/xen/arch/arm/include/asm/mpu/mm.h
@@ -3,9 +3,13 @@
 #ifndef __ARM_MPU_MM_H__
 #define __ARM_MPU_MM_H__
 
+#include <xen/bug.h>
 #include <xen/macros.h>
 #include <xen/page-size.h>
 #include <xen/types.h>
+#include <asm/mm.h>
+
+extern struct page_info *frame_table;
 
 #define virt_to_maddr(va) ((paddr_t)((vaddr_t)(va) & PADDR_MASK))
 
@@ -15,6 +19,16 @@ static inline void *maddr_to_virt(paddr_t ma)
     return _p(ma);
 }
 
+/* Convert between virtual address to page-info structure. */
+static inline struct page_info *virt_to_page(const void *v)
+{
+    mfn_t mfn = _mfn(virt_to_mfn(v));
+
+    ASSERT(mfn_valid(mfn));
+
+    return mfn_to_page(mfn);
+}
+
 #endif /* __ARM_MPU_MM_H__ */
 
 /*
diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
index 0b8748e575..3632011c10 100644
--- a/xen/arch/arm/mpu/mm.c
+++ b/xen/arch/arm/mpu/mm.c
@@ -1,9 +1,12 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#include <xen/lib.h>
 #include <xen/init.h>
+#include <xen/lib.h>
+#include <xen/mm.h>
 #include <xen/sizes.h>
 
+struct page_info *frame_table;
+
 static void __init __maybe_unused build_assertions(void)
 {
     /*
@@ -13,3 +16,12 @@ static void __init __maybe_unused build_assertions(void)
      */
     BUILD_BUG_ON(PAGE_SIZE != SZ_4K);
 }
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 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 Apr 02 11:44:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 11:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935668.1337038 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzwWS-00007v-Oj; Wed, 02 Apr 2025 11:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935668.1337038; Wed, 02 Apr 2025 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 1tzwWS-00007n-Lm; Wed, 02 Apr 2025 11:44:44 +0000
Received: by outflank-mailman (input) for mailman id 935668;
 Wed, 02 Apr 2025 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 1tzwWQ-00007T-PY
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 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 1tzwWQ-007U8N-2P
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 11:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzwWQ-003qE6-2J
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 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=c64Qec8PVENQ2zBLEiSOl1U0G6gESnt8fE3E7FStUlo=; b=DZajCeolJ+pTnPNjIyjKwbQ5dY
	ekPohEDYs8bJLAmrM6UeJmSpDGK4wsKXZUqm+1Ci+tKUmiePgdtGxAtsQIoEorrOkpT8jkcM1vFUq
	v2xiC+O4fLidYUemV0iICoRAb+vc592yIC278oPFCmzbs1Tv+iCJo5vy1wfimfCQZfHU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/mpu: Kconfig symbols for MPU build
Message-Id: <E1tzwWQ-003qE6-2J@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 11:44:42 +0000

commit 2244da28fc08ea6678e7f337b09c72a2c411ef05
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Tue Apr 1 09:58:55 2025 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 2 11:15:10 2025 +0200

    arm/mpu: Kconfig symbols for MPU build
    
    The MPU system requires static memory to work, select that
    when building this memory management subsystem.
    
    While there, provide a restriction for the ARM_EFI Kconfig
    parameter to be built only when !MPU, the EFI stub is not
    used as there are no implementation of UEFI services for
    armv8-r.
    
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 466b7db63c..7a7658812d 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -85,6 +85,7 @@ config MMU
 
 config MPU
 	bool "MPU" if UNSUPPORTED
+	select STATIC_MEMORY
 	help
 	  Memory Protection Unit (MPU). Select if you plan to run Xen on ARMv8-R
 	  systems supporting EL2. (UNSUPPORTED)
@@ -102,7 +103,7 @@ config ACPI
 
 config ARM_EFI
 	bool "UEFI boot service support"
-	depends on ARM_64
+	depends on ARM_64 && !MPU
 	default y
 	help
 	  This option provides support for boot services through
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 11:44:54 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 11:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935669.1337041 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzwWc-0000AX-Q7; Wed, 02 Apr 2025 11:44:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935669.1337041; Wed, 02 Apr 2025 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 1tzwWc-0000AO-N6; Wed, 02 Apr 2025 11:44:54 +0000
Received: by outflank-mailman (input) for mailman id 935669;
 Wed, 02 Apr 2025 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 1tzwWa-0000AF-Rz
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 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 1tzwWa-007U8R-2h
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 11:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzwWa-003qFw-2b
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 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=3+5AFVw/ki6m35ZVFr4HBEDCZ0gkMfzubQKzoZkfvJw=; b=GtLDMAUgLSc1aObiXeg7C64ua5
	PiLR4oSIXvtnNLYdf9Czwhts8xuKOc2UYFVJVMmbaRe/990hEkGd19lRfbqUomvQiGoXy69Idm/wB
	R1rMrSiApCUdtA2wqOwe8XE3Klns5tLfYEea3r5kuu4RON/3aRnQvCjYFVnzYpCS/ASA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/mpu: Implement stubs for ioremap_attr on MPU
Message-Id: <E1tzwWa-003qFw-2b@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 11:44:52 +0000

commit 2cd02c27d3277b0fe664040e10445818a48b6492
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Tue Apr 1 09:58:56 2025 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 2 11:15:10 2025 +0200

    arm/mpu: Implement stubs for ioremap_attr on MPU
    
    Implement ioremap_attr() stub for MPU system; the
    implementation of ioremap() is the same between MMU
    and MPU system, and it relies on ioremap_attr(), so
    move the definition from mmu/pt.c to arm/mm.c.
    
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/mm.c     | 5 +++++
 xen/arch/arm/mmu/pt.c | 5 -----
 xen/arch/arm/mpu/mm.c | 6 ++++++
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index a56e20ba2b..5a52f0c623 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -395,6 +395,11 @@ unsigned long get_upper_mfn_bound(void)
     return max_page - 1;
 }
 
+void *ioremap(paddr_t pa, size_t len)
+{
+    return ioremap_attr(pa, len, PAGE_HYPERVISOR_NOCACHE);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/arm/mmu/pt.c b/xen/arch/arm/mmu/pt.c
index da28d669e7..11cb1c66da 100644
--- a/xen/arch/arm/mmu/pt.c
+++ b/xen/arch/arm/mmu/pt.c
@@ -223,11 +223,6 @@ void *ioremap_attr(paddr_t start, size_t len, unsigned int attributes)
     return ptr + offs;
 }
 
-void *ioremap(paddr_t pa, size_t len)
-{
-    return ioremap_attr(pa, len, PAGE_HYPERVISOR_NOCACHE);
-}
-
 static int create_xen_table(lpae_t *entry)
 {
     mfn_t mfn;
diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
index 3632011c10..4e9a2405d8 100644
--- a/xen/arch/arm/mpu/mm.c
+++ b/xen/arch/arm/mpu/mm.c
@@ -17,6 +17,12 @@ static void __init __maybe_unused build_assertions(void)
     BUILD_BUG_ON(PAGE_SIZE != SZ_4K);
 }
 
+void __iomem *ioremap_attr(paddr_t start, size_t len, unsigned int flags)
+{
+    BUG_ON("unimplemented");
+    return NULL;
+}
+
 /*
  * Local variables:
  * mode: C
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 11:45:04 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 11:45:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935670.1337045 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzwWm-0000D7-RC; Wed, 02 Apr 2025 11:45:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935670.1337045; Wed, 02 Apr 2025 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 1tzwWm-0000Cz-OY; Wed, 02 Apr 2025 11:45:04 +0000
Received: by outflank-mailman (input) for mailman id 935670;
 Wed, 02 Apr 2025 11: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 1tzwWk-0000Cm-VT
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 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 1tzwWk-007U8x-30
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 11:45:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzwWk-003qGn-2t
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 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=O/cgE0XKSTFrr4P3gsfGYPwzgMHtPueWOjHqJ4l5gG0=; b=JD6ueQxsc6JnnMaewajTYTHGQc
	HG/xMD25o1fQzGCZWOi9RH4N7tSJp/FLFUCKn+B2/1FQV9OGXy38F2S66dnkwUvH0gxM4foESe5wd
	k8Q9RH4rWwT3lX1NqwZ5LVGZygF8o1fLyBeaNCT99hm+xLXuPVXH540TPOx6KJ6IJ/B4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: introduce Kconfig ARCH_PAGING_MEMPOOL
Message-Id: <E1tzwWk-003qGn-2t@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 11:45:02 +0000

commit 2705f1adb9df93ee632a52651cf2b6bb86d9ca35
Author:     Penny Zheng <Penny.Zheng@arm.com>
AuthorDate: Tue Apr 1 09:58:57 2025 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 2 11:15:10 2025 +0200

    xen: introduce Kconfig ARCH_PAGING_MEMPOOL
    
    ARM MPU system doesn't need to use paging memory pool, as MPU memory
    mapping table at most takes only one 4KB page, which is enough to
    manage the maximum 255 MPU memory regions, for all EL2 stage 1
    translation and EL1 stage 2 translation.
    
    Introduce ARCH_PAGING_MEMPOOL Kconfig common symbol, selected for Arm
    MMU systems and x86. Removed stubs from RISC-V now that the common code
    provide them and the functions are not gonna be used.
    
    Wrap the code inside 'construct_domU' that deal with p2m paging
    allocation in a new function 'domain_p2m_set_allocation', protected
    by ARCH_PAGING_MEMPOOL, this is done in this way to prevent polluting
    the former function with #ifdefs and improve readability
    
    Introduce arch_{get,set}_paging_mempool_size stubs for architecture
    with !ARCH_PAGING_MEMPOOL.
    
    Remove 'struct paging_domain' from Arm 'struct arch_domain' when the
    field is not required.
    
    Signed-off-by: Penny Zheng <penny.zheng@arm.com>
    Signed-off-by: Wei Chen <wei.chen@arm.com>
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com> # arm
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> # riscv
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/arm/Kconfig              |  1 +
 xen/arch/arm/dom0less-build.c     | 70 ++++++++++++++++++++++++---------------
 xen/arch/arm/include/asm/domain.h |  2 ++
 xen/arch/riscv/stubs.c            | 11 ------
 xen/arch/x86/Kconfig              |  1 +
 xen/common/Kconfig                |  3 ++
 xen/include/xen/domain.h          | 17 ++++++++++
 7 files changed, 68 insertions(+), 37 deletions(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 7a7658812d..565f288331 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -75,6 +75,7 @@ choice
 
 config MMU
 	bool "MMU"
+	select ARCH_PAGING_MEMPOOL
 	select HAS_LLC_COLORING if !NUMA && ARM_64
 	select HAS_PMAP
 	select HAS_VMAP
diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index 573b0d25ae..bd15563750 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -673,21 +673,6 @@ static int __init prepare_dtb_domU(struct domain *d, struct kernel_info *kinfo)
     return -EINVAL;
 }
 
-static unsigned long __init domain_p2m_pages(unsigned long maxmem_kb,
-                                             unsigned int smp_cpus)
-{
-    /*
-     * Keep in sync with libxl__get_required_paging_memory().
-     * 256 pages (1MB) per vcpu, plus 1 page per MiB of RAM for the P2M map,
-     * plus 128 pages to cover extended regions.
-     */
-    unsigned long memkb = 4 * (256 * smp_cpus + (maxmem_kb / 1024) + 128);
-
-    BUILD_BUG_ON(PAGE_SIZE != SZ_4K);
-
-    return DIV_ROUND_UP(memkb, 1024) << (20 - PAGE_SHIFT);
-}
-
 static int __init alloc_xenstore_evtchn(struct domain *d)
 {
     evtchn_alloc_unbound_t alloc;
@@ -841,6 +826,49 @@ static void __init domain_vcpu_affinity(struct domain *d,
     }
 }
 
+#ifdef CONFIG_ARCH_PAGING_MEMPOOL
+static unsigned long __init domain_p2m_pages(unsigned long maxmem_kb,
+                                             unsigned int smp_cpus)
+{
+    /*
+     * Keep in sync with libxl__get_required_paging_memory().
+     * 256 pages (1MB) per vcpu, plus 1 page per MiB of RAM for the P2M map,
+     * plus 128 pages to cover extended regions.
+     */
+    unsigned long memkb = 4 * (256 * smp_cpus + (maxmem_kb / 1024) + 128);
+
+    BUILD_BUG_ON(PAGE_SIZE != SZ_4K);
+
+    return DIV_ROUND_UP(memkb, 1024) << (20 - PAGE_SHIFT);
+}
+
+static int __init domain_p2m_set_allocation(struct domain *d, uint64_t mem,
+                                            const struct dt_device_node *node)
+{
+    unsigned long p2m_pages;
+    uint32_t p2m_mem_mb;
+    int rc;
+
+    rc = dt_property_read_u32(node, "xen,domain-p2m-mem-mb", &p2m_mem_mb);
+    /* If xen,domain-p2m-mem-mb is not specified, use the default value. */
+    p2m_pages = rc ?
+                p2m_mem_mb << (20 - PAGE_SHIFT) :
+                domain_p2m_pages(mem, d->max_vcpus);
+
+    spin_lock(&d->arch.paging.lock);
+    rc = p2m_set_allocation(d, p2m_pages, NULL);
+    spin_unlock(&d->arch.paging.lock);
+
+    return rc;
+}
+#else /* !CONFIG_ARCH_PAGING_MEMPOOL */
+static inline int domain_p2m_set_allocation(struct domain *d, uint64_t mem,
+                                            const struct dt_device_node *node)
+{
+    return 0;
+}
+#endif /* CONFIG_ARCH_PAGING_MEMPOOL */
+
 static int __init construct_domU(struct domain *d,
                                  const struct dt_device_node *node)
 {
@@ -848,8 +876,6 @@ static int __init construct_domU(struct domain *d,
     const char *dom0less_enhanced;
     int rc;
     u64 mem;
-    u32 p2m_mem_mb;
-    unsigned long p2m_pages;
 
     rc = dt_property_read_u64(node, "memory", &mem);
     if ( !rc )
@@ -859,15 +885,7 @@ static int __init construct_domU(struct domain *d,
     }
     kinfo.unassigned_mem = (paddr_t)mem * SZ_1K;
 
-    rc = dt_property_read_u32(node, "xen,domain-p2m-mem-mb", &p2m_mem_mb);
-    /* If xen,domain-p2m-mem-mb is not specified, use the default value. */
-    p2m_pages = rc ?
-                p2m_mem_mb << (20 - PAGE_SHIFT) :
-                domain_p2m_pages(mem, d->max_vcpus);
-
-    spin_lock(&d->arch.paging.lock);
-    rc = p2m_set_allocation(d, p2m_pages, NULL);
-    spin_unlock(&d->arch.paging.lock);
+    rc = domain_p2m_set_allocation(d, mem, node);
     if ( rc != 0 )
         return rc;
 
diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h
index 50b6a4b009..a3487ca713 100644
--- a/xen/arch/arm/include/asm/domain.h
+++ b/xen/arch/arm/include/asm/domain.h
@@ -75,7 +75,9 @@ struct arch_domain
 
     struct hvm_domain hvm;
 
+#ifdef CONFIG_ARCH_PAGING_MEMPOOL
     struct paging_domain paging;
+#endif
 
     struct vmmio vmmio;
 
diff --git a/xen/arch/riscv/stubs.c b/xen/arch/riscv/stubs.c
index caa133de84..a1d64534cd 100644
--- a/xen/arch/riscv/stubs.c
+++ b/xen/arch/riscv/stubs.c
@@ -333,11 +333,6 @@ void arch_do_physinfo(struct xen_sysctl_physinfo *pi)
 
 /* p2m.c */
 
-int arch_set_paging_mempool_size(struct domain *d, uint64_t size)
-{
-    BUG_ON("unimplemented");
-}
-
 int unmap_mmio_regions(struct domain *d,
                        gfn_t start_gfn,
                        unsigned long nr,
@@ -360,12 +355,6 @@ int set_foreign_p2m_entry(struct domain *d, const struct domain *fd,
     BUG_ON("unimplemented");
 }
 
-/* Return the size of the pool, in bytes. */
-int arch_get_paging_mempool_size(struct domain *d, uint64_t *size)
-{
-    BUG_ON("unimplemented");
-}
-
 int guest_physmap_remove_page(struct domain *d, gfn_t gfn, mfn_t mfn,
                               unsigned int page_order)
 {
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index 18efdb2e31..de2fa37f08 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -9,6 +9,7 @@ config X86
 	select ACPI_NUMA
 	select ALTERNATIVE_CALL
 	select ARCH_MAP_DOMAIN_PAGE
+	select ARCH_PAGING_MEMPOOL
 	select ARCH_SUPPORTS_INT128
 	imply CORE_PARKING
 	select FUNCTION_ALIGNMENT_16B
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index a6aa2c5c14..218357d593 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -44,6 +44,9 @@ config ALTERNATIVE_CALL
 config ARCH_MAP_DOMAIN_PAGE
 	bool
 
+config ARCH_PAGING_MEMPOOL
+	bool
+
 config GENERIC_BUG_FRAME
 	bool
 
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index 83069de501..a34daa7d10 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -2,6 +2,7 @@
 #ifndef __XEN_DOMAIN_H__
 #define __XEN_DOMAIN_H__
 
+#include <xen/errno.h>
 #include <xen/numa.h>
 #include <xen/types.h>
 
@@ -114,9 +115,25 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c);
 int arch_initialise_vcpu(struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg);
 int default_initialise_vcpu(struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg);
 
+#ifdef CONFIG_ARCH_PAGING_MEMPOOL
+
 int arch_get_paging_mempool_size(struct domain *d, uint64_t *size /* bytes */);
 int arch_set_paging_mempool_size(struct domain *d, uint64_t size /* bytes */);
 
+#else /* !CONFIG_ARCH_PAGING_MEMPOOL */
+
+static inline int arch_get_paging_mempool_size(struct domain *d, uint64_t *size)
+{
+    return -EOPNOTSUPP;
+}
+
+static inline int arch_set_paging_mempool_size(struct domain *d, uint64_t size)
+{
+    return -EOPNOTSUPP;
+}
+
+#endif /* CONFIG_ARCH_PAGING_MEMPOOL */
+
 bool update_runstate_area(struct vcpu *v);
 
 int domain_relinquish_resources(struct domain *d);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 11:45:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 11:45:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935671.1337048 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzwWw-0000Fu-Sk; Wed, 02 Apr 2025 11:45:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935671.1337048; Wed, 02 Apr 2025 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 1tzwWw-0000Fn-QA; Wed, 02 Apr 2025 11:45:14 +0000
Received: by outflank-mailman (input) for mailman id 935671;
 Wed, 02 Apr 2025 11: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 1tzwWv-0000FW-2c
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 11: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 1tzwWv-007U93-08
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 11:45:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzwWu-003qI4-3C
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 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=uyo2f8YBfm4IoVy6mb22GzFiGIc+Hm2UwC1jdpn5ils=; b=oixrwF9GskNBtCvAY8RotKYRTj
	ARRHYVWcXkhy6Cdw/H0DLA3k/TqXOXPLB1g/xuu3LB91IPx2VcII+9lIEYMSog7bXM7kOe9i89SCt
	F7dW2TNT91CdiLI5rDuuJc3zw4uyeTIFAGNItiDPJ9OmeBdvDZS9iEsTzOB6EzR1pJ/s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/mpu: Create the skeleton for MPU compilation
Message-Id: <E1tzwWu-003qI4-3C@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 11:45:12 +0000

commit 5d9610f9149a67e8fc3d9934e93e8b968832c43c
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Tue Apr 1 09:58:58 2025 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 2 11:15:10 2025 +0200

    arm/mpu: Create the skeleton for MPU compilation
    
    This commit introduces the skeleton for the MPU memory management
    subsystem that allows the compilation on Arm64.
    
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/arm64/mpu/Makefile    |  2 +
 xen/arch/arm/arm64/mpu/p2m.c       | 19 +++++++++
 xen/arch/arm/arm64/mpu/smpboot.c   | 26 ++++++++++++
 xen/arch/arm/include/asm/mpu/p2m.h | 21 ++++++++++
 xen/arch/arm/include/asm/p2m.h     |  2 +-
 xen/arch/arm/mpu/Makefile          |  3 ++
 xen/arch/arm/mpu/mm.c              | 25 ++++++++++++
 xen/arch/arm/mpu/p2m.c             | 84 ++++++++++++++++++++++++++++++++++++++
 xen/arch/arm/mpu/setup.c           | 40 ++++++++++++++++++
 xen/arch/arm/mpu/vmap.c            | 26 ++++++++++++
 10 files changed, 247 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/arm64/mpu/Makefile b/xen/arch/arm/arm64/mpu/Makefile
index 3340058c08..cf0540aecc 100644
--- a/xen/arch/arm/arm64/mpu/Makefile
+++ b/xen/arch/arm/arm64/mpu/Makefile
@@ -1 +1,3 @@
 obj-y += head.o
+obj-y += p2m.o
+obj-y += smpboot.o
diff --git a/xen/arch/arm/arm64/mpu/p2m.c b/xen/arch/arm/arm64/mpu/p2m.c
new file mode 100644
index 0000000000..b6d8b2777b
--- /dev/null
+++ b/xen/arch/arm/arm64/mpu/p2m.c
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/bug.h>
+#include <xen/init.h>
+#include <asm/p2m.h>
+
+void __init setup_virt_paging(void)
+{
+    BUG_ON("unimplemented");
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/arm64/mpu/smpboot.c b/xen/arch/arm/arm64/mpu/smpboot.c
new file mode 100644
index 0000000000..5090f443f5
--- /dev/null
+++ b/xen/arch/arm/arm64/mpu/smpboot.c
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/bug.h>
+#include <xen/errno.h>
+#include <xen/mm.h>
+#include <xen/stdbool.h>
+
+int prepare_secondary_mm(int cpu)
+{
+    BUG_ON("unimplemented");
+    return -EINVAL;
+}
+
+void update_boot_mapping(bool enable)
+{
+    BUG_ON("unimplemented");
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/include/asm/mpu/p2m.h b/xen/arch/arm/include/asm/mpu/p2m.h
new file mode 100644
index 0000000000..e46d9e757a
--- /dev/null
+++ b/xen/arch/arm/include/asm/mpu/p2m.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef __ARM_MPU_P2M_H__
+#define __ARM_MPU_P2M_H__
+
+struct p2m_domain;
+
+static inline void p2m_clear_root_pages(struct p2m_domain *p2m) {}
+
+static inline void p2m_tlb_flush_sync(struct p2m_domain *p2m) {}
+
+#endif /* __ARM_MPU_P2M_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/include/asm/p2m.h b/xen/arch/arm/include/asm/p2m.h
index 594dc40041..2d53bf9b61 100644
--- a/xen/arch/arm/include/asm/p2m.h
+++ b/xen/arch/arm/include/asm/p2m.h
@@ -168,7 +168,7 @@ typedef enum {
 #if defined(CONFIG_MMU)
 # include <asm/mmu/p2m.h>
 #else
-# error "Unknown memory management layout"
+# include <asm/mpu/p2m.h>
 #endif
 
 static inline bool arch_acquire_resource_check(struct domain *d)
diff --git a/xen/arch/arm/mpu/Makefile b/xen/arch/arm/mpu/Makefile
index b18cec4836..21bbc517b5 100644
--- a/xen/arch/arm/mpu/Makefile
+++ b/xen/arch/arm/mpu/Makefile
@@ -1 +1,4 @@
 obj-y += mm.o
+obj-y += p2m.o
+obj-y += setup.init.o
+obj-y += vmap.o
diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
index 4e9a2405d8..07c8959f4e 100644
--- a/xen/arch/arm/mpu/mm.c
+++ b/xen/arch/arm/mpu/mm.c
@@ -1,9 +1,12 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
+#include <xen/bug.h>
+#include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/mm.h>
 #include <xen/sizes.h>
+#include <xen/types.h>
 
 struct page_info *frame_table;
 
@@ -17,6 +20,28 @@ static void __init __maybe_unused build_assertions(void)
     BUILD_BUG_ON(PAGE_SIZE != SZ_4K);
 }
 
+void __init setup_mm(void)
+{
+    BUG_ON("unimplemented");
+}
+
+int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
+{
+    BUG_ON("unimplemented");
+    return -EINVAL;
+}
+
+void dump_hyp_walk(vaddr_t addr)
+{
+    BUG_ON("unimplemented");
+}
+
+/* Release all __init and __initdata ranges to be reused */
+void free_init_memory(void)
+{
+    BUG_ON("unimplemented");
+}
+
 void __iomem *ioremap_attr(paddr_t start, size_t len, unsigned int flags)
 {
     BUG_ON("unimplemented");
diff --git a/xen/arch/arm/mpu/p2m.c b/xen/arch/arm/mpu/p2m.c
new file mode 100644
index 0000000000..f7fb58ab6a
--- /dev/null
+++ b/xen/arch/arm/mpu/p2m.c
@@ -0,0 +1,84 @@
+
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/bug.h>
+#include <xen/domain.h>
+#include <xen/errno.h>
+#include <xen/mm-frame.h>
+#include <xen/sched.h>
+#include <xen/types.h>
+#include <asm/p2m.h>
+
+int p2m_set_entry(struct p2m_domain *p2m, gfn_t sgfn, unsigned long nr,
+                  mfn_t smfn, p2m_type_t t, p2m_access_t a)
+{
+    BUG_ON("unimplemented");
+    return -EINVAL;
+}
+
+mfn_t p2m_get_entry(struct p2m_domain *p2m, gfn_t gfn, p2m_type_t *t,
+                    p2m_access_t *a, unsigned int *page_order, bool *valid)
+{
+    BUG_ON("unimplemented");
+    return INVALID_MFN;
+}
+
+void p2m_dump_info(struct domain *d)
+{
+    BUG_ON("unimplemented");
+}
+
+int p2m_init(struct domain *d)
+{
+    BUG_ON("unimplemented");
+    return -EINVAL;
+}
+
+void p2m_save_state(struct vcpu *p)
+{
+    BUG_ON("unimplemented");
+}
+
+void p2m_restore_state(struct vcpu *n)
+{
+    BUG_ON("unimplemented");
+}
+
+void p2m_final_teardown(struct domain *d)
+{
+    BUG_ON("unimplemented");
+}
+
+bool p2m_resolve_translation_fault(struct domain *d, gfn_t gfn)
+{
+    BUG_ON("unimplemented");
+    return false;
+}
+
+void p2m_flush_vm(struct vcpu *v) {}
+
+int relinquish_p2m_mapping(struct domain *d)
+{
+    return 0;
+}
+
+void p2m_domain_creation_finished(struct domain *d) {}
+
+int p2m_teardown(struct domain *d)
+{
+    return 0;
+}
+
+int p2m_teardown_allocation(struct domain *d)
+{
+    return 0;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/mpu/setup.c b/xen/arch/arm/mpu/setup.c
new file mode 100644
index 0000000000..b4da77003f
--- /dev/null
+++ b/xen/arch/arm/mpu/setup.c
@@ -0,0 +1,40 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/bug.h>
+#include <xen/init.h>
+#include <xen/mm.h>
+#include <xen/types.h>
+#include <asm/setup.h>
+
+void __init setup_pagetables(void) {}
+
+void * __init early_fdt_map(paddr_t fdt_paddr)
+{
+    BUG_ON("unimplemented");
+    return NULL;
+}
+
+/*
+ * copy_from_paddr - copy data from a physical address
+ * @dst: destination virtual address
+ * @paddr: source physical address
+ * @len: length to copy
+ */
+void __init copy_from_paddr(void *dst, paddr_t paddr, unsigned long len)
+{
+    BUG_ON("unimplemented");
+}
+
+void __init remove_early_mappings(void)
+{
+    BUG_ON("unimplemented");
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/mpu/vmap.c b/xen/arch/arm/mpu/vmap.c
new file mode 100644
index 0000000000..f977b79cd4
--- /dev/null
+++ b/xen/arch/arm/mpu/vmap.c
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/bug.h>
+#include <xen/mm-frame.h>
+#include <xen/types.h>
+#include <xen/vmap.h>
+
+void *vmap_contig(mfn_t mfn, unsigned int nr)
+{
+    BUG_ON("unimplemented");
+    return NULL;
+}
+
+void vunmap(const void *va)
+{
+    BUG_ON("unimplemented");
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 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 Apr 02 11:45:25 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 11:45:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935672.1337053 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzwX6-0000Iq-Uc; Wed, 02 Apr 2025 11:45:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935672.1337053; Wed, 02 Apr 2025 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 1tzwX6-0000Ij-Rd; Wed, 02 Apr 2025 11:45:24 +0000
Received: by outflank-mailman (input) for mailman id 935672;
 Wed, 02 Apr 2025 11: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 1tzwX5-0000IX-4z
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 11: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 1tzwX5-007U9R-0O
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 11:45:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzwX5-003qKF-0I
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 11: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=dXk9W3dthMZICC8mp5vhysws0PZP3Mkcz9h5Ja+SQ7I=; b=qtKeHPiZN9Oljo5eQxbD1U4jJQ
	T9BCy71ILY0tehHxiomgOw9sAyWaD9V6bLmvr+LBPys8v0WwIlxI9zW9s0+Ji3whnfMIulJA0G02h
	93j0BjjERcBtWQ7fia8jwsdwZxGp/GTDElHLaQDNVMNYBnJ0SOP8Ep7koe2l/ESzZ0S8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: simplify bitmap_to_xenctl_bitmap for little endian
Message-Id: <E1tzwX5-003qKF-0I@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 11:45:23 +0000

commit 288c4641c80d63169d65687a7723a0003327c8e9
Author:     Stefano Stabellini <stefano.stabellini@amd.com>
AuthorDate: Wed Apr 2 12:14:40 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 2 12:14:40 2025 +0200

    xen: simplify bitmap_to_xenctl_bitmap for little endian
    
    The little endian implementation of bitmap_to_xenctl_bitmap leads to
    unnecessary xmallocs and xfrees. Given that Xen only supports little
    endian architectures, it is worth optimizing.
    
    This patch removes the need for the xmalloc on little endian
    architectures.
    
    Remove clamp_last_byte as it is only called once and only needs to
    modify one byte. Inline it.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/bitmap.c | 65 +++++++++++++++++++++++++++++------------------------
 1 file changed, 36 insertions(+), 29 deletions(-)

diff --git a/xen/common/bitmap.c b/xen/common/bitmap.c
index 3da63a32a6..6c4af09c18 100644
--- a/xen/common/bitmap.c
+++ b/xen/common/bitmap.c
@@ -40,21 +40,6 @@
  * for the best explanations of this ordering.
  */
 
-/*
- * If a bitmap has a number of bits which is not a multiple of 8 then
- * the last few bits of the last byte of the bitmap can be
- * unexpectedly set which can confuse consumers (e.g. in the tools)
- * who also round up their loops to 8 bits. Ensure we clear those left
- * over bits so as to prevent surprises.
- */
-static void clamp_last_byte(uint8_t *bp, unsigned int nbits)
-{
-	unsigned int remainder = nbits % 8;
-
-	if (remainder)
-		bp[nbits/8] &= (1U << remainder) - 1;
-}
-
 int __bitmap_empty(const unsigned long *bitmap, unsigned int bits)
 {
 	int k, lim = bits/BITS_PER_LONG;
@@ -338,7 +323,6 @@ static void bitmap_long_to_byte(uint8_t *bp, const unsigned long *lp,
 			nbits -= 8;
 		}
 	}
-	clamp_last_byte(bp, nbits);
 }
 
 static void bitmap_byte_to_long(unsigned long *lp, const uint8_t *bp,
@@ -359,12 +343,11 @@ static void bitmap_byte_to_long(unsigned long *lp, const uint8_t *bp,
 
 #elif defined(__LITTLE_ENDIAN)
 
-static void bitmap_long_to_byte(uint8_t *bp, const unsigned long *lp,
-				unsigned int nbits)
-{
-	memcpy(bp, lp, DIV_ROUND_UP(nbits, BITS_PER_BYTE));
-	clamp_last_byte(bp, nbits);
-}
+#define LITTLE_ENDIAN 1 /* For IS_ENABLED(). */
+
+/* Unused function, but a declaration is needed. */
+void bitmap_long_to_byte(uint8_t *bp, const unsigned long *lp,
+			 unsigned int nbits);
 
 static void bitmap_byte_to_long(unsigned long *lp, const uint8_t *bp,
 				unsigned int nbits)
@@ -384,22 +367,46 @@ int bitmap_to_xenctl_bitmap(struct xenctl_bitmap *xenctl_bitmap,
     uint8_t zero = 0;
     int err = 0;
     unsigned int xen_bytes = DIV_ROUND_UP(nbits, BITS_PER_BYTE);
-    uint8_t *bytemap = xmalloc_array(uint8_t, xen_bytes);
+    const uint8_t *bytemap;
+    uint8_t last, *buf = NULL;
 
-    if ( !bytemap )
-        return -ENOMEM;
+    if ( !IS_ENABLED(LITTLE_ENDIAN) )
+    {
+        buf = xmalloc_array(uint8_t, xen_bytes);
+        if ( !buf )
+            return -ENOMEM;
+
+        bitmap_long_to_byte(buf, bitmap, nbits);
+
+        bytemap = buf;
+    }
+    else
+        bytemap = (const uint8_t *)bitmap;
 
     guest_bytes = DIV_ROUND_UP(xenctl_bitmap->nr_bits, BITS_PER_BYTE);
     copy_bytes  = min(guest_bytes, xen_bytes);
 
-    bitmap_long_to_byte(bytemap, bitmap, nbits);
+    if ( copy_bytes > 1 &&
+         copy_to_guest(xenctl_bitmap->bitmap, bytemap, copy_bytes - 1) )
+        err = -EFAULT;
+
+    /*
+     * If a bitmap has a number of bits which is not a multiple of 8 then the
+     * last few bits of the last byte of the bitmap can be unexpectedly set,
+     * which can confuse consumers (e.g. in the tools), who also may round up
+     * their loops to 8 bits. Ensure we clear those left over bits so as to
+     * prevent surprises.
+     */
+    last = bytemap[nbits / 8];
+    if ( nbits % 8 )
+        last &= (1U << (nbits % 8)) - 1;
+
+    xfree(buf);
 
     if ( copy_bytes &&
-         copy_to_guest(xenctl_bitmap->bitmap, bytemap, copy_bytes) )
+         copy_to_guest_offset(xenctl_bitmap->bitmap, copy_bytes - 1, &last, 1) )
         err = -EFAULT;
 
-    xfree(bytemap);
-
     for ( i = copy_bytes; !err && i < guest_bytes; i++ )
         if ( copy_to_guest_offset(xenctl_bitmap->bitmap, i, &zero, 1) )
             err = -EFAULT;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 11:45:35 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 11:45:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935673.1337057 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzwXH-0000MO-0p; Wed, 02 Apr 2025 11:45:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935673.1337057; Wed, 02 Apr 2025 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 1tzwXG-0000MG-UP; Wed, 02 Apr 2025 11:45:34 +0000
Received: by outflank-mailman (input) for mailman id 935673;
 Wed, 02 Apr 2025 11: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 1tzwXF-0000M0-7i
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 11: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 1tzwXF-007UBM-0g
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 11:45:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzwXF-003qKw-0Z
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 11: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=gPvRo4G/vvoKf1+9mM+i+FI4iCagZflplTto4NKDA3g=; b=jcrySEPceZblWqZP527W7730m8
	HYMXnVuxDhuYOZm8BFzlx7nYWdq0aVnz9Uio1WbNce+UDiEnFHpKXO0OnOMBr9BcWi/9wWzEi4JUE
	mOLeY0uHu0RgdtndYk3fqDUzWath2JLcTLEsjd/FKk1F0mzPyUDK7Y0T+x0xpNvJL8NQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Include xen/vmap.h in mm.c
Message-Id: <E1tzwXF-003qKw-0Z@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 11:45:33 +0000

commit a613df24a6f1712ea4581fe48ad1eb5386b3b2ae
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Apr 2 12:10:13 2025 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 2 12:25:10 2025 +0200

    xen/arm: Include xen/vmap.h in mm.c
    
    As reported by ECLAIR scan, MISRA requires declaration to be visible
    (R8.4). This is not the case for ioremap().
    
    Fixes: 2cd02c27d327 ("arm/mpu: Implement stubs for ioremap_attr on MPU")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/arm/mm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 5a52f0c623..0613c19169 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -12,6 +12,7 @@
 #include <xen/grant_table.h>
 #include <xen/guest_access.h>
 #include <xen/mm.h>
+#include <xen/vmap.h>
 
 #include <xsm/xsm.h>
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 12:44:10 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 12:44:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935687.1337061 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzxRr-0005bn-04; Wed, 02 Apr 2025 12:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935687.1337061; Wed, 02 Apr 2025 12: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 1tzxRq-0005bf-TO; Wed, 02 Apr 2025 12:44:02 +0000
Received: by outflank-mailman (input) for mailman id 935687;
 Wed, 02 Apr 2025 12:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1tzxRq-0005bZ-Et
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 12:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzxRq-007VYo-0v
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 12:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzxRq-003ys5-0i
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 12:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6S7GhzuGZW8LE8YLcNSDZlIWocSmf1Cu8AQyf267ztE=; b=PcI6AgHbAtr7oY4Y5RRZ1PVOua
	nb1Tq/xUN6mBkzugLhBugXlnGPVFBDBr5opC2vgO7mUlNzLsqSgzbJlUeuHEXXM6ccuygs5rNpTaR
	VnQUGZSUTts/I7cRaY1LfwQ9Me363GW5MDrKoOsnTRVMQHecqEaZIGVXtjrJ+H7LbF30=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] tools/ocaml: Fix oxenstored build warning
Message-Id: <E1tzxRq-003ys5-0i@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 12:44:02 +0000

commit ad063b08b114715331615c966951ae544b7fc1f4
Author:     Andrii Sultanov <andrii.sultanov@cloud.com>
AuthorDate: Wed Apr 2 14:20:54 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 2 14:20:54 2025 +0200

    tools/ocaml: Fix oxenstored build warning
    
    OCaml, in preparation for a renaming of the error string associated with
    conversion failure in 'int_of_string' functions, started to issue this
    warning:
    
      File "process.ml", line 440, characters 13-28:
      440 |   | (Failure "int_of_string")    -> reply_error "EINVAL"
                         ^^^^^^^^^^^^^^^
      Warning 52 [fragile-literal-pattern]: Code should not depend on the actual values of
      this constructor's arguments. They are only for information
      and may change in future versions. (See manual section 11.5)
    
    Deal with this at the source, and instead create our own stable
    ConversionFailure exception that's raised on the None case in
    'int_of_string_opt'.
    
    'c_int_of_string' is safe and does not raise such exceptions.
    
    Signed-off-by: Andrii Sultanov <andrii.sultanov@cloud.com>
    Acked-by: Christian Lindig <christian.lindig@cloud.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: c11772277fe5f1b0874141a24554c2e3da2d9a6e
    master date: 2025-02-25 13:30:55 +0000
---
 tools/ocaml/xenstored/Makefile     |  1 +
 tools/ocaml/xenstored/perms.ml     |  2 +-
 tools/ocaml/xenstored/poll.ml      |  2 +-
 tools/ocaml/xenstored/process.ml   | 18 +++++++++---------
 tools/ocaml/xenstored/utils.ml     | 10 ++++++++--
 tools/ocaml/xenstored/xenstored.ml | 16 ++++++++--------
 6 files changed, 28 insertions(+), 21 deletions(-)

diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index 5e8210a906..c333394a34 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -54,6 +54,7 @@ OBJS = paths \
 	history \
 	parse_arg \
 	process \
+	poll \
 	xenstored
 
 INTF = symbol.cmi trie.cmi syslog.cmi systemd.cmi poll.cmi
diff --git a/tools/ocaml/xenstored/perms.ml b/tools/ocaml/xenstored/perms.ml
index 14f8e334fe..2c4ee9e617 100644
--- a/tools/ocaml/xenstored/perms.ml
+++ b/tools/ocaml/xenstored/perms.ml
@@ -70,7 +70,7 @@ struct
 
   let perm_of_string s =
     let ty = permty_of_char s.[0]
-    and id = int_of_string (String.sub s 1 (String.length s - 1)) in
+    and id = Utils.int_of_string_exn (String.sub s 1 (String.length s - 1)) in
     (id, ty)
 
   let of_strings ls =
diff --git a/tools/ocaml/xenstored/poll.ml b/tools/ocaml/xenstored/poll.ml
index fefaa6e74c..f8571e4590 100644
--- a/tools/ocaml/xenstored/poll.ml
+++ b/tools/ocaml/xenstored/poll.ml
@@ -30,7 +30,7 @@ external set_fd_limit: int -> unit = "stub_set_fd_limit"
 let get_sys_fs_nr_open () =
   try
     let ch = open_in "/proc/sys/fs/nr_open" in
-    let v = int_of_string (input_line ch) in
+    let v = Utils.int_of_string_exn (input_line ch) in
     close_in_noerr ch; v
   with _ -> 1024 * 1024
 
diff --git a/tools/ocaml/xenstored/process.ml b/tools/ocaml/xenstored/process.ml
index 432d66321c..0c9c460a99 100644
--- a/tools/ocaml/xenstored/process.ml
+++ b/tools/ocaml/xenstored/process.ml
@@ -229,7 +229,7 @@ let do_debug con t _domains cons data =
       Logging.xb_op ~tid:0 ~ty:Xenbus.Xb.Op.Debug ~con:"=======>" msg;
       None
     | "quota" :: domid :: _ ->
-      let domid = int_of_string domid in
+      let domid = Utils.int_of_string_exn domid in
       let quota = (Store.get_quota t.Transaction.store) in
       Some (Quota.to_string quota domid ^ "\000")
     | "watches" :: _ ->
@@ -242,7 +242,7 @@ let do_debug con t _domains cons data =
       History.trim ();
       Some "trimmed"
     | "txn" :: domid :: _ ->
-      let domid = int_of_string domid in
+      let domid = Utils.int_of_string_exn domid in
       let con = Connections.find_domain cons domid in
       let b = Buffer.create 128 in
       let () = con.transactions |> Hashtbl.iter @@ fun id tx ->
@@ -253,7 +253,7 @@ let do_debug con t _domains cons data =
       in
       Some (Buffer.contents b)
     | "xenbus" :: domid :: _ ->
-      let domid = int_of_string domid in
+      let domid = Utils.int_of_string_exn domid in
       let con = Connections.find_domain cons domid in
       let s = Printf.sprintf "xenbus: %s; overflow queue length: %d, can_input: %b, has_more_input: %b, has_old_output: %b, has_new_output: %b, has_more_work: %b. pending: %s"
           (Xenbus.Xb.debug con.xb)
@@ -267,7 +267,7 @@ let do_debug con t _domains cons data =
       in
       Some s
     | "mfn" :: domid :: _ ->
-      let domid = int_of_string domid in
+      let domid = Utils.int_of_string_exn domid in
       let con = Connections.find_domain cons domid in
       may (fun dom -> Printf.sprintf "%nd\000" (Domain.get_mfn dom)) (Connection.get_domain con)
     | _ -> None
@@ -340,7 +340,7 @@ let do_isintroduced con _t domains _cons data =
   then raise Define.Permission_denied;
   let domid =
     match (split None '\000' data) with
-    | domid :: _ -> int_of_string domid
+    | domid :: _ -> Utils.int_of_string_exn domid
     | _          -> raise Invalid_Cmd_Args
   in
   if domid = Define.domid_self || Domains.exist domains domid then "T\000" else "F\000"
@@ -437,7 +437,7 @@ let input_handle_error ~cons ~doms ~fct ~con ~t ~req =
   | Quota.Limit_reached          -> reply_error "EQUOTA"
   | Quota.Data_too_big           -> reply_error "E2BIG"
   | Quota.Transaction_opened     -> reply_error "EQUOTA"
-  | (Failure "int_of_string")    -> reply_error "EINVAL"
+  | Utils.ConversionFailed s     -> reply_error "EINVAL"
   | Define.Unknown_operation     -> reply_error "ENOSYS"
 
 let write_access_log ~ty ~tid ~con ~data =
@@ -578,7 +578,7 @@ let do_introduce con t domains cons data =
   let (domid, mfn, remote_port) =
     match (split None '\000' data) with
     | domid :: mfn :: remote_port :: _ ->
-      int_of_string domid, Nativeint.of_string mfn, int_of_string remote_port
+      Utils.int_of_string_exn domid, Nativeint.of_string mfn, Utils.int_of_string_exn remote_port
     | _                         -> raise Invalid_Cmd_Args;
   in
   let dom =
@@ -604,7 +604,7 @@ let do_release con t domains cons data =
   then raise Define.Permission_denied;
   let domid =
     match (split None '\000' data) with
-    | [domid;""] -> int_of_string domid
+    | [domid;""] -> Utils.int_of_string_exn domid
     | _          -> raise Invalid_Cmd_Args
   in
   let fire_spec_watches = Domains.exist domains domid in
@@ -620,7 +620,7 @@ let do_resume con _t domains _cons data =
   then raise Define.Permission_denied;
   let domid =
     match (split None '\000' data) with
-    | domid :: _ -> int_of_string domid
+    | domid :: _ -> Utils.int_of_string_exn domid
     | _          -> raise Invalid_Cmd_Args
   in
   if Domains.exist domains domid
diff --git a/tools/ocaml/xenstored/utils.ml b/tools/ocaml/xenstored/utils.ml
index 48d84ef7d3..7a556bce75 100644
--- a/tools/ocaml/xenstored/utils.ml
+++ b/tools/ocaml/xenstored/utils.ml
@@ -53,8 +53,14 @@ let hexify s =
     ) s;
   Bytes.unsafe_to_string hs
 
+exception ConversionFailed of string
+let int_of_string_exn s =
+  match int_of_string_opt s with
+  | Some x -> x
+  | None -> raise (ConversionFailed s)
+
 let unhexify hs =
-  let char_of_hexseq seq0 seq1 = Char.chr (int_of_string (sprintf "0x%c%c" seq0 seq1)) in
+  let char_of_hexseq seq0 seq1 = Char.chr (int_of_string_exn (sprintf "0x%c%c" seq0 seq1)) in
   let b = Bytes.create (String.length hs / 2) in
   for i = 0 to Bytes.length b - 1
   do
@@ -86,7 +92,7 @@ let read_file_single_integer filename =
   let buf = Bytes.make 20 '\000' in
   let sz = Unix.read fd buf 0 20 in
   Unix.close fd;
-  int_of_string (Bytes.sub_string buf 0 sz)
+  int_of_string_exn (Bytes.sub_string buf 0 sz)
 
 (* @path may be guest data and needs its length validating.  @connection_path
  * is generated locally in xenstored and always of the form "/local/domain/$N/" *)
diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml
index 1aaa3e995e..84dee622ea 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -167,20 +167,20 @@ module DB = struct
                					   e.g. a RO socket from a previous version: ignore it *)
             global_f ~rw
           | "evtchn-dev" :: fd :: domexc_port :: [] ->
-            evtchn_f ~fd:(int_of_string fd)
-              ~domexc_port:(int_of_string domexc_port)
+            evtchn_f ~fd:(Utils.int_of_string_exn fd)
+              ~domexc_port:(Utils.int_of_string_exn domexc_port)
           | "socket" :: fd :: [] ->
-            socket_f ~fd:(int_of_string fd)
+            socket_f ~fd:(Utils.int_of_string_exn fd)
           | "dom" :: domid :: mfn :: remote_port :: rest ->
             let local_port = match rest with
               | [] -> None (* backward compat: old version didn't have it *)
-              | local_port :: _ -> Some (int_of_string local_port) in
+              | local_port :: _ -> Some (Utils.int_of_string_exn local_port) in
             domain_f ?local_port
-              ~remote_port:(int_of_string remote_port)
-              (int_of_string domid)
+              ~remote_port:(Utils.int_of_string_exn remote_port)
+              (Utils.int_of_string_exn domid)
               (Nativeint.of_string mfn)
           | "watch" :: domid :: path :: token :: [] ->
-            watch_f (int_of_string domid)
+            watch_f (Utils.int_of_string_exn domid)
               (unhexify path) (unhexify token)
           | "store" :: path :: perms :: value :: [] ->
             store_f (getpath path)
@@ -214,7 +214,7 @@ module DB = struct
     in
     let global_f ~rw =
       let get_listen_sock sockfd =
-        let fd = sockfd |> int_of_string |> Utils.FD.of_int in
+        let fd = sockfd |> Utils.int_of_string_exn |> Utils.FD.of_int in
         Unix.listen fd 1;
         Some fd
       in
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 12:44:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 12:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935688.1337065 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzxS1-0005dI-1L; Wed, 02 Apr 2025 12:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935688.1337065; Wed, 02 Apr 2025 12: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 1tzxS0-0005dA-Us; Wed, 02 Apr 2025 12:44:12 +0000
Received: by outflank-mailman (input) for mailman id 935688;
 Wed, 02 Apr 2025 12: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 1tzxS0-0005d4-EL
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 12: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 1tzxS0-007VYs-1J
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 12:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzxS0-003ytb-16
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 12: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=p5CUbQkKZnrr7KDw54hBE+PRBZh+ACojKXLGFbRtnJY=; b=KMZPVC0sO57J6Qa4soqLJUEYug
	kBOz3QQCeXYDgUrDcnITzTPs7L+LYSMtf++jhItEFSodHtaP5uXXDmLzReodWVIUT/HMnmoLYAdkb
	nVzp49p0ZGFs5NIu4SwDO7vB6bRE0H6i3duhGHIaDuEEwSUc2tJAKSkEHkaWm9Hja9WY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] ARM/vgic: Fix out-of-bounds accesses in vgic_mmio_write_sgir()
Message-Id: <E1tzxS0-003ytb-16@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 12:44:12 +0000

commit 64f9c54daa5b727291db49c87fa70964f268e85d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Apr 2 14:22:10 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 2 14:22:10 2025 +0200

    ARM/vgic: Fix out-of-bounds accesses in vgic_mmio_write_sgir()
    
    The switch() statement is over bits 24:25 (unshifted) of the guest provided
    value.  This makes case 0x3: dead, and not an implementation of the 4th
    possible state.
    
    A guest which writes (0x3 << 24) | (0xff << 16) to this register will skip the
    early exit, then enter bitmap_for_each() with targets not bound by nr_vcpus.
    
    If the guest has fewer than 8 vCPUs, bitmap_for_each() will read off the end
    of d->vcpu[] and use the resulting vcpu pointer to ultimately derive irq, and
    perform out-of-bounds writes.
    
    Fix this by changing case 0x3 to default.
    
    Fixes: 08c688ca6422 ("ARM: new VGIC: Add SGIR register handler")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    master commit: be7f0cc651d8d02a95820792204c0558f1f29e03
    master date: 2025-03-27 11:54:23 +0000
---
 xen/arch/arm/vgic/vgic-mmio-v2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/vgic/vgic-mmio-v2.c b/xen/arch/arm/vgic/vgic-mmio-v2.c
index 670b335db2..7d1391ac9b 100644
--- a/xen/arch/arm/vgic/vgic-mmio-v2.c
+++ b/xen/arch/arm/vgic/vgic-mmio-v2.c
@@ -104,7 +104,8 @@ static void vgic_mmio_write_sgir(struct vcpu *source_vcpu,
     case GICD_SGI_TARGET_SELF:                    /* this very vCPU only */
         targets = (1U << source_vcpu->vcpu_id);
         break;
-    case 0x3:                                     /* reserved */
+
+    default:
         return;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 12:44:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 12:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935689.1337069 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzxSB-0005fS-2t; Wed, 02 Apr 2025 12:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935689.1337069; Wed, 02 Apr 2025 12: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 1tzxSB-0005fK-0B; Wed, 02 Apr 2025 12:44:23 +0000
Received: by outflank-mailman (input) for mailman id 935689;
 Wed, 02 Apr 2025 12: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 1tzxSA-0005fE-HU
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 12: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 1tzxSA-007VZF-1e
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 12:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzxSA-003yuc-1U
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 12: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=vh1TjflZlK0bD7XSvVkD6i4Dbci88KRRBMMK994NYGo=; b=QPLGcB4sSWwHv0lTWqhAMo71WD
	MCvil6W6PSJKfvU6b7Ni+YG9Z+7/DqiPlCC0BtAPpuv0KY/TwI/b+j7tPjqLsbH5Yh4RGkMIgEXM6
	5uX5CI3Bqli7W2vVCLSapEUlcneRkvu8+JLiLYkyxIK8gWnU1bP8RZI+j5vW+B8wu3ys=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/P2M: synchronize fast and slow paths of p2m_get_page_from_gfn()
Message-Id: <E1tzxSA-003yuc-1U@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 12:44:22 +0000

commit b1bbf20a9329d7540a3d2d3fd900919aae5cbe72
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Apr 2 14:22:27 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 2 14:22:27 2025 +0200

    x86/P2M: synchronize fast and slow paths of p2m_get_page_from_gfn()
    
    Handling of both grants and foreign pages was different between the two
    paths.
    
    While permitting access to grants would be desirable, doing so would
    require more involved handling; undo that for the time being. In
    particular the page reference obtained would prevent the owning domain
    from changing e.g. the page's type (after the grantee has released the
    last reference of the grant). Instead perhaps another reference on the
    grant would need obtaining. Which in turn would require determining
    which grant that was.
    
    Foreign pages in any event need permitting on both paths.
    
    Introduce a helper function to be used on both paths, such that
    respective checking differs in just the extra "to be unshared" condition
    on the fast path.
    
    While there adjust the sanity check for foreign pages: Don't leak the
    reference on release builds when on a debug build the assertion would
    have triggered. (Thanks to Roger for the suggestion.)
    
    Fixes: 80ea7af17269 ("x86/mm: Introduce get_page_from_gfn()")
    Fixes: 50fe6e737059 ("pvh dom0: add and remove foreign pages")
    Fixes: cbbca7be4aaa ("x86/p2m: make p2m_get_page_from_gfn() handle grant case correctly")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: a8325f981ce4ff8ac8bcc73735f357846b0a0fbb
    master date: 2025-03-31 09:21:12 +0200
---
 xen/arch/x86/mm/p2m.c | 68 +++++++++++++++++++++++++++++----------------------
 1 file changed, 39 insertions(+), 29 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 1739133fc2..41fc108bba 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -328,12 +328,46 @@ void p2m_put_gfn(struct p2m_domain *p2m, gfn_t gfn)
     gfn_unlock(p2m, gfn_x(gfn), 0);
 }
 
+static struct page_info *get_page_from_mfn_and_type(
+    const struct domain *d, mfn_t mfn, p2m_type_t t)
+{
+    struct page_info *page;
+
+    if ( !mfn_valid(mfn) )
+        return NULL;
+
+    page = mfn_to_page(mfn);
+
+    if ( p2m_is_ram(t) )
+    {
+        if ( p2m_is_shared(t) )
+            d = dom_cow;
+
+        if ( get_page(page, d) )
+            return page;
+    }
+    else if ( unlikely(p2m_is_foreign(t)) )
+    {
+        const struct domain *fdom = page_get_owner_and_reference(page);
+
+        if ( fdom )
+        {
+            if ( likely(fdom != d) )
+                return page;
+            ASSERT_UNREACHABLE();
+            put_page(page);
+        }
+    }
+
+    return NULL;
+}
+
 /* Atomically look up a GFN and take a reference count on the backing page. */
 struct page_info *p2m_get_page_from_gfn(
     struct p2m_domain *p2m, gfn_t gfn,
     p2m_type_t *t, p2m_access_t *a, p2m_query_t q)
 {
-    struct page_info *page = NULL;
+    struct page_info *page;
     p2m_access_t _a;
     p2m_type_t _t;
     mfn_t mfn;
@@ -347,26 +381,9 @@ struct page_info *p2m_get_page_from_gfn(
         /* Fast path: look up and get out */
         p2m_read_lock(p2m);
         mfn = p2m_get_gfn_type_access(p2m, gfn, t, a, 0, NULL, 0);
-        if ( p2m_is_any_ram(*t) && mfn_valid(mfn)
-             && !((q & P2M_UNSHARE) && p2m_is_shared(*t)) )
-        {
-            page = mfn_to_page(mfn);
-            if ( unlikely(p2m_is_foreign(*t)) || unlikely(p2m_is_grant(*t)) )
-            {
-                struct domain *fdom = page_get_owner_and_reference(page);
-
-                ASSERT(!p2m_is_foreign(*t) || fdom != p2m->domain);
-                if ( fdom == NULL )
-                    page = NULL;
-            }
-            else
-            {
-                struct domain *d = !p2m_is_shared(*t) ? p2m->domain : dom_cow;
-
-                if ( !get_page(page, d) )
-                    page = NULL;
-            }
-        }
+        page = !(q & P2M_UNSHARE) || !p2m_is_shared(*t)
+               ? get_page_from_mfn_and_type(p2m->domain, mfn, *t)
+               : NULL;
         p2m_read_unlock(p2m);
 
         if ( page )
@@ -380,14 +397,7 @@ struct page_info *p2m_get_page_from_gfn(
 
     /* Slow path: take the write lock and do fixups */
     mfn = get_gfn_type_access(p2m, gfn_x(gfn), t, a, q, NULL);
-    if ( p2m_is_ram(*t) && mfn_valid(mfn) )
-    {
-        struct domain *d = !p2m_is_shared(*t) ? p2m->domain : dom_cow;
-
-        page = mfn_to_page(mfn);
-        if ( !get_page(page, d) )
-            page = NULL;
-    }
+    page = get_page_from_mfn_and_type(p2m->domain, mfn, *t);
     put_gfn(p2m->domain, gfn_x(gfn));
 
     return page;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 12:44:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 12:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935690.1337073 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzxSL-0005iJ-4M; Wed, 02 Apr 2025 12:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935690.1337073; Wed, 02 Apr 2025 12: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 1tzxSL-0005iB-1g; Wed, 02 Apr 2025 12:44:33 +0000
Received: by outflank-mailman (input) for mailman id 935690;
 Wed, 02 Apr 2025 12: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 1tzxSK-0005hl-Kl
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 12: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 1tzxSK-007VZL-1z
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 12:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzxSK-003yw8-1o
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 12: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=fyQp3Ow0ncFNm1Tb6zJywTVnDTOQC+7AvmvR2lOd0x0=; b=ZUbEolKsB3I4XB09OmWcsHN1Ks
	k+aWj4ldlnKwynTRD99UfXvXHhI1mTpk05goADEaa8aY7yROmQ0In/PZsDM75l+pkS40rwRqtoKrJ
	71zo8DyutuH+v1E/8PuI4Qpkfl/AuUUPlBXkXE700r1OEduvR/qXdNTvDIKDYO+/zeh8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] xen/percpu: don't initialize percpu on resume
Message-Id: <E1tzxSK-003yw8-1o@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 12:44:32 +0000

commit 3ccbe66d30f09e2cd8d370d1ec163d90ad2b3ff4
Author:     Mykyta Poturai <mykyta_poturai@epam.com>
AuthorDate: Wed Apr 2 14:26:23 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 2 14:26:23 2025 +0200

    xen/percpu: don't initialize percpu on resume
    
    Invocation of the CPU_UP_PREPARE notification
    on ARM64 during resume causes a crash:
    
    (XEN) [  315.807606] Error bringing CPU1 up: -16
    (XEN) [  315.811926] Xen BUG at common/cpu.c:258
    [...]
    (XEN) [  316.142765] Xen call trace:
    (XEN) [  316.146048]    [<00000a0000202264>] enable_nonboot_cpus+0x128/0x1ac (PC)
    (XEN) [  316.153219]    [<00000a000020225c>] enable_nonboot_cpus+0x120/0x1ac (LR)
    (XEN) [  316.160391]    [<00000a0000278180>] suspend.c#system_suspend+0x4c/0x1a0
    (XEN) [  316.167476]    [<00000a0000206b70>] domain.c#continue_hypercall_tasklet_handler+0x54/0xd0
    (XEN) [  316.176117]    [<00000a0000226538>] tasklet.c#do_tasklet_work+0xb8/0x100
    (XEN) [  316.183288]    [<00000a0000226920>] do_tasklet+0x68/0xb0
    (XEN) [  316.189077]    [<00000a000026e120>] domain.c#idle_loop+0x7c/0x194
    (XEN) [  316.195644]    [<00000a0000277638>] shutdown.c#halt_this_cpu+0/0x14
    (XEN) [  316.202383]    [<0000000000000008>] 0000000000000008
    
    Freeing per-CPU areas and setting __per_cpu_offset to INVALID_PERCPU_AREA
    only occur when !park_offline_cpus and system_state is not SYS_STATE_suspend.
    On ARM64, park_offline_cpus is always false, so setting __per_cpu_offset to
    INVALID_PERCPU_AREA depends solely on the system state.
    
    If the system is suspended, this area is not freed, and during resume, an error
    occurs in init_percpu_area, causing a crash because INVALID_PERCPU_AREA is not
    set and park_offline_cpus remains 0:
    
        if ( __per_cpu_offset[cpu] != INVALID_PERCPU_AREA )
            return park_offline_cpus ? 0 : -EBUSY;
    
    The same crash can occur on x86 if park_offline_cpus is set
    to 0 during Xen resume.
    
    Fixes: f75780d26b2f ("xen: move per-cpu area management into common code")
    Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com>
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/percpu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/common/percpu.c b/xen/common/percpu.c
index e4e8b7bcab..c6ecd95a08 100644
--- a/xen/common/percpu.c
+++ b/xen/common/percpu.c
@@ -30,7 +30,9 @@ static int init_percpu_area(unsigned int cpu)
     char *p;
 
     if ( __per_cpu_offset[cpu] != INVALID_PERCPU_AREA )
-        return park_offline_cpus ? 0 : -EBUSY;
+        return park_offline_cpus || system_state == SYS_STATE_resume
+               ? 0
+               : -EBUSY;
 
     if ( (p = alloc_xenheap_pages(PERCPU_ORDER, 0)) == NULL )
         return -ENOMEM;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 12:44:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 12:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935691.1337077 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzxSW-0005ku-5t; Wed, 02 Apr 2025 12:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935691.1337077; Wed, 02 Apr 2025 12: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 1tzxSW-0005km-3A; Wed, 02 Apr 2025 12:44:44 +0000
Received: by outflank-mailman (input) for mailman id 935691;
 Wed, 02 Apr 2025 12: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 1tzxSV-0005ke-3h
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 12:44:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzxSV-007VZR-0H
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 12:44:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzxSV-003yxJ-05
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 12:44: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=ItXyo8zTJswFmWQgMe2D8bQANxfBgM/TWosnkcw8JK8=; b=grFacE0ceEiiGv322QQwKVQ6hf
	b2ipJxauuqLpGHvJFx2ONpw75NyM0tmCDL7iuaAGo/vDjddBz2wrc+Rx3b7LjWcDmqXyf/w/nx/QF
	xuR1jKE/ZA/uuJ+BlG7qHzGlf/eEe6gAXREHfAeWO3uZBtmCCCERhQRS8CICDkjlT9Kw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] tools/ocaml: Fix oxenstored build warning
Message-Id: <E1tzxSV-003yxJ-05@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 12:44:43 +0000

commit 52d704c2bc716df58c46bd4ff40701541310549e
Author:     Andrii Sultanov <andrii.sultanov@cloud.com>
AuthorDate: Wed Apr 2 14:27:30 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 2 14:27:30 2025 +0200

    tools/ocaml: Fix oxenstored build warning
    
    OCaml, in preparation for a renaming of the error string associated with
    conversion failure in 'int_of_string' functions, started to issue this
    warning:
    
      File "process.ml", line 440, characters 13-28:
      440 |   | (Failure "int_of_string")    -> reply_error "EINVAL"
                         ^^^^^^^^^^^^^^^
      Warning 52 [fragile-literal-pattern]: Code should not depend on the actual values of
      this constructor's arguments. They are only for information
      and may change in future versions. (See manual section 11.5)
    
    Deal with this at the source, and instead create our own stable
    ConversionFailure exception that's raised on the None case in
    'int_of_string_opt'.
    
    'c_int_of_string' is safe and does not raise such exceptions.
    
    Signed-off-by: Andrii Sultanov <andrii.sultanov@cloud.com>
    Acked-by: Christian Lindig <christian.lindig@cloud.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: c11772277fe5f1b0874141a24554c2e3da2d9a6e
    master date: 2025-02-25 13:30:55 +0000
---
 tools/ocaml/xenstored/Makefile     |  1 +
 tools/ocaml/xenstored/perms.ml     |  2 +-
 tools/ocaml/xenstored/poll.ml      |  2 +-
 tools/ocaml/xenstored/process.ml   | 18 +++++++++---------
 tools/ocaml/xenstored/utils.ml     | 10 ++++++++--
 tools/ocaml/xenstored/xenstored.ml | 16 ++++++++--------
 6 files changed, 28 insertions(+), 21 deletions(-)

diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index fa45305d8c..9714b1ee46 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -53,6 +53,7 @@ OBJS = paths \
 	history \
 	parse_arg \
 	process \
+	poll \
 	xenstored
 
 INTF = symbol.cmi trie.cmi syslog.cmi systemd.cmi poll.cmi
diff --git a/tools/ocaml/xenstored/perms.ml b/tools/ocaml/xenstored/perms.ml
index 14f8e334fe..2c4ee9e617 100644
--- a/tools/ocaml/xenstored/perms.ml
+++ b/tools/ocaml/xenstored/perms.ml
@@ -70,7 +70,7 @@ struct
 
   let perm_of_string s =
     let ty = permty_of_char s.[0]
-    and id = int_of_string (String.sub s 1 (String.length s - 1)) in
+    and id = Utils.int_of_string_exn (String.sub s 1 (String.length s - 1)) in
     (id, ty)
 
   let of_strings ls =
diff --git a/tools/ocaml/xenstored/poll.ml b/tools/ocaml/xenstored/poll.ml
index fefaa6e74c..f8571e4590 100644
--- a/tools/ocaml/xenstored/poll.ml
+++ b/tools/ocaml/xenstored/poll.ml
@@ -30,7 +30,7 @@ external set_fd_limit: int -> unit = "stub_set_fd_limit"
 let get_sys_fs_nr_open () =
   try
     let ch = open_in "/proc/sys/fs/nr_open" in
-    let v = int_of_string (input_line ch) in
+    let v = Utils.int_of_string_exn (input_line ch) in
     close_in_noerr ch; v
   with _ -> 1024 * 1024
 
diff --git a/tools/ocaml/xenstored/process.ml b/tools/ocaml/xenstored/process.ml
index 432d66321c..0c9c460a99 100644
--- a/tools/ocaml/xenstored/process.ml
+++ b/tools/ocaml/xenstored/process.ml
@@ -229,7 +229,7 @@ let do_debug con t _domains cons data =
       Logging.xb_op ~tid:0 ~ty:Xenbus.Xb.Op.Debug ~con:"=======>" msg;
       None
     | "quota" :: domid :: _ ->
-      let domid = int_of_string domid in
+      let domid = Utils.int_of_string_exn domid in
       let quota = (Store.get_quota t.Transaction.store) in
       Some (Quota.to_string quota domid ^ "\000")
     | "watches" :: _ ->
@@ -242,7 +242,7 @@ let do_debug con t _domains cons data =
       History.trim ();
       Some "trimmed"
     | "txn" :: domid :: _ ->
-      let domid = int_of_string domid in
+      let domid = Utils.int_of_string_exn domid in
       let con = Connections.find_domain cons domid in
       let b = Buffer.create 128 in
       let () = con.transactions |> Hashtbl.iter @@ fun id tx ->
@@ -253,7 +253,7 @@ let do_debug con t _domains cons data =
       in
       Some (Buffer.contents b)
     | "xenbus" :: domid :: _ ->
-      let domid = int_of_string domid in
+      let domid = Utils.int_of_string_exn domid in
       let con = Connections.find_domain cons domid in
       let s = Printf.sprintf "xenbus: %s; overflow queue length: %d, can_input: %b, has_more_input: %b, has_old_output: %b, has_new_output: %b, has_more_work: %b. pending: %s"
           (Xenbus.Xb.debug con.xb)
@@ -267,7 +267,7 @@ let do_debug con t _domains cons data =
       in
       Some s
     | "mfn" :: domid :: _ ->
-      let domid = int_of_string domid in
+      let domid = Utils.int_of_string_exn domid in
       let con = Connections.find_domain cons domid in
       may (fun dom -> Printf.sprintf "%nd\000" (Domain.get_mfn dom)) (Connection.get_domain con)
     | _ -> None
@@ -340,7 +340,7 @@ let do_isintroduced con _t domains _cons data =
   then raise Define.Permission_denied;
   let domid =
     match (split None '\000' data) with
-    | domid :: _ -> int_of_string domid
+    | domid :: _ -> Utils.int_of_string_exn domid
     | _          -> raise Invalid_Cmd_Args
   in
   if domid = Define.domid_self || Domains.exist domains domid then "T\000" else "F\000"
@@ -437,7 +437,7 @@ let input_handle_error ~cons ~doms ~fct ~con ~t ~req =
   | Quota.Limit_reached          -> reply_error "EQUOTA"
   | Quota.Data_too_big           -> reply_error "E2BIG"
   | Quota.Transaction_opened     -> reply_error "EQUOTA"
-  | (Failure "int_of_string")    -> reply_error "EINVAL"
+  | Utils.ConversionFailed s     -> reply_error "EINVAL"
   | Define.Unknown_operation     -> reply_error "ENOSYS"
 
 let write_access_log ~ty ~tid ~con ~data =
@@ -578,7 +578,7 @@ let do_introduce con t domains cons data =
   let (domid, mfn, remote_port) =
     match (split None '\000' data) with
     | domid :: mfn :: remote_port :: _ ->
-      int_of_string domid, Nativeint.of_string mfn, int_of_string remote_port
+      Utils.int_of_string_exn domid, Nativeint.of_string mfn, Utils.int_of_string_exn remote_port
     | _                         -> raise Invalid_Cmd_Args;
   in
   let dom =
@@ -604,7 +604,7 @@ let do_release con t domains cons data =
   then raise Define.Permission_denied;
   let domid =
     match (split None '\000' data) with
-    | [domid;""] -> int_of_string domid
+    | [domid;""] -> Utils.int_of_string_exn domid
     | _          -> raise Invalid_Cmd_Args
   in
   let fire_spec_watches = Domains.exist domains domid in
@@ -620,7 +620,7 @@ let do_resume con _t domains _cons data =
   then raise Define.Permission_denied;
   let domid =
     match (split None '\000' data) with
-    | domid :: _ -> int_of_string domid
+    | domid :: _ -> Utils.int_of_string_exn domid
     | _          -> raise Invalid_Cmd_Args
   in
   if Domains.exist domains domid
diff --git a/tools/ocaml/xenstored/utils.ml b/tools/ocaml/xenstored/utils.ml
index 48d84ef7d3..7a556bce75 100644
--- a/tools/ocaml/xenstored/utils.ml
+++ b/tools/ocaml/xenstored/utils.ml
@@ -53,8 +53,14 @@ let hexify s =
     ) s;
   Bytes.unsafe_to_string hs
 
+exception ConversionFailed of string
+let int_of_string_exn s =
+  match int_of_string_opt s with
+  | Some x -> x
+  | None -> raise (ConversionFailed s)
+
 let unhexify hs =
-  let char_of_hexseq seq0 seq1 = Char.chr (int_of_string (sprintf "0x%c%c" seq0 seq1)) in
+  let char_of_hexseq seq0 seq1 = Char.chr (int_of_string_exn (sprintf "0x%c%c" seq0 seq1)) in
   let b = Bytes.create (String.length hs / 2) in
   for i = 0 to Bytes.length b - 1
   do
@@ -86,7 +92,7 @@ let read_file_single_integer filename =
   let buf = Bytes.make 20 '\000' in
   let sz = Unix.read fd buf 0 20 in
   Unix.close fd;
-  int_of_string (Bytes.sub_string buf 0 sz)
+  int_of_string_exn (Bytes.sub_string buf 0 sz)
 
 (* @path may be guest data and needs its length validating.  @connection_path
  * is generated locally in xenstored and always of the form "/local/domain/$N/" *)
diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml
index 1aaa3e995e..84dee622ea 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -167,20 +167,20 @@ module DB = struct
                					   e.g. a RO socket from a previous version: ignore it *)
             global_f ~rw
           | "evtchn-dev" :: fd :: domexc_port :: [] ->
-            evtchn_f ~fd:(int_of_string fd)
-              ~domexc_port:(int_of_string domexc_port)
+            evtchn_f ~fd:(Utils.int_of_string_exn fd)
+              ~domexc_port:(Utils.int_of_string_exn domexc_port)
           | "socket" :: fd :: [] ->
-            socket_f ~fd:(int_of_string fd)
+            socket_f ~fd:(Utils.int_of_string_exn fd)
           | "dom" :: domid :: mfn :: remote_port :: rest ->
             let local_port = match rest with
               | [] -> None (* backward compat: old version didn't have it *)
-              | local_port :: _ -> Some (int_of_string local_port) in
+              | local_port :: _ -> Some (Utils.int_of_string_exn local_port) in
             domain_f ?local_port
-              ~remote_port:(int_of_string remote_port)
-              (int_of_string domid)
+              ~remote_port:(Utils.int_of_string_exn remote_port)
+              (Utils.int_of_string_exn domid)
               (Nativeint.of_string mfn)
           | "watch" :: domid :: path :: token :: [] ->
-            watch_f (int_of_string domid)
+            watch_f (Utils.int_of_string_exn domid)
               (unhexify path) (unhexify token)
           | "store" :: path :: perms :: value :: [] ->
             store_f (getpath path)
@@ -214,7 +214,7 @@ module DB = struct
     in
     let global_f ~rw =
       let get_listen_sock sockfd =
-        let fd = sockfd |> int_of_string |> Utils.FD.of_int in
+        let fd = sockfd |> Utils.int_of_string_exn |> Utils.FD.of_int in
         Unix.listen fd 1;
         Some fd
       in
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 12:44:54 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 12:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935692.1337080 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzxSg-0005nj-8d; Wed, 02 Apr 2025 12:44:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935692.1337080; Wed, 02 Apr 2025 12: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 1tzxSg-0005nb-5t; Wed, 02 Apr 2025 12:44:54 +0000
Received: by outflank-mailman (input) for mailman id 935692;
 Wed, 02 Apr 2025 12: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 1tzxSf-0005nV-9E
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 12: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 1tzxSf-007VZX-0m
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 12:44:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzxSf-003yym-0S
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 12: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=LBG0AN4Fu+EOXnWR1krBw+TFwA3vVIpgcSc/bzbq774=; b=wbQPwcbRRO85KtZrATrfGXT94g
	A5LB8Ls5vHuuBhOLC+itylu8W51ImWj8gwo/JRF+sFYW6Xg3U0+s9UbCr2tUf8WyJjGHaiayHX/Ks
	00R4xpqrLrQr1yjISvMTmYriLBxYfKl356CHS1T15zHTT8Loi5HpzL9jTK7Wy4Ndp/FM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] ARM/vgic: Fix out-of-bounds accesses in vgic_mmio_write_sgir()
Message-Id: <E1tzxSf-003yym-0S@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 12:44:53 +0000

commit f0a30501613f4ddb725e164b208c64073faa0e01
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Apr 2 14:27:56 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 2 14:27:56 2025 +0200

    ARM/vgic: Fix out-of-bounds accesses in vgic_mmio_write_sgir()
    
    The switch() statement is over bits 24:25 (unshifted) of the guest provided
    value.  This makes case 0x3: dead, and not an implementation of the 4th
    possible state.
    
    A guest which writes (0x3 << 24) | (0xff << 16) to this register will skip the
    early exit, then enter bitmap_for_each() with targets not bound by nr_vcpus.
    
    If the guest has fewer than 8 vCPUs, bitmap_for_each() will read off the end
    of d->vcpu[] and use the resulting vcpu pointer to ultimately derive irq, and
    perform out-of-bounds writes.
    
    Fix this by changing case 0x3 to default.
    
    Fixes: 08c688ca6422 ("ARM: new VGIC: Add SGIR register handler")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    master commit: be7f0cc651d8d02a95820792204c0558f1f29e03
    master date: 2025-03-27 11:54:23 +0000
---
 xen/arch/arm/vgic/vgic-mmio-v2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/vgic/vgic-mmio-v2.c b/xen/arch/arm/vgic/vgic-mmio-v2.c
index 2e507b10fe..e14de567a7 100644
--- a/xen/arch/arm/vgic/vgic-mmio-v2.c
+++ b/xen/arch/arm/vgic/vgic-mmio-v2.c
@@ -104,7 +104,8 @@ static void vgic_mmio_write_sgir(struct vcpu *source_vcpu,
     case GICD_SGI_TARGET_SELF:                    /* this very vCPU only */
         targets = (1U << source_vcpu->vcpu_id);
         break;
-    case 0x3:                                     /* reserved */
+
+    default:
         return;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 12:45:04 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 12:45:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935693.1337085 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzxSq-0005pw-9z; Wed, 02 Apr 2025 12:45:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935693.1337085; Wed, 02 Apr 2025 12: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 1tzxSq-0005po-7I; Wed, 02 Apr 2025 12:45:04 +0000
Received: by outflank-mailman (input) for mailman id 935693;
 Wed, 02 Apr 2025 12: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 1tzxSp-0005pf-Bs
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 12: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 1tzxSp-007VZx-15
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 12:45:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzxSp-003yzT-0x
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 12: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=qz3U51FwlC8Eo2lcxDUza7leCWQP8c0LKKluG0TCNlI=; b=lxTYPGPpFzdiCZcygxIcg3cV9t
	yjhgsUPWzgVDMgASUe192Q9O5JMODiXpOqByqVieX2UsIjnMdIYV9KOOcrkn1tzBhmGsyCrf61qIs
	E4ImmOX8W8Fd0WTiCOT909TyoVVvzx0bxVr9TmpWSkpw6amRhFQVtdFbGZBpafskIxXQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/P2M: synchronize fast and slow paths of p2m_get_page_from_gfn()
Message-Id: <E1tzxSp-003yzT-0x@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 12:45:03 +0000

commit 30eb7e6ad803d7221a89db070b5f8859cb2fdc68
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Apr 2 14:28:08 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 2 14:28:08 2025 +0200

    x86/P2M: synchronize fast and slow paths of p2m_get_page_from_gfn()
    
    Handling of both grants and foreign pages was different between the two
    paths.
    
    While permitting access to grants would be desirable, doing so would
    require more involved handling; undo that for the time being. In
    particular the page reference obtained would prevent the owning domain
    from changing e.g. the page's type (after the grantee has released the
    last reference of the grant). Instead perhaps another reference on the
    grant would need obtaining. Which in turn would require determining
    which grant that was.
    
    Foreign pages in any event need permitting on both paths.
    
    Introduce a helper function to be used on both paths, such that
    respective checking differs in just the extra "to be unshared" condition
    on the fast path.
    
    While there adjust the sanity check for foreign pages: Don't leak the
    reference on release builds when on a debug build the assertion would
    have triggered. (Thanks to Roger for the suggestion.)
    
    Fixes: 80ea7af17269 ("x86/mm: Introduce get_page_from_gfn()")
    Fixes: 50fe6e737059 ("pvh dom0: add and remove foreign pages")
    Fixes: cbbca7be4aaa ("x86/p2m: make p2m_get_page_from_gfn() handle grant case correctly")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: a8325f981ce4ff8ac8bcc73735f357846b0a0fbb
    master date: 2025-03-31 09:21:12 +0200
---
 xen/arch/x86/mm/p2m.c | 68 +++++++++++++++++++++++++++++----------------------
 1 file changed, 39 insertions(+), 29 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 1739133fc2..41fc108bba 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -328,12 +328,46 @@ void p2m_put_gfn(struct p2m_domain *p2m, gfn_t gfn)
     gfn_unlock(p2m, gfn_x(gfn), 0);
 }
 
+static struct page_info *get_page_from_mfn_and_type(
+    const struct domain *d, mfn_t mfn, p2m_type_t t)
+{
+    struct page_info *page;
+
+    if ( !mfn_valid(mfn) )
+        return NULL;
+
+    page = mfn_to_page(mfn);
+
+    if ( p2m_is_ram(t) )
+    {
+        if ( p2m_is_shared(t) )
+            d = dom_cow;
+
+        if ( get_page(page, d) )
+            return page;
+    }
+    else if ( unlikely(p2m_is_foreign(t)) )
+    {
+        const struct domain *fdom = page_get_owner_and_reference(page);
+
+        if ( fdom )
+        {
+            if ( likely(fdom != d) )
+                return page;
+            ASSERT_UNREACHABLE();
+            put_page(page);
+        }
+    }
+
+    return NULL;
+}
+
 /* Atomically look up a GFN and take a reference count on the backing page. */
 struct page_info *p2m_get_page_from_gfn(
     struct p2m_domain *p2m, gfn_t gfn,
     p2m_type_t *t, p2m_access_t *a, p2m_query_t q)
 {
-    struct page_info *page = NULL;
+    struct page_info *page;
     p2m_access_t _a;
     p2m_type_t _t;
     mfn_t mfn;
@@ -347,26 +381,9 @@ struct page_info *p2m_get_page_from_gfn(
         /* Fast path: look up and get out */
         p2m_read_lock(p2m);
         mfn = p2m_get_gfn_type_access(p2m, gfn, t, a, 0, NULL, 0);
-        if ( p2m_is_any_ram(*t) && mfn_valid(mfn)
-             && !((q & P2M_UNSHARE) && p2m_is_shared(*t)) )
-        {
-            page = mfn_to_page(mfn);
-            if ( unlikely(p2m_is_foreign(*t)) || unlikely(p2m_is_grant(*t)) )
-            {
-                struct domain *fdom = page_get_owner_and_reference(page);
-
-                ASSERT(!p2m_is_foreign(*t) || fdom != p2m->domain);
-                if ( fdom == NULL )
-                    page = NULL;
-            }
-            else
-            {
-                struct domain *d = !p2m_is_shared(*t) ? p2m->domain : dom_cow;
-
-                if ( !get_page(page, d) )
-                    page = NULL;
-            }
-        }
+        page = !(q & P2M_UNSHARE) || !p2m_is_shared(*t)
+               ? get_page_from_mfn_and_type(p2m->domain, mfn, *t)
+               : NULL;
         p2m_read_unlock(p2m);
 
         if ( page )
@@ -380,14 +397,7 @@ struct page_info *p2m_get_page_from_gfn(
 
     /* Slow path: take the write lock and do fixups */
     mfn = get_gfn_type_access(p2m, gfn_x(gfn), t, a, q, NULL);
-    if ( p2m_is_ram(*t) && mfn_valid(mfn) )
-    {
-        struct domain *d = !p2m_is_shared(*t) ? p2m->domain : dom_cow;
-
-        page = mfn_to_page(mfn);
-        if ( !get_page(page, d) )
-            page = NULL;
-    }
+    page = get_page_from_mfn_and_type(p2m->domain, mfn, *t);
     put_gfn(p2m->domain, gfn_x(gfn));
 
     return page;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 12:45:15 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 12:45:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935694.1337089 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzxT1-0005sB-BQ; Wed, 02 Apr 2025 12:45:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935694.1337089; Wed, 02 Apr 2025 12:45: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 1tzxT1-0005s4-8o; Wed, 02 Apr 2025 12:45:15 +0000
Received: by outflank-mailman (input) for mailman id 935694;
 Wed, 02 Apr 2025 12: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 1tzxSz-0005rm-PR
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 12: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 1tzxSz-007Va1-2S
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 12:45:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzxSz-003z1c-2M
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 12: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=Hkwu/PAbsXiNTR7Nv9P3bOL0udYCjohp5oMeipJkBlE=; b=WOov2c7mduferZNvZl19IBPmRL
	AZxur8M4K6pguLywr5Mjg3Op6aRfEKwGwQh326dNQSo7+xbRpDI1s7xC1zf9RWFfNzWpHruE+5un7
	9Tup7dv8LWYlAOpsxmyZdst8fj7jGzxLDaQm6KIYRUWcixFqgGzqdvJhoHwQgccxJ8I0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] tools/ocaml: Fix oxenstored build warning
Message-Id: <E1tzxSz-003z1c-2M@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 12:45:13 +0000

commit ca847010e3a8004af779836134502cca1ca2ca50
Author:     Andrii Sultanov <andrii.sultanov@cloud.com>
AuthorDate: Wed Apr 2 14:30:08 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 2 14:30:08 2025 +0200

    tools/ocaml: Fix oxenstored build warning
    
    OCaml, in preparation for a renaming of the error string associated with
    conversion failure in 'int_of_string' functions, started to issue this
    warning:
    
      File "process.ml", line 440, characters 13-28:
      440 |   | (Failure "int_of_string")    -> reply_error "EINVAL"
                         ^^^^^^^^^^^^^^^
      Warning 52 [fragile-literal-pattern]: Code should not depend on the actual values of
      this constructor's arguments. They are only for information
      and may change in future versions. (See manual section 11.5)
    
    Deal with this at the source, and instead create our own stable
    ConversionFailure exception that's raised on the None case in
    'int_of_string_opt'.
    
    'c_int_of_string' is safe and does not raise such exceptions.
    
    Signed-off-by: Andrii Sultanov <andrii.sultanov@cloud.com>
    Acked-by: Christian Lindig <christian.lindig@cloud.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: c11772277fe5f1b0874141a24554c2e3da2d9a6e
    master date: 2025-02-25 13:30:55 +0000
---
 tools/ocaml/xenstored/Makefile     |  1 +
 tools/ocaml/xenstored/perms.ml     |  2 +-
 tools/ocaml/xenstored/poll.ml      |  2 +-
 tools/ocaml/xenstored/process.ml   | 18 +++++++++---------
 tools/ocaml/xenstored/utils.ml     | 10 ++++++++--
 tools/ocaml/xenstored/xenstored.ml | 16 ++++++++--------
 6 files changed, 28 insertions(+), 21 deletions(-)

diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index fa45305d8c..9714b1ee46 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -53,6 +53,7 @@ OBJS = paths \
 	history \
 	parse_arg \
 	process \
+	poll \
 	xenstored
 
 INTF = symbol.cmi trie.cmi syslog.cmi systemd.cmi poll.cmi
diff --git a/tools/ocaml/xenstored/perms.ml b/tools/ocaml/xenstored/perms.ml
index 14f8e334fe..2c4ee9e617 100644
--- a/tools/ocaml/xenstored/perms.ml
+++ b/tools/ocaml/xenstored/perms.ml
@@ -70,7 +70,7 @@ struct
 
   let perm_of_string s =
     let ty = permty_of_char s.[0]
-    and id = int_of_string (String.sub s 1 (String.length s - 1)) in
+    and id = Utils.int_of_string_exn (String.sub s 1 (String.length s - 1)) in
     (id, ty)
 
   let of_strings ls =
diff --git a/tools/ocaml/xenstored/poll.ml b/tools/ocaml/xenstored/poll.ml
index fefaa6e74c..f8571e4590 100644
--- a/tools/ocaml/xenstored/poll.ml
+++ b/tools/ocaml/xenstored/poll.ml
@@ -30,7 +30,7 @@ external set_fd_limit: int -> unit = "stub_set_fd_limit"
 let get_sys_fs_nr_open () =
   try
     let ch = open_in "/proc/sys/fs/nr_open" in
-    let v = int_of_string (input_line ch) in
+    let v = Utils.int_of_string_exn (input_line ch) in
     close_in_noerr ch; v
   with _ -> 1024 * 1024
 
diff --git a/tools/ocaml/xenstored/process.ml b/tools/ocaml/xenstored/process.ml
index 432d66321c..0c9c460a99 100644
--- a/tools/ocaml/xenstored/process.ml
+++ b/tools/ocaml/xenstored/process.ml
@@ -229,7 +229,7 @@ let do_debug con t _domains cons data =
       Logging.xb_op ~tid:0 ~ty:Xenbus.Xb.Op.Debug ~con:"=======>" msg;
       None
     | "quota" :: domid :: _ ->
-      let domid = int_of_string domid in
+      let domid = Utils.int_of_string_exn domid in
       let quota = (Store.get_quota t.Transaction.store) in
       Some (Quota.to_string quota domid ^ "\000")
     | "watches" :: _ ->
@@ -242,7 +242,7 @@ let do_debug con t _domains cons data =
       History.trim ();
       Some "trimmed"
     | "txn" :: domid :: _ ->
-      let domid = int_of_string domid in
+      let domid = Utils.int_of_string_exn domid in
       let con = Connections.find_domain cons domid in
       let b = Buffer.create 128 in
       let () = con.transactions |> Hashtbl.iter @@ fun id tx ->
@@ -253,7 +253,7 @@ let do_debug con t _domains cons data =
       in
       Some (Buffer.contents b)
     | "xenbus" :: domid :: _ ->
-      let domid = int_of_string domid in
+      let domid = Utils.int_of_string_exn domid in
       let con = Connections.find_domain cons domid in
       let s = Printf.sprintf "xenbus: %s; overflow queue length: %d, can_input: %b, has_more_input: %b, has_old_output: %b, has_new_output: %b, has_more_work: %b. pending: %s"
           (Xenbus.Xb.debug con.xb)
@@ -267,7 +267,7 @@ let do_debug con t _domains cons data =
       in
       Some s
     | "mfn" :: domid :: _ ->
-      let domid = int_of_string domid in
+      let domid = Utils.int_of_string_exn domid in
       let con = Connections.find_domain cons domid in
       may (fun dom -> Printf.sprintf "%nd\000" (Domain.get_mfn dom)) (Connection.get_domain con)
     | _ -> None
@@ -340,7 +340,7 @@ let do_isintroduced con _t domains _cons data =
   then raise Define.Permission_denied;
   let domid =
     match (split None '\000' data) with
-    | domid :: _ -> int_of_string domid
+    | domid :: _ -> Utils.int_of_string_exn domid
     | _          -> raise Invalid_Cmd_Args
   in
   if domid = Define.domid_self || Domains.exist domains domid then "T\000" else "F\000"
@@ -437,7 +437,7 @@ let input_handle_error ~cons ~doms ~fct ~con ~t ~req =
   | Quota.Limit_reached          -> reply_error "EQUOTA"
   | Quota.Data_too_big           -> reply_error "E2BIG"
   | Quota.Transaction_opened     -> reply_error "EQUOTA"
-  | (Failure "int_of_string")    -> reply_error "EINVAL"
+  | Utils.ConversionFailed s     -> reply_error "EINVAL"
   | Define.Unknown_operation     -> reply_error "ENOSYS"
 
 let write_access_log ~ty ~tid ~con ~data =
@@ -578,7 +578,7 @@ let do_introduce con t domains cons data =
   let (domid, mfn, remote_port) =
     match (split None '\000' data) with
     | domid :: mfn :: remote_port :: _ ->
-      int_of_string domid, Nativeint.of_string mfn, int_of_string remote_port
+      Utils.int_of_string_exn domid, Nativeint.of_string mfn, Utils.int_of_string_exn remote_port
     | _                         -> raise Invalid_Cmd_Args;
   in
   let dom =
@@ -604,7 +604,7 @@ let do_release con t domains cons data =
   then raise Define.Permission_denied;
   let domid =
     match (split None '\000' data) with
-    | [domid;""] -> int_of_string domid
+    | [domid;""] -> Utils.int_of_string_exn domid
     | _          -> raise Invalid_Cmd_Args
   in
   let fire_spec_watches = Domains.exist domains domid in
@@ -620,7 +620,7 @@ let do_resume con _t domains _cons data =
   then raise Define.Permission_denied;
   let domid =
     match (split None '\000' data) with
-    | domid :: _ -> int_of_string domid
+    | domid :: _ -> Utils.int_of_string_exn domid
     | _          -> raise Invalid_Cmd_Args
   in
   if Domains.exist domains domid
diff --git a/tools/ocaml/xenstored/utils.ml b/tools/ocaml/xenstored/utils.ml
index 48d84ef7d3..7a556bce75 100644
--- a/tools/ocaml/xenstored/utils.ml
+++ b/tools/ocaml/xenstored/utils.ml
@@ -53,8 +53,14 @@ let hexify s =
     ) s;
   Bytes.unsafe_to_string hs
 
+exception ConversionFailed of string
+let int_of_string_exn s =
+  match int_of_string_opt s with
+  | Some x -> x
+  | None -> raise (ConversionFailed s)
+
 let unhexify hs =
-  let char_of_hexseq seq0 seq1 = Char.chr (int_of_string (sprintf "0x%c%c" seq0 seq1)) in
+  let char_of_hexseq seq0 seq1 = Char.chr (int_of_string_exn (sprintf "0x%c%c" seq0 seq1)) in
   let b = Bytes.create (String.length hs / 2) in
   for i = 0 to Bytes.length b - 1
   do
@@ -86,7 +92,7 @@ let read_file_single_integer filename =
   let buf = Bytes.make 20 '\000' in
   let sz = Unix.read fd buf 0 20 in
   Unix.close fd;
-  int_of_string (Bytes.sub_string buf 0 sz)
+  int_of_string_exn (Bytes.sub_string buf 0 sz)
 
 (* @path may be guest data and needs its length validating.  @connection_path
  * is generated locally in xenstored and always of the form "/local/domain/$N/" *)
diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml
index 1aaa3e995e..84dee622ea 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -167,20 +167,20 @@ module DB = struct
                					   e.g. a RO socket from a previous version: ignore it *)
             global_f ~rw
           | "evtchn-dev" :: fd :: domexc_port :: [] ->
-            evtchn_f ~fd:(int_of_string fd)
-              ~domexc_port:(int_of_string domexc_port)
+            evtchn_f ~fd:(Utils.int_of_string_exn fd)
+              ~domexc_port:(Utils.int_of_string_exn domexc_port)
           | "socket" :: fd :: [] ->
-            socket_f ~fd:(int_of_string fd)
+            socket_f ~fd:(Utils.int_of_string_exn fd)
           | "dom" :: domid :: mfn :: remote_port :: rest ->
             let local_port = match rest with
               | [] -> None (* backward compat: old version didn't have it *)
-              | local_port :: _ -> Some (int_of_string local_port) in
+              | local_port :: _ -> Some (Utils.int_of_string_exn local_port) in
             domain_f ?local_port
-              ~remote_port:(int_of_string remote_port)
-              (int_of_string domid)
+              ~remote_port:(Utils.int_of_string_exn remote_port)
+              (Utils.int_of_string_exn domid)
               (Nativeint.of_string mfn)
           | "watch" :: domid :: path :: token :: [] ->
-            watch_f (int_of_string domid)
+            watch_f (Utils.int_of_string_exn domid)
               (unhexify path) (unhexify token)
           | "store" :: path :: perms :: value :: [] ->
             store_f (getpath path)
@@ -214,7 +214,7 @@ module DB = struct
     in
     let global_f ~rw =
       let get_listen_sock sockfd =
-        let fd = sockfd |> int_of_string |> Utils.FD.of_int in
+        let fd = sockfd |> Utils.int_of_string_exn |> Utils.FD.of_int in
         Unix.listen fd 1;
         Some fd
       in
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 12:45:25 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 12:45:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935695.1337095 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzxTB-0005uG-EH; Wed, 02 Apr 2025 12:45:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935695.1337095; Wed, 02 Apr 2025 12:45:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzxTB-0005u1-AK; Wed, 02 Apr 2025 12:45:25 +0000
Received: by outflank-mailman (input) for mailman id 935695;
 Wed, 02 Apr 2025 12: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 1tzxT9-0005ts-SC
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 12: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 1tzxT9-007VaL-2i
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 12:45:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzxT9-003z2B-2d
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 12: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=zrLTbxhZBQvw3hpELF79VvdCJ0DUkXP45QdYjTLO2aY=; b=QmNP8vBk8C7Ebevi3eCbBMQWz3
	vEU/H6SjxGNGUyj4s9cQfP2RqI/q79HM6IkQ7c9JbC6WCvct+s+QN0s3v/zM8eYxaHYCyRJEi51wu
	njTEV/Y+VcPD+/wcmpCMa2j2kWeq3aftM2Z2R+rsJEY4B2FFstGz+mEpHXvOTQrbBqNY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] ARM/vgic: Fix out-of-bounds accesses in vgic_mmio_write_sgir()
Message-Id: <E1tzxT9-003z2B-2d@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 12:45:23 +0000

commit 022596f53f96ee83c6ad8be608e3ab84d2fd2ab2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Apr 2 14:31:17 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 2 14:31:17 2025 +0200

    ARM/vgic: Fix out-of-bounds accesses in vgic_mmio_write_sgir()
    
    The switch() statement is over bits 24:25 (unshifted) of the guest provided
    value.  This makes case 0x3: dead, and not an implementation of the 4th
    possible state.
    
    A guest which writes (0x3 << 24) | (0xff << 16) to this register will skip the
    early exit, then enter bitmap_for_each() with targets not bound by nr_vcpus.
    
    If the guest has fewer than 8 vCPUs, bitmap_for_each() will read off the end
    of d->vcpu[] and use the resulting vcpu pointer to ultimately derive irq, and
    perform out-of-bounds writes.
    
    Fix this by changing case 0x3 to default.
    
    Fixes: 08c688ca6422 ("ARM: new VGIC: Add SGIR register handler")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    master commit: be7f0cc651d8d02a95820792204c0558f1f29e03
    master date: 2025-03-27 11:54:23 +0000
---
 xen/arch/arm/vgic/vgic-mmio-v2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/vgic/vgic-mmio-v2.c b/xen/arch/arm/vgic/vgic-mmio-v2.c
index 2e507b10fe..e14de567a7 100644
--- a/xen/arch/arm/vgic/vgic-mmio-v2.c
+++ b/xen/arch/arm/vgic/vgic-mmio-v2.c
@@ -104,7 +104,8 @@ static void vgic_mmio_write_sgir(struct vcpu *source_vcpu,
     case GICD_SGI_TARGET_SELF:                    /* this very vCPU only */
         targets = (1U << source_vcpu->vcpu_id);
         break;
-    case 0x3:                                     /* reserved */
+
+    default:
         return;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 12:45:35 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 12:45:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935696.1337097 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzxTL-0005wh-Ed; Wed, 02 Apr 2025 12:45:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935696.1337097; Wed, 02 Apr 2025 12:45:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzxTL-0005wZ-Bh; Wed, 02 Apr 2025 12:45:35 +0000
Received: by outflank-mailman (input) for mailman id 935696;
 Wed, 02 Apr 2025 12:45: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 1tzxTJ-0005wK-Uu
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 12: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 1tzxTJ-007VaR-30
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 12:45:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzxTJ-003z3r-2u
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 12: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=oD6fRNZhayEGc55MKIPKY66z65F7TwbZY3HA5+bFPP8=; b=R5wQqUlPZOBge7kblkgKBwrabH
	9d8d3VIx/lrvclJ3HGxs2fMentWpk0MpQuhbnnj6/Sog/lsKGvoMnzgjgCy528TE7UUPOngSTmAL0
	UPggi6GdUz5RCO1cD/9ytccvptxPSFr6ZiBIh1SiF0OnhcY+W8+oWYB4J8xepuf/xef0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] x86/P2M: synchronize fast and slow paths of p2m_get_page_from_gfn()
Message-Id: <E1tzxTJ-003z3r-2u@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 12:45:33 +0000

commit 73ad31d852f2cbf82bf66c3af84d4672f38ac00e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Apr 2 14:31:26 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 2 14:31:26 2025 +0200

    x86/P2M: synchronize fast and slow paths of p2m_get_page_from_gfn()
    
    Handling of foreign pages was different between the two paths.
    
    While permitting access to grants would be desirable, doing so would
    require more involved handling; undo that for the time being. In
    particular the page reference obtained would prevent the owning domain
    from changing e.g. the page's type (after the grantee has released the
    last reference of the grant). Instead perhaps another reference on the
    grant would need obtaining. Which in turn would require determining
    which grant that was.
    
    Foreign pages in any event need permitting on both paths.
    
    Introduce a helper function to be used on both paths, such that
    respective checking differs in just the extra "to be unshared" condition
    on the fast path.
    
    While there adjust the sanity check for foreign pages: Don't leak the
    reference on release builds when on a debug build the assertion would
    have triggered. (Thanks to Roger for the suggestion.)
    
    Fixes: 80ea7af17269 ("x86/mm: Introduce get_page_from_gfn()")
    Fixes: 50fe6e737059 ("pvh dom0: add and remove foreign pages")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: a8325f981ce4ff8ac8bcc73735f357846b0a0fbb
    master date: 2025-03-31 09:21:12 +0200
---
 xen/arch/x86/mm/p2m.c | 68 +++++++++++++++++++++++++++++----------------------
 1 file changed, 39 insertions(+), 29 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 4d5a41898a..ae37e1ec78 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -321,12 +321,46 @@ void p2m_put_gfn(struct p2m_domain *p2m, gfn_t gfn)
     gfn_unlock(p2m, gfn_x(gfn), 0);
 }
 
+static struct page_info *get_page_from_mfn_and_type(
+    const struct domain *d, mfn_t mfn, p2m_type_t t)
+{
+    struct page_info *page;
+
+    if ( !mfn_valid(mfn) )
+        return NULL;
+
+    page = mfn_to_page(mfn);
+
+    if ( p2m_is_ram(t) )
+    {
+        if ( p2m_is_shared(t) )
+            d = dom_cow;
+
+        if ( get_page(page, d) )
+            return page;
+    }
+    else if ( unlikely(p2m_is_foreign(t)) )
+    {
+        const struct domain *fdom = page_get_owner_and_reference(page);
+
+        if ( fdom )
+        {
+            if ( likely(fdom != d) )
+                return page;
+            ASSERT_UNREACHABLE();
+            put_page(page);
+        }
+    }
+
+    return NULL;
+}
+
 /* Atomically look up a GFN and take a reference count on the backing page. */
 struct page_info *p2m_get_page_from_gfn(
     struct p2m_domain *p2m, gfn_t gfn,
     p2m_type_t *t, p2m_access_t *a, p2m_query_t q)
 {
-    struct page_info *page = NULL;
+    struct page_info *page;
     p2m_access_t _a;
     p2m_type_t _t;
     mfn_t mfn;
@@ -340,26 +374,9 @@ struct page_info *p2m_get_page_from_gfn(
         /* Fast path: look up and get out */
         p2m_read_lock(p2m);
         mfn = p2m_get_gfn_type_access(p2m, gfn, t, a, 0, NULL, 0);
-        if ( p2m_is_any_ram(*t) && mfn_valid(mfn)
-             && !((q & P2M_UNSHARE) && p2m_is_shared(*t)) )
-        {
-            page = mfn_to_page(mfn);
-            if ( unlikely(p2m_is_foreign(*t)) )
-            {
-                struct domain *fdom = page_get_owner_and_reference(page);
-
-                ASSERT(fdom != p2m->domain);
-                if ( fdom == NULL )
-                    page = NULL;
-            }
-            else
-            {
-                struct domain *d = !p2m_is_shared(*t) ? p2m->domain : dom_cow;
-
-                if ( !get_page(page, d) )
-                    page = NULL;
-            }
-        }
+        page = !(q & P2M_UNSHARE) || !p2m_is_shared(*t)
+               ? get_page_from_mfn_and_type(p2m->domain, mfn, *t)
+               : NULL;
         p2m_read_unlock(p2m);
 
         if ( page )
@@ -373,14 +390,7 @@ struct page_info *p2m_get_page_from_gfn(
 
     /* Slow path: take the write lock and do fixups */
     mfn = get_gfn_type_access(p2m, gfn_x(gfn), t, a, q, NULL);
-    if ( p2m_is_ram(*t) && mfn_valid(mfn) )
-    {
-        struct domain *d = !p2m_is_shared(*t) ? p2m->domain : dom_cow;
-
-        page = mfn_to_page(mfn);
-        if ( !get_page(page, d) )
-            page = NULL;
-    }
+    page = get_page_from_mfn_and_type(p2m->domain, mfn, *t);
     put_gfn(p2m->domain, gfn_x(gfn));
 
     return page;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 13:11:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 13:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935697.1337101 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzxrz-0004DG-8Y; Wed, 02 Apr 2025 13:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935697.1337101; Wed, 02 Apr 2025 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 1tzxrz-0004D8-5x; Wed, 02 Apr 2025 13:11:03 +0000
Received: by outflank-mailman (input) for mailman id 935697;
 Wed, 02 Apr 2025 13: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 1tzxrx-0004Cw-QB
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 13: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 1tzxrx-007WB3-1x
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 13:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzxrx-0042dV-1n
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 13: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=rQjIc69DVFZOgIfQizxsTnagmEOPOMMVRiWMOlkME+A=; b=yxYYFUaEH3Q5QHT6MJP0/XxQkY
	xYM/aA2E7H3yXRjQk79VWiDWejt/oqH7hhpqI1pfZw0zsD4ESSWVPbfuP9DsUCYvth9AsFTHnFkMP
	35mTtwJb+qjOH33DOTH0MKUgAnzmS5oyIpOiPqLp9byEni1AqbLOqbASDO+IRnvjBGr4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/lzo: Remove more remanants of TMEM
Message-Id: <E1tzxrx-0042dV-1n@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 13:11:01 +0000

commit 6b72381e9d98f2a9d59a9af0dc71470067905a1e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 28 10:04:31 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 2 13:16:27 2025 +0100

    xen/lzo: Remove more remanants of TMEM
    
    This logic was inserted by commit 447f613c5404 ("lzo: update LZO compression
    to current upstream version") but was only relevant for the TMEM logic, so
    should have been deleted in commit c492e19fdd05 ("xen: remove tmem from
    hypervisor")
    
    Fixes: c492e19fdd05 ("xen: remove tmem from hypervisor")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/lzo.c | 21 ---------------------
 1 file changed, 21 deletions(-)

diff --git a/xen/common/lzo.c b/xen/common/lzo.c
index 3454ce4a7e..07b4017812 100644
--- a/xen/common/lzo.c
+++ b/xen/common/lzo.c
@@ -28,27 +28,6 @@
 #define COPY4(dst, src) memcpy(dst, src, 4)
 #define COPY8(dst, src) memcpy(dst, src, 8)
 
-#ifdef __MINIOS__
-# include <lib.h>
-# if __BYTE_ORDER == __LITTLE_ENDIAN
-#  undef __BIG_ENDIAN
-# endif
-# if __BYTE_ORDER == __BIG_ENDIAN
-#  undef __LITTLE_ENDIAN
-# endif
-#endif
-
-#if defined(__BIG_ENDIAN) && defined(__LITTLE_ENDIAN)
-#error "conflicting endian definitions"
-#elif defined(__x86_64__)
-#define LZO_USE_CTZ64    1
-#define LZO_USE_CTZ32    1
-#elif defined(__i386__) || defined(__powerpc__)
-#define LZO_USE_CTZ32    1
-#elif defined(__arm__) && (__LINUX_ARM_ARCH__ >= 5)
-#define LZO_USE_CTZ32    1
-#endif
-
 #define M1_MAX_OFFSET 0x0400
 #define M2_MAX_OFFSET 0x0800
 #define M3_MAX_OFFSET 0x4000
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 13:11:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 13:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935698.1337104 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzxs9-0004F9-9u; Wed, 02 Apr 2025 13:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935698.1337104; Wed, 02 Apr 2025 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 1tzxs9-0004F1-7N; Wed, 02 Apr 2025 13:11:13 +0000
Received: by outflank-mailman (input) for mailman id 935698;
 Wed, 02 Apr 2025 13: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 1tzxs7-0004Ek-NY
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 13: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 1tzxs7-007WBI-2G
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 13:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzxs7-0042gA-29
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 13: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=ud33NLYTtXJ2o6WAm2ALvSQUxNh84kPCmMuFcUWAT/M=; b=5s4bzw2s4TSD8OoiDiwjBmQu6e
	CBZWJ3ZRfMovG1Mk6j8Cr4O1flUVPETMzeSF0twYIUM2/tidR+9h96fSv2eKVQdfdnDzwYuHBt0iz
	NcLmiBGzFZaJdoBzw92T+NgWwYjBwHzMPGjzW/LNMY8nHDuepdVAqblFajFr9qRHgY4w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/vmx: Use asm goto() in _vmx_cpu_up()
Message-Id: <E1tzxs7-0042gA-29@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 13:11:11 +0000

commit 350d63eff60860de4b9c72926ca6126701aaf03c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 1 23:56:46 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 2 13:16:27 2025 +0100

    x86/vmx: Use asm goto() in _vmx_cpu_up()
    
    With the new toolchain baseline, we can make use of asm goto() in certain
    places, and the VMXON invocation is one example.
    
    This removes the logic to set up rc (including a fixup section where bactraces
    have no connection to the invoking function), the logic to decode it,
    including the default case which was dead but not visibly-so to the compiler.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/vmx/vmcs.c            | 51 ++++++++++++++++++----------------
 xen/arch/x86/include/asm/hvm/vmx/vmx.h | 19 -------------
 2 files changed, 27 insertions(+), 43 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 0ba65becec..1d427100ce 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -749,30 +749,15 @@ static int _vmx_cpu_up(bool bsp)
     if ( bsp && (rc = vmx_cpu_up_prepare(cpu)) != 0 )
         return rc;
 
-    switch ( __vmxon(this_cpu(vmxon_region)) )
-    {
-    case -2: /* #UD or #GP */
-        if ( bios_locked &&
-             test_bit(X86_FEATURE_SMX, &boot_cpu_data.x86_capability) &&
-             (!(eax & IA32_FEATURE_CONTROL_ENABLE_VMXON_OUTSIDE_SMX) ||
-              !(eax & IA32_FEATURE_CONTROL_ENABLE_VMXON_INSIDE_SMX)) )
-        {
-            printk("CPU%d: VMXON failed: perhaps because of TXT settings "
-                   "in your BIOS configuration?\n", cpu);
-            printk(" --> Disable TXT in your BIOS unless using a secure "
-                   "bootloader.\n");
-            return -EINVAL;
-        }
-        /* fall through */
-    case -1: /* CF==1 or ZF==1 */
-        printk("CPU%d: unexpected VMXON failure\n", cpu);
-        return -EINVAL;
-    case 0: /* success */
-        this_cpu(vmxon) = 1;
-        break;
-    default:
-        BUG();
-    }
+    asm goto ( "1: vmxon %[addr]\n\t"
+               "   jbe %l[vmxon_fail]\n\t"
+               _ASM_EXTABLE(1b, %l[vmxon_fault])
+               :
+               : [addr] "m" (this_cpu(vmxon_region))
+               : "memory"
+               : vmxon_fail, vmxon_fault );
+
+    this_cpu(vmxon) = 1;
 
     hvm_asid_init(cpu_has_vmx_vpid ? (1u << VMCS_VPID_WIDTH) : 0);
 
@@ -785,6 +770,24 @@ static int _vmx_cpu_up(bool bsp)
     vmx_pi_per_cpu_init(cpu);
 
     return 0;
+
+ vmxon_fault:
+    if ( bios_locked &&
+         test_bit(X86_FEATURE_SMX, &boot_cpu_data.x86_capability) &&
+         (!(eax & IA32_FEATURE_CONTROL_ENABLE_VMXON_OUTSIDE_SMX) ||
+          !(eax & IA32_FEATURE_CONTROL_ENABLE_VMXON_INSIDE_SMX)) )
+    {
+        printk(XENLOG_ERR
+               "CPU%d: VMXON failed: perhaps because of TXT settings in your BIOS configuration?\n",
+               cpu);
+        printk(XENLOG_ERR
+               " --> Disable TXT in your BIOS unless using a secure bootloader.\n");
+        return -EINVAL;
+    }
+
+ vmxon_fail:
+    printk(XENLOG_ERR "CPU%d: unexpected VMXON failure\n", cpu);
+    return -EINVAL;
 }
 
 int cf_check vmx_cpu_up(void)
diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmx.h b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
index 843f8591b9..7c6ba73407 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
@@ -559,25 +559,6 @@ static inline void __vmxoff(void)
         : : : "memory" );
 }
 
-static inline int __vmxon(u64 addr)
-{
-    int rc;
-
-    asm volatile ( 
-        "1: " VMXON_OPCODE MODRM_EAX_06 "\n"
-        "   setna %b0 ; neg %0\n" /* CF==1 or ZF==1 --> rc = -1 */
-        "2:\n"
-        ".section .fixup,\"ax\"\n"
-        "3: sub $2,%0 ; jmp 2b\n"    /* #UD or #GP --> rc = -2 */
-        ".previous\n"
-        _ASM_EXTABLE(1b, 3b)
-        : "=q" (rc)
-        : "0" (0), "a" (&addr)
-        : "memory");
-
-    return rc;
-}
-
 int cf_check vmx_guest_x86_mode(struct vcpu *v);
 unsigned int vmx_get_cpl(void);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 13:11:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 13:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935699.1337110 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzxsJ-0004Hp-Bj; Wed, 02 Apr 2025 13:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935699.1337110; Wed, 02 Apr 2025 13: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 1tzxsJ-0004Hf-8k; Wed, 02 Apr 2025 13:11:23 +0000
Received: by outflank-mailman (input) for mailman id 935699;
 Wed, 02 Apr 2025 13:11:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1tzxsH-0004HS-QR
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 13:11:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzxsH-007WBf-2X
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 13:11:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzxsH-0042gx-2Q
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 13: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=hmDJnQFmg22UIyOXUVsNHx+hmG5Is8FQOo9O4dEuB0o=; b=ENIsUS2y9ERQZOukirnouYEvT9
	Oq/Ce18cLzZJjivaHkvo8F06wJGsgnxkoJXBdcd7IJihC/HG1gE3Clu0enMgqxfTvTS4Ek02lnzwj
	zuC7jiAOEi2cfaGRKbzC/KLzePIIwWCZhzCLTftGLGQJ3rheanKws6Fa2S1GWuilXZ5Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/asm: remove HAVE_AS_CLAC_STAC
Message-Id: <E1tzxsH-0042gx-2Q@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 13:11:21 +0000

commit a48be48f0c576e8ea3b94ab4273ad3dc8d329728
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Tue Apr 1 22:21:38 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 2 13:16:27 2025 +0100

    x86/asm: remove HAVE_AS_CLAC_STAC
    
    The new toolchain baseline knows the STAC/CLAC instructions,
    no need to carry the workaround in the code.
    
    Resolves: https://gitlab.com/xen-project/xen/-/work_items/203
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/arch.mk                 |  1 -
 xen/arch/x86/include/asm/asm-defns.h | 10 ----------
 2 files changed, 11 deletions(-)

diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk
index cb47d72991..258e459bec 100644
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -17,7 +17,6 @@ $(call as-option-add,CFLAGS,CC,"rdrand %eax",-DHAVE_AS_RDRAND)
 $(call as-option-add,CFLAGS,CC,"rdfsbase %rax",-DHAVE_AS_FSGSBASE)
 $(call as-option-add,CFLAGS,CC,"xsaveopt (%rax)",-DHAVE_AS_XSAVEOPT)
 $(call as-option-add,CFLAGS,CC,"rdseed %eax",-DHAVE_AS_RDSEED)
-$(call as-option-add,CFLAGS,CC,"clac",-DHAVE_AS_CLAC_STAC)
 $(call as-option-add,CFLAGS,CC,"clwb (%rax)",-DHAVE_AS_CLWB)
 $(call as-option-add,CFLAGS,CC,".equ \"x\"$(comma)1",-DHAVE_AS_QUOTED_SYM)
 $(call as-option-add,CFLAGS,CC,"invpcid (%rax)$(comma)%rax",-DHAVE_AS_INVPCID)
diff --git a/xen/arch/x86/include/asm/asm-defns.h b/xen/arch/x86/include/asm/asm-defns.h
index 32d6b44910..ab653f3218 100644
--- a/xen/arch/x86/include/asm/asm-defns.h
+++ b/xen/arch/x86/include/asm/asm-defns.h
@@ -1,15 +1,5 @@
 #include <asm/page-bits.h>
 
-#ifndef HAVE_AS_CLAC_STAC
-.macro clac
-    .byte 0x0f, 0x01, 0xca
-.endm
-
-.macro stac
-    .byte 0x0f, 0x01, 0xcb
-.endm
-#endif
-
 .macro vmrun
     .byte 0x0f, 0x01, 0xd8
 .endm
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 14:33:11 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 14:33:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935875.1337232 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzz9L-00052P-MC; Wed, 02 Apr 2025 14:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935875.1337232; Wed, 02 Apr 2025 14: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 1tzz9L-00052I-Jc; Wed, 02 Apr 2025 14:33:03 +0000
Received: by outflank-mailman (input) for mailman id 935875;
 Wed, 02 Apr 2025 14: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 1tzz9K-00050f-Dj
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 14: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 1tzz9K-007YKE-0P
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 14:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzz9K-004DOM-0H
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 14: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=OLZ/1xpptPVpIBnMHI/JPvQ4TLhambxJ/nQkQ1qmXOs=; b=gSYUoqLFmldnDruI/5ToQ5Lj3I
	CnVBZISeZn/RwbmpXQbd+TU22lfHSKdDWwfuknV5yTClRIMv0wFbK6KbXzSMz5/SMe+Rvz0MhYreg
	DyCKvRB1uxVDV2732c3ECipasjpx3o/06b1J+jLyT5G8RHz8VC1+vqgxK/n1brN/3CiA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] tools/ocaml: Fix oxenstored build warning
Message-Id: <E1tzz9K-004DOM-0H@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 14:33:02 +0000

commit ad063b08b114715331615c966951ae544b7fc1f4
Author:     Andrii Sultanov <andrii.sultanov@cloud.com>
AuthorDate: Wed Apr 2 14:20:54 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 2 14:20:54 2025 +0200

    tools/ocaml: Fix oxenstored build warning
    
    OCaml, in preparation for a renaming of the error string associated with
    conversion failure in 'int_of_string' functions, started to issue this
    warning:
    
      File "process.ml", line 440, characters 13-28:
      440 |   | (Failure "int_of_string")    -> reply_error "EINVAL"
                         ^^^^^^^^^^^^^^^
      Warning 52 [fragile-literal-pattern]: Code should not depend on the actual values of
      this constructor's arguments. They are only for information
      and may change in future versions. (See manual section 11.5)
    
    Deal with this at the source, and instead create our own stable
    ConversionFailure exception that's raised on the None case in
    'int_of_string_opt'.
    
    'c_int_of_string' is safe and does not raise such exceptions.
    
    Signed-off-by: Andrii Sultanov <andrii.sultanov@cloud.com>
    Acked-by: Christian Lindig <christian.lindig@cloud.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: c11772277fe5f1b0874141a24554c2e3da2d9a6e
    master date: 2025-02-25 13:30:55 +0000
---
 tools/ocaml/xenstored/Makefile     |  1 +
 tools/ocaml/xenstored/perms.ml     |  2 +-
 tools/ocaml/xenstored/poll.ml      |  2 +-
 tools/ocaml/xenstored/process.ml   | 18 +++++++++---------
 tools/ocaml/xenstored/utils.ml     | 10 ++++++++--
 tools/ocaml/xenstored/xenstored.ml | 16 ++++++++--------
 6 files changed, 28 insertions(+), 21 deletions(-)

diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index 5e8210a906..c333394a34 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -54,6 +54,7 @@ OBJS = paths \
 	history \
 	parse_arg \
 	process \
+	poll \
 	xenstored
 
 INTF = symbol.cmi trie.cmi syslog.cmi systemd.cmi poll.cmi
diff --git a/tools/ocaml/xenstored/perms.ml b/tools/ocaml/xenstored/perms.ml
index 14f8e334fe..2c4ee9e617 100644
--- a/tools/ocaml/xenstored/perms.ml
+++ b/tools/ocaml/xenstored/perms.ml
@@ -70,7 +70,7 @@ struct
 
   let perm_of_string s =
     let ty = permty_of_char s.[0]
-    and id = int_of_string (String.sub s 1 (String.length s - 1)) in
+    and id = Utils.int_of_string_exn (String.sub s 1 (String.length s - 1)) in
     (id, ty)
 
   let of_strings ls =
diff --git a/tools/ocaml/xenstored/poll.ml b/tools/ocaml/xenstored/poll.ml
index fefaa6e74c..f8571e4590 100644
--- a/tools/ocaml/xenstored/poll.ml
+++ b/tools/ocaml/xenstored/poll.ml
@@ -30,7 +30,7 @@ external set_fd_limit: int -> unit = "stub_set_fd_limit"
 let get_sys_fs_nr_open () =
   try
     let ch = open_in "/proc/sys/fs/nr_open" in
-    let v = int_of_string (input_line ch) in
+    let v = Utils.int_of_string_exn (input_line ch) in
     close_in_noerr ch; v
   with _ -> 1024 * 1024
 
diff --git a/tools/ocaml/xenstored/process.ml b/tools/ocaml/xenstored/process.ml
index 432d66321c..0c9c460a99 100644
--- a/tools/ocaml/xenstored/process.ml
+++ b/tools/ocaml/xenstored/process.ml
@@ -229,7 +229,7 @@ let do_debug con t _domains cons data =
       Logging.xb_op ~tid:0 ~ty:Xenbus.Xb.Op.Debug ~con:"=======>" msg;
       None
     | "quota" :: domid :: _ ->
-      let domid = int_of_string domid in
+      let domid = Utils.int_of_string_exn domid in
       let quota = (Store.get_quota t.Transaction.store) in
       Some (Quota.to_string quota domid ^ "\000")
     | "watches" :: _ ->
@@ -242,7 +242,7 @@ let do_debug con t _domains cons data =
       History.trim ();
       Some "trimmed"
     | "txn" :: domid :: _ ->
-      let domid = int_of_string domid in
+      let domid = Utils.int_of_string_exn domid in
       let con = Connections.find_domain cons domid in
       let b = Buffer.create 128 in
       let () = con.transactions |> Hashtbl.iter @@ fun id tx ->
@@ -253,7 +253,7 @@ let do_debug con t _domains cons data =
       in
       Some (Buffer.contents b)
     | "xenbus" :: domid :: _ ->
-      let domid = int_of_string domid in
+      let domid = Utils.int_of_string_exn domid in
       let con = Connections.find_domain cons domid in
       let s = Printf.sprintf "xenbus: %s; overflow queue length: %d, can_input: %b, has_more_input: %b, has_old_output: %b, has_new_output: %b, has_more_work: %b. pending: %s"
           (Xenbus.Xb.debug con.xb)
@@ -267,7 +267,7 @@ let do_debug con t _domains cons data =
       in
       Some s
     | "mfn" :: domid :: _ ->
-      let domid = int_of_string domid in
+      let domid = Utils.int_of_string_exn domid in
       let con = Connections.find_domain cons domid in
       may (fun dom -> Printf.sprintf "%nd\000" (Domain.get_mfn dom)) (Connection.get_domain con)
     | _ -> None
@@ -340,7 +340,7 @@ let do_isintroduced con _t domains _cons data =
   then raise Define.Permission_denied;
   let domid =
     match (split None '\000' data) with
-    | domid :: _ -> int_of_string domid
+    | domid :: _ -> Utils.int_of_string_exn domid
     | _          -> raise Invalid_Cmd_Args
   in
   if domid = Define.domid_self || Domains.exist domains domid then "T\000" else "F\000"
@@ -437,7 +437,7 @@ let input_handle_error ~cons ~doms ~fct ~con ~t ~req =
   | Quota.Limit_reached          -> reply_error "EQUOTA"
   | Quota.Data_too_big           -> reply_error "E2BIG"
   | Quota.Transaction_opened     -> reply_error "EQUOTA"
-  | (Failure "int_of_string")    -> reply_error "EINVAL"
+  | Utils.ConversionFailed s     -> reply_error "EINVAL"
   | Define.Unknown_operation     -> reply_error "ENOSYS"
 
 let write_access_log ~ty ~tid ~con ~data =
@@ -578,7 +578,7 @@ let do_introduce con t domains cons data =
   let (domid, mfn, remote_port) =
     match (split None '\000' data) with
     | domid :: mfn :: remote_port :: _ ->
-      int_of_string domid, Nativeint.of_string mfn, int_of_string remote_port
+      Utils.int_of_string_exn domid, Nativeint.of_string mfn, Utils.int_of_string_exn remote_port
     | _                         -> raise Invalid_Cmd_Args;
   in
   let dom =
@@ -604,7 +604,7 @@ let do_release con t domains cons data =
   then raise Define.Permission_denied;
   let domid =
     match (split None '\000' data) with
-    | [domid;""] -> int_of_string domid
+    | [domid;""] -> Utils.int_of_string_exn domid
     | _          -> raise Invalid_Cmd_Args
   in
   let fire_spec_watches = Domains.exist domains domid in
@@ -620,7 +620,7 @@ let do_resume con _t domains _cons data =
   then raise Define.Permission_denied;
   let domid =
     match (split None '\000' data) with
-    | domid :: _ -> int_of_string domid
+    | domid :: _ -> Utils.int_of_string_exn domid
     | _          -> raise Invalid_Cmd_Args
   in
   if Domains.exist domains domid
diff --git a/tools/ocaml/xenstored/utils.ml b/tools/ocaml/xenstored/utils.ml
index 48d84ef7d3..7a556bce75 100644
--- a/tools/ocaml/xenstored/utils.ml
+++ b/tools/ocaml/xenstored/utils.ml
@@ -53,8 +53,14 @@ let hexify s =
     ) s;
   Bytes.unsafe_to_string hs
 
+exception ConversionFailed of string
+let int_of_string_exn s =
+  match int_of_string_opt s with
+  | Some x -> x
+  | None -> raise (ConversionFailed s)
+
 let unhexify hs =
-  let char_of_hexseq seq0 seq1 = Char.chr (int_of_string (sprintf "0x%c%c" seq0 seq1)) in
+  let char_of_hexseq seq0 seq1 = Char.chr (int_of_string_exn (sprintf "0x%c%c" seq0 seq1)) in
   let b = Bytes.create (String.length hs / 2) in
   for i = 0 to Bytes.length b - 1
   do
@@ -86,7 +92,7 @@ let read_file_single_integer filename =
   let buf = Bytes.make 20 '\000' in
   let sz = Unix.read fd buf 0 20 in
   Unix.close fd;
-  int_of_string (Bytes.sub_string buf 0 sz)
+  int_of_string_exn (Bytes.sub_string buf 0 sz)
 
 (* @path may be guest data and needs its length validating.  @connection_path
  * is generated locally in xenstored and always of the form "/local/domain/$N/" *)
diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml
index 1aaa3e995e..84dee622ea 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -167,20 +167,20 @@ module DB = struct
                					   e.g. a RO socket from a previous version: ignore it *)
             global_f ~rw
           | "evtchn-dev" :: fd :: domexc_port :: [] ->
-            evtchn_f ~fd:(int_of_string fd)
-              ~domexc_port:(int_of_string domexc_port)
+            evtchn_f ~fd:(Utils.int_of_string_exn fd)
+              ~domexc_port:(Utils.int_of_string_exn domexc_port)
           | "socket" :: fd :: [] ->
-            socket_f ~fd:(int_of_string fd)
+            socket_f ~fd:(Utils.int_of_string_exn fd)
           | "dom" :: domid :: mfn :: remote_port :: rest ->
             let local_port = match rest with
               | [] -> None (* backward compat: old version didn't have it *)
-              | local_port :: _ -> Some (int_of_string local_port) in
+              | local_port :: _ -> Some (Utils.int_of_string_exn local_port) in
             domain_f ?local_port
-              ~remote_port:(int_of_string remote_port)
-              (int_of_string domid)
+              ~remote_port:(Utils.int_of_string_exn remote_port)
+              (Utils.int_of_string_exn domid)
               (Nativeint.of_string mfn)
           | "watch" :: domid :: path :: token :: [] ->
-            watch_f (int_of_string domid)
+            watch_f (Utils.int_of_string_exn domid)
               (unhexify path) (unhexify token)
           | "store" :: path :: perms :: value :: [] ->
             store_f (getpath path)
@@ -214,7 +214,7 @@ module DB = struct
     in
     let global_f ~rw =
       let get_listen_sock sockfd =
-        let fd = sockfd |> int_of_string |> Utils.FD.of_int in
+        let fd = sockfd |> Utils.int_of_string_exn |> Utils.FD.of_int in
         Unix.listen fd 1;
         Some fd
       in
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 14:33:12 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 14:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935876.1337237 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzz9U-000542-Ny; Wed, 02 Apr 2025 14:33:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935876.1337237; Wed, 02 Apr 2025 14: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 1tzz9U-00053t-L6; Wed, 02 Apr 2025 14:33:12 +0000
Received: by outflank-mailman (input) for mailman id 935876;
 Wed, 02 Apr 2025 14: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 1tzz9U-00053n-8Q
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 14: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 1tzz9U-007YKO-0i
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 14:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzz9U-004DT6-0b
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 14: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=3X6mBWHlylolk9KqNicPC4fbH6l3PX3XLTgGGh32uBw=; b=l5/UnznZyU71QU3ChqH32vdzGe
	0PKq91hHJbeNh6AFYXdVcsAtPoMwWxKHaaUEkly0O1GkRw1e433nqBnlMlf0wHVb9UFRMWJY2MdfF
	8q9PDvG8q/akM69+D4b0O7K4CrY4NNVcoShn3BOPPKombSHcob7CUzvX8rl8MBeZECOk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] ARM/vgic: Fix out-of-bounds accesses in vgic_mmio_write_sgir()
Message-Id: <E1tzz9U-004DT6-0b@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 14:33:12 +0000

commit 64f9c54daa5b727291db49c87fa70964f268e85d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Apr 2 14:22:10 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 2 14:22:10 2025 +0200

    ARM/vgic: Fix out-of-bounds accesses in vgic_mmio_write_sgir()
    
    The switch() statement is over bits 24:25 (unshifted) of the guest provided
    value.  This makes case 0x3: dead, and not an implementation of the 4th
    possible state.
    
    A guest which writes (0x3 << 24) | (0xff << 16) to this register will skip the
    early exit, then enter bitmap_for_each() with targets not bound by nr_vcpus.
    
    If the guest has fewer than 8 vCPUs, bitmap_for_each() will read off the end
    of d->vcpu[] and use the resulting vcpu pointer to ultimately derive irq, and
    perform out-of-bounds writes.
    
    Fix this by changing case 0x3 to default.
    
    Fixes: 08c688ca6422 ("ARM: new VGIC: Add SGIR register handler")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    master commit: be7f0cc651d8d02a95820792204c0558f1f29e03
    master date: 2025-03-27 11:54:23 +0000
---
 xen/arch/arm/vgic/vgic-mmio-v2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/vgic/vgic-mmio-v2.c b/xen/arch/arm/vgic/vgic-mmio-v2.c
index 670b335db2..7d1391ac9b 100644
--- a/xen/arch/arm/vgic/vgic-mmio-v2.c
+++ b/xen/arch/arm/vgic/vgic-mmio-v2.c
@@ -104,7 +104,8 @@ static void vgic_mmio_write_sgir(struct vcpu *source_vcpu,
     case GICD_SGI_TARGET_SELF:                    /* this very vCPU only */
         targets = (1U << source_vcpu->vcpu_id);
         break;
-    case 0x3:                                     /* reserved */
+
+    default:
         return;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 14:33:22 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 14:33:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935877.1337241 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzz9e-00056y-P9; Wed, 02 Apr 2025 14:33:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935877.1337241; Wed, 02 Apr 2025 14: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 1tzz9e-00056m-MX; Wed, 02 Apr 2025 14:33:22 +0000
Received: by outflank-mailman (input) for mailman id 935877;
 Wed, 02 Apr 2025 14: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 1tzz9e-00056f-Bh
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 14: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 1tzz9e-007YKk-14
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 14:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzz9e-004DWR-0u
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 14: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=Qpv/+1csWVqFQ3eUMXagFTxA6Y7FH0cNXr0itKfL67Q=; b=B2cGllhnAm7YDPo2x4zLlxdOGQ
	OI+QIUikcXzQjRpnQdnOqEhOIBPQ8s9V5SzfdlJsJ5FDO/TfjGKCrBo0O37txZQaYR69dooYSbkBw
	HE2Nkjq0PrCiCfAO43pkjouNphA15MEJHYvDYDb5pwK59nlNPwuV9rqzArN3drd0MEmo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/P2M: synchronize fast and slow paths of p2m_get_page_from_gfn()
Message-Id: <E1tzz9e-004DWR-0u@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 14:33:22 +0000

commit b1bbf20a9329d7540a3d2d3fd900919aae5cbe72
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Apr 2 14:22:27 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 2 14:22:27 2025 +0200

    x86/P2M: synchronize fast and slow paths of p2m_get_page_from_gfn()
    
    Handling of both grants and foreign pages was different between the two
    paths.
    
    While permitting access to grants would be desirable, doing so would
    require more involved handling; undo that for the time being. In
    particular the page reference obtained would prevent the owning domain
    from changing e.g. the page's type (after the grantee has released the
    last reference of the grant). Instead perhaps another reference on the
    grant would need obtaining. Which in turn would require determining
    which grant that was.
    
    Foreign pages in any event need permitting on both paths.
    
    Introduce a helper function to be used on both paths, such that
    respective checking differs in just the extra "to be unshared" condition
    on the fast path.
    
    While there adjust the sanity check for foreign pages: Don't leak the
    reference on release builds when on a debug build the assertion would
    have triggered. (Thanks to Roger for the suggestion.)
    
    Fixes: 80ea7af17269 ("x86/mm: Introduce get_page_from_gfn()")
    Fixes: 50fe6e737059 ("pvh dom0: add and remove foreign pages")
    Fixes: cbbca7be4aaa ("x86/p2m: make p2m_get_page_from_gfn() handle grant case correctly")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: a8325f981ce4ff8ac8bcc73735f357846b0a0fbb
    master date: 2025-03-31 09:21:12 +0200
---
 xen/arch/x86/mm/p2m.c | 68 +++++++++++++++++++++++++++++----------------------
 1 file changed, 39 insertions(+), 29 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 1739133fc2..41fc108bba 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -328,12 +328,46 @@ void p2m_put_gfn(struct p2m_domain *p2m, gfn_t gfn)
     gfn_unlock(p2m, gfn_x(gfn), 0);
 }
 
+static struct page_info *get_page_from_mfn_and_type(
+    const struct domain *d, mfn_t mfn, p2m_type_t t)
+{
+    struct page_info *page;
+
+    if ( !mfn_valid(mfn) )
+        return NULL;
+
+    page = mfn_to_page(mfn);
+
+    if ( p2m_is_ram(t) )
+    {
+        if ( p2m_is_shared(t) )
+            d = dom_cow;
+
+        if ( get_page(page, d) )
+            return page;
+    }
+    else if ( unlikely(p2m_is_foreign(t)) )
+    {
+        const struct domain *fdom = page_get_owner_and_reference(page);
+
+        if ( fdom )
+        {
+            if ( likely(fdom != d) )
+                return page;
+            ASSERT_UNREACHABLE();
+            put_page(page);
+        }
+    }
+
+    return NULL;
+}
+
 /* Atomically look up a GFN and take a reference count on the backing page. */
 struct page_info *p2m_get_page_from_gfn(
     struct p2m_domain *p2m, gfn_t gfn,
     p2m_type_t *t, p2m_access_t *a, p2m_query_t q)
 {
-    struct page_info *page = NULL;
+    struct page_info *page;
     p2m_access_t _a;
     p2m_type_t _t;
     mfn_t mfn;
@@ -347,26 +381,9 @@ struct page_info *p2m_get_page_from_gfn(
         /* Fast path: look up and get out */
         p2m_read_lock(p2m);
         mfn = p2m_get_gfn_type_access(p2m, gfn, t, a, 0, NULL, 0);
-        if ( p2m_is_any_ram(*t) && mfn_valid(mfn)
-             && !((q & P2M_UNSHARE) && p2m_is_shared(*t)) )
-        {
-            page = mfn_to_page(mfn);
-            if ( unlikely(p2m_is_foreign(*t)) || unlikely(p2m_is_grant(*t)) )
-            {
-                struct domain *fdom = page_get_owner_and_reference(page);
-
-                ASSERT(!p2m_is_foreign(*t) || fdom != p2m->domain);
-                if ( fdom == NULL )
-                    page = NULL;
-            }
-            else
-            {
-                struct domain *d = !p2m_is_shared(*t) ? p2m->domain : dom_cow;
-
-                if ( !get_page(page, d) )
-                    page = NULL;
-            }
-        }
+        page = !(q & P2M_UNSHARE) || !p2m_is_shared(*t)
+               ? get_page_from_mfn_and_type(p2m->domain, mfn, *t)
+               : NULL;
         p2m_read_unlock(p2m);
 
         if ( page )
@@ -380,14 +397,7 @@ struct page_info *p2m_get_page_from_gfn(
 
     /* Slow path: take the write lock and do fixups */
     mfn = get_gfn_type_access(p2m, gfn_x(gfn), t, a, q, NULL);
-    if ( p2m_is_ram(*t) && mfn_valid(mfn) )
-    {
-        struct domain *d = !p2m_is_shared(*t) ? p2m->domain : dom_cow;
-
-        page = mfn_to_page(mfn);
-        if ( !get_page(page, d) )
-            page = NULL;
-    }
+    page = get_page_from_mfn_and_type(p2m->domain, mfn, *t);
     put_gfn(p2m->domain, gfn_x(gfn));
 
     return page;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 14:33:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 14:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935878.1337244 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzz9p-0005AC-Rx; Wed, 02 Apr 2025 14:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935878.1337244; Wed, 02 Apr 2025 14: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 1tzz9p-0005A4-PP; Wed, 02 Apr 2025 14:33:33 +0000
Received: by outflank-mailman (input) for mailman id 935878;
 Wed, 02 Apr 2025 14: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 1tzz9o-00059o-EW
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 14: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 1tzz9o-007YKr-1M
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 14:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzz9o-004DY1-1F
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 14: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=47CW0dEUjXEzN7xQ2JZCHbd6jhr/pYmbFMRRQCu9knQ=; b=rcVVk4SvSyRXZKacZoVzz2VXdt
	mKXkA5qIJj91vzWbidjfW/7YQ37dAKmYTZrGjkyuBtCJTChnj46F6F273e/1mj7me3n0MY3j0lLxx
	soedF70Ncu/keoqpSJPcUstDzw90J2yxHOVHwMZFJmZqC36sjx4KYizRj8SEv3SRdOr4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] xen/percpu: don't initialize percpu on resume
Message-Id: <E1tzz9o-004DY1-1F@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 14:33:32 +0000

commit 3ccbe66d30f09e2cd8d370d1ec163d90ad2b3ff4
Author:     Mykyta Poturai <mykyta_poturai@epam.com>
AuthorDate: Wed Apr 2 14:26:23 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 2 14:26:23 2025 +0200

    xen/percpu: don't initialize percpu on resume
    
    Invocation of the CPU_UP_PREPARE notification
    on ARM64 during resume causes a crash:
    
    (XEN) [  315.807606] Error bringing CPU1 up: -16
    (XEN) [  315.811926] Xen BUG at common/cpu.c:258
    [...]
    (XEN) [  316.142765] Xen call trace:
    (XEN) [  316.146048]    [<00000a0000202264>] enable_nonboot_cpus+0x128/0x1ac (PC)
    (XEN) [  316.153219]    [<00000a000020225c>] enable_nonboot_cpus+0x120/0x1ac (LR)
    (XEN) [  316.160391]    [<00000a0000278180>] suspend.c#system_suspend+0x4c/0x1a0
    (XEN) [  316.167476]    [<00000a0000206b70>] domain.c#continue_hypercall_tasklet_handler+0x54/0xd0
    (XEN) [  316.176117]    [<00000a0000226538>] tasklet.c#do_tasklet_work+0xb8/0x100
    (XEN) [  316.183288]    [<00000a0000226920>] do_tasklet+0x68/0xb0
    (XEN) [  316.189077]    [<00000a000026e120>] domain.c#idle_loop+0x7c/0x194
    (XEN) [  316.195644]    [<00000a0000277638>] shutdown.c#halt_this_cpu+0/0x14
    (XEN) [  316.202383]    [<0000000000000008>] 0000000000000008
    
    Freeing per-CPU areas and setting __per_cpu_offset to INVALID_PERCPU_AREA
    only occur when !park_offline_cpus and system_state is not SYS_STATE_suspend.
    On ARM64, park_offline_cpus is always false, so setting __per_cpu_offset to
    INVALID_PERCPU_AREA depends solely on the system state.
    
    If the system is suspended, this area is not freed, and during resume, an error
    occurs in init_percpu_area, causing a crash because INVALID_PERCPU_AREA is not
    set and park_offline_cpus remains 0:
    
        if ( __per_cpu_offset[cpu] != INVALID_PERCPU_AREA )
            return park_offline_cpus ? 0 : -EBUSY;
    
    The same crash can occur on x86 if park_offline_cpus is set
    to 0 during Xen resume.
    
    Fixes: f75780d26b2f ("xen: move per-cpu area management into common code")
    Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com>
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/percpu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/common/percpu.c b/xen/common/percpu.c
index e4e8b7bcab..c6ecd95a08 100644
--- a/xen/common/percpu.c
+++ b/xen/common/percpu.c
@@ -30,7 +30,9 @@ static int init_percpu_area(unsigned int cpu)
     char *p;
 
     if ( __per_cpu_offset[cpu] != INVALID_PERCPU_AREA )
-        return park_offline_cpus ? 0 : -EBUSY;
+        return park_offline_cpus || system_state == SYS_STATE_resume
+               ? 0
+               : -EBUSY;
 
     if ( (p = alloc_xenheap_pages(PERCPU_ORDER, 0)) == NULL )
         return -ENOMEM;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 15:11:09 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 15:11:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.935940.1337299 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1tzzk7-0000Jb-JI; Wed, 02 Apr 2025 15:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 935940.1337299; Wed, 02 Apr 2025 15: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 1tzzk7-0000JU-Gj; Wed, 02 Apr 2025 15:11:03 +0000
Received: by outflank-mailman (input) for mailman id 935940;
 Wed, 02 Apr 2025 15: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 1tzzk6-0000FN-OE
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 15: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 1tzzk5-007ZJq-1T
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 15:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1tzzk5-004IsN-1M
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 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=YbnRpgV6kPUS5k9hHi5cqKZSMYiwYywK+YysUp7TyGo=; b=QF06qD0Yoc3rvFIEoX2DDAnSOb
	3lFLTpsu1dA7pGdj8mXP/Xwgp33vLhlJXKzTSvynAUXpwbwSqJWTrPF33KaTG1QPohk4JmD9tVCxw
	o4zM5sb47f8EbtReAtGSr5GpQWecYZZ2N+ibbLl2iUW2WqR7gNRrqfxRSAHO3OGxP3Ts=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/svm: Drop wrappers of SVM instructions
Message-Id: <E1tzzk5-004IsN-1M@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 15:11:01 +0000

commit ae5fd39be98c6219a302045aec7c25bdafa81781
Author:     Alexander M. Merritt <alexander@edera.dev>
AuthorDate: Wed Apr 2 14:54:10 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 2 16:06:53 2025 +0100

    x86/svm: Drop wrappers of SVM instructions
    
    The new toolchain baseline knows the SVM instructions.
    
    Resolves: xen-project/xen#204
    
    Signed-off-by: "Alexander M. Merritt" <alexander@edera.dev>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/svm/svm.h           | 14 +++-----------
 xen/arch/x86/include/asm/asm-defns.h | 12 ------------
 2 files changed, 3 insertions(+), 23 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.h b/xen/arch/x86/hvm/svm/svm.h
index beeaaab4f7..f5b0312d2d 100644
--- a/xen/arch/x86/hvm/svm/svm.h
+++ b/xen/arch/x86/hvm/svm/svm.h
@@ -23,25 +23,17 @@ void __update_guest_eip(struct cpu_user_regs *regs, unsigned int inst_len);
 
 static inline void svm_vmload_pa(paddr_t vmcb)
 {
-    asm volatile (
-        ".byte 0x0f,0x01,0xda" /* vmload */
-        : : "a" (vmcb) : "memory" );
+    asm volatile ( "vmload" :: "a" (vmcb) : "memory" );
 }
 
 static inline void svm_vmsave_pa(paddr_t vmcb)
 {
-    asm volatile (
-        ".byte 0x0f,0x01,0xdb" /* vmsave */
-        : : "a" (vmcb) : "memory" );
+    asm volatile ( "vmsave" :: "a" (vmcb) : "memory" );
 }
 
 static inline void svm_invlpga(unsigned long linear, uint32_t asid)
 {
-    asm volatile (
-        ".byte 0x0f,0x01,0xdf"
-        : /* output */
-        : /* input */
-        "a" (linear), "c" (asid) );
+    asm volatile ( "invlpga" :: "a" (linear), "c" (asid) );
 }
 
 /*
diff --git a/xen/arch/x86/include/asm/asm-defns.h b/xen/arch/x86/include/asm/asm-defns.h
index ab653f3218..1b821db49c 100644
--- a/xen/arch/x86/include/asm/asm-defns.h
+++ b/xen/arch/x86/include/asm/asm-defns.h
@@ -1,17 +1,5 @@
 #include <asm/page-bits.h>
 
-.macro vmrun
-    .byte 0x0f, 0x01, 0xd8
-.endm
-
-.macro stgi
-    .byte 0x0f, 0x01, 0xdc
-.endm
-
-.macro clgi
-    .byte 0x0f, 0x01, 0xdd
-.endm
-
 /*
  * Call a noreturn function.  This could be JMP, but CALL results in a more
  * helpful backtrace.  BUG is to catch functions which do decide to return...
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 16:33:15 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 16:33:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936004.1337346 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u011c-0006AW-5C; Wed, 02 Apr 2025 16:33:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936004.1337346; Wed, 02 Apr 2025 16: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 1u011c-0006AO-2O; Wed, 02 Apr 2025 16:33:12 +0000
Received: by outflank-mailman (input) for mailman id 936004;
 Wed, 02 Apr 2025 16:33:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u011b-0006AI-Le
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 16:33:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u011b-007biC-21
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 16:33:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u011b-004S47-1s
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 16:33:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BJqyMDQdV5qTz8Se5SBSmEw11NmzF8zDvrXgvkuKkOM=; b=zGl0cYpCqttAiLUdIIQj1aOK3V
	K97jJY21quBpxWfzZ+9zIpJEDhysYPnSwyY2ngM8Mbz9AbjeAwkTOhkMuGvWOZQxxGS/pNG1MJlus
	EhObAEUGx2rF0Wvgh2h/m8rwvPb7ZslRvzFywP2x+FBYr1fBGD/vO9Dfa4CYbLcMnWr0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/vmx: Use asm goto() in _vmx_cpu_up()
Message-Id: <E1u011b-004S47-1s@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 16:33:11 +0000

commit 350d63eff60860de4b9c72926ca6126701aaf03c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 1 23:56:46 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 2 13:16:27 2025 +0100

    x86/vmx: Use asm goto() in _vmx_cpu_up()
    
    With the new toolchain baseline, we can make use of asm goto() in certain
    places, and the VMXON invocation is one example.
    
    This removes the logic to set up rc (including a fixup section where bactraces
    have no connection to the invoking function), the logic to decode it,
    including the default case which was dead but not visibly-so to the compiler.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/vmx/vmcs.c            | 51 ++++++++++++++++++----------------
 xen/arch/x86/include/asm/hvm/vmx/vmx.h | 19 -------------
 2 files changed, 27 insertions(+), 43 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 0ba65becec..1d427100ce 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -749,30 +749,15 @@ static int _vmx_cpu_up(bool bsp)
     if ( bsp && (rc = vmx_cpu_up_prepare(cpu)) != 0 )
         return rc;
 
-    switch ( __vmxon(this_cpu(vmxon_region)) )
-    {
-    case -2: /* #UD or #GP */
-        if ( bios_locked &&
-             test_bit(X86_FEATURE_SMX, &boot_cpu_data.x86_capability) &&
-             (!(eax & IA32_FEATURE_CONTROL_ENABLE_VMXON_OUTSIDE_SMX) ||
-              !(eax & IA32_FEATURE_CONTROL_ENABLE_VMXON_INSIDE_SMX)) )
-        {
-            printk("CPU%d: VMXON failed: perhaps because of TXT settings "
-                   "in your BIOS configuration?\n", cpu);
-            printk(" --> Disable TXT in your BIOS unless using a secure "
-                   "bootloader.\n");
-            return -EINVAL;
-        }
-        /* fall through */
-    case -1: /* CF==1 or ZF==1 */
-        printk("CPU%d: unexpected VMXON failure\n", cpu);
-        return -EINVAL;
-    case 0: /* success */
-        this_cpu(vmxon) = 1;
-        break;
-    default:
-        BUG();
-    }
+    asm goto ( "1: vmxon %[addr]\n\t"
+               "   jbe %l[vmxon_fail]\n\t"
+               _ASM_EXTABLE(1b, %l[vmxon_fault])
+               :
+               : [addr] "m" (this_cpu(vmxon_region))
+               : "memory"
+               : vmxon_fail, vmxon_fault );
+
+    this_cpu(vmxon) = 1;
 
     hvm_asid_init(cpu_has_vmx_vpid ? (1u << VMCS_VPID_WIDTH) : 0);
 
@@ -785,6 +770,24 @@ static int _vmx_cpu_up(bool bsp)
     vmx_pi_per_cpu_init(cpu);
 
     return 0;
+
+ vmxon_fault:
+    if ( bios_locked &&
+         test_bit(X86_FEATURE_SMX, &boot_cpu_data.x86_capability) &&
+         (!(eax & IA32_FEATURE_CONTROL_ENABLE_VMXON_OUTSIDE_SMX) ||
+          !(eax & IA32_FEATURE_CONTROL_ENABLE_VMXON_INSIDE_SMX)) )
+    {
+        printk(XENLOG_ERR
+               "CPU%d: VMXON failed: perhaps because of TXT settings in your BIOS configuration?\n",
+               cpu);
+        printk(XENLOG_ERR
+               " --> Disable TXT in your BIOS unless using a secure bootloader.\n");
+        return -EINVAL;
+    }
+
+ vmxon_fail:
+    printk(XENLOG_ERR "CPU%d: unexpected VMXON failure\n", cpu);
+    return -EINVAL;
 }
 
 int cf_check vmx_cpu_up(void)
diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmx.h b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
index 843f8591b9..7c6ba73407 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
@@ -559,25 +559,6 @@ static inline void __vmxoff(void)
         : : : "memory" );
 }
 
-static inline int __vmxon(u64 addr)
-{
-    int rc;
-
-    asm volatile ( 
-        "1: " VMXON_OPCODE MODRM_EAX_06 "\n"
-        "   setna %b0 ; neg %0\n" /* CF==1 or ZF==1 --> rc = -1 */
-        "2:\n"
-        ".section .fixup,\"ax\"\n"
-        "3: sub $2,%0 ; jmp 2b\n"    /* #UD or #GP --> rc = -2 */
-        ".previous\n"
-        _ASM_EXTABLE(1b, 3b)
-        : "=q" (rc)
-        : "0" (0), "a" (&addr)
-        : "memory");
-
-    return rc;
-}
-
 int cf_check vmx_guest_x86_mode(struct vcpu *v);
 unsigned int vmx_get_cpl(void);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 16:33:15 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 16:33:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936003.1337345 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u011T-00067g-4p; Wed, 02 Apr 2025 16:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936003.1337345; Wed, 02 Apr 2025 16:33:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u011T-00067Y-16; Wed, 02 Apr 2025 16:33:03 +0000
Received: by outflank-mailman (input) for mailman id 936003;
 Wed, 02 Apr 2025 16:33:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u011R-00067S-T4
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 16:33:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u011R-007bhv-1f
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 16:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u011R-004S2V-1T
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 16:33:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qUN89DKf+9MUtcubi/+bAAGzVjNy3T2GI9J/bluuBLo=; b=hz+CkFE+KymCbZ7+MHIAvJ02cW
	AzMkiI0LD24cwy6bTupQZzsob6UpQSBzAJkX6ztv4fv0kA5S5gqhxFg3Z3KEajlQLnXe22OZjM/O3
	G7P2dDJEkPYo0v0IpSFZaujREvL4pdbOEZEPpyTkhJFY+CGlBY7IyHd/arQfgaM+qBXw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/lzo: Remove more remanants of TMEM
Message-Id: <E1u011R-004S2V-1T@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 16:33:01 +0000

commit 6b72381e9d98f2a9d59a9af0dc71470067905a1e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 28 10:04:31 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 2 13:16:27 2025 +0100

    xen/lzo: Remove more remanants of TMEM
    
    This logic was inserted by commit 447f613c5404 ("lzo: update LZO compression
    to current upstream version") but was only relevant for the TMEM logic, so
    should have been deleted in commit c492e19fdd05 ("xen: remove tmem from
    hypervisor")
    
    Fixes: c492e19fdd05 ("xen: remove tmem from hypervisor")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/lzo.c | 21 ---------------------
 1 file changed, 21 deletions(-)

diff --git a/xen/common/lzo.c b/xen/common/lzo.c
index 3454ce4a7e..07b4017812 100644
--- a/xen/common/lzo.c
+++ b/xen/common/lzo.c
@@ -28,27 +28,6 @@
 #define COPY4(dst, src) memcpy(dst, src, 4)
 #define COPY8(dst, src) memcpy(dst, src, 8)
 
-#ifdef __MINIOS__
-# include <lib.h>
-# if __BYTE_ORDER == __LITTLE_ENDIAN
-#  undef __BIG_ENDIAN
-# endif
-# if __BYTE_ORDER == __BIG_ENDIAN
-#  undef __LITTLE_ENDIAN
-# endif
-#endif
-
-#if defined(__BIG_ENDIAN) && defined(__LITTLE_ENDIAN)
-#error "conflicting endian definitions"
-#elif defined(__x86_64__)
-#define LZO_USE_CTZ64    1
-#define LZO_USE_CTZ32    1
-#elif defined(__i386__) || defined(__powerpc__)
-#define LZO_USE_CTZ32    1
-#elif defined(__arm__) && (__LINUX_ARM_ARCH__ >= 5)
-#define LZO_USE_CTZ32    1
-#endif
-
 #define M1_MAX_OFFSET 0x0400
 #define M2_MAX_OFFSET 0x0800
 #define M3_MAX_OFFSET 0x4000
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 16:33:22 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 16:33:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936005.1337351 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u011m-0006Dh-6E; Wed, 02 Apr 2025 16:33:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936005.1337351; Wed, 02 Apr 2025 16: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 1u011m-0006DZ-3f; Wed, 02 Apr 2025 16:33:22 +0000
Received: by outflank-mailman (input) for mailman id 936005;
 Wed, 02 Apr 2025 16:33: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 1u011l-0006DQ-Of
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 16:33: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 1u011l-007biY-2N
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 16:33:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u011l-004S9N-2C
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 16:33: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=mYKO6GDmDg5U7sUqPc7+djwngZW0OoPQe65W9Wz9iV0=; b=kF+jifAbfllm1PvSJEZgrNngQB
	k3hL7LuunOIuOZKGCBbFkdA322sWDaMHTKRuX/j3M3YpUxR+vWXz1nK14zLkLfbauJ59+y+FzShlG
	tkycIzmEOV7ULz1Fg9VXKvGP/TIIP44T2P5EuHZtqZuxrBXsqieIg7Qc8+xj2sS9oQFY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/asm: remove HAVE_AS_CLAC_STAC
Message-Id: <E1u011l-004S9N-2C@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 16:33:21 +0000

commit a48be48f0c576e8ea3b94ab4273ad3dc8d329728
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Tue Apr 1 22:21:38 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 2 13:16:27 2025 +0100

    x86/asm: remove HAVE_AS_CLAC_STAC
    
    The new toolchain baseline knows the STAC/CLAC instructions,
    no need to carry the workaround in the code.
    
    Resolves: https://gitlab.com/xen-project/xen/-/work_items/203
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/arch.mk                 |  1 -
 xen/arch/x86/include/asm/asm-defns.h | 10 ----------
 2 files changed, 11 deletions(-)

diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk
index cb47d72991..258e459bec 100644
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -17,7 +17,6 @@ $(call as-option-add,CFLAGS,CC,"rdrand %eax",-DHAVE_AS_RDRAND)
 $(call as-option-add,CFLAGS,CC,"rdfsbase %rax",-DHAVE_AS_FSGSBASE)
 $(call as-option-add,CFLAGS,CC,"xsaveopt (%rax)",-DHAVE_AS_XSAVEOPT)
 $(call as-option-add,CFLAGS,CC,"rdseed %eax",-DHAVE_AS_RDSEED)
-$(call as-option-add,CFLAGS,CC,"clac",-DHAVE_AS_CLAC_STAC)
 $(call as-option-add,CFLAGS,CC,"clwb (%rax)",-DHAVE_AS_CLWB)
 $(call as-option-add,CFLAGS,CC,".equ \"x\"$(comma)1",-DHAVE_AS_QUOTED_SYM)
 $(call as-option-add,CFLAGS,CC,"invpcid (%rax)$(comma)%rax",-DHAVE_AS_INVPCID)
diff --git a/xen/arch/x86/include/asm/asm-defns.h b/xen/arch/x86/include/asm/asm-defns.h
index 32d6b44910..ab653f3218 100644
--- a/xen/arch/x86/include/asm/asm-defns.h
+++ b/xen/arch/x86/include/asm/asm-defns.h
@@ -1,15 +1,5 @@
 #include <asm/page-bits.h>
 
-#ifndef HAVE_AS_CLAC_STAC
-.macro clac
-    .byte 0x0f, 0x01, 0xca
-.endm
-
-.macro stac
-    .byte 0x0f, 0x01, 0xcb
-.endm
-#endif
-
 .macro vmrun
     .byte 0x0f, 0x01, 0xd8
 .endm
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 17:44:08 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 17:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936011.1337355 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u028A-0005Bp-Vy; Wed, 02 Apr 2025 17:44:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936011.1337355; Wed, 02 Apr 2025 17: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 1u028A-0005Bh-TO; Wed, 02 Apr 2025 17:44:02 +0000
Received: by outflank-mailman (input) for mailman id 936011;
 Wed, 02 Apr 2025 17: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 1u0289-0005Bb-Rx
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 17: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 1u0289-007dKb-21
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 17:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0289-004hbF-1t
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 17: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=RyjjRxv2VYT6eNDlJPLdM9NkGbikcvQFpCieGLxwZ/Q=; b=SU+wVvZLgSEEXGc7UZqF0HTySV
	21AADSG1CsS5Yr01hRVO7Dzz2EWUX6YuUS8kaT2a96D0GY4nx5ZZf8nWo5pGGwhV/pCn8E0rDBaXg
	bt0rTSBRRsNkU/vRjPAKluWs1vERz1dk1PH0EzL3XellOEC5JkyuLPH//B1x+dRw/+Fg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/svm: Drop wrappers of SVM instructions
Message-Id: <E1u0289-004hbF-1t@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 17:44:01 +0000

commit ae5fd39be98c6219a302045aec7c25bdafa81781
Author:     Alexander M. Merritt <alexander@edera.dev>
AuthorDate: Wed Apr 2 14:54:10 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 2 16:06:53 2025 +0100

    x86/svm: Drop wrappers of SVM instructions
    
    The new toolchain baseline knows the SVM instructions.
    
    Resolves: xen-project/xen#204
    
    Signed-off-by: "Alexander M. Merritt" <alexander@edera.dev>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/svm/svm.h           | 14 +++-----------
 xen/arch/x86/include/asm/asm-defns.h | 12 ------------
 2 files changed, 3 insertions(+), 23 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.h b/xen/arch/x86/hvm/svm/svm.h
index beeaaab4f7..f5b0312d2d 100644
--- a/xen/arch/x86/hvm/svm/svm.h
+++ b/xen/arch/x86/hvm/svm/svm.h
@@ -23,25 +23,17 @@ void __update_guest_eip(struct cpu_user_regs *regs, unsigned int inst_len);
 
 static inline void svm_vmload_pa(paddr_t vmcb)
 {
-    asm volatile (
-        ".byte 0x0f,0x01,0xda" /* vmload */
-        : : "a" (vmcb) : "memory" );
+    asm volatile ( "vmload" :: "a" (vmcb) : "memory" );
 }
 
 static inline void svm_vmsave_pa(paddr_t vmcb)
 {
-    asm volatile (
-        ".byte 0x0f,0x01,0xdb" /* vmsave */
-        : : "a" (vmcb) : "memory" );
+    asm volatile ( "vmsave" :: "a" (vmcb) : "memory" );
 }
 
 static inline void svm_invlpga(unsigned long linear, uint32_t asid)
 {
-    asm volatile (
-        ".byte 0x0f,0x01,0xdf"
-        : /* output */
-        : /* input */
-        "a" (linear), "c" (asid) );
+    asm volatile ( "invlpga" :: "a" (linear), "c" (asid) );
 }
 
 /*
diff --git a/xen/arch/x86/include/asm/asm-defns.h b/xen/arch/x86/include/asm/asm-defns.h
index ab653f3218..1b821db49c 100644
--- a/xen/arch/x86/include/asm/asm-defns.h
+++ b/xen/arch/x86/include/asm/asm-defns.h
@@ -1,17 +1,5 @@
 #include <asm/page-bits.h>
 
-.macro vmrun
-    .byte 0x0f, 0x01, 0xd8
-.endm
-
-.macro stgi
-    .byte 0x0f, 0x01, 0xdc
-.endm
-
-.macro clgi
-    .byte 0x0f, 0x01, 0xdd
-.endm
-
 /*
  * Call a noreturn function.  This could be JMP, but CALL results in a more
  * helpful backtrace.  BUG is to catch functions which do decide to return...
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 17:44:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 17:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936012.1337358 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u028L-0005DO-1S; Wed, 02 Apr 2025 17:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936012.1337358; Wed, 02 Apr 2025 17: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 1u028K-0005DG-Uo; Wed, 02 Apr 2025 17:44:12 +0000
Received: by outflank-mailman (input) for mailman id 936012;
 Wed, 02 Apr 2025 17: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 1u028K-0005DA-3X
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 17: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 1u028K-007dKh-0F
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 17:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u028K-004hd3-06
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 17: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=rf58SdvslTuW+nuWl8GHEbi3CKoxYKXgB4L6IkTg0XE=; b=iHLnubEzrqmCUAqvbDHOHLj36K
	17t6yXEOj+u20LeMJkkFnS+QhgRhplo2F+sJ9G0RmR76TAy++TCBVsk2O1JyrTgTcC2NUhRl0/hxj
	8T2bfcW9VlkPcQXVT7h7w2GOQjQtiHQmMeTCrmckPfNaISbi7uvS9dwNE0kuS0o4qJ80=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] tools/ocaml: Fix oxenstored build warning
Message-Id: <E1u028K-004hd3-06@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 17:44:12 +0000

commit 52d704c2bc716df58c46bd4ff40701541310549e
Author:     Andrii Sultanov <andrii.sultanov@cloud.com>
AuthorDate: Wed Apr 2 14:27:30 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 2 14:27:30 2025 +0200

    tools/ocaml: Fix oxenstored build warning
    
    OCaml, in preparation for a renaming of the error string associated with
    conversion failure in 'int_of_string' functions, started to issue this
    warning:
    
      File "process.ml", line 440, characters 13-28:
      440 |   | (Failure "int_of_string")    -> reply_error "EINVAL"
                         ^^^^^^^^^^^^^^^
      Warning 52 [fragile-literal-pattern]: Code should not depend on the actual values of
      this constructor's arguments. They are only for information
      and may change in future versions. (See manual section 11.5)
    
    Deal with this at the source, and instead create our own stable
    ConversionFailure exception that's raised on the None case in
    'int_of_string_opt'.
    
    'c_int_of_string' is safe and does not raise such exceptions.
    
    Signed-off-by: Andrii Sultanov <andrii.sultanov@cloud.com>
    Acked-by: Christian Lindig <christian.lindig@cloud.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: c11772277fe5f1b0874141a24554c2e3da2d9a6e
    master date: 2025-02-25 13:30:55 +0000
---
 tools/ocaml/xenstored/Makefile     |  1 +
 tools/ocaml/xenstored/perms.ml     |  2 +-
 tools/ocaml/xenstored/poll.ml      |  2 +-
 tools/ocaml/xenstored/process.ml   | 18 +++++++++---------
 tools/ocaml/xenstored/utils.ml     | 10 ++++++++--
 tools/ocaml/xenstored/xenstored.ml | 16 ++++++++--------
 6 files changed, 28 insertions(+), 21 deletions(-)

diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index fa45305d8c..9714b1ee46 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -53,6 +53,7 @@ OBJS = paths \
 	history \
 	parse_arg \
 	process \
+	poll \
 	xenstored
 
 INTF = symbol.cmi trie.cmi syslog.cmi systemd.cmi poll.cmi
diff --git a/tools/ocaml/xenstored/perms.ml b/tools/ocaml/xenstored/perms.ml
index 14f8e334fe..2c4ee9e617 100644
--- a/tools/ocaml/xenstored/perms.ml
+++ b/tools/ocaml/xenstored/perms.ml
@@ -70,7 +70,7 @@ struct
 
   let perm_of_string s =
     let ty = permty_of_char s.[0]
-    and id = int_of_string (String.sub s 1 (String.length s - 1)) in
+    and id = Utils.int_of_string_exn (String.sub s 1 (String.length s - 1)) in
     (id, ty)
 
   let of_strings ls =
diff --git a/tools/ocaml/xenstored/poll.ml b/tools/ocaml/xenstored/poll.ml
index fefaa6e74c..f8571e4590 100644
--- a/tools/ocaml/xenstored/poll.ml
+++ b/tools/ocaml/xenstored/poll.ml
@@ -30,7 +30,7 @@ external set_fd_limit: int -> unit = "stub_set_fd_limit"
 let get_sys_fs_nr_open () =
   try
     let ch = open_in "/proc/sys/fs/nr_open" in
-    let v = int_of_string (input_line ch) in
+    let v = Utils.int_of_string_exn (input_line ch) in
     close_in_noerr ch; v
   with _ -> 1024 * 1024
 
diff --git a/tools/ocaml/xenstored/process.ml b/tools/ocaml/xenstored/process.ml
index 432d66321c..0c9c460a99 100644
--- a/tools/ocaml/xenstored/process.ml
+++ b/tools/ocaml/xenstored/process.ml
@@ -229,7 +229,7 @@ let do_debug con t _domains cons data =
       Logging.xb_op ~tid:0 ~ty:Xenbus.Xb.Op.Debug ~con:"=======>" msg;
       None
     | "quota" :: domid :: _ ->
-      let domid = int_of_string domid in
+      let domid = Utils.int_of_string_exn domid in
       let quota = (Store.get_quota t.Transaction.store) in
       Some (Quota.to_string quota domid ^ "\000")
     | "watches" :: _ ->
@@ -242,7 +242,7 @@ let do_debug con t _domains cons data =
       History.trim ();
       Some "trimmed"
     | "txn" :: domid :: _ ->
-      let domid = int_of_string domid in
+      let domid = Utils.int_of_string_exn domid in
       let con = Connections.find_domain cons domid in
       let b = Buffer.create 128 in
       let () = con.transactions |> Hashtbl.iter @@ fun id tx ->
@@ -253,7 +253,7 @@ let do_debug con t _domains cons data =
       in
       Some (Buffer.contents b)
     | "xenbus" :: domid :: _ ->
-      let domid = int_of_string domid in
+      let domid = Utils.int_of_string_exn domid in
       let con = Connections.find_domain cons domid in
       let s = Printf.sprintf "xenbus: %s; overflow queue length: %d, can_input: %b, has_more_input: %b, has_old_output: %b, has_new_output: %b, has_more_work: %b. pending: %s"
           (Xenbus.Xb.debug con.xb)
@@ -267,7 +267,7 @@ let do_debug con t _domains cons data =
       in
       Some s
     | "mfn" :: domid :: _ ->
-      let domid = int_of_string domid in
+      let domid = Utils.int_of_string_exn domid in
       let con = Connections.find_domain cons domid in
       may (fun dom -> Printf.sprintf "%nd\000" (Domain.get_mfn dom)) (Connection.get_domain con)
     | _ -> None
@@ -340,7 +340,7 @@ let do_isintroduced con _t domains _cons data =
   then raise Define.Permission_denied;
   let domid =
     match (split None '\000' data) with
-    | domid :: _ -> int_of_string domid
+    | domid :: _ -> Utils.int_of_string_exn domid
     | _          -> raise Invalid_Cmd_Args
   in
   if domid = Define.domid_self || Domains.exist domains domid then "T\000" else "F\000"
@@ -437,7 +437,7 @@ let input_handle_error ~cons ~doms ~fct ~con ~t ~req =
   | Quota.Limit_reached          -> reply_error "EQUOTA"
   | Quota.Data_too_big           -> reply_error "E2BIG"
   | Quota.Transaction_opened     -> reply_error "EQUOTA"
-  | (Failure "int_of_string")    -> reply_error "EINVAL"
+  | Utils.ConversionFailed s     -> reply_error "EINVAL"
   | Define.Unknown_operation     -> reply_error "ENOSYS"
 
 let write_access_log ~ty ~tid ~con ~data =
@@ -578,7 +578,7 @@ let do_introduce con t domains cons data =
   let (domid, mfn, remote_port) =
     match (split None '\000' data) with
     | domid :: mfn :: remote_port :: _ ->
-      int_of_string domid, Nativeint.of_string mfn, int_of_string remote_port
+      Utils.int_of_string_exn domid, Nativeint.of_string mfn, Utils.int_of_string_exn remote_port
     | _                         -> raise Invalid_Cmd_Args;
   in
   let dom =
@@ -604,7 +604,7 @@ let do_release con t domains cons data =
   then raise Define.Permission_denied;
   let domid =
     match (split None '\000' data) with
-    | [domid;""] -> int_of_string domid
+    | [domid;""] -> Utils.int_of_string_exn domid
     | _          -> raise Invalid_Cmd_Args
   in
   let fire_spec_watches = Domains.exist domains domid in
@@ -620,7 +620,7 @@ let do_resume con _t domains _cons data =
   then raise Define.Permission_denied;
   let domid =
     match (split None '\000' data) with
-    | domid :: _ -> int_of_string domid
+    | domid :: _ -> Utils.int_of_string_exn domid
     | _          -> raise Invalid_Cmd_Args
   in
   if Domains.exist domains domid
diff --git a/tools/ocaml/xenstored/utils.ml b/tools/ocaml/xenstored/utils.ml
index 48d84ef7d3..7a556bce75 100644
--- a/tools/ocaml/xenstored/utils.ml
+++ b/tools/ocaml/xenstored/utils.ml
@@ -53,8 +53,14 @@ let hexify s =
     ) s;
   Bytes.unsafe_to_string hs
 
+exception ConversionFailed of string
+let int_of_string_exn s =
+  match int_of_string_opt s with
+  | Some x -> x
+  | None -> raise (ConversionFailed s)
+
 let unhexify hs =
-  let char_of_hexseq seq0 seq1 = Char.chr (int_of_string (sprintf "0x%c%c" seq0 seq1)) in
+  let char_of_hexseq seq0 seq1 = Char.chr (int_of_string_exn (sprintf "0x%c%c" seq0 seq1)) in
   let b = Bytes.create (String.length hs / 2) in
   for i = 0 to Bytes.length b - 1
   do
@@ -86,7 +92,7 @@ let read_file_single_integer filename =
   let buf = Bytes.make 20 '\000' in
   let sz = Unix.read fd buf 0 20 in
   Unix.close fd;
-  int_of_string (Bytes.sub_string buf 0 sz)
+  int_of_string_exn (Bytes.sub_string buf 0 sz)
 
 (* @path may be guest data and needs its length validating.  @connection_path
  * is generated locally in xenstored and always of the form "/local/domain/$N/" *)
diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml
index 1aaa3e995e..84dee622ea 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -167,20 +167,20 @@ module DB = struct
                					   e.g. a RO socket from a previous version: ignore it *)
             global_f ~rw
           | "evtchn-dev" :: fd :: domexc_port :: [] ->
-            evtchn_f ~fd:(int_of_string fd)
-              ~domexc_port:(int_of_string domexc_port)
+            evtchn_f ~fd:(Utils.int_of_string_exn fd)
+              ~domexc_port:(Utils.int_of_string_exn domexc_port)
           | "socket" :: fd :: [] ->
-            socket_f ~fd:(int_of_string fd)
+            socket_f ~fd:(Utils.int_of_string_exn fd)
           | "dom" :: domid :: mfn :: remote_port :: rest ->
             let local_port = match rest with
               | [] -> None (* backward compat: old version didn't have it *)
-              | local_port :: _ -> Some (int_of_string local_port) in
+              | local_port :: _ -> Some (Utils.int_of_string_exn local_port) in
             domain_f ?local_port
-              ~remote_port:(int_of_string remote_port)
-              (int_of_string domid)
+              ~remote_port:(Utils.int_of_string_exn remote_port)
+              (Utils.int_of_string_exn domid)
               (Nativeint.of_string mfn)
           | "watch" :: domid :: path :: token :: [] ->
-            watch_f (int_of_string domid)
+            watch_f (Utils.int_of_string_exn domid)
               (unhexify path) (unhexify token)
           | "store" :: path :: perms :: value :: [] ->
             store_f (getpath path)
@@ -214,7 +214,7 @@ module DB = struct
     in
     let global_f ~rw =
       let get_listen_sock sockfd =
-        let fd = sockfd |> int_of_string |> Utils.FD.of_int in
+        let fd = sockfd |> Utils.int_of_string_exn |> Utils.FD.of_int in
         Unix.listen fd 1;
         Some fd
       in
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 17:44:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 17:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936013.1337364 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u028V-0005Fz-4Z; Wed, 02 Apr 2025 17:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936013.1337364; Wed, 02 Apr 2025 17: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 1u028V-0005Fr-1f; Wed, 02 Apr 2025 17:44:23 +0000
Received: by outflank-mailman (input) for mailman id 936013;
 Wed, 02 Apr 2025 17: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 1u028U-0005Fl-7B
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 17: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 1u028U-007dLA-0c
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 17:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u028U-004heF-0Q
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 17: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=j3cmPw6D0EAF/jDOJWGbJZK3bCb8sJf3OZ+IFCZY1qA=; b=wEMQKnq9xCekVQjVFx7QgS+OEL
	jFckJUbNGBK/wKZDDe5vt0ff+0z9SFph2z7kQUtkkXJYd31si2EAq3JohA900xKCHDL4nLjToshws
	g371Ik3LvWwgtK+OABDdriUSkhJUqlLZkBcXDaVm3vNDNRPqYvUpE5wLgPrYq2XCI3X8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] ARM/vgic: Fix out-of-bounds accesses in vgic_mmio_write_sgir()
Message-Id: <E1u028U-004heF-0Q@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 17:44:22 +0000

commit f0a30501613f4ddb725e164b208c64073faa0e01
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Apr 2 14:27:56 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 2 14:27:56 2025 +0200

    ARM/vgic: Fix out-of-bounds accesses in vgic_mmio_write_sgir()
    
    The switch() statement is over bits 24:25 (unshifted) of the guest provided
    value.  This makes case 0x3: dead, and not an implementation of the 4th
    possible state.
    
    A guest which writes (0x3 << 24) | (0xff << 16) to this register will skip the
    early exit, then enter bitmap_for_each() with targets not bound by nr_vcpus.
    
    If the guest has fewer than 8 vCPUs, bitmap_for_each() will read off the end
    of d->vcpu[] and use the resulting vcpu pointer to ultimately derive irq, and
    perform out-of-bounds writes.
    
    Fix this by changing case 0x3 to default.
    
    Fixes: 08c688ca6422 ("ARM: new VGIC: Add SGIR register handler")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    master commit: be7f0cc651d8d02a95820792204c0558f1f29e03
    master date: 2025-03-27 11:54:23 +0000
---
 xen/arch/arm/vgic/vgic-mmio-v2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/vgic/vgic-mmio-v2.c b/xen/arch/arm/vgic/vgic-mmio-v2.c
index 2e507b10fe..e14de567a7 100644
--- a/xen/arch/arm/vgic/vgic-mmio-v2.c
+++ b/xen/arch/arm/vgic/vgic-mmio-v2.c
@@ -104,7 +104,8 @@ static void vgic_mmio_write_sgir(struct vcpu *source_vcpu,
     case GICD_SGI_TARGET_SELF:                    /* this very vCPU only */
         targets = (1U << source_vcpu->vcpu_id);
         break;
-    case 0x3:                                     /* reserved */
+
+    default:
         return;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Apr 02 17:44:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 02 Apr 2025 17:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936014.1337366 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u028f-0005IB-5k; Wed, 02 Apr 2025 17:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936014.1337366; Wed, 02 Apr 2025 17: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 1u028f-0005I4-33; Wed, 02 Apr 2025 17:44:33 +0000
Received: by outflank-mailman (input) for mailman id 936014;
 Wed, 02 Apr 2025 17: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 1u028e-0005Hw-AU
 for xen-changelog@lists.xenproject.org; Wed, 02 Apr 2025 17: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 1u028e-007dLG-0u
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 17:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u028e-004hfI-0n
 for xen-changelog@lists.xenproject.org;
 Wed, 02 Apr 2025 17: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=3yuxkYcwHZ5JJbTWbOeIIf+o4yhgdo7DllByaaEk5dE=; b=QIaextH4w5f7nhoP5HGgWXNKlJ
	pRNPffa8qd35NE/19OiEwb2+/wAk148BuZE/LTNCClyVIZL3Oe1LAtZYp3niN3ouEgG6lsmFE3kKW
	YL8goVgj1nt+DTxUUEsIk57txPUUPl9YYgjElmE1LRieCYsPy6fKnvDw6+2Vj2DIKI5c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/P2M: synchronize fast and slow paths of p2m_get_page_from_gfn()
Message-Id: <E1u028e-004hfI-0n@xenbits.xenproject.org>
Date: Wed, 02 Apr 2025 17:44:32 +0000

commit 30eb7e6ad803d7221a89db070b5f8859cb2fdc68
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Apr 2 14:28:08 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 2 14:28:08 2025 +0200

    x86/P2M: synchronize fast and slow paths of p2m_get_page_from_gfn()
    
    Handling of both grants and foreign pages was different between the two
    paths.
    
    While permitting access to grants would be desirable, doing so would
    require more involved handling; undo that for the time being. In
    particular the page reference obtained would prevent the owning domain
    from changing e.g. the page's type (after the grantee has released the
    last reference of the grant). Instead perhaps another reference on the
    grant would need obtaining. Which in turn would require determining
    which grant that was.
    
    Foreign pages in any event need permitting on both paths.
    
    Introduce a helper function to be used on both paths, such that
    respective checking differs in just the extra "to be unshared" condition
    on the fast path.
    
    While there adjust the sanity check for foreign pages: Don't leak the
    reference on release builds when on a debug build the assertion would
    have triggered. (Thanks to Roger for the suggestion.)
    
    Fixes: 80ea7af17269 ("x86/mm: Introduce get_page_from_gfn()")
    Fixes: 50fe6e737059 ("pvh dom0: add and remove foreign pages")
    Fixes: cbbca7be4aaa ("x86/p2m: make p2m_get_page_from_gfn() handle grant case correctly")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: a8325f981ce4ff8ac8bcc73735f357846b0a0fbb
    master date: 2025-03-31 09:21:12 +0200
---
 xen/arch/x86/mm/p2m.c | 68 +++++++++++++++++++++++++++++----------------------
 1 file changed, 39 insertions(+), 29 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 1739133fc2..41fc108bba 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -328,12 +328,46 @@ void p2m_put_gfn(struct p2m_domain *p2m, gfn_t gfn)
     gfn_unlock(p2m, gfn_x(gfn), 0);
 }
 
+static struct page_info *get_page_from_mfn_and_type(
+    const struct domain *d, mfn_t mfn, p2m_type_t t)
+{
+    struct page_info *page;
+
+    if ( !mfn_valid(mfn) )
+        return NULL;
+
+    page = mfn_to_page(mfn);
+
+    if ( p2m_is_ram(t) )
+    {
+        if ( p2m_is_shared(t) )
+            d = dom_cow;
+
+        if ( get_page(page, d) )
+            return page;
+    }
+    else if ( unlikely(p2m_is_foreign(t)) )
+    {
+        const struct domain *fdom = page_get_owner_and_reference(page);
+
+        if ( fdom )
+        {
+            if ( likely(fdom != d) )
+                return page;
+            ASSERT_UNREACHABLE();
+            put_page(page);
+        }
+    }
+
+    return NULL;
+}
+
 /* Atomically look up a GFN and take a reference count on the backing page. */
 struct page_info *p2m_get_page_from_gfn(
     struct p2m_domain *p2m, gfn_t gfn,
     p2m_type_t *t, p2m_access_t *a, p2m_query_t q)
 {
-    struct page_info *page = NULL;
+    struct page_info *page;
     p2m_access_t _a;
     p2m_type_t _t;
     mfn_t mfn;
@@ -347,26 +381,9 @@ struct page_info *p2m_get_page_from_gfn(
         /* Fast path: look up and get out */
         p2m_read_lock(p2m);
         mfn = p2m_get_gfn_type_access(p2m, gfn, t, a, 0, NULL, 0);
-        if ( p2m_is_any_ram(*t) && mfn_valid(mfn)
-             && !((q & P2M_UNSHARE) && p2m_is_shared(*t)) )
-        {
-            page = mfn_to_page(mfn);
-            if ( unlikely(p2m_is_foreign(*t)) || unlikely(p2m_is_grant(*t)) )
-            {
-                struct domain *fdom = page_get_owner_and_reference(page);
-
-                ASSERT(!p2m_is_foreign(*t) || fdom != p2m->domain);
-                if ( fdom == NULL )
-                    page = NULL;
-            }
-            else
-            {
-                struct domain *d = !p2m_is_shared(*t) ? p2m->domain : dom_cow;
-
-                if ( !get_page(page, d) )
-                    page = NULL;
-            }
-        }
+        page = !(q & P2M_UNSHARE) || !p2m_is_shared(*t)
+               ? get_page_from_mfn_and_type(p2m->domain, mfn, *t)
+               : NULL;
         p2m_read_unlock(p2m);
 
         if ( page )
@@ -380,14 +397,7 @@ struct page_info *p2m_get_page_from_gfn(
 
     /* Slow path: take the write lock and do fixups */
     mfn = get_gfn_type_access(p2m, gfn_x(gfn), t, a, q, NULL);
-    if ( p2m_is_ram(*t) && mfn_valid(mfn) )
-    {
-        struct domain *d = !p2m_is_shared(*t) ? p2m->domain : dom_cow;
-
-        page = mfn_to_page(mfn);
-        if ( !get_page(page, d) )
-            page = NULL;
-    }
+    page = get_page_from_mfn_and_type(p2m->domain, mfn, *t);
     put_gfn(p2m->domain, gfn_x(gfn));
 
     return page;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 00:00:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 00:00:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936139.1337436 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0804-0008HH-1R; Thu, 03 Apr 2025 00:00:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936139.1337436; Thu, 03 Apr 2025 00:00: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 1u0803-0008Gm-T2; Thu, 03 Apr 2025 00:00:03 +0000
Received: by outflank-mailman (input) for mailman id 936139;
 Thu, 03 Apr 2025 00:00:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u0802-0007xl-L5
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 00: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 1u0802-007oRM-1T
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 00:00:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0802-005Zl7-1E
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 00: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=U+PxzLSJLd5BonR62PHi8rpCQi7NbsAfa1uGj+nVAYc=; b=N5wv20WllWcCxnYzWo/AWalhnl
	4SxO89x9+LlzC3R7SwXa6KyCZpqoP4BMZ/tlM65/3m3DG168NfoH0rIh/zvVxdxjqnUkT9zzPFWTr
	v/mLq2K9nH4dA+SG60uEZHsYOOlTq5uwUqc7XGP/lQPG3hG2ExMvF/J0rhy24iD8KCqY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: add kconfig for event_fifo
Message-Id: <E1u0802-005Zl7-1E@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 00:00:02 +0000

commit cfe15a473d92404cef0e5d361be4db4a7b9babe8
Author:     Stefano Stabellini <stefano.stabellini@amd.com>
AuthorDate: Thu Mar 27 16:22:25 2025 -0700
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Wed Apr 2 14:59:53 2025 -0700

    xen: add kconfig for event_fifo
    
    Evtchn fifos are not needed on smaller systems; the older interface is
    lightweight and sufficient. Also, event_fifo causes runtime anonymous
    memory allocations, which are undesirable.  Additionally, it exposes an
    extra interface to the guest, which is also undesirable unless
    necessary.
    
    Make it possible to disable evtchn fifo.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Acked-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/common/Kconfig         | 14 ++++++++++++++
 xen/common/Makefile        |  2 +-
 xen/common/event_channel.h | 15 +++++++++++++++
 3 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 218357d593..06ae9751aa 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -23,6 +23,20 @@ config GRANT_TABLE
 
 	  If unsure, say Y.
 
+config EVTCHN_FIFO
+	bool "Event Channel Fifo support" if EXPERT
+	default y
+	help
+	  The Event channel Fifo extends support for event channels
+	  beyond 1024 event channels for 32-bit guests and 4096 for
+	  64-bit guests.
+
+	  Cons: They cause runtime anonymous memory allocations and expose
+	  an additional interface to the guest. For smaller systems, you
+	  might consider disabling this feature.
+
+	  If unsure, say Y.
+
 config PDX_COMPRESSION
 	bool "PDX (Page inDeX) compression" if EXPERT && !X86 && !RISCV
 	default ARM || PPC
diff --git a/xen/common/Makefile b/xen/common/Makefile
index ac23120d7d..9da8a7244d 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -13,7 +13,7 @@ obj-$(CONFIG_IOREQ_SERVER) += dm.o
 obj-y += domain.o
 obj-y += event_2l.o
 obj-y += event_channel.o
-obj-y += event_fifo.o
+obj-$(CONFIG_EVTCHN_FIFO) += event_fifo.o
 obj-$(CONFIG_GRANT_TABLE) += grant_table.o
 obj-y += guestcopy.o
 obj-y += gzip/
diff --git a/xen/common/event_channel.h b/xen/common/event_channel.h
index 45219ca67c..a778ae775b 100644
--- a/xen/common/event_channel.h
+++ b/xen/common/event_channel.h
@@ -45,12 +45,27 @@ void evtchn_2l_init(struct domain *d);
 
 /* FIFO */
 
+#ifdef CONFIG_EVTCHN_FIFO
 struct evtchn_init_control;
 struct evtchn_expand_array;
 
 int evtchn_fifo_init_control(struct evtchn_init_control *init_control);
 int evtchn_fifo_expand_array(const struct evtchn_expand_array *expand_array);
 void evtchn_fifo_destroy(struct domain *d);
+#else
+static inline int evtchn_fifo_init_control(struct evtchn_init_control *init_control)
+{
+    return -EOPNOTSUPP;
+}
+static inline int evtchn_fifo_expand_array(const struct evtchn_expand_array *expand_array)
+{
+    return -EOPNOTSUPP;
+}
+static inline void evtchn_fifo_destroy(struct domain *d)
+{
+    return;
+}
+#endif /* CONFIG_EVTCHN_FIFO */
 
 /*
  * Local variables:
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 00:00:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 00:00:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936140.1337437 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u080E-0000KG-6i; Thu, 03 Apr 2025 00:00:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936140.1337437; Thu, 03 Apr 2025 00:00: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 1u080E-0000K8-48; Thu, 03 Apr 2025 00:00:14 +0000
Received: by outflank-mailman (input) for mailman id 936140;
 Thu, 03 Apr 2025 00:00:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u080C-0000Jz-JQ
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 00: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 1u080C-007oe8-1p
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 00:00:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u080C-005Zo2-1f
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 00:00:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fds3xivIWrm7mtg86QzGd4zJJrggal/wLQYDzZipxeA=; b=4dLYBgYDNpFob3aVe04biPXRFp
	prVRjjWK1fAR7ww90K9DNTJVKCnxoAZsBAwj+5v8eFerO70aGx9kjUnH1oZWzPpkA2yus9Eop03fs
	A5Hi2d3FLtNAeqcjd8fmqZsa6DP0hEYPwG2K9D6MZDKTzx3rsX1sPKd8ZSbbllR6kATw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] ci: create boot.ipxe for legacy boot
Message-Id: <E1u080C-005Zo2-1f@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 00:00:12 +0000

commit 42beecae0b219fdfa04db729dea2229e05bf4af0
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Tue Apr 1 01:41:35 2025 +0200
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Wed Apr 2 16:53:02 2025 -0700

    ci: create boot.ipxe for legacy boot
    
    Hardware runners that use legacy boot use iPXE instead of grub2. Create
    boot.ipxe for those too - with exact same options.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/scripts/qubes-x86-64.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index 7c80e0c233..f272964459 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -251,6 +251,14 @@ module2 (http)/gitlab-ci/vmlinuz console=hvc0 root=/dev/ram0 earlyprintk=xen
 module2 (http)/gitlab-ci/initrd-dom0
 " > $TFTP/grub.cfg
 
+echo "#!ipxe
+
+kernel /gitlab-ci/xen $CONSOLE_OPTS loglvl=all guest_loglvl=all dom0_mem=4G console_timestamps=boot $extra_xen_opts || reboot
+module /gitlab-ci/vmlinuz console=hvc0 root=/dev/ram0 earlyprintk=xen || reboot
+module /gitlab-ci/initrd-dom0 || reboot
+boot
+" > $TFTP/boot.ipxe
+
 cp -f binaries/xen $TFTP/xen
 cp -f binaries/bzImage $TFTP/vmlinuz
 cp -f binaries/dom0-rootfs.cpio.gz $TFTP/initrd-dom0
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 00:00:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 00:00:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936141.1337442 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u080N-0000Xu-8P; Thu, 03 Apr 2025 00:00:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936141.1337442; Thu, 03 Apr 2025 00:00:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u080N-0000Xm-5T; Thu, 03 Apr 2025 00:00:23 +0000
Received: by outflank-mailman (input) for mailman id 936141;
 Thu, 03 Apr 2025 00:00:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u080M-0000Px-Mk
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 00:00:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u080M-007onL-2A
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 00:00:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u080M-005Zow-1z
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 00:00:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZKZvvnjltMV4nlel467rFKg6xwkh2XbqlZ8bPsIKefE=; b=pATI140hMdVNz8wIQ0eTWJgYtb
	ZgQ3ZucUGZ/R0ukEvUWWrBfFSi+U+rQqfPSFlRe6lJzkZk/eFafSxX+91YR+AvDqB6Di0BNxsTiFd
	TWMziMG4wm36d8VO2Rn4/VNL4b2N9GE/9LDMKgKPZkNyJA1LYa8Y/eDezF5s233PXbzA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] ci: add Intel KabyLake HW runner
Message-Id: <E1u080M-005Zow-1z@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 00:00:22 +0000

commit 911a766f143196a1576c1b009e2e1cde8b921062
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Tue Apr 1 01:41:36 2025 +0200
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Wed Apr 2 16:53:02 2025 -0700

    ci: add Intel KabyLake HW runner
    
    This is Intel i7-7567U in NUC 7i7BNH. This one is an older one, with no
    firmware updates (last update from 2023) and no microcode udpates
    either. While this firmware supports UEFI, network boot works only in
    legacy mode - thus legacy is used here (via iPXE, instead of grub2.efi).
    Testing legacy boot path may be a useful thing on its own.
    
    Add the same set of tests as on ADL runner.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/gitlab-ci/test.yaml | 89 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 89 insertions(+)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 225eb43998..d05b9a98af 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -155,6 +155,17 @@
   tags:
     - qubes-hw2
 
+.kbl-x86-64:
+  # it's really similar to the ADL one
+  extends: .adl-x86-64
+  variables:
+    PCIDEV: "00:1f.6"
+    PCIDEV_INTR: "MSI"
+    CONSOLE_OPTS: "console=com1 com1=115200,8n1,pci,msi"
+    SUT_ADDR: test-3.testnet
+  tags:
+    - qubes-hw3
+
 .zen2-x86-64:
   # it's really similar to the above
   extends: .adl-x86-64
@@ -312,6 +323,84 @@ adl-tools-tests-pvh-x86-64-gcc-debug:
     - *x86-64-test-needs
     - alpine-3.18-gcc-debug
 
+kbl-smoke-x86-64-gcc-debug:
+  extends: .kbl-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
+kbl-smoke-x86-64-dom0pvh-gcc-debug:
+  extends: .kbl-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh dom0pvh 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
+kbl-smoke-x86-64-dom0pvh-hvm-gcc-debug:
+  extends: .kbl-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh dom0pvh-hvm 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
+kbl-suspend-x86-64-gcc-debug:
+  extends: .kbl-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh s3 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
+kbl-pci-pv-x86-64-gcc-debug:
+  extends: .kbl-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh pci-pv 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
+kbl-pci-hvm-x86-64-gcc-debug:
+  extends: .kbl-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh pci-hvm 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
+kbl-pvshim-x86-64-gcc-debug:
+  extends: .kbl-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh pvshim 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
+kbl-tools-tests-pv-x86-64-gcc-debug:
+  extends: .kbl-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh tools-tests-pv 2>&1 | tee ${LOGFILE}
+  artifacts:
+    reports:
+      junit: tests-junit.xml
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
+kbl-tools-tests-pvh-x86-64-gcc-debug:
+  extends: .kbl-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh tools-tests-pvh 2>&1 | tee ${LOGFILE}
+  artifacts:
+    reports:
+      junit: tests-junit.xml
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
 zen2-smoke-x86-64-gcc-debug:
   extends: .zen2-x86-64
   script:
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 06:00:22 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 06:00:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936221.1337497 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0Dce-0007RN-0T; Thu, 03 Apr 2025 06:00:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936221.1337497; Thu, 03 Apr 2025 06:00: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 1u0Dcd-0007RE-TI; Thu, 03 Apr 2025 06:00:15 +0000
Received: by outflank-mailman (input) for mailman id 936221;
 Thu, 03 Apr 2025 06:00: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 1u0DcR-0006e4-7d
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 06:00: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 1u0DcQ-009PdE-0k
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 06:00:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0DcQ-006a3U-0a
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 06: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=v7ya56uobXC/Oe6btioiTrxTqxzajYo7JBhQG+QzC9E=; b=UbkBVj5rRIvcHUN8JXHdkpzATf
	BL/fE5n8NJ875aMfgVcmigtIpqaTVTOeXxo1U+3ketmzcI+AnPvFPSum3AFwy5fMe1IxNeigaUYEs
	N3JD9Xd8OJSrZKc2ESKwcLhnHIsmz6Fssa+HHq3R23zbqQJmOPrVI7PfdDlTLpfRmD/c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] Revert "tools/ocaml: Fix oxenstored build warning"
Message-Id: <E1u0DcQ-006a3U-0a@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 06:00:02 +0000

commit da7928d6daa8a03feac2449627186363ba87ba2e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 3 07:52:11 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 3 07:52:11 2025 +0200

    Revert "tools/ocaml: Fix oxenstored build warning"
    
    This reverts commit ca847010e3a8004af779836134502cca1ca2ca50. It
    depends on an OCaml version bump not present on this branch.
---
 tools/ocaml/xenstored/Makefile     |  1 -
 tools/ocaml/xenstored/perms.ml     |  2 +-
 tools/ocaml/xenstored/poll.ml      |  2 +-
 tools/ocaml/xenstored/process.ml   | 18 +++++++++---------
 tools/ocaml/xenstored/utils.ml     | 10 ++--------
 tools/ocaml/xenstored/xenstored.ml | 16 ++++++++--------
 6 files changed, 21 insertions(+), 28 deletions(-)

diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index 9714b1ee46..fa45305d8c 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -53,7 +53,6 @@ OBJS = paths \
 	history \
 	parse_arg \
 	process \
-	poll \
 	xenstored
 
 INTF = symbol.cmi trie.cmi syslog.cmi systemd.cmi poll.cmi
diff --git a/tools/ocaml/xenstored/perms.ml b/tools/ocaml/xenstored/perms.ml
index 2c4ee9e617..14f8e334fe 100644
--- a/tools/ocaml/xenstored/perms.ml
+++ b/tools/ocaml/xenstored/perms.ml
@@ -70,7 +70,7 @@ struct
 
   let perm_of_string s =
     let ty = permty_of_char s.[0]
-    and id = Utils.int_of_string_exn (String.sub s 1 (String.length s - 1)) in
+    and id = int_of_string (String.sub s 1 (String.length s - 1)) in
     (id, ty)
 
   let of_strings ls =
diff --git a/tools/ocaml/xenstored/poll.ml b/tools/ocaml/xenstored/poll.ml
index f8571e4590..fefaa6e74c 100644
--- a/tools/ocaml/xenstored/poll.ml
+++ b/tools/ocaml/xenstored/poll.ml
@@ -30,7 +30,7 @@ external set_fd_limit: int -> unit = "stub_set_fd_limit"
 let get_sys_fs_nr_open () =
   try
     let ch = open_in "/proc/sys/fs/nr_open" in
-    let v = Utils.int_of_string_exn (input_line ch) in
+    let v = int_of_string (input_line ch) in
     close_in_noerr ch; v
   with _ -> 1024 * 1024
 
diff --git a/tools/ocaml/xenstored/process.ml b/tools/ocaml/xenstored/process.ml
index 0c9c460a99..432d66321c 100644
--- a/tools/ocaml/xenstored/process.ml
+++ b/tools/ocaml/xenstored/process.ml
@@ -229,7 +229,7 @@ let do_debug con t _domains cons data =
       Logging.xb_op ~tid:0 ~ty:Xenbus.Xb.Op.Debug ~con:"=======>" msg;
       None
     | "quota" :: domid :: _ ->
-      let domid = Utils.int_of_string_exn domid in
+      let domid = int_of_string domid in
       let quota = (Store.get_quota t.Transaction.store) in
       Some (Quota.to_string quota domid ^ "\000")
     | "watches" :: _ ->
@@ -242,7 +242,7 @@ let do_debug con t _domains cons data =
       History.trim ();
       Some "trimmed"
     | "txn" :: domid :: _ ->
-      let domid = Utils.int_of_string_exn domid in
+      let domid = int_of_string domid in
       let con = Connections.find_domain cons domid in
       let b = Buffer.create 128 in
       let () = con.transactions |> Hashtbl.iter @@ fun id tx ->
@@ -253,7 +253,7 @@ let do_debug con t _domains cons data =
       in
       Some (Buffer.contents b)
     | "xenbus" :: domid :: _ ->
-      let domid = Utils.int_of_string_exn domid in
+      let domid = int_of_string domid in
       let con = Connections.find_domain cons domid in
       let s = Printf.sprintf "xenbus: %s; overflow queue length: %d, can_input: %b, has_more_input: %b, has_old_output: %b, has_new_output: %b, has_more_work: %b. pending: %s"
           (Xenbus.Xb.debug con.xb)
@@ -267,7 +267,7 @@ let do_debug con t _domains cons data =
       in
       Some s
     | "mfn" :: domid :: _ ->
-      let domid = Utils.int_of_string_exn domid in
+      let domid = int_of_string domid in
       let con = Connections.find_domain cons domid in
       may (fun dom -> Printf.sprintf "%nd\000" (Domain.get_mfn dom)) (Connection.get_domain con)
     | _ -> None
@@ -340,7 +340,7 @@ let do_isintroduced con _t domains _cons data =
   then raise Define.Permission_denied;
   let domid =
     match (split None '\000' data) with
-    | domid :: _ -> Utils.int_of_string_exn domid
+    | domid :: _ -> int_of_string domid
     | _          -> raise Invalid_Cmd_Args
   in
   if domid = Define.domid_self || Domains.exist domains domid then "T\000" else "F\000"
@@ -437,7 +437,7 @@ let input_handle_error ~cons ~doms ~fct ~con ~t ~req =
   | Quota.Limit_reached          -> reply_error "EQUOTA"
   | Quota.Data_too_big           -> reply_error "E2BIG"
   | Quota.Transaction_opened     -> reply_error "EQUOTA"
-  | Utils.ConversionFailed s     -> reply_error "EINVAL"
+  | (Failure "int_of_string")    -> reply_error "EINVAL"
   | Define.Unknown_operation     -> reply_error "ENOSYS"
 
 let write_access_log ~ty ~tid ~con ~data =
@@ -578,7 +578,7 @@ let do_introduce con t domains cons data =
   let (domid, mfn, remote_port) =
     match (split None '\000' data) with
     | domid :: mfn :: remote_port :: _ ->
-      Utils.int_of_string_exn domid, Nativeint.of_string mfn, Utils.int_of_string_exn remote_port
+      int_of_string domid, Nativeint.of_string mfn, int_of_string remote_port
     | _                         -> raise Invalid_Cmd_Args;
   in
   let dom =
@@ -604,7 +604,7 @@ let do_release con t domains cons data =
   then raise Define.Permission_denied;
   let domid =
     match (split None '\000' data) with
-    | [domid;""] -> Utils.int_of_string_exn domid
+    | [domid;""] -> int_of_string domid
     | _          -> raise Invalid_Cmd_Args
   in
   let fire_spec_watches = Domains.exist domains domid in
@@ -620,7 +620,7 @@ let do_resume con _t domains _cons data =
   then raise Define.Permission_denied;
   let domid =
     match (split None '\000' data) with
-    | domid :: _ -> Utils.int_of_string_exn domid
+    | domid :: _ -> int_of_string domid
     | _          -> raise Invalid_Cmd_Args
   in
   if Domains.exist domains domid
diff --git a/tools/ocaml/xenstored/utils.ml b/tools/ocaml/xenstored/utils.ml
index 7a556bce75..48d84ef7d3 100644
--- a/tools/ocaml/xenstored/utils.ml
+++ b/tools/ocaml/xenstored/utils.ml
@@ -53,14 +53,8 @@ let hexify s =
     ) s;
   Bytes.unsafe_to_string hs
 
-exception ConversionFailed of string
-let int_of_string_exn s =
-  match int_of_string_opt s with
-  | Some x -> x
-  | None -> raise (ConversionFailed s)
-
 let unhexify hs =
-  let char_of_hexseq seq0 seq1 = Char.chr (int_of_string_exn (sprintf "0x%c%c" seq0 seq1)) in
+  let char_of_hexseq seq0 seq1 = Char.chr (int_of_string (sprintf "0x%c%c" seq0 seq1)) in
   let b = Bytes.create (String.length hs / 2) in
   for i = 0 to Bytes.length b - 1
   do
@@ -92,7 +86,7 @@ let read_file_single_integer filename =
   let buf = Bytes.make 20 '\000' in
   let sz = Unix.read fd buf 0 20 in
   Unix.close fd;
-  int_of_string_exn (Bytes.sub_string buf 0 sz)
+  int_of_string (Bytes.sub_string buf 0 sz)
 
 (* @path may be guest data and needs its length validating.  @connection_path
  * is generated locally in xenstored and always of the form "/local/domain/$N/" *)
diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml
index 84dee622ea..1aaa3e995e 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -167,20 +167,20 @@ module DB = struct
                					   e.g. a RO socket from a previous version: ignore it *)
             global_f ~rw
           | "evtchn-dev" :: fd :: domexc_port :: [] ->
-            evtchn_f ~fd:(Utils.int_of_string_exn fd)
-              ~domexc_port:(Utils.int_of_string_exn domexc_port)
+            evtchn_f ~fd:(int_of_string fd)
+              ~domexc_port:(int_of_string domexc_port)
           | "socket" :: fd :: [] ->
-            socket_f ~fd:(Utils.int_of_string_exn fd)
+            socket_f ~fd:(int_of_string fd)
           | "dom" :: domid :: mfn :: remote_port :: rest ->
             let local_port = match rest with
               | [] -> None (* backward compat: old version didn't have it *)
-              | local_port :: _ -> Some (Utils.int_of_string_exn local_port) in
+              | local_port :: _ -> Some (int_of_string local_port) in
             domain_f ?local_port
-              ~remote_port:(Utils.int_of_string_exn remote_port)
-              (Utils.int_of_string_exn domid)
+              ~remote_port:(int_of_string remote_port)
+              (int_of_string domid)
               (Nativeint.of_string mfn)
           | "watch" :: domid :: path :: token :: [] ->
-            watch_f (Utils.int_of_string_exn domid)
+            watch_f (int_of_string domid)
               (unhexify path) (unhexify token)
           | "store" :: path :: perms :: value :: [] ->
             store_f (getpath path)
@@ -214,7 +214,7 @@ module DB = struct
     in
     let global_f ~rw =
       let get_listen_sock sockfd =
-        let fd = sockfd |> Utils.int_of_string_exn |> Utils.FD.of_int in
+        let fd = sockfd |> int_of_string |> Utils.FD.of_int in
         Unix.listen fd 1;
         Some fd
       in
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 06:44:08 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 06:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936240.1337509 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0EJ1-0001bz-6F; Thu, 03 Apr 2025 06:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936240.1337509; Thu, 03 Apr 2025 06: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 1u0EJ1-0001br-3i; Thu, 03 Apr 2025 06:44:03 +0000
Received: by outflank-mailman (input) for mailman id 936240;
 Thu, 03 Apr 2025 06: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 1u0EIz-0001bl-TP
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 06: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 1u0EIz-009QY9-2b
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 06:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0EIz-006i5j-2S
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 06: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=BpMNz8g/2MKJbAf4bbMa1gZmPDbZXu7ZpgOSzX04kFc=; b=AAV2UCYDuSmx2MoRptzj2FXdVQ
	P5A2u6vT6i1EsEE4fkTAVlZkqNryglRwOGzihYQIJnlRsCMNq09bZOVPHeKmbL1kZz0KGIofxlLrM
	fs48V1KczWBDpm/fz5fcnIlYiXp1uGbMcZdmqNz3y6pGMSs3ZgtH7DEv46M6X/75RSXw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] tools/ocaml: Fix oxenstored build warning
Message-Id: <E1u0EIz-006i5j-2S@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 06:44:01 +0000

commit ca847010e3a8004af779836134502cca1ca2ca50
Author:     Andrii Sultanov <andrii.sultanov@cloud.com>
AuthorDate: Wed Apr 2 14:30:08 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 2 14:30:08 2025 +0200

    tools/ocaml: Fix oxenstored build warning
    
    OCaml, in preparation for a renaming of the error string associated with
    conversion failure in 'int_of_string' functions, started to issue this
    warning:
    
      File "process.ml", line 440, characters 13-28:
      440 |   | (Failure "int_of_string")    -> reply_error "EINVAL"
                         ^^^^^^^^^^^^^^^
      Warning 52 [fragile-literal-pattern]: Code should not depend on the actual values of
      this constructor's arguments. They are only for information
      and may change in future versions. (See manual section 11.5)
    
    Deal with this at the source, and instead create our own stable
    ConversionFailure exception that's raised on the None case in
    'int_of_string_opt'.
    
    'c_int_of_string' is safe and does not raise such exceptions.
    
    Signed-off-by: Andrii Sultanov <andrii.sultanov@cloud.com>
    Acked-by: Christian Lindig <christian.lindig@cloud.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: c11772277fe5f1b0874141a24554c2e3da2d9a6e
    master date: 2025-02-25 13:30:55 +0000
---
 tools/ocaml/xenstored/Makefile     |  1 +
 tools/ocaml/xenstored/perms.ml     |  2 +-
 tools/ocaml/xenstored/poll.ml      |  2 +-
 tools/ocaml/xenstored/process.ml   | 18 +++++++++---------
 tools/ocaml/xenstored/utils.ml     | 10 ++++++++--
 tools/ocaml/xenstored/xenstored.ml | 16 ++++++++--------
 6 files changed, 28 insertions(+), 21 deletions(-)

diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index fa45305d8c..9714b1ee46 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -53,6 +53,7 @@ OBJS = paths \
 	history \
 	parse_arg \
 	process \
+	poll \
 	xenstored
 
 INTF = symbol.cmi trie.cmi syslog.cmi systemd.cmi poll.cmi
diff --git a/tools/ocaml/xenstored/perms.ml b/tools/ocaml/xenstored/perms.ml
index 14f8e334fe..2c4ee9e617 100644
--- a/tools/ocaml/xenstored/perms.ml
+++ b/tools/ocaml/xenstored/perms.ml
@@ -70,7 +70,7 @@ struct
 
   let perm_of_string s =
     let ty = permty_of_char s.[0]
-    and id = int_of_string (String.sub s 1 (String.length s - 1)) in
+    and id = Utils.int_of_string_exn (String.sub s 1 (String.length s - 1)) in
     (id, ty)
 
   let of_strings ls =
diff --git a/tools/ocaml/xenstored/poll.ml b/tools/ocaml/xenstored/poll.ml
index fefaa6e74c..f8571e4590 100644
--- a/tools/ocaml/xenstored/poll.ml
+++ b/tools/ocaml/xenstored/poll.ml
@@ -30,7 +30,7 @@ external set_fd_limit: int -> unit = "stub_set_fd_limit"
 let get_sys_fs_nr_open () =
   try
     let ch = open_in "/proc/sys/fs/nr_open" in
-    let v = int_of_string (input_line ch) in
+    let v = Utils.int_of_string_exn (input_line ch) in
     close_in_noerr ch; v
   with _ -> 1024 * 1024
 
diff --git a/tools/ocaml/xenstored/process.ml b/tools/ocaml/xenstored/process.ml
index 432d66321c..0c9c460a99 100644
--- a/tools/ocaml/xenstored/process.ml
+++ b/tools/ocaml/xenstored/process.ml
@@ -229,7 +229,7 @@ let do_debug con t _domains cons data =
       Logging.xb_op ~tid:0 ~ty:Xenbus.Xb.Op.Debug ~con:"=======>" msg;
       None
     | "quota" :: domid :: _ ->
-      let domid = int_of_string domid in
+      let domid = Utils.int_of_string_exn domid in
       let quota = (Store.get_quota t.Transaction.store) in
       Some (Quota.to_string quota domid ^ "\000")
     | "watches" :: _ ->
@@ -242,7 +242,7 @@ let do_debug con t _domains cons data =
       History.trim ();
       Some "trimmed"
     | "txn" :: domid :: _ ->
-      let domid = int_of_string domid in
+      let domid = Utils.int_of_string_exn domid in
       let con = Connections.find_domain cons domid in
       let b = Buffer.create 128 in
       let () = con.transactions |> Hashtbl.iter @@ fun id tx ->
@@ -253,7 +253,7 @@ let do_debug con t _domains cons data =
       in
       Some (Buffer.contents b)
     | "xenbus" :: domid :: _ ->
-      let domid = int_of_string domid in
+      let domid = Utils.int_of_string_exn domid in
       let con = Connections.find_domain cons domid in
       let s = Printf.sprintf "xenbus: %s; overflow queue length: %d, can_input: %b, has_more_input: %b, has_old_output: %b, has_new_output: %b, has_more_work: %b. pending: %s"
           (Xenbus.Xb.debug con.xb)
@@ -267,7 +267,7 @@ let do_debug con t _domains cons data =
       in
       Some s
     | "mfn" :: domid :: _ ->
-      let domid = int_of_string domid in
+      let domid = Utils.int_of_string_exn domid in
       let con = Connections.find_domain cons domid in
       may (fun dom -> Printf.sprintf "%nd\000" (Domain.get_mfn dom)) (Connection.get_domain con)
     | _ -> None
@@ -340,7 +340,7 @@ let do_isintroduced con _t domains _cons data =
   then raise Define.Permission_denied;
   let domid =
     match (split None '\000' data) with
-    | domid :: _ -> int_of_string domid
+    | domid :: _ -> Utils.int_of_string_exn domid
     | _          -> raise Invalid_Cmd_Args
   in
   if domid = Define.domid_self || Domains.exist domains domid then "T\000" else "F\000"
@@ -437,7 +437,7 @@ let input_handle_error ~cons ~doms ~fct ~con ~t ~req =
   | Quota.Limit_reached          -> reply_error "EQUOTA"
   | Quota.Data_too_big           -> reply_error "E2BIG"
   | Quota.Transaction_opened     -> reply_error "EQUOTA"
-  | (Failure "int_of_string")    -> reply_error "EINVAL"
+  | Utils.ConversionFailed s     -> reply_error "EINVAL"
   | Define.Unknown_operation     -> reply_error "ENOSYS"
 
 let write_access_log ~ty ~tid ~con ~data =
@@ -578,7 +578,7 @@ let do_introduce con t domains cons data =
   let (domid, mfn, remote_port) =
     match (split None '\000' data) with
     | domid :: mfn :: remote_port :: _ ->
-      int_of_string domid, Nativeint.of_string mfn, int_of_string remote_port
+      Utils.int_of_string_exn domid, Nativeint.of_string mfn, Utils.int_of_string_exn remote_port
     | _                         -> raise Invalid_Cmd_Args;
   in
   let dom =
@@ -604,7 +604,7 @@ let do_release con t domains cons data =
   then raise Define.Permission_denied;
   let domid =
     match (split None '\000' data) with
-    | [domid;""] -> int_of_string domid
+    | [domid;""] -> Utils.int_of_string_exn domid
     | _          -> raise Invalid_Cmd_Args
   in
   let fire_spec_watches = Domains.exist domains domid in
@@ -620,7 +620,7 @@ let do_resume con _t domains _cons data =
   then raise Define.Permission_denied;
   let domid =
     match (split None '\000' data) with
-    | domid :: _ -> int_of_string domid
+    | domid :: _ -> Utils.int_of_string_exn domid
     | _          -> raise Invalid_Cmd_Args
   in
   if Domains.exist domains domid
diff --git a/tools/ocaml/xenstored/utils.ml b/tools/ocaml/xenstored/utils.ml
index 48d84ef7d3..7a556bce75 100644
--- a/tools/ocaml/xenstored/utils.ml
+++ b/tools/ocaml/xenstored/utils.ml
@@ -53,8 +53,14 @@ let hexify s =
     ) s;
   Bytes.unsafe_to_string hs
 
+exception ConversionFailed of string
+let int_of_string_exn s =
+  match int_of_string_opt s with
+  | Some x -> x
+  | None -> raise (ConversionFailed s)
+
 let unhexify hs =
-  let char_of_hexseq seq0 seq1 = Char.chr (int_of_string (sprintf "0x%c%c" seq0 seq1)) in
+  let char_of_hexseq seq0 seq1 = Char.chr (int_of_string_exn (sprintf "0x%c%c" seq0 seq1)) in
   let b = Bytes.create (String.length hs / 2) in
   for i = 0 to Bytes.length b - 1
   do
@@ -86,7 +92,7 @@ let read_file_single_integer filename =
   let buf = Bytes.make 20 '\000' in
   let sz = Unix.read fd buf 0 20 in
   Unix.close fd;
-  int_of_string (Bytes.sub_string buf 0 sz)
+  int_of_string_exn (Bytes.sub_string buf 0 sz)
 
 (* @path may be guest data and needs its length validating.  @connection_path
  * is generated locally in xenstored and always of the form "/local/domain/$N/" *)
diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml
index 1aaa3e995e..84dee622ea 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -167,20 +167,20 @@ module DB = struct
                					   e.g. a RO socket from a previous version: ignore it *)
             global_f ~rw
           | "evtchn-dev" :: fd :: domexc_port :: [] ->
-            evtchn_f ~fd:(int_of_string fd)
-              ~domexc_port:(int_of_string domexc_port)
+            evtchn_f ~fd:(Utils.int_of_string_exn fd)
+              ~domexc_port:(Utils.int_of_string_exn domexc_port)
           | "socket" :: fd :: [] ->
-            socket_f ~fd:(int_of_string fd)
+            socket_f ~fd:(Utils.int_of_string_exn fd)
           | "dom" :: domid :: mfn :: remote_port :: rest ->
             let local_port = match rest with
               | [] -> None (* backward compat: old version didn't have it *)
-              | local_port :: _ -> Some (int_of_string local_port) in
+              | local_port :: _ -> Some (Utils.int_of_string_exn local_port) in
             domain_f ?local_port
-              ~remote_port:(int_of_string remote_port)
-              (int_of_string domid)
+              ~remote_port:(Utils.int_of_string_exn remote_port)
+              (Utils.int_of_string_exn domid)
               (Nativeint.of_string mfn)
           | "watch" :: domid :: path :: token :: [] ->
-            watch_f (int_of_string domid)
+            watch_f (Utils.int_of_string_exn domid)
               (unhexify path) (unhexify token)
           | "store" :: path :: perms :: value :: [] ->
             store_f (getpath path)
@@ -214,7 +214,7 @@ module DB = struct
     in
     let global_f ~rw =
       let get_listen_sock sockfd =
-        let fd = sockfd |> int_of_string |> Utils.FD.of_int in
+        let fd = sockfd |> Utils.int_of_string_exn |> Utils.FD.of_int in
         Unix.listen fd 1;
         Some fd
       in
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 06:44:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 06:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936241.1337514 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0EJB-0001dg-8U; Thu, 03 Apr 2025 06:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936241.1337514; Thu, 03 Apr 2025 06: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 1u0EJB-0001dU-58; Thu, 03 Apr 2025 06:44:13 +0000
Received: by outflank-mailman (input) for mailman id 936241;
 Thu, 03 Apr 2025 06: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 1u0EJ9-0001dK-Un
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 06: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 1u0EJ9-009QYE-2w
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 06:44:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0EJ9-006i7e-2m
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 06: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=uJp69aggzHEn0V4yv/4vFjmtEN6i+sCp6rgftexIS58=; b=jjT2wYc/sPSWo7GK9L3zVE8Wec
	u84DEY/JXRxsl6ZjauquZRBLi5Ui4fZ16cL7fXvoGgkaIZrtCxKVGRW8I/pCY7mN3MKYnqstjRHbD
	LIWtuF8Zq1oPKrH0L/dPMUciUIIzFNPSet65UjFwgIysFC3LjX2U5sWZEpKgD5BvPbbI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] ARM/vgic: Fix out-of-bounds accesses in vgic_mmio_write_sgir()
Message-Id: <E1u0EJ9-006i7e-2m@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 06:44:11 +0000

commit 022596f53f96ee83c6ad8be608e3ab84d2fd2ab2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Apr 2 14:31:17 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 2 14:31:17 2025 +0200

    ARM/vgic: Fix out-of-bounds accesses in vgic_mmio_write_sgir()
    
    The switch() statement is over bits 24:25 (unshifted) of the guest provided
    value.  This makes case 0x3: dead, and not an implementation of the 4th
    possible state.
    
    A guest which writes (0x3 << 24) | (0xff << 16) to this register will skip the
    early exit, then enter bitmap_for_each() with targets not bound by nr_vcpus.
    
    If the guest has fewer than 8 vCPUs, bitmap_for_each() will read off the end
    of d->vcpu[] and use the resulting vcpu pointer to ultimately derive irq, and
    perform out-of-bounds writes.
    
    Fix this by changing case 0x3 to default.
    
    Fixes: 08c688ca6422 ("ARM: new VGIC: Add SGIR register handler")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    master commit: be7f0cc651d8d02a95820792204c0558f1f29e03
    master date: 2025-03-27 11:54:23 +0000
---
 xen/arch/arm/vgic/vgic-mmio-v2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/vgic/vgic-mmio-v2.c b/xen/arch/arm/vgic/vgic-mmio-v2.c
index 2e507b10fe..e14de567a7 100644
--- a/xen/arch/arm/vgic/vgic-mmio-v2.c
+++ b/xen/arch/arm/vgic/vgic-mmio-v2.c
@@ -104,7 +104,8 @@ static void vgic_mmio_write_sgir(struct vcpu *source_vcpu,
     case GICD_SGI_TARGET_SELF:                    /* this very vCPU only */
         targets = (1U << source_vcpu->vcpu_id);
         break;
-    case 0x3:                                     /* reserved */
+
+    default:
         return;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 06:44:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 06:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936242.1337518 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0EJL-0001gB-9A; Thu, 03 Apr 2025 06:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936242.1337518; Thu, 03 Apr 2025 06: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 1u0EJL-0001g3-6b; Thu, 03 Apr 2025 06:44:23 +0000
Received: by outflank-mailman (input) for mailman id 936242;
 Thu, 03 Apr 2025 06: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 1u0EJK-0001fq-1m
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 06: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 1u0EJK-009QbA-04
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 06:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0EJJ-006i9s-38
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 06: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=GgLFHNtFv/8gz4nYYlKWr3EBgs3P+sGf0Cthus03Zsg=; b=JyT8t4+UuED3MTohr2y6ztpebg
	N908TD93XVBxg75Xb6nd5DQNZzupuPfPiXTHnhQHgbE8DtvOpsCKqARTOj8otDBWl0Fzst2jKJLSF
	ONzwSRH5DY0RbPzFo7dK5GEay2ny6K1H1xJJ5g8chlsWls+7qgM5tyIS2v/OsL3bvEFc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] x86/P2M: synchronize fast and slow paths of p2m_get_page_from_gfn()
Message-Id: <E1u0EJJ-006i9s-38@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 06:44:21 +0000

commit 73ad31d852f2cbf82bf66c3af84d4672f38ac00e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Apr 2 14:31:26 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 2 14:31:26 2025 +0200

    x86/P2M: synchronize fast and slow paths of p2m_get_page_from_gfn()
    
    Handling of foreign pages was different between the two paths.
    
    While permitting access to grants would be desirable, doing so would
    require more involved handling; undo that for the time being. In
    particular the page reference obtained would prevent the owning domain
    from changing e.g. the page's type (after the grantee has released the
    last reference of the grant). Instead perhaps another reference on the
    grant would need obtaining. Which in turn would require determining
    which grant that was.
    
    Foreign pages in any event need permitting on both paths.
    
    Introduce a helper function to be used on both paths, such that
    respective checking differs in just the extra "to be unshared" condition
    on the fast path.
    
    While there adjust the sanity check for foreign pages: Don't leak the
    reference on release builds when on a debug build the assertion would
    have triggered. (Thanks to Roger for the suggestion.)
    
    Fixes: 80ea7af17269 ("x86/mm: Introduce get_page_from_gfn()")
    Fixes: 50fe6e737059 ("pvh dom0: add and remove foreign pages")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: a8325f981ce4ff8ac8bcc73735f357846b0a0fbb
    master date: 2025-03-31 09:21:12 +0200
---
 xen/arch/x86/mm/p2m.c | 68 +++++++++++++++++++++++++++++----------------------
 1 file changed, 39 insertions(+), 29 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 4d5a41898a..ae37e1ec78 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -321,12 +321,46 @@ void p2m_put_gfn(struct p2m_domain *p2m, gfn_t gfn)
     gfn_unlock(p2m, gfn_x(gfn), 0);
 }
 
+static struct page_info *get_page_from_mfn_and_type(
+    const struct domain *d, mfn_t mfn, p2m_type_t t)
+{
+    struct page_info *page;
+
+    if ( !mfn_valid(mfn) )
+        return NULL;
+
+    page = mfn_to_page(mfn);
+
+    if ( p2m_is_ram(t) )
+    {
+        if ( p2m_is_shared(t) )
+            d = dom_cow;
+
+        if ( get_page(page, d) )
+            return page;
+    }
+    else if ( unlikely(p2m_is_foreign(t)) )
+    {
+        const struct domain *fdom = page_get_owner_and_reference(page);
+
+        if ( fdom )
+        {
+            if ( likely(fdom != d) )
+                return page;
+            ASSERT_UNREACHABLE();
+            put_page(page);
+        }
+    }
+
+    return NULL;
+}
+
 /* Atomically look up a GFN and take a reference count on the backing page. */
 struct page_info *p2m_get_page_from_gfn(
     struct p2m_domain *p2m, gfn_t gfn,
     p2m_type_t *t, p2m_access_t *a, p2m_query_t q)
 {
-    struct page_info *page = NULL;
+    struct page_info *page;
     p2m_access_t _a;
     p2m_type_t _t;
     mfn_t mfn;
@@ -340,26 +374,9 @@ struct page_info *p2m_get_page_from_gfn(
         /* Fast path: look up and get out */
         p2m_read_lock(p2m);
         mfn = p2m_get_gfn_type_access(p2m, gfn, t, a, 0, NULL, 0);
-        if ( p2m_is_any_ram(*t) && mfn_valid(mfn)
-             && !((q & P2M_UNSHARE) && p2m_is_shared(*t)) )
-        {
-            page = mfn_to_page(mfn);
-            if ( unlikely(p2m_is_foreign(*t)) )
-            {
-                struct domain *fdom = page_get_owner_and_reference(page);
-
-                ASSERT(fdom != p2m->domain);
-                if ( fdom == NULL )
-                    page = NULL;
-            }
-            else
-            {
-                struct domain *d = !p2m_is_shared(*t) ? p2m->domain : dom_cow;
-
-                if ( !get_page(page, d) )
-                    page = NULL;
-            }
-        }
+        page = !(q & P2M_UNSHARE) || !p2m_is_shared(*t)
+               ? get_page_from_mfn_and_type(p2m->domain, mfn, *t)
+               : NULL;
         p2m_read_unlock(p2m);
 
         if ( page )
@@ -373,14 +390,7 @@ struct page_info *p2m_get_page_from_gfn(
 
     /* Slow path: take the write lock and do fixups */
     mfn = get_gfn_type_access(p2m, gfn_x(gfn), t, a, q, NULL);
-    if ( p2m_is_ram(*t) && mfn_valid(mfn) )
-    {
-        struct domain *d = !p2m_is_shared(*t) ? p2m->domain : dom_cow;
-
-        page = mfn_to_page(mfn);
-        if ( !get_page(page, d) )
-            page = NULL;
-    }
+    page = get_page_from_mfn_and_type(p2m->domain, mfn, *t);
     put_gfn(p2m->domain, gfn_x(gfn));
 
     return page;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 06:44:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 06:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936243.1337522 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0EJV-0001it-Aq; Thu, 03 Apr 2025 06:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936243.1337522; Thu, 03 Apr 2025 06: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 1u0EJV-0001ih-7y; Thu, 03 Apr 2025 06:44:33 +0000
Received: by outflank-mailman (input) for mailman id 936243;
 Thu, 03 Apr 2025 06: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 1u0EJU-0001iQ-4i
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 06: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 1u0EJU-009Qbn-0M
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 06:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0EJU-006iD9-0F
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 06: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=aDmRoobvJX2H/4mhmGOtaOEXN1BOcmXRP6G8hYjUenk=; b=cNINmeG/ett3buACvRBvWdkkbS
	opj9L+AoY8TrJxWdX7Gh1AdQXnkpEIQpc0vLwoZQ2I9ymZFmA5BfR4Y1LkYIPA+iAOGe0xANuLyO4
	/v3Gy8ev2CiAu0YTX0kjdajme93TRfgZLCrAVgo4NCDqsKsbU2DVIzNno4TgCbaThncA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] Revert "tools/ocaml: Fix oxenstored build warning"
Message-Id: <E1u0EJU-006iD9-0F@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 06:44:32 +0000

commit da7928d6daa8a03feac2449627186363ba87ba2e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 3 07:52:11 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 3 07:52:11 2025 +0200

    Revert "tools/ocaml: Fix oxenstored build warning"
    
    This reverts commit ca847010e3a8004af779836134502cca1ca2ca50. It
    depends on an OCaml version bump not present on this branch.
---
 tools/ocaml/xenstored/Makefile     |  1 -
 tools/ocaml/xenstored/perms.ml     |  2 +-
 tools/ocaml/xenstored/poll.ml      |  2 +-
 tools/ocaml/xenstored/process.ml   | 18 +++++++++---------
 tools/ocaml/xenstored/utils.ml     | 10 ++--------
 tools/ocaml/xenstored/xenstored.ml | 16 ++++++++--------
 6 files changed, 21 insertions(+), 28 deletions(-)

diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index 9714b1ee46..fa45305d8c 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -53,7 +53,6 @@ OBJS = paths \
 	history \
 	parse_arg \
 	process \
-	poll \
 	xenstored
 
 INTF = symbol.cmi trie.cmi syslog.cmi systemd.cmi poll.cmi
diff --git a/tools/ocaml/xenstored/perms.ml b/tools/ocaml/xenstored/perms.ml
index 2c4ee9e617..14f8e334fe 100644
--- a/tools/ocaml/xenstored/perms.ml
+++ b/tools/ocaml/xenstored/perms.ml
@@ -70,7 +70,7 @@ struct
 
   let perm_of_string s =
     let ty = permty_of_char s.[0]
-    and id = Utils.int_of_string_exn (String.sub s 1 (String.length s - 1)) in
+    and id = int_of_string (String.sub s 1 (String.length s - 1)) in
     (id, ty)
 
   let of_strings ls =
diff --git a/tools/ocaml/xenstored/poll.ml b/tools/ocaml/xenstored/poll.ml
index f8571e4590..fefaa6e74c 100644
--- a/tools/ocaml/xenstored/poll.ml
+++ b/tools/ocaml/xenstored/poll.ml
@@ -30,7 +30,7 @@ external set_fd_limit: int -> unit = "stub_set_fd_limit"
 let get_sys_fs_nr_open () =
   try
     let ch = open_in "/proc/sys/fs/nr_open" in
-    let v = Utils.int_of_string_exn (input_line ch) in
+    let v = int_of_string (input_line ch) in
     close_in_noerr ch; v
   with _ -> 1024 * 1024
 
diff --git a/tools/ocaml/xenstored/process.ml b/tools/ocaml/xenstored/process.ml
index 0c9c460a99..432d66321c 100644
--- a/tools/ocaml/xenstored/process.ml
+++ b/tools/ocaml/xenstored/process.ml
@@ -229,7 +229,7 @@ let do_debug con t _domains cons data =
       Logging.xb_op ~tid:0 ~ty:Xenbus.Xb.Op.Debug ~con:"=======>" msg;
       None
     | "quota" :: domid :: _ ->
-      let domid = Utils.int_of_string_exn domid in
+      let domid = int_of_string domid in
       let quota = (Store.get_quota t.Transaction.store) in
       Some (Quota.to_string quota domid ^ "\000")
     | "watches" :: _ ->
@@ -242,7 +242,7 @@ let do_debug con t _domains cons data =
       History.trim ();
       Some "trimmed"
     | "txn" :: domid :: _ ->
-      let domid = Utils.int_of_string_exn domid in
+      let domid = int_of_string domid in
       let con = Connections.find_domain cons domid in
       let b = Buffer.create 128 in
       let () = con.transactions |> Hashtbl.iter @@ fun id tx ->
@@ -253,7 +253,7 @@ let do_debug con t _domains cons data =
       in
       Some (Buffer.contents b)
     | "xenbus" :: domid :: _ ->
-      let domid = Utils.int_of_string_exn domid in
+      let domid = int_of_string domid in
       let con = Connections.find_domain cons domid in
       let s = Printf.sprintf "xenbus: %s; overflow queue length: %d, can_input: %b, has_more_input: %b, has_old_output: %b, has_new_output: %b, has_more_work: %b. pending: %s"
           (Xenbus.Xb.debug con.xb)
@@ -267,7 +267,7 @@ let do_debug con t _domains cons data =
       in
       Some s
     | "mfn" :: domid :: _ ->
-      let domid = Utils.int_of_string_exn domid in
+      let domid = int_of_string domid in
       let con = Connections.find_domain cons domid in
       may (fun dom -> Printf.sprintf "%nd\000" (Domain.get_mfn dom)) (Connection.get_domain con)
     | _ -> None
@@ -340,7 +340,7 @@ let do_isintroduced con _t domains _cons data =
   then raise Define.Permission_denied;
   let domid =
     match (split None '\000' data) with
-    | domid :: _ -> Utils.int_of_string_exn domid
+    | domid :: _ -> int_of_string domid
     | _          -> raise Invalid_Cmd_Args
   in
   if domid = Define.domid_self || Domains.exist domains domid then "T\000" else "F\000"
@@ -437,7 +437,7 @@ let input_handle_error ~cons ~doms ~fct ~con ~t ~req =
   | Quota.Limit_reached          -> reply_error "EQUOTA"
   | Quota.Data_too_big           -> reply_error "E2BIG"
   | Quota.Transaction_opened     -> reply_error "EQUOTA"
-  | Utils.ConversionFailed s     -> reply_error "EINVAL"
+  | (Failure "int_of_string")    -> reply_error "EINVAL"
   | Define.Unknown_operation     -> reply_error "ENOSYS"
 
 let write_access_log ~ty ~tid ~con ~data =
@@ -578,7 +578,7 @@ let do_introduce con t domains cons data =
   let (domid, mfn, remote_port) =
     match (split None '\000' data) with
     | domid :: mfn :: remote_port :: _ ->
-      Utils.int_of_string_exn domid, Nativeint.of_string mfn, Utils.int_of_string_exn remote_port
+      int_of_string domid, Nativeint.of_string mfn, int_of_string remote_port
     | _                         -> raise Invalid_Cmd_Args;
   in
   let dom =
@@ -604,7 +604,7 @@ let do_release con t domains cons data =
   then raise Define.Permission_denied;
   let domid =
     match (split None '\000' data) with
-    | [domid;""] -> Utils.int_of_string_exn domid
+    | [domid;""] -> int_of_string domid
     | _          -> raise Invalid_Cmd_Args
   in
   let fire_spec_watches = Domains.exist domains domid in
@@ -620,7 +620,7 @@ let do_resume con _t domains _cons data =
   then raise Define.Permission_denied;
   let domid =
     match (split None '\000' data) with
-    | domid :: _ -> Utils.int_of_string_exn domid
+    | domid :: _ -> int_of_string domid
     | _          -> raise Invalid_Cmd_Args
   in
   if Domains.exist domains domid
diff --git a/tools/ocaml/xenstored/utils.ml b/tools/ocaml/xenstored/utils.ml
index 7a556bce75..48d84ef7d3 100644
--- a/tools/ocaml/xenstored/utils.ml
+++ b/tools/ocaml/xenstored/utils.ml
@@ -53,14 +53,8 @@ let hexify s =
     ) s;
   Bytes.unsafe_to_string hs
 
-exception ConversionFailed of string
-let int_of_string_exn s =
-  match int_of_string_opt s with
-  | Some x -> x
-  | None -> raise (ConversionFailed s)
-
 let unhexify hs =
-  let char_of_hexseq seq0 seq1 = Char.chr (int_of_string_exn (sprintf "0x%c%c" seq0 seq1)) in
+  let char_of_hexseq seq0 seq1 = Char.chr (int_of_string (sprintf "0x%c%c" seq0 seq1)) in
   let b = Bytes.create (String.length hs / 2) in
   for i = 0 to Bytes.length b - 1
   do
@@ -92,7 +86,7 @@ let read_file_single_integer filename =
   let buf = Bytes.make 20 '\000' in
   let sz = Unix.read fd buf 0 20 in
   Unix.close fd;
-  int_of_string_exn (Bytes.sub_string buf 0 sz)
+  int_of_string (Bytes.sub_string buf 0 sz)
 
 (* @path may be guest data and needs its length validating.  @connection_path
  * is generated locally in xenstored and always of the form "/local/domain/$N/" *)
diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml
index 84dee622ea..1aaa3e995e 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -167,20 +167,20 @@ module DB = struct
                					   e.g. a RO socket from a previous version: ignore it *)
             global_f ~rw
           | "evtchn-dev" :: fd :: domexc_port :: [] ->
-            evtchn_f ~fd:(Utils.int_of_string_exn fd)
-              ~domexc_port:(Utils.int_of_string_exn domexc_port)
+            evtchn_f ~fd:(int_of_string fd)
+              ~domexc_port:(int_of_string domexc_port)
           | "socket" :: fd :: [] ->
-            socket_f ~fd:(Utils.int_of_string_exn fd)
+            socket_f ~fd:(int_of_string fd)
           | "dom" :: domid :: mfn :: remote_port :: rest ->
             let local_port = match rest with
               | [] -> None (* backward compat: old version didn't have it *)
-              | local_port :: _ -> Some (Utils.int_of_string_exn local_port) in
+              | local_port :: _ -> Some (int_of_string local_port) in
             domain_f ?local_port
-              ~remote_port:(Utils.int_of_string_exn remote_port)
-              (Utils.int_of_string_exn domid)
+              ~remote_port:(int_of_string remote_port)
+              (int_of_string domid)
               (Nativeint.of_string mfn)
           | "watch" :: domid :: path :: token :: [] ->
-            watch_f (Utils.int_of_string_exn domid)
+            watch_f (int_of_string domid)
               (unhexify path) (unhexify token)
           | "store" :: path :: perms :: value :: [] ->
             store_f (getpath path)
@@ -214,7 +214,7 @@ module DB = struct
     in
     let global_f ~rw =
       let get_listen_sock sockfd =
-        let fd = sockfd |> Utils.int_of_string_exn |> Utils.FD.of_int in
+        let fd = sockfd |> int_of_string |> Utils.FD.of_int in
         Unix.listen fd 1;
         Some fd
       in
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 06:55:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 06:55:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936244.1337526 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0ETf-000418-3f; Thu, 03 Apr 2025 06:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936244.1337526; Thu, 03 Apr 2025 06: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 1u0ETf-000410-17; Thu, 03 Apr 2025 06:55:03 +0000
Received: by outflank-mailman (input) for mailman id 936244;
 Thu, 03 Apr 2025 06: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 1u0ETd-00040u-Tl
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 06: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 1u0ETd-009QqN-2F
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 06:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0ETd-006jwk-25
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 06: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=kx9kGd7TT3sD728EqzDkMux5Q11mnp4SYBl5nAWJ0QA=; b=7HZiMBDHD7Cy7nnz6Hrxavwuy6
	5NMoX/mhOc3dO3zLKWwskj6N238IxN25VQbOFLfsA27jRObLzvkxiatsHQdBgMpvTh5x6UXdFuimN
	C9tDjmUvAPIOnGOTaEjO+W7Q3SlyeOUaJlTiZx4JO0pnIMRGh71WrB6AJqTLr7BgAzkE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: add kconfig for event_fifo
Message-Id: <E1u0ETd-006jwk-25@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 06:55:01 +0000

commit cfe15a473d92404cef0e5d361be4db4a7b9babe8
Author:     Stefano Stabellini <stefano.stabellini@amd.com>
AuthorDate: Thu Mar 27 16:22:25 2025 -0700
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Wed Apr 2 14:59:53 2025 -0700

    xen: add kconfig for event_fifo
    
    Evtchn fifos are not needed on smaller systems; the older interface is
    lightweight and sufficient. Also, event_fifo causes runtime anonymous
    memory allocations, which are undesirable.  Additionally, it exposes an
    extra interface to the guest, which is also undesirable unless
    necessary.
    
    Make it possible to disable evtchn fifo.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Acked-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/common/Kconfig         | 14 ++++++++++++++
 xen/common/Makefile        |  2 +-
 xen/common/event_channel.h | 15 +++++++++++++++
 3 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 218357d593..06ae9751aa 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -23,6 +23,20 @@ config GRANT_TABLE
 
 	  If unsure, say Y.
 
+config EVTCHN_FIFO
+	bool "Event Channel Fifo support" if EXPERT
+	default y
+	help
+	  The Event channel Fifo extends support for event channels
+	  beyond 1024 event channels for 32-bit guests and 4096 for
+	  64-bit guests.
+
+	  Cons: They cause runtime anonymous memory allocations and expose
+	  an additional interface to the guest. For smaller systems, you
+	  might consider disabling this feature.
+
+	  If unsure, say Y.
+
 config PDX_COMPRESSION
 	bool "PDX (Page inDeX) compression" if EXPERT && !X86 && !RISCV
 	default ARM || PPC
diff --git a/xen/common/Makefile b/xen/common/Makefile
index ac23120d7d..9da8a7244d 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -13,7 +13,7 @@ obj-$(CONFIG_IOREQ_SERVER) += dm.o
 obj-y += domain.o
 obj-y += event_2l.o
 obj-y += event_channel.o
-obj-y += event_fifo.o
+obj-$(CONFIG_EVTCHN_FIFO) += event_fifo.o
 obj-$(CONFIG_GRANT_TABLE) += grant_table.o
 obj-y += guestcopy.o
 obj-y += gzip/
diff --git a/xen/common/event_channel.h b/xen/common/event_channel.h
index 45219ca67c..a778ae775b 100644
--- a/xen/common/event_channel.h
+++ b/xen/common/event_channel.h
@@ -45,12 +45,27 @@ void evtchn_2l_init(struct domain *d);
 
 /* FIFO */
 
+#ifdef CONFIG_EVTCHN_FIFO
 struct evtchn_init_control;
 struct evtchn_expand_array;
 
 int evtchn_fifo_init_control(struct evtchn_init_control *init_control);
 int evtchn_fifo_expand_array(const struct evtchn_expand_array *expand_array);
 void evtchn_fifo_destroy(struct domain *d);
+#else
+static inline int evtchn_fifo_init_control(struct evtchn_init_control *init_control)
+{
+    return -EOPNOTSUPP;
+}
+static inline int evtchn_fifo_expand_array(const struct evtchn_expand_array *expand_array)
+{
+    return -EOPNOTSUPP;
+}
+static inline void evtchn_fifo_destroy(struct domain *d)
+{
+    return;
+}
+#endif /* CONFIG_EVTCHN_FIFO */
 
 /*
  * Local variables:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 06:55:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 06:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936245.1337530 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0ETp-000438-5C; Thu, 03 Apr 2025 06:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936245.1337530; Thu, 03 Apr 2025 06: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 1u0ETp-000430-2Y; Thu, 03 Apr 2025 06:55:13 +0000
Received: by outflank-mailman (input) for mailman id 936245;
 Thu, 03 Apr 2025 06: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 1u0ETn-00042n-Qe
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 06: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 1u0ETn-009QqU-2Y
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 06:55:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0ETn-006jzV-2R
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 06: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=588gH3P5ZZIoLh71dfVy3Yj8DHcp67GJpKVsuQIv4IY=; b=Dt6hiHeGM7/4FyjPPTavYWYr24
	S/C33V+45h3L2VCOBU4iysNIpPlgCVWV/9W0U7otNeqvzDs0kcYKWeRGdmP1xnX6QNS6ZuOLzqgv7
	nn8QiPHAms1RfdWl0vN6SdepnqDUEJK9QCRVf8PAd5iSACXaHfCYsMtMGW6UWmJFf8c4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] ci: create boot.ipxe for legacy boot
Message-Id: <E1u0ETn-006jzV-2R@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 06:55:11 +0000

commit 42beecae0b219fdfa04db729dea2229e05bf4af0
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Tue Apr 1 01:41:35 2025 +0200
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Wed Apr 2 16:53:02 2025 -0700

    ci: create boot.ipxe for legacy boot
    
    Hardware runners that use legacy boot use iPXE instead of grub2. Create
    boot.ipxe for those too - with exact same options.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/scripts/qubes-x86-64.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index 7c80e0c233..f272964459 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -251,6 +251,14 @@ module2 (http)/gitlab-ci/vmlinuz console=hvc0 root=/dev/ram0 earlyprintk=xen
 module2 (http)/gitlab-ci/initrd-dom0
 " > $TFTP/grub.cfg
 
+echo "#!ipxe
+
+kernel /gitlab-ci/xen $CONSOLE_OPTS loglvl=all guest_loglvl=all dom0_mem=4G console_timestamps=boot $extra_xen_opts || reboot
+module /gitlab-ci/vmlinuz console=hvc0 root=/dev/ram0 earlyprintk=xen || reboot
+module /gitlab-ci/initrd-dom0 || reboot
+boot
+" > $TFTP/boot.ipxe
+
 cp -f binaries/xen $TFTP/xen
 cp -f binaries/bzImage $TFTP/vmlinuz
 cp -f binaries/dom0-rootfs.cpio.gz $TFTP/initrd-dom0
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 06:55:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 06:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936246.1337534 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0ETz-00045Z-6W; Thu, 03 Apr 2025 06:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936246.1337534; Thu, 03 Apr 2025 06: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 1u0ETz-00045R-3s; Thu, 03 Apr 2025 06:55:23 +0000
Received: by outflank-mailman (input) for mailman id 936246;
 Thu, 03 Apr 2025 06: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 1u0ETx-00045H-Tu
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 06: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 1u0ETx-009QqY-2t
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 06:55:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0ETx-006k1k-2j
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 06: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=6bB3acfwRB/6I9wDkqUSZtYobe2YjlNhLhkIrh7qV6E=; b=ZF31fYZZZIar0IXbi+J/ifGOTD
	W0t9N1adOfn9zk+ip5VPFyzOrMZq1k/o0S2nlBBQ6WntAjEAA0SlZfrdzQnTA10J1knz5jAJF73aR
	IJCgqhDDhE8d1bv6BY2az3EAAnJVa8a/pYM4qu1A7SF/fwl2SU2NJmZGdRDBdSwSnUNw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] ci: add Intel KabyLake HW runner
Message-Id: <E1u0ETx-006k1k-2j@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 06:55:21 +0000

commit 911a766f143196a1576c1b009e2e1cde8b921062
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Tue Apr 1 01:41:36 2025 +0200
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Wed Apr 2 16:53:02 2025 -0700

    ci: add Intel KabyLake HW runner
    
    This is Intel i7-7567U in NUC 7i7BNH. This one is an older one, with no
    firmware updates (last update from 2023) and no microcode udpates
    either. While this firmware supports UEFI, network boot works only in
    legacy mode - thus legacy is used here (via iPXE, instead of grub2.efi).
    Testing legacy boot path may be a useful thing on its own.
    
    Add the same set of tests as on ADL runner.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/gitlab-ci/test.yaml | 89 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 89 insertions(+)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 225eb43998..d05b9a98af 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -155,6 +155,17 @@
   tags:
     - qubes-hw2
 
+.kbl-x86-64:
+  # it's really similar to the ADL one
+  extends: .adl-x86-64
+  variables:
+    PCIDEV: "00:1f.6"
+    PCIDEV_INTR: "MSI"
+    CONSOLE_OPTS: "console=com1 com1=115200,8n1,pci,msi"
+    SUT_ADDR: test-3.testnet
+  tags:
+    - qubes-hw3
+
 .zen2-x86-64:
   # it's really similar to the above
   extends: .adl-x86-64
@@ -312,6 +323,84 @@ adl-tools-tests-pvh-x86-64-gcc-debug:
     - *x86-64-test-needs
     - alpine-3.18-gcc-debug
 
+kbl-smoke-x86-64-gcc-debug:
+  extends: .kbl-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
+kbl-smoke-x86-64-dom0pvh-gcc-debug:
+  extends: .kbl-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh dom0pvh 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
+kbl-smoke-x86-64-dom0pvh-hvm-gcc-debug:
+  extends: .kbl-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh dom0pvh-hvm 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
+kbl-suspend-x86-64-gcc-debug:
+  extends: .kbl-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh s3 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
+kbl-pci-pv-x86-64-gcc-debug:
+  extends: .kbl-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh pci-pv 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
+kbl-pci-hvm-x86-64-gcc-debug:
+  extends: .kbl-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh pci-hvm 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
+kbl-pvshim-x86-64-gcc-debug:
+  extends: .kbl-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh pvshim 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
+kbl-tools-tests-pv-x86-64-gcc-debug:
+  extends: .kbl-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh tools-tests-pv 2>&1 | tee ${LOGFILE}
+  artifacts:
+    reports:
+      junit: tests-junit.xml
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
+kbl-tools-tests-pvh-x86-64-gcc-debug:
+  extends: .kbl-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh tools-tests-pvh 2>&1 | tee ${LOGFILE}
+  artifacts:
+    reports:
+      junit: tests-junit.xml
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
 zen2-smoke-x86-64-gcc-debug:
   extends: .zen2-x86-64
   script:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 07:44:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 07:44:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936311.1337578 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0FF5-0001FU-Cj; Thu, 03 Apr 2025 07:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936311.1337578; Thu, 03 Apr 2025 07: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 1u0FF5-0001FM-A8; Thu, 03 Apr 2025 07:44:03 +0000
Received: by outflank-mailman (input) for mailman id 936311;
 Thu, 03 Apr 2025 07:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u0FF4-0001FG-C3
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 07:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0FF3-009Rua-31
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 07:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0FF3-006wQw-2r
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 07: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=Z1ucTS/wD38TRtDLfR5rG9s/DTpOrAKOkL/8YmoFM1s=; b=KhUNSiSydQ3OPDaRx+Q6XAkXTM
	aMsFnm/3NGwaXXMvTukiCx68zUfa8xupXT8GUVpJkHAk2ZUWLvoDhGW+DVrImnwYmJrZ8vQOdhPfM
	j7DFRsYBJs3ORFBLG+NpnFFZ3yP3bn/OlgTY6aGjIga/1A/hTk/eJD8/KEHwE3WTXRPI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/MTRR: constrain AP sync and BSP restore
Message-Id: <E1u0FF3-006wQw-2r@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 07:44:01 +0000

commit 1b0e74aa37e2035e84f797253fba429726512d30
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 3 09:38:41 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 3 09:38:41 2025 +0200

    x86/MTRR: constrain AP sync and BSP restore
    
    mtrr_set_all() has quite a bit of overhead, which is entirely useless
    when set_mtrr_state() really does nothing. Furthermore, with
    mtrr_state.def_type never initialized from hardware, post_set()'s
    unconditional writing of the MSR means would leave us running in UC
    mode after the sync.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/cpu/mtrr/main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/mtrr/main.c b/xen/arch/x86/cpu/mtrr/main.c
index 0a44ebbcb0..39b18c6013 100644
--- a/xen/arch/x86/cpu/mtrr/main.c
+++ b/xen/arch/x86/cpu/mtrr/main.c
@@ -605,13 +605,15 @@ void mtrr_aps_sync_begin(void)
 
 void mtrr_aps_sync_end(void)
 {
-	set_mtrr(~0U, 0, 0, 0);
+	if (mtrr_if)
+		set_mtrr(~0U, 0, 0, 0);
 	hold_mtrr_updates_on_aps = 0;
 }
 
 void mtrr_bp_restore(void)
 {
-	mtrr_set_all();
+	if (mtrr_if)
+		mtrr_set_all();
 }
 
 static int __init cf_check mtrr_init_finialize(void)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 07:44:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 07:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936312.1337582 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0FFF-0001HP-EF; Thu, 03 Apr 2025 07:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936312.1337582; Thu, 03 Apr 2025 07: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 1u0FFF-0001HH-BU; Thu, 03 Apr 2025 07:44:13 +0000
Received: by outflank-mailman (input) for mailman id 936312;
 Thu, 03 Apr 2025 07:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u0FFE-0001H5-2T
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 07:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0FFE-009Rue-08
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 07:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0FFD-006wU1-3C
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 07: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=elgrfBjhsdG2J15W7qpYEUAi9M0O7UhgRWQN4fVHmFQ=; b=a5RxxiTW7Qgw7NT7GQLcG5VMp3
	8tVv6LFqIgZFu2TrfYyuimKIDB/SDtCFEalK85LyDR7mvAaJM7krKxiaNGemd5T1HIHj8PuRMHn9+
	glW8UBUueFZZ/nzNpGlJPoqvQJZydOFq7JVyixOL0/t4eozwHRp225qmsWKmydBx0raI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/MTRR: hook mtrr_bp_restore() back up
Message-Id: <E1u0FFD-006wU1-3C@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 07:44:11 +0000

commit 0414dedd6fde1a1c5c5e38dcbef4dad506e1398c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 3 09:39:13 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 3 09:39:13 2025 +0200

    x86/MTRR: hook mtrr_bp_restore() back up
    
    Unlike stated in the offending commit's description,
    load_system_tables() wasn't the only thing left to retain from the
    earlier restore_rest_processor_state(). Note that MTRR state was still
    reloaded via mtrr_aps_sync_end(), but that happens quite a bit later in
    the resume process.
    
    While there also do Misra-related tidying for the function itself: The
    function being used from assembly only means it doesn't need to have a
    declaration, but wants to be asmlinkage.
    
    Fixes: 4304ff420e51 ("x86/S3: Drop {save,restore}_rest_processor_state() completely")
    Reported-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/acpi/wakeup_prot.S | 2 ++
 xen/arch/x86/cpu/mtrr/main.c    | 2 +-
 xen/arch/x86/include/asm/mtrr.h | 1 -
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/acpi/wakeup_prot.S b/xen/arch/x86/acpi/wakeup_prot.S
index 8ce57ad137..a741d58b91 100644
--- a/xen/arch/x86/acpi/wakeup_prot.S
+++ b/xen/arch/x86/acpi/wakeup_prot.S
@@ -124,6 +124,8 @@ LABEL(s3_resume)
         mov     STACK_CPUINFO_FIELD(cr4)(%rbx), %rax
         mov     %rax, %cr4
 
+        call    mtrr_bp_restore
+
 .Lsuspend_err:
         pop     %r15
         pop     %r14
diff --git a/xen/arch/x86/cpu/mtrr/main.c b/xen/arch/x86/cpu/mtrr/main.c
index 39b18c6013..24cddcaddf 100644
--- a/xen/arch/x86/cpu/mtrr/main.c
+++ b/xen/arch/x86/cpu/mtrr/main.c
@@ -610,7 +610,7 @@ void mtrr_aps_sync_end(void)
 	hold_mtrr_updates_on_aps = 0;
 }
 
-void mtrr_bp_restore(void)
+void asmlinkage mtrr_bp_restore(void)
 {
 	if (mtrr_if)
 		mtrr_set_all();
diff --git a/xen/arch/x86/include/asm/mtrr.h b/xen/arch/x86/include/asm/mtrr.h
index 36dac0a775..48b59d2620 100644
--- a/xen/arch/x86/include/asm/mtrr.h
+++ b/xen/arch/x86/include/asm/mtrr.h
@@ -66,7 +66,6 @@ extern uint8_t pat_type_2_pte_flags(uint8_t pat_type);
 extern int hold_mtrr_updates_on_aps;
 extern void mtrr_aps_sync_begin(void);
 extern void mtrr_aps_sync_end(void);
-extern void mtrr_bp_restore(void);
 
 extern bool mtrr_var_range_msr_set(struct domain *d, struct mtrr_state *m,
                                    uint32_t msr, uint64_t msr_content);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 07:44:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 07:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936313.1337586 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0FFP-0001Ju-Ff; Thu, 03 Apr 2025 07:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936313.1337586; Thu, 03 Apr 2025 07: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 1u0FFP-0001Jm-Cw; Thu, 03 Apr 2025 07:44:23 +0000
Received: by outflank-mailman (input) for mailman id 936313;
 Thu, 03 Apr 2025 07:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u0FFO-0001Ja-7N
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 07:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0FFO-009Rui-0S
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 07:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0FFO-006wVp-0J
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 07:44:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MZJGVUoK1EV6Jo0xB48Qz6BEUn78usZteypmRkvTJD8=; b=VzCqRcAlay/+LETvAqE7L15GSS
	zJArni7AGjdkWNEJgGUzpFlJq+/ECaD38EjSNKAW8NK6CUqRMP2Lt9GwIBkx9clZYoCNMMbGjYtUW
	D9OdmjnKqWvbouJoKnjpzXXhz3XU4EWeZjdFI3rkB6vwXhLI/5byB/3H2Zn928xpMYiI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/CPU: don't hard-code MTRR availability
Message-Id: <E1u0FFO-006wVp-0J@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 07:44:22 +0000

commit a56574f65d6ff7a92cd48f97ca1719eeb888498c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 3 09:39:35 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 3 09:39:35 2025 +0200

    x86/CPU: don't hard-code MTRR availability
    
    In particular if we're running virtualized, the underlying hypervisor
    (which may be another Xen) may not surface MTRRs, and offer PAT only.
    
    Fixes: 5a281883cdc3 ("Hardcode many cpu features for x86/64 -- we know 64-bit")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/include/asm/cpufeature.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/include/asm/cpufeature.h b/xen/arch/x86/include/asm/cpufeature.h
index 6935703e71..05399fb9c9 100644
--- a/xen/arch/x86/include/asm/cpufeature.h
+++ b/xen/arch/x86/include/asm/cpufeature.h
@@ -70,7 +70,7 @@ static inline bool boot_cpu_has(unsigned int feat)
 #define cpu_has_pse             1
 #define cpu_has_apic            boot_cpu_has(X86_FEATURE_APIC)
 #define cpu_has_sep             boot_cpu_has(X86_FEATURE_SEP)
-#define cpu_has_mtrr            1
+#define cpu_has_mtrr            boot_cpu_has(X86_FEATURE_MTRR)
 #define cpu_has_pge             1
 #define cpu_has_pse36           boot_cpu_has(X86_FEATURE_PSE36)
 #define cpu_has_clflush         boot_cpu_has(X86_FEATURE_CLFLUSH)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 07:44:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 07:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936314.1337590 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0FFZ-0001MW-Gn; Thu, 03 Apr 2025 07:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936314.1337590; Thu, 03 Apr 2025 07: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 1u0FFZ-0001MO-EF; Thu, 03 Apr 2025 07:44:33 +0000
Received: by outflank-mailman (input) for mailman id 936314;
 Thu, 03 Apr 2025 07:44:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u0FFY-0001M9-8q
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 07:44:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0FFY-009Ruo-0j
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 07:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0FFY-006wZB-0c
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 07:44:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=iE6+2qoWIMEPEMH1MiF7k8vNfEJjd+ygvzCRCowyjcE=; b=Zd3CHzs+zjwle2cy/mRldtfmOy
	6auSqaxNU1kEPO9G9QPi9Y/BZmgS3WQt6U70KYCwroKou9UEaeTV5MIKlS4/v3e3cBQw+7eoEeNZ+
	8bM6ffymHdWBvB2ZCgoh9mko/LnoXQSB14OaSIn8/hrF109XYYdHl6mYBMXTQMIX8HjU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/boot: re-order .init.data contributions
Message-Id: <E1u0FFY-006wZB-0c@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 07:44:32 +0000

commit 35910ed65f1d188774ce90ba9898ca33f7a9fe4d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 3 09:39:52 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 3 09:39:52 2025 +0200

    x86/boot: re-order .init.data contributions
    
    Putting a few bytes ahead of page tables isn't very efficient; there's
    a gap almost worth a full page. To avoid re-ordering of items in the
    source file, simply put the few small items in sub-section 1, for them
    to end up after the page tables, followed (in the final binary) by non-
    page-aligned items from other CUs.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/boot/head.S | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index 81473578fe..77bb7a9e21 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -136,6 +136,7 @@ multiboot2_header:
 .Lno_nx_msg:   .asciz "ERR: Not an NX-capable CPU!"
 
         .section .init.data, "aw", @progbits
+        .subsection 1 /* Put data here after the page tables (in x86_64.S). */
         .align 4
 
         .word   0
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 11:44:09 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 11:44:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936694.1337874 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0IzK-0000uE-QA; Thu, 03 Apr 2025 11:44:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936694.1337874; Thu, 03 Apr 2025 11:44:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0IzK-0000u6-NP; Thu, 03 Apr 2025 11:44:02 +0000
Received: by outflank-mailman (input) for mailman id 936694;
 Thu, 03 Apr 2025 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 1u0IzK-0000u0-11
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 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 1u0IzJ-009Xyu-2e
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 11:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0IzJ-007jQJ-2L
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 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=cPRlcZBW66NuRMn6VTgFBtZhQBwch/CKOSGxJxuluJc=; b=m2Odek+XlJAxQfJ0g38zWSmCFs
	PPvdAmTnpsiu0kxn9jzR+EFSL/0SOR7rxC9sB0vC9VmOs0u7JkpcoUjQj0o7jTr8WC3Pkb4mD3DzS
	9HvcWbS36YQCGT397xYxRdcA9003/vxUP2bnHa/W64bkY6YIjS43wmAIeui4mAKLlQTc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/MTRR: constrain AP sync and BSP restore
Message-Id: <E1u0IzJ-007jQJ-2L@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 11:44:01 +0000

commit 1b0e74aa37e2035e84f797253fba429726512d30
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 3 09:38:41 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 3 09:38:41 2025 +0200

    x86/MTRR: constrain AP sync and BSP restore
    
    mtrr_set_all() has quite a bit of overhead, which is entirely useless
    when set_mtrr_state() really does nothing. Furthermore, with
    mtrr_state.def_type never initialized from hardware, post_set()'s
    unconditional writing of the MSR means would leave us running in UC
    mode after the sync.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/cpu/mtrr/main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/mtrr/main.c b/xen/arch/x86/cpu/mtrr/main.c
index 0a44ebbcb0..39b18c6013 100644
--- a/xen/arch/x86/cpu/mtrr/main.c
+++ b/xen/arch/x86/cpu/mtrr/main.c
@@ -605,13 +605,15 @@ void mtrr_aps_sync_begin(void)
 
 void mtrr_aps_sync_end(void)
 {
-	set_mtrr(~0U, 0, 0, 0);
+	if (mtrr_if)
+		set_mtrr(~0U, 0, 0, 0);
 	hold_mtrr_updates_on_aps = 0;
 }
 
 void mtrr_bp_restore(void)
 {
-	mtrr_set_all();
+	if (mtrr_if)
+		mtrr_set_all();
 }
 
 static int __init cf_check mtrr_init_finialize(void)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 11:44:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 11:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936695.1337878 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0IzU-0000wW-Sq; Thu, 03 Apr 2025 11:44:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936695.1337878; Thu, 03 Apr 2025 11:44:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0IzU-0000wO-QC; Thu, 03 Apr 2025 11:44:12 +0000
Received: by outflank-mailman (input) for mailman id 936695;
 Thu, 03 Apr 2025 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 1u0IzU-0000wE-1h
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 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 1u0IzU-009Xz9-02
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 11:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0IzT-007jYz-35
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 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=+k6DxOVezFrNI29ClzRbVEI6xuBPkC1z7j51C0zKJEs=; b=ZXXxuVfaAZ7mJEI0UjXONs9tSj
	TeyJwLm8JViZexKY4JjrfJOiIL5HPUlxvbD7ZbpedlefPHRhd1K4nLm5VuXOeiwNEluCjCO5/ZhuU
	spV3/6kD6dz1G2D4qfmHZt1rJa0deGnLHal1gICkz+qx8NrsEumCSvFNP77ANvZEq4YY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/MTRR: hook mtrr_bp_restore() back up
Message-Id: <E1u0IzT-007jYz-35@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 11:44:11 +0000

commit 0414dedd6fde1a1c5c5e38dcbef4dad506e1398c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 3 09:39:13 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 3 09:39:13 2025 +0200

    x86/MTRR: hook mtrr_bp_restore() back up
    
    Unlike stated in the offending commit's description,
    load_system_tables() wasn't the only thing left to retain from the
    earlier restore_rest_processor_state(). Note that MTRR state was still
    reloaded via mtrr_aps_sync_end(), but that happens quite a bit later in
    the resume process.
    
    While there also do Misra-related tidying for the function itself: The
    function being used from assembly only means it doesn't need to have a
    declaration, but wants to be asmlinkage.
    
    Fixes: 4304ff420e51 ("x86/S3: Drop {save,restore}_rest_processor_state() completely")
    Reported-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/acpi/wakeup_prot.S | 2 ++
 xen/arch/x86/cpu/mtrr/main.c    | 2 +-
 xen/arch/x86/include/asm/mtrr.h | 1 -
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/acpi/wakeup_prot.S b/xen/arch/x86/acpi/wakeup_prot.S
index 8ce57ad137..a741d58b91 100644
--- a/xen/arch/x86/acpi/wakeup_prot.S
+++ b/xen/arch/x86/acpi/wakeup_prot.S
@@ -124,6 +124,8 @@ LABEL(s3_resume)
         mov     STACK_CPUINFO_FIELD(cr4)(%rbx), %rax
         mov     %rax, %cr4
 
+        call    mtrr_bp_restore
+
 .Lsuspend_err:
         pop     %r15
         pop     %r14
diff --git a/xen/arch/x86/cpu/mtrr/main.c b/xen/arch/x86/cpu/mtrr/main.c
index 39b18c6013..24cddcaddf 100644
--- a/xen/arch/x86/cpu/mtrr/main.c
+++ b/xen/arch/x86/cpu/mtrr/main.c
@@ -610,7 +610,7 @@ void mtrr_aps_sync_end(void)
 	hold_mtrr_updates_on_aps = 0;
 }
 
-void mtrr_bp_restore(void)
+void asmlinkage mtrr_bp_restore(void)
 {
 	if (mtrr_if)
 		mtrr_set_all();
diff --git a/xen/arch/x86/include/asm/mtrr.h b/xen/arch/x86/include/asm/mtrr.h
index 36dac0a775..48b59d2620 100644
--- a/xen/arch/x86/include/asm/mtrr.h
+++ b/xen/arch/x86/include/asm/mtrr.h
@@ -66,7 +66,6 @@ extern uint8_t pat_type_2_pte_flags(uint8_t pat_type);
 extern int hold_mtrr_updates_on_aps;
 extern void mtrr_aps_sync_begin(void);
 extern void mtrr_aps_sync_end(void);
-extern void mtrr_bp_restore(void);
 
 extern bool mtrr_var_range_msr_set(struct domain *d, struct mtrr_state *m,
                                    uint32_t msr, uint64_t msr_content);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 11:44:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 11:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936696.1337882 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0Ize-0000ys-UX; Thu, 03 Apr 2025 11:44:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936696.1337882; Thu, 03 Apr 2025 11: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 1u0Ize-0000yk-RZ; Thu, 03 Apr 2025 11:44:22 +0000
Received: by outflank-mailman (input) for mailman id 936696;
 Thu, 03 Apr 2025 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 1u0Ize-0000yb-4E
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 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 1u0Ize-009XzH-0K
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 11:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0Ize-007jq1-0D
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 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=q0JGiTiSrF/gK8QMMWaNMG4js7LppZpX8lq3gljP2HI=; b=K097aNTqzGjpaH9dwAlEFozyaV
	17QjAZ6PdkcJTaw3KVOi78tx7M+nWSmnWAvysLYMyfCIIycix3p9rvIai2TzRBlBdIyu4CJw/B/tJ
	VqItj/VUoCPF1++tJZ1adQnX9P1abQCCrTfY3vTj+nyNqyoruv0TFORJd5RXTjyOioQY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/CPU: don't hard-code MTRR availability
Message-Id: <E1u0Ize-007jq1-0D@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 11:44:22 +0000

commit a56574f65d6ff7a92cd48f97ca1719eeb888498c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 3 09:39:35 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 3 09:39:35 2025 +0200

    x86/CPU: don't hard-code MTRR availability
    
    In particular if we're running virtualized, the underlying hypervisor
    (which may be another Xen) may not surface MTRRs, and offer PAT only.
    
    Fixes: 5a281883cdc3 ("Hardcode many cpu features for x86/64 -- we know 64-bit")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/include/asm/cpufeature.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/include/asm/cpufeature.h b/xen/arch/x86/include/asm/cpufeature.h
index 6935703e71..05399fb9c9 100644
--- a/xen/arch/x86/include/asm/cpufeature.h
+++ b/xen/arch/x86/include/asm/cpufeature.h
@@ -70,7 +70,7 @@ static inline bool boot_cpu_has(unsigned int feat)
 #define cpu_has_pse             1
 #define cpu_has_apic            boot_cpu_has(X86_FEATURE_APIC)
 #define cpu_has_sep             boot_cpu_has(X86_FEATURE_SEP)
-#define cpu_has_mtrr            1
+#define cpu_has_mtrr            boot_cpu_has(X86_FEATURE_MTRR)
 #define cpu_has_pge             1
 #define cpu_has_pse36           boot_cpu_has(X86_FEATURE_PSE36)
 #define cpu_has_clflush         boot_cpu_has(X86_FEATURE_CLFLUSH)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 11:44:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 11:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936698.1337885 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0Izo-00011d-VT; Thu, 03 Apr 2025 11:44:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936698.1337885; Thu, 03 Apr 2025 11:44: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 1u0Izo-00011V-Su; Thu, 03 Apr 2025 11:44:32 +0000
Received: by outflank-mailman (input) for mailman id 936698;
 Thu, 03 Apr 2025 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 1u0Izo-00011G-79
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 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 1u0Izo-009XzL-0b
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 11:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0Izo-007kI9-0V
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 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=OZPl08mx11GrUzpgmT4Dla5hdmZOqB2C2xBHQyeOxiM=; b=ecSvF5FRnJGF5eEp9jooylJJ5f
	78MUBMLd27ZA3ZNNZ+aWIQOy/2t6ugoScn6eYjtXaUK6UcB1Q1de5Iil6Pldhxk/myWLX2e/1Lnvs
	+u/Dk5v/NT+ZBO0R9a/+UFDy/k5nhWrkrNnI1utBNoqVMuHV3NnWqSwQy587bWL6TkAo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/boot: re-order .init.data contributions
Message-Id: <E1u0Izo-007kI9-0V@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 11:44:32 +0000

commit 35910ed65f1d188774ce90ba9898ca33f7a9fe4d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 3 09:39:52 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 3 09:39:52 2025 +0200

    x86/boot: re-order .init.data contributions
    
    Putting a few bytes ahead of page tables isn't very efficient; there's
    a gap almost worth a full page. To avoid re-ordering of items in the
    source file, simply put the few small items in sub-section 1, for them
    to end up after the page tables, followed (in the final binary) by non-
    page-aligned items from other CUs.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/boot/head.S | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index 81473578fe..77bb7a9e21 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -136,6 +136,7 @@ multiboot2_header:
 .Lno_nx_msg:   .asciz "ERR: Not an NX-capable CPU!"
 
         .section .init.data, "aw", @progbits
+        .subsection 1 /* Put data here after the page tables (in x86_64.S). */
         .align 4
 
         .word   0
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 14:44:11 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 14:44:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936899.1338020 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0LnX-0002e0-Oz; Thu, 03 Apr 2025 14:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936899.1338020; Thu, 03 Apr 2025 14:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0LnX-0002ds-MJ; Thu, 03 Apr 2025 14:44:03 +0000
Received: by outflank-mailman (input) for mailman id 936899;
 Thu, 03 Apr 2025 14:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u0LnW-0002dm-96
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 14:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0LnW-009c58-0I
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 14:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0LnW-008JVB-07
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 14:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OxcJigc8TUzkpbLY4+pOREVohyKPShLlz/eRCHqPGi8=; b=DKSyerDrdfr3K6EOtWBmdPR1bB
	Jw3xtdYAgetf3JQVxZm3nMevxqk/XPlrMzA5yj4PtQurFK6nb8O8npbkqc6hNx+JlJwchUryWLUkl
	8OV9dHK7jZoRz/gg3ISgykNYlQdUB+ykhj9A16eW5HwLVAne1oHXoQrC/z5afgEwbMlc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: Don't call process_shm_chosen() during ACPI boot
Message-Id: <E1u0LnW-008JVB-07@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 14:44:02 +0000

commit c95346e14417f78dcd47defb9ae52d8b6c904d4b
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Apr 2 10:42:32 2025 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Apr 3 09:52:54 2025 +0200

    xen/arm: Don't call process_shm_chosen() during ACPI boot
    
    Static shared memory requires device-tree boot. At the moment, booting
    with ACPI enabled and CONFIG_STATIC_SHM=y results in a data abort when
    dereferencing node in process_shm() because dt_host is always NULL.
    
    Fixes: 09c0a8976acf ("xen/arm: enable statically shared memory on Dom0")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/domain_build.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 2b5b433183..85f423214a 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -2325,9 +2325,12 @@ int __init construct_hwdom(struct kernel_info *kinfo)
     else
         allocate_memory(d, kinfo);
 
-    rc = process_shm_chosen(d, kinfo);
-    if ( rc < 0 )
-        return rc;
+    if ( acpi_disabled )
+    {
+        rc = process_shm_chosen(d, kinfo);
+        if ( rc < 0 )
+            return rc;
+    }
 
     /* Map extra GIC MMIO, irqs and other hw stuffs to dom0. */
     rc = gic_map_hwdom_extra_mappings(d);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 14:44:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 14:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936900.1338023 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0Lnh-0002fd-QI; Thu, 03 Apr 2025 14:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936900.1338023; Thu, 03 Apr 2025 14:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0Lnh-0002fV-Nl; Thu, 03 Apr 2025 14:44:13 +0000
Received: by outflank-mailman (input) for mailman id 936900;
 Thu, 03 Apr 2025 14:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u0Lng-0002fH-9T
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 14:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0Lng-009c5E-0f
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 14:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0Lng-008JX9-0U
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 14:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MMbzMZI40cMNfyVF9/DwZ7ug3P8EcB2YBilEAKqrtYA=; b=26kJ6LnLl5tHJbJtIEQCIy6xt7
	6SK4HGRKILo+AkLC0TC2bSNuI0RUgxIxmmkW8Fqu7Fc/4zkxy3/QFqjUTf8kzvbRFHPGF5xl4eat8
	Tndy7NZ14aXWCmuViTw/Sy1C5OwoWeGeoHdtcqayYt8UnpNseFEUOiux8h0KZ6oLciYw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: Drop process_shm_chosen()
Message-Id: <E1u0Lng-008JX9-0U@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 14:44:12 +0000

commit 6194e6925d02fc724d81f660a002fca2155436cd
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Apr 2 10:42:33 2025 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Apr 3 09:52:54 2025 +0200

    xen/arm: Drop process_shm_chosen()
    
    There's no benefit in having process_shm_chosen() next to process_shm().
    The former is just a helper to pass "/chosen" node to the latter for
    hwdom case. Drop process_shm_chosen() and instead use process_shm()
    passing NULL as node parameter, which will result in searching for and
    using /chosen to find shm node (the DT full path search is done in
    process_shm() to avoid expensive lookup if !CONFIG_STATIC_SHM). This
    will simplify future handling of hw/control domain separation.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/domain_build.c             |  2 +-
 xen/arch/arm/include/asm/static-shmem.h | 14 --------------
 xen/arch/arm/static-shmem.c             |  7 +++++++
 3 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 85f423214a..634333cdde 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -2327,7 +2327,7 @@ int __init construct_hwdom(struct kernel_info *kinfo)
 
     if ( acpi_disabled )
     {
-        rc = process_shm_chosen(d, kinfo);
+        rc = process_shm(d, kinfo, NULL);
         if ( rc < 0 )
             return rc;
     }
diff --git a/xen/arch/arm/include/asm/static-shmem.h b/xen/arch/arm/include/asm/static-shmem.h
index fd0867c4f2..94eaa9d500 100644
--- a/xen/arch/arm/include/asm/static-shmem.h
+++ b/xen/arch/arm/include/asm/static-shmem.h
@@ -18,14 +18,6 @@ int make_resv_memory_node(const struct kernel_info *kinfo, int addrcells,
 int process_shm(struct domain *d, struct kernel_info *kinfo,
                 const struct dt_device_node *node);
 
-static inline int process_shm_chosen(struct domain *d,
-                                     struct kernel_info *kinfo)
-{
-    const struct dt_device_node *node = dt_find_node_by_path("/chosen");
-
-    return process_shm(d, kinfo, node);
-}
-
 int process_shm_node(const void *fdt, int node, uint32_t address_cells,
                      uint32_t size_cells);
 
@@ -74,12 +66,6 @@ static inline int process_shm(struct domain *d, struct kernel_info *kinfo,
     return 0;
 }
 
-static inline int process_shm_chosen(struct domain *d,
-                                     struct kernel_info *kinfo)
-{
-    return 0;
-}
-
 static inline void init_sharedmem_pages(void) {};
 
 static inline int remove_shm_from_rangeset(const struct kernel_info *kinfo,
diff --git a/xen/arch/arm/static-shmem.c b/xen/arch/arm/static-shmem.c
index c74fa13d48..e8d4ca3ba3 100644
--- a/xen/arch/arm/static-shmem.c
+++ b/xen/arch/arm/static-shmem.c
@@ -297,6 +297,13 @@ int __init process_shm(struct domain *d, struct kernel_info *kinfo,
 {
     struct dt_device_node *shm_node;
 
+    /* Hwdom case - shm node under /chosen */
+    if ( !node )
+    {
+        node = dt_find_node_by_path("/chosen");
+        BUG_ON(!node);
+    }
+
     dt_for_each_child_node(node, shm_node)
     {
         const struct membank *boot_shm_bank;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 15:55:10 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 15:55:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936906.1338027 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0MuF-0001un-I5; Thu, 03 Apr 2025 15:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936906.1338027; Thu, 03 Apr 2025 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 1u0MuF-0001uf-FH; Thu, 03 Apr 2025 15:55:03 +0000
Received: by outflank-mailman (input) for mailman id 936906;
 Thu, 03 Apr 2025 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 1u0MuE-0001uZ-Ae
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 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 1u0MuE-009dkv-0e
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 15:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0MuE-008WM6-0U
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 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=9qEkr0WgOR8sCcOQH/4zw58U1ZxTAIBMGpueUAUn1Q4=; b=u0E9s3M9dHOw69ijAV1OY5sGNp
	mpZNISQwUzYttNEiXKWV2ogX/UPJA4ZoRK0k3MyyCjFLeIZQvcLNYtXaG/+OrF31auVXCKCJl1uSx
	cskQOiej+oXSuhV9dfgSkpuDMnCu6W92g+a57lOOcdOw81jzAFKGT79U58OsRm82rTSs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Don't call process_shm_chosen() during ACPI boot
Message-Id: <E1u0MuE-008WM6-0U@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 15:55:02 +0000

commit c95346e14417f78dcd47defb9ae52d8b6c904d4b
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Apr 2 10:42:32 2025 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Apr 3 09:52:54 2025 +0200

    xen/arm: Don't call process_shm_chosen() during ACPI boot
    
    Static shared memory requires device-tree boot. At the moment, booting
    with ACPI enabled and CONFIG_STATIC_SHM=y results in a data abort when
    dereferencing node in process_shm() because dt_host is always NULL.
    
    Fixes: 09c0a8976acf ("xen/arm: enable statically shared memory on Dom0")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/domain_build.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 2b5b433183..85f423214a 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -2325,9 +2325,12 @@ int __init construct_hwdom(struct kernel_info *kinfo)
     else
         allocate_memory(d, kinfo);
 
-    rc = process_shm_chosen(d, kinfo);
-    if ( rc < 0 )
-        return rc;
+    if ( acpi_disabled )
+    {
+        rc = process_shm_chosen(d, kinfo);
+        if ( rc < 0 )
+            return rc;
+    }
 
     /* Map extra GIC MMIO, irqs and other hw stuffs to dom0. */
     rc = gic_map_hwdom_extra_mappings(d);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 15:55:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 15:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.936907.1338031 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0MuP-0001wH-J7; Thu, 03 Apr 2025 15:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 936907.1338031; Thu, 03 Apr 2025 15:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0MuP-0001wA-Gh; Thu, 03 Apr 2025 15:55:13 +0000
Received: by outflank-mailman (input) for mailman id 936907;
 Thu, 03 Apr 2025 15: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 1u0MuO-0001vy-CE
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 15: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 1u0MuO-009dl1-14
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 15:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0MuO-008WOf-0r
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 15: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=2Sj9zqpLeBraPTzE6Im1TFbkXaT0Q3CQaTwUrkk8cMg=; b=vkx27ymm4Nz6/rIPaHguKJIi4e
	QXZfuHP68Waemqa3UEeZ7BmcM4TtFEMTwNKhj9GWYQH810/l7RVaNbLe39es/jjrOGXV6kNiynGhD
	+7TQw3FfsW808P8xT8TRxA+ple03U2rx8lBmDizI0n7LdTgb2xrFFpZUh5Rk9s4LURiU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Drop process_shm_chosen()
Message-Id: <E1u0MuO-008WOf-0r@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 15:55:12 +0000

commit 6194e6925d02fc724d81f660a002fca2155436cd
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Apr 2 10:42:33 2025 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Apr 3 09:52:54 2025 +0200

    xen/arm: Drop process_shm_chosen()
    
    There's no benefit in having process_shm_chosen() next to process_shm().
    The former is just a helper to pass "/chosen" node to the latter for
    hwdom case. Drop process_shm_chosen() and instead use process_shm()
    passing NULL as node parameter, which will result in searching for and
    using /chosen to find shm node (the DT full path search is done in
    process_shm() to avoid expensive lookup if !CONFIG_STATIC_SHM). This
    will simplify future handling of hw/control domain separation.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/domain_build.c             |  2 +-
 xen/arch/arm/include/asm/static-shmem.h | 14 --------------
 xen/arch/arm/static-shmem.c             |  7 +++++++
 3 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 85f423214a..634333cdde 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -2327,7 +2327,7 @@ int __init construct_hwdom(struct kernel_info *kinfo)
 
     if ( acpi_disabled )
     {
-        rc = process_shm_chosen(d, kinfo);
+        rc = process_shm(d, kinfo, NULL);
         if ( rc < 0 )
             return rc;
     }
diff --git a/xen/arch/arm/include/asm/static-shmem.h b/xen/arch/arm/include/asm/static-shmem.h
index fd0867c4f2..94eaa9d500 100644
--- a/xen/arch/arm/include/asm/static-shmem.h
+++ b/xen/arch/arm/include/asm/static-shmem.h
@@ -18,14 +18,6 @@ int make_resv_memory_node(const struct kernel_info *kinfo, int addrcells,
 int process_shm(struct domain *d, struct kernel_info *kinfo,
                 const struct dt_device_node *node);
 
-static inline int process_shm_chosen(struct domain *d,
-                                     struct kernel_info *kinfo)
-{
-    const struct dt_device_node *node = dt_find_node_by_path("/chosen");
-
-    return process_shm(d, kinfo, node);
-}
-
 int process_shm_node(const void *fdt, int node, uint32_t address_cells,
                      uint32_t size_cells);
 
@@ -74,12 +66,6 @@ static inline int process_shm(struct domain *d, struct kernel_info *kinfo,
     return 0;
 }
 
-static inline int process_shm_chosen(struct domain *d,
-                                     struct kernel_info *kinfo)
-{
-    return 0;
-}
-
 static inline void init_sharedmem_pages(void) {};
 
 static inline int remove_shm_from_rangeset(const struct kernel_info *kinfo,
diff --git a/xen/arch/arm/static-shmem.c b/xen/arch/arm/static-shmem.c
index c74fa13d48..e8d4ca3ba3 100644
--- a/xen/arch/arm/static-shmem.c
+++ b/xen/arch/arm/static-shmem.c
@@ -297,6 +297,13 @@ int __init process_shm(struct domain *d, struct kernel_info *kinfo,
 {
     struct dt_device_node *shm_node;
 
+    /* Hwdom case - shm node under /chosen */
+    if ( !node )
+    {
+        node = dt_find_node_by_path("/chosen");
+        BUG_ON(!node);
+    }
+
     dt_for_each_child_node(node, shm_node)
     {
         const struct membank *boot_shm_bank;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 20:33:11 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 20:33:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.937270.1338266 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0RFG-0006jP-SB; Thu, 03 Apr 2025 20:33:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 937270.1338266; Thu, 03 Apr 2025 20: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 1u0RFG-0006jH-PK; Thu, 03 Apr 2025 20:33:02 +0000
Received: by outflank-mailman (input) for mailman id 937270;
 Thu, 03 Apr 2025 20: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 1u0RFF-0006jB-Qi
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 20: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 1u0RFF-009kt3-29
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 20:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0RFF-009PsR-1p
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 20: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=hMoIepfEu2OAJ7xC5T86AzAACXNu/8Sn+WxdmIQ465M=; b=R8fDYG+rd7I/4zWdG8w3oLDP8t
	JRRSCD93WzEP9PAxmj+8vpNOnLZg1sQAHnucYvUSZYhCllUvFZyxOHIz7Fqoz3XT7wvg9zyvGQv4U
	C8+zdH3yy0uBZAjbSEN4GcYW6oZRcbwZ55BD4p26ynSbd4XYhSRM4swXZNP2skIKMMFE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/vmx: Remove HAVE_AS_{EPT,VMX}, GAS_VMX_OP(), etc
Message-Id: <E1u0RFF-009PsR-1p@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 20:33:01 +0000

commit 1f2ea165f6b4be754ce02319f89df96a2a649d37
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Thu Apr 3 18:23:04 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Apr 3 21:29:34 2025 +0100

    x86/vmx: Remove HAVE_AS_{EPT,VMX}, GAS_VMX_OP(), etc
    
    The new toolchain baseline knows the VMX instructions; no need to carry the
    workaround in the code.
    
    Inline __vmxoff() into it's single caller.
    
    Updated formatting in the wrappers to consistent.
    
    No functional change.
    
    Resolves: https://gitlab.com/xen-project/xen/-/work_items/202
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/arch.mk                   |   4 +-
 xen/arch/x86/hvm/vmx/vmcs.c            |   2 +-
 xen/arch/x86/include/asm/hvm/vmx/vmx.h | 125 +++++----------------------------
 3 files changed, 19 insertions(+), 112 deletions(-)

diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk
index 258e459bec..e9fa1c92d7 100644
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -10,9 +10,7 @@ CFLAGS += -msoft-float
 
 $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
 $(call cc-option-add,CFLAGS,CC,-Wnested-externs)
-$(call as-option-add,CFLAGS,CC,"vmcall",-DHAVE_AS_VMX)
 $(call as-option-add,CFLAGS,CC,"crc32 %eax$(comma)%eax",-DHAVE_AS_SSE4_2)
-$(call as-option-add,CFLAGS,CC,"invept (%rax)$(comma)%rax",-DHAVE_AS_EPT)
 $(call as-option-add,CFLAGS,CC,"rdrand %eax",-DHAVE_AS_RDRAND)
 $(call as-option-add,CFLAGS,CC,"rdfsbase %rax",-DHAVE_AS_FSGSBASE)
 $(call as-option-add,CFLAGS,CC,"xsaveopt (%rax)",-DHAVE_AS_XSAVEOPT)
@@ -23,7 +21,7 @@ $(call as-option-add,CFLAGS,CC,"invpcid (%rax)$(comma)%rax",-DHAVE_AS_INVPCID)
 $(call as-option-add,CFLAGS,CC,"movdiri %rax$(comma)(%rax)",-DHAVE_AS_MOVDIR)
 $(call as-option-add,CFLAGS,CC,"enqcmd (%rax)$(comma)%rax",-DHAVE_AS_ENQCMD)
 
-# Check to see whether the assmbler supports the .nop directive.
+# Check to see whether the assembler supports the .nop directive.
 $(call as-option-add,CFLAGS,CC,\
     ".L1: .L2: .nops (.L2 - .L1)$(comma)9",-DHAVE_AS_NOPS_DIRECTIVE)
 
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 1d427100ce..a44475ae15 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -811,7 +811,7 @@ void cf_check vmx_cpu_down(void)
 
     BUG_ON(!(read_cr4() & X86_CR4_VMXE));
     this_cpu(vmxon) = 0;
-    __vmxoff();
+    asm volatile ( "vmxoff" ::: "memory" );
 
     local_irq_restore(flags);
 }
diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmx.h b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
index 7c6ba73407..affb3a8bd6 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
@@ -257,24 +257,6 @@ typedef union cr_access_qual {
 #define X86_SEG_AR_GRANULARITY  (1u << 15) /* 15, granularity */
 #define X86_SEG_AR_SEG_UNUSABLE (1u << 16) /* 16, segment unusable */
 
-#define VMCALL_OPCODE   ".byte 0x0f,0x01,0xc1\n"
-#define VMCLEAR_OPCODE  ".byte 0x66,0x0f,0xc7\n"        /* reg/opcode: /6 */
-#define VMLAUNCH_OPCODE ".byte 0x0f,0x01,0xc2\n"
-#define VMPTRLD_OPCODE  ".byte 0x0f,0xc7\n"             /* reg/opcode: /6 */
-#define VMPTRST_OPCODE  ".byte 0x0f,0xc7\n"             /* reg/opcode: /7 */
-#define VMREAD_OPCODE   ".byte 0x0f,0x78\n"
-#define VMRESUME_OPCODE ".byte 0x0f,0x01,0xc3\n"
-#define VMWRITE_OPCODE  ".byte 0x0f,0x79\n"
-#define INVEPT_OPCODE   ".byte 0x66,0x0f,0x38,0x80\n"   /* m128,r64/32 */
-#define INVVPID_OPCODE  ".byte 0x66,0x0f,0x38,0x81\n"   /* m128,r64/32 */
-#define VMXOFF_OPCODE   ".byte 0x0f,0x01,0xc4\n"
-#define VMXON_OPCODE    ".byte 0xf3,0x0f,0xc7\n"
-
-#define MODRM_EAX_08    ".byte 0x08\n" /* ECX, [EAX] */
-#define MODRM_EAX_06    ".byte 0x30\n" /* [EAX], with reg/opcode: /6 */
-#define MODRM_EAX_07    ".byte 0x38\n" /* [EAX], with reg/opcode: /7 */
-#define MODRM_EAX_ECX   ".byte 0xc1\n" /* EAX, ECX */
-
 extern uint8_t posted_intr_vector;
 
 #define cpu_has_vmx_ept_exec_only_supported        \
@@ -310,99 +292,54 @@ extern uint8_t posted_intr_vector;
 #define INVVPID_ALL_CONTEXT                     2
 #define INVVPID_SINGLE_CONTEXT_RETAINING_GLOBAL 3
 
-#ifdef HAVE_AS_VMX
-# define GAS_VMX_OP(yes, no) yes
-#else
-# define GAS_VMX_OP(yes, no) no
-#endif
-
 static always_inline void __vmptrld(u64 addr)
 {
-    asm volatile (
-#ifdef HAVE_AS_VMX
-                   "vmptrld %0\n"
-#else
-                   VMPTRLD_OPCODE MODRM_EAX_06
-#endif
+    asm volatile ( "vmptrld %0\n\t"
                    /* CF==1 or ZF==1 --> BUG() */
                    UNLIKELY_START(be, vmptrld)
                    _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION
                    :
-#ifdef HAVE_AS_VMX
                    : "m" (addr),
-#else
-                   : "a" (&addr),
-#endif
                      _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
-                   : "memory");
+                   : "memory" );
 }
 
 static always_inline void __vmpclear(u64 addr)
 {
-    asm volatile (
-#ifdef HAVE_AS_VMX
-                   "vmclear %0\n"
-#else
-                   VMCLEAR_OPCODE MODRM_EAX_06
-#endif
+    asm volatile ( "vmclear %0\n\t"
                    /* CF==1 or ZF==1 --> BUG() */
                    UNLIKELY_START(be, vmclear)
                    _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION
                    :
-#ifdef HAVE_AS_VMX
                    : "m" (addr),
-#else
-                   : "a" (&addr),
-#endif
                      _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
-                   : "memory");
+                   : "memory" );
 }
 
 static always_inline void __vmread(unsigned long field, unsigned long *value)
 {
-    asm volatile (
-#ifdef HAVE_AS_VMX
-                   "vmread %1, %0\n\t"
-#else
-                   VMREAD_OPCODE MODRM_EAX_ECX
-#endif
+    asm volatile ( "vmread %1, %0\n\t"
                    /* CF==1 or ZF==1 --> BUG() */
                    UNLIKELY_START(be, vmread)
                    _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION
-#ifdef HAVE_AS_VMX
                    : "=rm" (*value)
                    : "r" (field),
-#else
-                   : "=c" (*value)
-                   : "a" (field),
-#endif
-                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
-        );
+                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0) );
 }
 
 static always_inline void __vmwrite(unsigned long field, unsigned long value)
 {
-    asm volatile (
-#ifdef HAVE_AS_VMX
-                   "vmwrite %1, %0\n"
-#else
-                   VMWRITE_OPCODE MODRM_EAX_ECX
-#endif
+    asm volatile ( "vmwrite %1, %0\n"
                    /* CF==1 or ZF==1 --> BUG() */
                    UNLIKELY_START(be, vmwrite)
                    _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION
                    :
-#ifdef HAVE_AS_VMX
                    : "r" (field) , "rm" (value),
-#else
-                   : "a" (field) , "c" (value),
-#endif
-                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
-        );
+                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0) );
 }
 
 static inline enum vmx_insn_errno vmread_safe(unsigned long field,
@@ -411,14 +348,13 @@ static inline enum vmx_insn_errno vmread_safe(unsigned long field,
     unsigned long ret = VMX_INSN_SUCCEED;
     bool fail_invalid, fail_valid;
 
-    asm volatile ( GAS_VMX_OP("vmread %[field], %[value]\n\t",
-                              VMREAD_OPCODE MODRM_EAX_ECX)
+    asm volatile ( "vmread %[field], %[value]\n\t"
                    ASM_FLAG_OUT(, "setc %[invalid]\n\t")
                    ASM_FLAG_OUT(, "setz %[valid]\n\t")
                    : ASM_FLAG_OUT("=@ccc", [invalid] "=rm") (fail_invalid),
                      ASM_FLAG_OUT("=@ccz", [valid] "=rm") (fail_valid),
-                     [value] GAS_VMX_OP("=rm", "=c") (*value)
-                   : [field] GAS_VMX_OP("r", "a") (field));
+                     [value] "=rm" (*value)
+                   : [field] "r" (field) );
 
     if ( unlikely(fail_invalid) )
         ret = VMX_INSN_FAIL_INVALID;
@@ -434,14 +370,13 @@ static inline enum vmx_insn_errno vmwrite_safe(unsigned long field,
     unsigned long ret = VMX_INSN_SUCCEED;
     bool fail_invalid, fail_valid;
 
-    asm volatile ( GAS_VMX_OP("vmwrite %[value], %[field]\n\t",
-                              VMWRITE_OPCODE MODRM_EAX_ECX)
+    asm volatile ( "vmwrite %[value], %[field]\n\t"
                    ASM_FLAG_OUT(, "setc %[invalid]\n\t")
                    ASM_FLAG_OUT(, "setz %[valid]\n\t")
                    : ASM_FLAG_OUT("=@ccc", [invalid] "=rm") (fail_invalid),
                      ASM_FLAG_OUT("=@ccz", [valid] "=rm") (fail_valid)
-                   : [field] GAS_VMX_OP("r", "a") (field),
-                     [value] GAS_VMX_OP("rm", "c") (value));
+                   : [field] "r" (field),
+                     [value] "rm" (value) );
 
     if ( unlikely(fail_invalid) )
         ret = VMX_INSN_FAIL_INVALID;
@@ -465,22 +400,13 @@ static always_inline void __invept(unsigned long type, uint64_t eptp)
          !cpu_has_vmx_ept_invept_single_context )
         type = INVEPT_ALL_CONTEXT;
 
-    asm volatile (
-#ifdef HAVE_AS_EPT
-                   "invept %0, %1\n"
-#else
-                   INVEPT_OPCODE MODRM_EAX_08
-#endif
+    asm volatile ( "invept %0, %1\n\t"
                    /* CF==1 or ZF==1 --> BUG() */
                    UNLIKELY_START(be, invept)
                    _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION
                    :
-#ifdef HAVE_AS_EPT
                    : "m" (operand), "r" (type),
-#else
-                   : "a" (&operand), "c" (type),
-#endif
                      _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
                    : "memory" );
 }
@@ -494,24 +420,14 @@ static always_inline void __invvpid(unsigned long type, u16 vpid, u64 gva)
     }  operand = {vpid, 0, gva};
 
     /* Fix up #UD exceptions which occur when TLBs are flushed before VMXON. */
-    asm volatile ( "1: "
-#ifdef HAVE_AS_EPT
-                   "invvpid %0, %1\n"
-#else
-                   INVVPID_OPCODE MODRM_EAX_08
-#endif
+    asm volatile ( "1: invvpid %0, %1\n\t"
                    /* CF==1 or ZF==1 --> BUG() */
                    UNLIKELY_START(be, invvpid)
                    _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION "\n"
-                   "2:"
-                   _ASM_EXTABLE(1b, 2b)
+                   "2:" _ASM_EXTABLE(1b, 2b)
                    :
-#ifdef HAVE_AS_EPT
                    : "m" (operand), "r" (type),
-#else
-                   : "a" (&operand), "c" (type),
-#endif
                      _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
                    : "memory" );
 }
@@ -552,13 +468,6 @@ static inline void vpid_sync_all(void)
     __invvpid(INVVPID_ALL_CONTEXT, 0, 0);
 }
 
-static inline void __vmxoff(void)
-{
-    asm volatile (
-        VMXOFF_OPCODE
-        : : : "memory" );
-}
-
 int cf_check vmx_guest_x86_mode(struct vcpu *v);
 unsigned int vmx_get_cpl(void);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 20:33:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 20:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.937271.1338270 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0RFQ-0006ld-Vg; Thu, 03 Apr 2025 20:33:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 937271.1338270; Thu, 03 Apr 2025 20: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 1u0RFQ-0006lV-Sp; Thu, 03 Apr 2025 20:33:12 +0000
Received: by outflank-mailman (input) for mailman id 937271;
 Thu, 03 Apr 2025 20:33:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u0RFP-0006lJ-QW
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 20:33:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0RFP-009ktK-2X
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 20:33:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0RFP-009Pw3-2L
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 20:33:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=e8peDpfJ8byavsHfM23+MaKExvQXSs1WPzfEA/D5KwM=; b=ueEC/hrYFYoXXIMsVWvmW13PCs
	JzY3M4fQ3DWOTgD+01nktr6DMYfslLfBfGOM4hOVzqduele/26olkuU69fc6bh+lCXhKqix6X/6Yx
	yR/tioTa2qSnnpGHgkn3q5yuxQMh+qL/khhOizWpi6T5+/iRFltDsa7oxK5HFKQIYCcs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/msr: Remove HAVE_AS_FSGSBASE
Message-Id: <E1u0RFP-009Pw3-2L@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 20:33:11 +0000

commit 56ad7a3b27c02f4dd4804cf5d8eaa8fb97c3a72e
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Thu Apr 3 18:23:09 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Apr 3 21:29:34 2025 +0100

    x86/msr: Remove HAVE_AS_FSGSBASE
    
    The new toolchain baseline knows the {RD,WR}{F,G}SBASE instructions; no need
    to carry the workaround in the code.
    
    No functional change.
    
    Resolves: https://gitlab.com/xen-project/xen/-/work_items/207
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/arch.mk           |  1 -
 xen/arch/x86/include/asm/msr.h | 22 ----------------------
 2 files changed, 23 deletions(-)

diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk
index e9fa1c92d7..6d2876b1a8 100644
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -12,7 +12,6 @@ $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
 $(call cc-option-add,CFLAGS,CC,-Wnested-externs)
 $(call as-option-add,CFLAGS,CC,"crc32 %eax$(comma)%eax",-DHAVE_AS_SSE4_2)
 $(call as-option-add,CFLAGS,CC,"rdrand %eax",-DHAVE_AS_RDRAND)
-$(call as-option-add,CFLAGS,CC,"rdfsbase %rax",-DHAVE_AS_FSGSBASE)
 $(call as-option-add,CFLAGS,CC,"xsaveopt (%rax)",-DHAVE_AS_XSAVEOPT)
 $(call as-option-add,CFLAGS,CC,"rdseed %eax",-DHAVE_AS_RDSEED)
 $(call as-option-add,CFLAGS,CC,"clwb (%rax)",-DHAVE_AS_CLWB)
diff --git a/xen/arch/x86/include/asm/msr.h b/xen/arch/x86/include/asm/msr.h
index 549d40b404..0d3b1d6374 100644
--- a/xen/arch/x86/include/asm/msr.h
+++ b/xen/arch/x86/include/asm/msr.h
@@ -152,11 +152,7 @@ static inline unsigned long __rdfsbase(void)
 {
     unsigned long base;
 
-#ifdef HAVE_AS_FSGSBASE
     asm volatile ( "rdfsbase %0" : "=r" (base) );
-#else
-    asm volatile ( ".byte 0xf3, 0x48, 0x0f, 0xae, 0xc0" : "=a" (base) );
-#endif
 
     return base;
 }
@@ -165,31 +161,19 @@ static inline unsigned long __rdgsbase(void)
 {
     unsigned long base;
 
-#ifdef HAVE_AS_FSGSBASE
     asm volatile ( "rdgsbase %0" : "=r" (base) );
-#else
-    asm volatile ( ".byte 0xf3, 0x48, 0x0f, 0xae, 0xc8" : "=a" (base) );
-#endif
 
     return base;
 }
 
 static inline void __wrfsbase(unsigned long base)
 {
-#ifdef HAVE_AS_FSGSBASE
     asm volatile ( "wrfsbase %0" :: "r" (base) );
-#else
-    asm volatile ( ".byte 0xf3, 0x48, 0x0f, 0xae, 0xd0" :: "a" (base) );
-#endif
 }
 
 static inline void __wrgsbase(unsigned long base)
 {
-#ifdef HAVE_AS_FSGSBASE
     asm volatile ( "wrgsbase %0" :: "r" (base) );
-#else
-    asm volatile ( ".byte 0xf3, 0x48, 0x0f, 0xae, 0xd8" :: "a" (base) );
-#endif
 }
 
 static inline unsigned long read_fs_base(void)
@@ -253,15 +237,9 @@ static inline void write_gs_shadow(unsigned long base)
     if ( read_cr4() & X86_CR4_FSGSBASE )
     {
         asm volatile ( "swapgs\n\t"
-#ifdef HAVE_AS_FSGSBASE
                        "wrgsbase %0\n\t"
                        "swapgs"
                        :: "r" (base) );
-#else
-                       ".byte 0xf3, 0x48, 0x0f, 0xae, 0xd8\n\t"
-                       "swapgs"
-                       :: "a" (base) );
-#endif
     }
     else
         wrmsrl(MSR_SHADOW_GS_BASE, base);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 20:33:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 20:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.937272.1338274 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0RFb-0006o6-0r; Thu, 03 Apr 2025 20:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 937272.1338274; Thu, 03 Apr 2025 20: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 1u0RFa-0006nz-UF; Thu, 03 Apr 2025 20:33:22 +0000
Received: by outflank-mailman (input) for mailman id 937272;
 Thu, 03 Apr 2025 20:33: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 1u0RFZ-0006nq-Tb
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 20:33: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 1u0RFZ-009ktR-2s
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 20:33:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0RFZ-009PxV-2i
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 20:33: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=aSOPSmd5twIVRIDnHT2K8S9GfbYSDKOalPJR4RVD0Qo=; b=ncAsDkNTcvwTmDxrwAOuacoI7Z
	r/onMGiYVXRRFhn5LzyPPsWphupyzPr8mheYqrXgwBHAZcBrw0vnzlkKKwprt1wn+pGT+HCykELnP
	QUveT4kYTY7Q9X0BdG1A1aflBjXEOYFJPiKFA8uwI5dsz2SDLYVlC4OYy1hksatid0+I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/asm: Remove HAVE_AS_INVPCID
Message-Id: <E1u0RFZ-009PxV-2i@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 20:33:21 +0000

commit 5d40380ee9d647874b3e49c0d263eeeb3bb7851e
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Thu Apr 3 18:23:13 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Apr 3 21:29:34 2025 +0100

    x86/asm: Remove HAVE_AS_INVPCID
    
    The new toolchain baseline knows the INVPCID instruction; no need to carry the
    workaround in the code.
    
    No functional change.
    
    Resolves: https://gitlab.com/xen-project/xen/-/work_items/209
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/arch.mk               |  1 -
 xen/arch/x86/include/asm/invpcid.h | 18 ++++--------------
 2 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk
index 6d2876b1a8..dcc8c3c330 100644
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -16,7 +16,6 @@ $(call as-option-add,CFLAGS,CC,"xsaveopt (%rax)",-DHAVE_AS_XSAVEOPT)
 $(call as-option-add,CFLAGS,CC,"rdseed %eax",-DHAVE_AS_RDSEED)
 $(call as-option-add,CFLAGS,CC,"clwb (%rax)",-DHAVE_AS_CLWB)
 $(call as-option-add,CFLAGS,CC,".equ \"x\"$(comma)1",-DHAVE_AS_QUOTED_SYM)
-$(call as-option-add,CFLAGS,CC,"invpcid (%rax)$(comma)%rax",-DHAVE_AS_INVPCID)
 $(call as-option-add,CFLAGS,CC,"movdiri %rax$(comma)(%rax)",-DHAVE_AS_MOVDIR)
 $(call as-option-add,CFLAGS,CC,"enqcmd (%rax)$(comma)%rax",-DHAVE_AS_ENQCMD)
 
diff --git a/xen/arch/x86/include/asm/invpcid.h b/xen/arch/x86/include/asm/invpcid.h
index bf5c30313a..204052f1b4 100644
--- a/xen/arch/x86/include/asm/invpcid.h
+++ b/xen/arch/x86/include/asm/invpcid.h
@@ -5,9 +5,6 @@
 
 extern bool use_invpcid;
 
-#define INVPCID_OPCODE ".byte 0x66, 0x0f, 0x38, 0x82\n"
-#define MODRM_ECX_01   ".byte 0x01\n"
-
 static inline void invpcid(unsigned int pcid, unsigned long addr,
                            unsigned int type)
 {
@@ -17,17 +14,10 @@ static inline void invpcid(unsigned int pcid, unsigned long addr,
         uint64_t addr;
     } desc = { .pcid = pcid, .addr = addr };
 
-    asm volatile (
-#ifdef HAVE_AS_INVPCID
-                  "invpcid %[desc], %q[type]"
-                  : /* No output */
-                  : [desc] "m" (desc), [type] "r" (type)
-#else
-                  INVPCID_OPCODE MODRM_ECX_01
-                  : /* No output */
-                  : "a" (type), "c" (&desc)
-#endif
-                  : "memory" );
+    asm volatile ( "invpcid %[desc], %q[type]"
+                   :
+                   : [desc] "m" (desc), [type] "r" (type)
+                   : "memory" );
 }
 
 /* Flush all mappings for a given PCID and addr, not including globals */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 20:33:34 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 20:33:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.937273.1338277 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0RFm-0006qT-27; Thu, 03 Apr 2025 20:33:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 937273.1338277; Thu, 03 Apr 2025 20: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 1u0RFl-0006qM-Vs; Thu, 03 Apr 2025 20:33:33 +0000
Received: by outflank-mailman (input) for mailman id 937273;
 Thu, 03 Apr 2025 20: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 1u0RFk-0006q9-1A
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 20: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 1u0RFk-009ktX-00
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 20:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0RFj-009PzC-35
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 20:33: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=qW5Hk0TTh5hVUp6WfXZOFiu/NQlrISXCuKzyJr1OEFE=; b=ZOvwGxKzAJpNxXPCH2ZfQ2VGU6
	UESHA0pSG+u2SRKhl07J4UBTdOEBzSBWmzmY/fhmYC/CCSiiY6G1fzCQ2c301rXrW5NyS+Sc83/Z1
	KduyZFYzjMJyWhgJc8UIf7xEHPuNE/MNxvRnbLQJW+7B6Z+5FZpp4rKSbT+k+SyvMrA0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/emulate: Remove HAVE_AS_SSE4_2
Message-Id: <E1u0RFj-009PzC-35@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 20:33:31 +0000

commit befc384d21784affa3daf2abc85b02500e4dc545
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Thu Apr 3 18:23:19 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Apr 3 21:29:34 2025 +0100

    x86/emulate: Remove HAVE_AS_SSE4_2
    
    The new toolchain baseline knows the CRC32 instructions; no need to carry the
    workaround in the code.
    
    Resolves: https://gitlab.com/xen-project/xen/-/work_items/206
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/arch.mk                   | 1 -
 xen/arch/x86/x86_emulate/x86_emulate.c | 7 +++----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk
index dcc8c3c330..3bbaee2a44 100644
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -10,7 +10,6 @@ CFLAGS += -msoft-float
 
 $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
 $(call cc-option-add,CFLAGS,CC,-Wnested-externs)
-$(call as-option-add,CFLAGS,CC,"crc32 %eax$(comma)%eax",-DHAVE_AS_SSE4_2)
 $(call as-option-add,CFLAGS,CC,"rdrand %eax",-DHAVE_AS_RDRAND)
 $(call as-option-add,CFLAGS,CC,"xsaveopt (%rax)",-DHAVE_AS_XSAVEOPT)
 $(call as-option-add,CFLAGS,CC,"rdseed %eax",-DHAVE_AS_RDSEED)
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 535d803588..55d36b9a26 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -6882,7 +6882,7 @@ x86_emulate(
             goto unhandleable;
         }
         break;
-#ifdef HAVE_AS_SSE4_2
+
     case X86EMUL_OPC_F2(0x0f38, 0xf0): /* crc32 r/m8, r{32,64} */
     case X86EMUL_OPC_F2(0x0f38, 0xf1): /* crc32 r/m{16,32,64}, r{32,64} */
         host_and_vcpu_must_have(sse4_2);
@@ -6901,17 +6901,16 @@ x86_emulate(
             asm ( "crc32l %1,%k0" : "+r" (dst.val)
                                   : "rm" (*(uint32_t *)&src.val) );
             break;
-# ifdef __x86_64__
+#ifdef __x86_64__
         case 8:
             asm ( "crc32q %1,%0" : "+r" (dst.val) : "rm" (src.val) );
             break;
-# endif
+#endif
         default:
             ASSERT_UNREACHABLE();
             goto unhandleable;
         }
         break;
-#endif
 
     case X86EMUL_OPC_VEX(0x0f38, 0xf2):    /* andn r/m,r,r */
     case X86EMUL_OPC_VEX(0x0f38, 0xf5):    /* bzhi r,r/m,r */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 21:44:10 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 21:44:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.937334.1338322 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0SLz-00008r-Qb; Thu, 03 Apr 2025 21:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 937334.1338322; Thu, 03 Apr 2025 21: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 1u0SLz-00008k-Nq; Thu, 03 Apr 2025 21:44:03 +0000
Received: by outflank-mailman (input) for mailman id 937334;
 Thu, 03 Apr 2025 21: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 1u0SLy-00008e-6v
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 21: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 1u0SLy-009mYj-0Q
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 21:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0SLy-009cqr-04
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 21: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=pYAwoS4pU5MpvownBb70UUgFMEb2T7wDcJhfGa983y8=; b=oHMPW8nYizKvC4uVgNFvd1NSnQ
	3Ju7wpZbQmFCiOASNC+1KkrznPCXIr+TbQWgS5XUiON1Jv60ufbCGv6/LHqFKb2Ii1ikeMLePz+TT
	YAoR3k/1WT9Sz0N8VzXMoWQwgVcFC4RsRMBguuwfwwAQBs7vHSVNsn6OLW1VbGcpcKCQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/vmx: Remove HAVE_AS_{EPT,VMX}, GAS_VMX_OP(), etc
Message-Id: <E1u0SLy-009cqr-04@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 21:44:02 +0000

commit 1f2ea165f6b4be754ce02319f89df96a2a649d37
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Thu Apr 3 18:23:04 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Apr 3 21:29:34 2025 +0100

    x86/vmx: Remove HAVE_AS_{EPT,VMX}, GAS_VMX_OP(), etc
    
    The new toolchain baseline knows the VMX instructions; no need to carry the
    workaround in the code.
    
    Inline __vmxoff() into it's single caller.
    
    Updated formatting in the wrappers to consistent.
    
    No functional change.
    
    Resolves: https://gitlab.com/xen-project/xen/-/work_items/202
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/arch.mk                   |   4 +-
 xen/arch/x86/hvm/vmx/vmcs.c            |   2 +-
 xen/arch/x86/include/asm/hvm/vmx/vmx.h | 125 +++++----------------------------
 3 files changed, 19 insertions(+), 112 deletions(-)

diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk
index 258e459bec..e9fa1c92d7 100644
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -10,9 +10,7 @@ CFLAGS += -msoft-float
 
 $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
 $(call cc-option-add,CFLAGS,CC,-Wnested-externs)
-$(call as-option-add,CFLAGS,CC,"vmcall",-DHAVE_AS_VMX)
 $(call as-option-add,CFLAGS,CC,"crc32 %eax$(comma)%eax",-DHAVE_AS_SSE4_2)
-$(call as-option-add,CFLAGS,CC,"invept (%rax)$(comma)%rax",-DHAVE_AS_EPT)
 $(call as-option-add,CFLAGS,CC,"rdrand %eax",-DHAVE_AS_RDRAND)
 $(call as-option-add,CFLAGS,CC,"rdfsbase %rax",-DHAVE_AS_FSGSBASE)
 $(call as-option-add,CFLAGS,CC,"xsaveopt (%rax)",-DHAVE_AS_XSAVEOPT)
@@ -23,7 +21,7 @@ $(call as-option-add,CFLAGS,CC,"invpcid (%rax)$(comma)%rax",-DHAVE_AS_INVPCID)
 $(call as-option-add,CFLAGS,CC,"movdiri %rax$(comma)(%rax)",-DHAVE_AS_MOVDIR)
 $(call as-option-add,CFLAGS,CC,"enqcmd (%rax)$(comma)%rax",-DHAVE_AS_ENQCMD)
 
-# Check to see whether the assmbler supports the .nop directive.
+# Check to see whether the assembler supports the .nop directive.
 $(call as-option-add,CFLAGS,CC,\
     ".L1: .L2: .nops (.L2 - .L1)$(comma)9",-DHAVE_AS_NOPS_DIRECTIVE)
 
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 1d427100ce..a44475ae15 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -811,7 +811,7 @@ void cf_check vmx_cpu_down(void)
 
     BUG_ON(!(read_cr4() & X86_CR4_VMXE));
     this_cpu(vmxon) = 0;
-    __vmxoff();
+    asm volatile ( "vmxoff" ::: "memory" );
 
     local_irq_restore(flags);
 }
diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmx.h b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
index 7c6ba73407..affb3a8bd6 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
@@ -257,24 +257,6 @@ typedef union cr_access_qual {
 #define X86_SEG_AR_GRANULARITY  (1u << 15) /* 15, granularity */
 #define X86_SEG_AR_SEG_UNUSABLE (1u << 16) /* 16, segment unusable */
 
-#define VMCALL_OPCODE   ".byte 0x0f,0x01,0xc1\n"
-#define VMCLEAR_OPCODE  ".byte 0x66,0x0f,0xc7\n"        /* reg/opcode: /6 */
-#define VMLAUNCH_OPCODE ".byte 0x0f,0x01,0xc2\n"
-#define VMPTRLD_OPCODE  ".byte 0x0f,0xc7\n"             /* reg/opcode: /6 */
-#define VMPTRST_OPCODE  ".byte 0x0f,0xc7\n"             /* reg/opcode: /7 */
-#define VMREAD_OPCODE   ".byte 0x0f,0x78\n"
-#define VMRESUME_OPCODE ".byte 0x0f,0x01,0xc3\n"
-#define VMWRITE_OPCODE  ".byte 0x0f,0x79\n"
-#define INVEPT_OPCODE   ".byte 0x66,0x0f,0x38,0x80\n"   /* m128,r64/32 */
-#define INVVPID_OPCODE  ".byte 0x66,0x0f,0x38,0x81\n"   /* m128,r64/32 */
-#define VMXOFF_OPCODE   ".byte 0x0f,0x01,0xc4\n"
-#define VMXON_OPCODE    ".byte 0xf3,0x0f,0xc7\n"
-
-#define MODRM_EAX_08    ".byte 0x08\n" /* ECX, [EAX] */
-#define MODRM_EAX_06    ".byte 0x30\n" /* [EAX], with reg/opcode: /6 */
-#define MODRM_EAX_07    ".byte 0x38\n" /* [EAX], with reg/opcode: /7 */
-#define MODRM_EAX_ECX   ".byte 0xc1\n" /* EAX, ECX */
-
 extern uint8_t posted_intr_vector;
 
 #define cpu_has_vmx_ept_exec_only_supported        \
@@ -310,99 +292,54 @@ extern uint8_t posted_intr_vector;
 #define INVVPID_ALL_CONTEXT                     2
 #define INVVPID_SINGLE_CONTEXT_RETAINING_GLOBAL 3
 
-#ifdef HAVE_AS_VMX
-# define GAS_VMX_OP(yes, no) yes
-#else
-# define GAS_VMX_OP(yes, no) no
-#endif
-
 static always_inline void __vmptrld(u64 addr)
 {
-    asm volatile (
-#ifdef HAVE_AS_VMX
-                   "vmptrld %0\n"
-#else
-                   VMPTRLD_OPCODE MODRM_EAX_06
-#endif
+    asm volatile ( "vmptrld %0\n\t"
                    /* CF==1 or ZF==1 --> BUG() */
                    UNLIKELY_START(be, vmptrld)
                    _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION
                    :
-#ifdef HAVE_AS_VMX
                    : "m" (addr),
-#else
-                   : "a" (&addr),
-#endif
                      _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
-                   : "memory");
+                   : "memory" );
 }
 
 static always_inline void __vmpclear(u64 addr)
 {
-    asm volatile (
-#ifdef HAVE_AS_VMX
-                   "vmclear %0\n"
-#else
-                   VMCLEAR_OPCODE MODRM_EAX_06
-#endif
+    asm volatile ( "vmclear %0\n\t"
                    /* CF==1 or ZF==1 --> BUG() */
                    UNLIKELY_START(be, vmclear)
                    _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION
                    :
-#ifdef HAVE_AS_VMX
                    : "m" (addr),
-#else
-                   : "a" (&addr),
-#endif
                      _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
-                   : "memory");
+                   : "memory" );
 }
 
 static always_inline void __vmread(unsigned long field, unsigned long *value)
 {
-    asm volatile (
-#ifdef HAVE_AS_VMX
-                   "vmread %1, %0\n\t"
-#else
-                   VMREAD_OPCODE MODRM_EAX_ECX
-#endif
+    asm volatile ( "vmread %1, %0\n\t"
                    /* CF==1 or ZF==1 --> BUG() */
                    UNLIKELY_START(be, vmread)
                    _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION
-#ifdef HAVE_AS_VMX
                    : "=rm" (*value)
                    : "r" (field),
-#else
-                   : "=c" (*value)
-                   : "a" (field),
-#endif
-                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
-        );
+                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0) );
 }
 
 static always_inline void __vmwrite(unsigned long field, unsigned long value)
 {
-    asm volatile (
-#ifdef HAVE_AS_VMX
-                   "vmwrite %1, %0\n"
-#else
-                   VMWRITE_OPCODE MODRM_EAX_ECX
-#endif
+    asm volatile ( "vmwrite %1, %0\n"
                    /* CF==1 or ZF==1 --> BUG() */
                    UNLIKELY_START(be, vmwrite)
                    _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION
                    :
-#ifdef HAVE_AS_VMX
                    : "r" (field) , "rm" (value),
-#else
-                   : "a" (field) , "c" (value),
-#endif
-                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
-        );
+                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0) );
 }
 
 static inline enum vmx_insn_errno vmread_safe(unsigned long field,
@@ -411,14 +348,13 @@ static inline enum vmx_insn_errno vmread_safe(unsigned long field,
     unsigned long ret = VMX_INSN_SUCCEED;
     bool fail_invalid, fail_valid;
 
-    asm volatile ( GAS_VMX_OP("vmread %[field], %[value]\n\t",
-                              VMREAD_OPCODE MODRM_EAX_ECX)
+    asm volatile ( "vmread %[field], %[value]\n\t"
                    ASM_FLAG_OUT(, "setc %[invalid]\n\t")
                    ASM_FLAG_OUT(, "setz %[valid]\n\t")
                    : ASM_FLAG_OUT("=@ccc", [invalid] "=rm") (fail_invalid),
                      ASM_FLAG_OUT("=@ccz", [valid] "=rm") (fail_valid),
-                     [value] GAS_VMX_OP("=rm", "=c") (*value)
-                   : [field] GAS_VMX_OP("r", "a") (field));
+                     [value] "=rm" (*value)
+                   : [field] "r" (field) );
 
     if ( unlikely(fail_invalid) )
         ret = VMX_INSN_FAIL_INVALID;
@@ -434,14 +370,13 @@ static inline enum vmx_insn_errno vmwrite_safe(unsigned long field,
     unsigned long ret = VMX_INSN_SUCCEED;
     bool fail_invalid, fail_valid;
 
-    asm volatile ( GAS_VMX_OP("vmwrite %[value], %[field]\n\t",
-                              VMWRITE_OPCODE MODRM_EAX_ECX)
+    asm volatile ( "vmwrite %[value], %[field]\n\t"
                    ASM_FLAG_OUT(, "setc %[invalid]\n\t")
                    ASM_FLAG_OUT(, "setz %[valid]\n\t")
                    : ASM_FLAG_OUT("=@ccc", [invalid] "=rm") (fail_invalid),
                      ASM_FLAG_OUT("=@ccz", [valid] "=rm") (fail_valid)
-                   : [field] GAS_VMX_OP("r", "a") (field),
-                     [value] GAS_VMX_OP("rm", "c") (value));
+                   : [field] "r" (field),
+                     [value] "rm" (value) );
 
     if ( unlikely(fail_invalid) )
         ret = VMX_INSN_FAIL_INVALID;
@@ -465,22 +400,13 @@ static always_inline void __invept(unsigned long type, uint64_t eptp)
          !cpu_has_vmx_ept_invept_single_context )
         type = INVEPT_ALL_CONTEXT;
 
-    asm volatile (
-#ifdef HAVE_AS_EPT
-                   "invept %0, %1\n"
-#else
-                   INVEPT_OPCODE MODRM_EAX_08
-#endif
+    asm volatile ( "invept %0, %1\n\t"
                    /* CF==1 or ZF==1 --> BUG() */
                    UNLIKELY_START(be, invept)
                    _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION
                    :
-#ifdef HAVE_AS_EPT
                    : "m" (operand), "r" (type),
-#else
-                   : "a" (&operand), "c" (type),
-#endif
                      _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
                    : "memory" );
 }
@@ -494,24 +420,14 @@ static always_inline void __invvpid(unsigned long type, u16 vpid, u64 gva)
     }  operand = {vpid, 0, gva};
 
     /* Fix up #UD exceptions which occur when TLBs are flushed before VMXON. */
-    asm volatile ( "1: "
-#ifdef HAVE_AS_EPT
-                   "invvpid %0, %1\n"
-#else
-                   INVVPID_OPCODE MODRM_EAX_08
-#endif
+    asm volatile ( "1: invvpid %0, %1\n\t"
                    /* CF==1 or ZF==1 --> BUG() */
                    UNLIKELY_START(be, invvpid)
                    _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION "\n"
-                   "2:"
-                   _ASM_EXTABLE(1b, 2b)
+                   "2:" _ASM_EXTABLE(1b, 2b)
                    :
-#ifdef HAVE_AS_EPT
                    : "m" (operand), "r" (type),
-#else
-                   : "a" (&operand), "c" (type),
-#endif
                      _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
                    : "memory" );
 }
@@ -552,13 +468,6 @@ static inline void vpid_sync_all(void)
     __invvpid(INVVPID_ALL_CONTEXT, 0, 0);
 }
 
-static inline void __vmxoff(void)
-{
-    asm volatile (
-        VMXOFF_OPCODE
-        : : : "memory" );
-}
-
 int cf_check vmx_guest_x86_mode(struct vcpu *v);
 unsigned int vmx_get_cpl(void);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 21:44:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 21:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.937335.1338326 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0SM9-0000Ax-SQ; Thu, 03 Apr 2025 21:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 937335.1338326; Thu, 03 Apr 2025 21: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 1u0SM9-0000Aq-PZ; Thu, 03 Apr 2025 21:44:13 +0000
Received: by outflank-mailman (input) for mailman id 937335;
 Thu, 03 Apr 2025 21: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 1u0SM8-0000AZ-8h
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 21: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 1u0SM8-009mYn-0j
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 21:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0SM8-009cs4-0c
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 21: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=8EFvw2lNvvCWDhHIEaAgvbHlSoZJc1xzSSQN6wC8b+0=; b=Tp+Kj6tbFi68L/qCTuhCRhyYRz
	H2UyxbiMBKfcQWGpn/yRVbLpCikw0ykiy51Jf7QKevHPoJubo/pRzEdun4NUQjlMwLeoKbPSEycKi
	r1Gkq0WK290RLa5zK1zsQboudVI36a4foqr1Lai6aK1tTHbB2nWaCCI5I7JhpH0x3uBg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/msr: Remove HAVE_AS_FSGSBASE
Message-Id: <E1u0SM8-009cs4-0c@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 21:44:12 +0000

commit 56ad7a3b27c02f4dd4804cf5d8eaa8fb97c3a72e
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Thu Apr 3 18:23:09 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Apr 3 21:29:34 2025 +0100

    x86/msr: Remove HAVE_AS_FSGSBASE
    
    The new toolchain baseline knows the {RD,WR}{F,G}SBASE instructions; no need
    to carry the workaround in the code.
    
    No functional change.
    
    Resolves: https://gitlab.com/xen-project/xen/-/work_items/207
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/arch.mk           |  1 -
 xen/arch/x86/include/asm/msr.h | 22 ----------------------
 2 files changed, 23 deletions(-)

diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk
index e9fa1c92d7..6d2876b1a8 100644
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -12,7 +12,6 @@ $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
 $(call cc-option-add,CFLAGS,CC,-Wnested-externs)
 $(call as-option-add,CFLAGS,CC,"crc32 %eax$(comma)%eax",-DHAVE_AS_SSE4_2)
 $(call as-option-add,CFLAGS,CC,"rdrand %eax",-DHAVE_AS_RDRAND)
-$(call as-option-add,CFLAGS,CC,"rdfsbase %rax",-DHAVE_AS_FSGSBASE)
 $(call as-option-add,CFLAGS,CC,"xsaveopt (%rax)",-DHAVE_AS_XSAVEOPT)
 $(call as-option-add,CFLAGS,CC,"rdseed %eax",-DHAVE_AS_RDSEED)
 $(call as-option-add,CFLAGS,CC,"clwb (%rax)",-DHAVE_AS_CLWB)
diff --git a/xen/arch/x86/include/asm/msr.h b/xen/arch/x86/include/asm/msr.h
index 549d40b404..0d3b1d6374 100644
--- a/xen/arch/x86/include/asm/msr.h
+++ b/xen/arch/x86/include/asm/msr.h
@@ -152,11 +152,7 @@ static inline unsigned long __rdfsbase(void)
 {
     unsigned long base;
 
-#ifdef HAVE_AS_FSGSBASE
     asm volatile ( "rdfsbase %0" : "=r" (base) );
-#else
-    asm volatile ( ".byte 0xf3, 0x48, 0x0f, 0xae, 0xc0" : "=a" (base) );
-#endif
 
     return base;
 }
@@ -165,31 +161,19 @@ static inline unsigned long __rdgsbase(void)
 {
     unsigned long base;
 
-#ifdef HAVE_AS_FSGSBASE
     asm volatile ( "rdgsbase %0" : "=r" (base) );
-#else
-    asm volatile ( ".byte 0xf3, 0x48, 0x0f, 0xae, 0xc8" : "=a" (base) );
-#endif
 
     return base;
 }
 
 static inline void __wrfsbase(unsigned long base)
 {
-#ifdef HAVE_AS_FSGSBASE
     asm volatile ( "wrfsbase %0" :: "r" (base) );
-#else
-    asm volatile ( ".byte 0xf3, 0x48, 0x0f, 0xae, 0xd0" :: "a" (base) );
-#endif
 }
 
 static inline void __wrgsbase(unsigned long base)
 {
-#ifdef HAVE_AS_FSGSBASE
     asm volatile ( "wrgsbase %0" :: "r" (base) );
-#else
-    asm volatile ( ".byte 0xf3, 0x48, 0x0f, 0xae, 0xd8" :: "a" (base) );
-#endif
 }
 
 static inline unsigned long read_fs_base(void)
@@ -253,15 +237,9 @@ static inline void write_gs_shadow(unsigned long base)
     if ( read_cr4() & X86_CR4_FSGSBASE )
     {
         asm volatile ( "swapgs\n\t"
-#ifdef HAVE_AS_FSGSBASE
                        "wrgsbase %0\n\t"
                        "swapgs"
                        :: "r" (base) );
-#else
-                       ".byte 0xf3, 0x48, 0x0f, 0xae, 0xd8\n\t"
-                       "swapgs"
-                       :: "a" (base) );
-#endif
     }
     else
         wrmsrl(MSR_SHADOW_GS_BASE, base);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 21:44:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 21:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.937336.1338329 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0SMI-0000EO-VL; Thu, 03 Apr 2025 21:44:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 937336.1338329; Thu, 03 Apr 2025 21: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 1u0SMI-0000EH-St; Thu, 03 Apr 2025 21:44:22 +0000
Received: by outflank-mailman (input) for mailman id 937336;
 Thu, 03 Apr 2025 21: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 1u0SMI-0000E1-BK
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 21: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 1u0SMI-009mYt-12
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 21:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0SMI-009ctn-0u
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 21: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=yZ9un07qfufOHVQsWYdwNobgRHWuIZcF7oWWXahrB/Y=; b=PX9qjBdYQHBt9w3FmmvkpNElkY
	UlsnI7LtynsD4z9GCqd59EB2kD8n7slKrl5JFaRtIDYczlZNaOxdTwLL1+XmBcFRBtpTvXtueFWXn
	OXC4PXqItBefXQZgIyXczJZ6uHaHJpI35ZB3uMl2hYriNkUnn/Zc68Rk23kLPY4Ishjo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/asm: Remove HAVE_AS_INVPCID
Message-Id: <E1u0SMI-009ctn-0u@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 21:44:22 +0000

commit 5d40380ee9d647874b3e49c0d263eeeb3bb7851e
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Thu Apr 3 18:23:13 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Apr 3 21:29:34 2025 +0100

    x86/asm: Remove HAVE_AS_INVPCID
    
    The new toolchain baseline knows the INVPCID instruction; no need to carry the
    workaround in the code.
    
    No functional change.
    
    Resolves: https://gitlab.com/xen-project/xen/-/work_items/209
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/arch.mk               |  1 -
 xen/arch/x86/include/asm/invpcid.h | 18 ++++--------------
 2 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk
index 6d2876b1a8..dcc8c3c330 100644
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -16,7 +16,6 @@ $(call as-option-add,CFLAGS,CC,"xsaveopt (%rax)",-DHAVE_AS_XSAVEOPT)
 $(call as-option-add,CFLAGS,CC,"rdseed %eax",-DHAVE_AS_RDSEED)
 $(call as-option-add,CFLAGS,CC,"clwb (%rax)",-DHAVE_AS_CLWB)
 $(call as-option-add,CFLAGS,CC,".equ \"x\"$(comma)1",-DHAVE_AS_QUOTED_SYM)
-$(call as-option-add,CFLAGS,CC,"invpcid (%rax)$(comma)%rax",-DHAVE_AS_INVPCID)
 $(call as-option-add,CFLAGS,CC,"movdiri %rax$(comma)(%rax)",-DHAVE_AS_MOVDIR)
 $(call as-option-add,CFLAGS,CC,"enqcmd (%rax)$(comma)%rax",-DHAVE_AS_ENQCMD)
 
diff --git a/xen/arch/x86/include/asm/invpcid.h b/xen/arch/x86/include/asm/invpcid.h
index bf5c30313a..204052f1b4 100644
--- a/xen/arch/x86/include/asm/invpcid.h
+++ b/xen/arch/x86/include/asm/invpcid.h
@@ -5,9 +5,6 @@
 
 extern bool use_invpcid;
 
-#define INVPCID_OPCODE ".byte 0x66, 0x0f, 0x38, 0x82\n"
-#define MODRM_ECX_01   ".byte 0x01\n"
-
 static inline void invpcid(unsigned int pcid, unsigned long addr,
                            unsigned int type)
 {
@@ -17,17 +14,10 @@ static inline void invpcid(unsigned int pcid, unsigned long addr,
         uint64_t addr;
     } desc = { .pcid = pcid, .addr = addr };
 
-    asm volatile (
-#ifdef HAVE_AS_INVPCID
-                  "invpcid %[desc], %q[type]"
-                  : /* No output */
-                  : [desc] "m" (desc), [type] "r" (type)
-#else
-                  INVPCID_OPCODE MODRM_ECX_01
-                  : /* No output */
-                  : "a" (type), "c" (&desc)
-#endif
-                  : "memory" );
+    asm volatile ( "invpcid %[desc], %q[type]"
+                   :
+                   : [desc] "m" (desc), [type] "r" (type)
+                   : "memory" );
 }
 
 /* Flush all mappings for a given PCID and addr, not including globals */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 03 21:44:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 03 Apr 2025 21:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.937337.1338334 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0SMT-0000HJ-0v; Thu, 03 Apr 2025 21:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 937337.1338334; Thu, 03 Apr 2025 21: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 1u0SMS-0000HB-UN; Thu, 03 Apr 2025 21:44:32 +0000
Received: by outflank-mailman (input) for mailman id 937337;
 Thu, 03 Apr 2025 21: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 1u0SMS-0000H0-GY
 for xen-changelog@lists.xenproject.org; Thu, 03 Apr 2025 21: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 1u0SMS-009mYz-1X
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 21:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0SMS-009cuw-1F
 for xen-changelog@lists.xenproject.org;
 Thu, 03 Apr 2025 21: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=RwW19FHAjUzFNOgfyy8GZuiB/OwMosNmyg+Cdi+gzoI=; b=3FmSJvSqhigqgHT6MBZZ3Zojki
	dTwCuCE/D3ql+3Il8uY1tIqX9WJgOtlZfgJ7FL9khx6N3ZRryL7ZpRqf4RqkYsedxWdiy3r+FX/Jg
	H56c/6lXKbk65EFvy2PUcBFlh0a3xs9UJgTjCj/8l/iL2sbcqz4NIP1ueU3Aufcnpj+0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/emulate: Remove HAVE_AS_SSE4_2
Message-Id: <E1u0SMS-009cuw-1F@xenbits.xenproject.org>
Date: Thu, 03 Apr 2025 21:44:32 +0000

commit befc384d21784affa3daf2abc85b02500e4dc545
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Thu Apr 3 18:23:19 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Apr 3 21:29:34 2025 +0100

    x86/emulate: Remove HAVE_AS_SSE4_2
    
    The new toolchain baseline knows the CRC32 instructions; no need to carry the
    workaround in the code.
    
    Resolves: https://gitlab.com/xen-project/xen/-/work_items/206
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/arch.mk                   | 1 -
 xen/arch/x86/x86_emulate/x86_emulate.c | 7 +++----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk
index dcc8c3c330..3bbaee2a44 100644
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -10,7 +10,6 @@ CFLAGS += -msoft-float
 
 $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
 $(call cc-option-add,CFLAGS,CC,-Wnested-externs)
-$(call as-option-add,CFLAGS,CC,"crc32 %eax$(comma)%eax",-DHAVE_AS_SSE4_2)
 $(call as-option-add,CFLAGS,CC,"rdrand %eax",-DHAVE_AS_RDRAND)
 $(call as-option-add,CFLAGS,CC,"xsaveopt (%rax)",-DHAVE_AS_XSAVEOPT)
 $(call as-option-add,CFLAGS,CC,"rdseed %eax",-DHAVE_AS_RDSEED)
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 535d803588..55d36b9a26 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -6882,7 +6882,7 @@ x86_emulate(
             goto unhandleable;
         }
         break;
-#ifdef HAVE_AS_SSE4_2
+
     case X86EMUL_OPC_F2(0x0f38, 0xf0): /* crc32 r/m8, r{32,64} */
     case X86EMUL_OPC_F2(0x0f38, 0xf1): /* crc32 r/m{16,32,64}, r{32,64} */
         host_and_vcpu_must_have(sse4_2);
@@ -6901,17 +6901,16 @@ x86_emulate(
             asm ( "crc32l %1,%k0" : "+r" (dst.val)
                                   : "rm" (*(uint32_t *)&src.val) );
             break;
-# ifdef __x86_64__
+#ifdef __x86_64__
         case 8:
             asm ( "crc32q %1,%0" : "+r" (dst.val) : "rm" (src.val) );
             break;
-# endif
+#endif
         default:
             ASSERT_UNREACHABLE();
             goto unhandleable;
         }
         break;
-#endif
 
     case X86EMUL_OPC_VEX(0x0f38, 0xf2):    /* andn r/m,r,r */
     case X86EMUL_OPC_VEX(0x0f38, 0xf5):    /* bzhi r,r/m,r */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 10:44:10 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 10:44:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938106.1338908 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eWp-0007xG-Ts; Fri, 04 Apr 2025 10:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938106.1338908; Fri, 04 Apr 2025 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 1u0eWp-0007x8-RJ; Fri, 04 Apr 2025 10:44:03 +0000
Received: by outflank-mailman (input) for mailman id 938106;
 Fri, 04 Apr 2025 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 1u0eWo-0007wj-EX
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 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 1u0eWo-00Bc15-0e
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0eWo-00BSUp-0U
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 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=Wh0WhQEtICyCgqpVYYYmeNjdwcJJYcoxOQxR/3eFzSw=; b=jgsJ6rfdCGYM6gdapM+h+9/3SW
	B0l7XAliVwdLxvptQcEO4tajT/tspH+k+ybv3r4hWYV8qCeBRGhVnFmMzjlv3YcMdo4CNo5MVOg/O
	IxpFCgaYq7EmH+D/j/MDGnFvuC+A+x9jInc9hzBw3F0mn4h9jZXU7hqwO9cyx1uNmy4E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] CirrusCI: Use shallow clone
Message-Id: <E1u0eWo-00BSUp-0U@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 10:44:02 +0000

commit 2599ee0b601c89cd2efb8b803934024ee1e83d65
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Feb 24 15:36:11 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:32:29 2025 +0100

    CirrusCI: Use shallow clone
    
    This reduces the Clone step from ~50s to ~3s.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 96970b46e5e84fa2666f76f5b0972b826a3ffba4)
---
 .cirrus.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.cirrus.yml b/.cirrus.yml
index 7216729b69..e2949d99d7 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -13,6 +13,7 @@ freebsd_template: &FREEBSD_ENV
   environment:
     APPEND_LIB: /usr/local/lib
     APPEND_INCLUDES: /usr/local/include
+    CIRRUS_CLONE_DEPTH: 1
 
 freebsd_full_build_template: &FREEBSD_FULL_BUILD_TEMPLATE
   << : *FREEBSD_ENV
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 10:44:12 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 10:44:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938107.1338911 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eWy-0007yo-VC; Fri, 04 Apr 2025 10:44:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938107.1338911; Fri, 04 Apr 2025 10: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 1u0eWy-0007yh-Sk; Fri, 04 Apr 2025 10:44:12 +0000
Received: by outflank-mailman (input) for mailman id 938107;
 Fri, 04 Apr 2025 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 1u0eWy-0007yX-AO
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 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 1u0eWy-00Bc1H-0w
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0eWy-00BSWC-0p
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 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=wEgtVaBTTf3aRQGg9TZESa3VDd8tCjmEilf+G6NrQJw=; b=BKFm5/dDzt+/afAIAphw3/lEND
	x0Fc65W6NAlVXhgXgL0iZlZapf/sKlQXX9S/n/L7cbwO8+T/6orbzxc1yB7daIQJ+rq0yWGXM3fmJ
	5qrODuCiR9I3GSKDFjh6eDm0KDOfpsA1VBpNpYhT9DiF/wO0zJCiwmU0s8w4XXtrVR3c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] automation/cirrus-ci: store xen/.config as an artifact
Message-Id: <E1u0eWy-00BSWC-0p@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 10:44:12 +0000

commit 8f94c1ec72093f7ee59c3d259ff2be37e0591395
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Mar 10 18:41:57 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:32:29 2025 +0100

    automation/cirrus-ci: store xen/.config as an artifact
    
    Always store xen/.config as an artifact, renamed to xen-config to match
    the naming used in the Gitlab CI tests.
    
    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>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 318659c818546b6415c2311339a53384dc20c427)
---
 .cirrus.yml | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/.cirrus.yml b/.cirrus.yml
index e2949d99d7..1a39f5026f 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -15,6 +15,14 @@ freebsd_template: &FREEBSD_ENV
     APPEND_INCLUDES: /usr/local/include
     CIRRUS_CLONE_DEPTH: 1
 
+freebsd_artifacts: &FREEBSD_ARTIFACTS
+  always:
+    rename_script:
+      - cp xen/.config xen-config
+    config_artifacts:
+      path: xen-config
+      type: text/plain
+
 freebsd_full_build_template: &FREEBSD_FULL_BUILD_TEMPLATE
   << : *FREEBSD_ENV
 
@@ -28,6 +36,8 @@ freebsd_full_build_template: &FREEBSD_FULL_BUILD_TEMPLATE
     - ./configure --with-system-seabios=/usr/local/share/seabios/bios.bin
     - gmake -j`sysctl -n hw.ncpu` clang=y
 
+  << : *FREEBSD_ARTIFACTS
+
 freebsd_randconfig_template: &FREEBSD_RANDCONFIG_TEMPLATE
   << : *FREEBSD_ENV
 
@@ -39,6 +49,8 @@ freebsd_randconfig_template: &FREEBSD_RANDCONFIG_TEMPLATE
             KCONFIG_ALLCONFIG=tools/kconfig/allrandom.config randconfig
     - gmake -j`sysctl -n hw.ncpu` build-xen clang=y
 
+  << : *FREEBSD_ARTIFACTS
+
 task:
   name: 'FreeBSD 13: full build'
   << : *FREEBSD_13
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 10:44:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 10:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938108.1338915 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eXA-00083G-0S; Fri, 04 Apr 2025 10:44:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938108.1338915; Fri, 04 Apr 2025 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 1u0eX9-000839-UF; Fri, 04 Apr 2025 10:44:23 +0000
Received: by outflank-mailman (input) for mailman id 938108;
 Fri, 04 Apr 2025 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 1u0eX8-00082A-DA
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 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 1u0eX8-00Bc1U-1E
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0eX8-00BSZI-16
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 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=GFokBYc3H/unqPQL349aTEXU+XzXEWO3Xmurfp7sIt0=; b=JAWQq7xU/VkSqmhENQSJF9opFW
	MepHucmXeo6FLKZKjYPbgSyuuW8vaiXVjFTm4daJ47GFbeOPZw6FqCFm67Z1qxaj5s8Lkg4D8jQ8m
	LgT4wzzK+yC17DB/t837USyXoPYfgyOoh+JKu+aruIDWZfAmdlKNbx8BZQVf6dRCuHOk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] automation/cirrus-ci: add timestamps
Message-Id: <E1u0eX8-00BSZI-16@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 10:44:22 +0000

commit 0a84ef273116c6e163a6b51014c2f27d584b05cb
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Mar 14 11:44:45 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:32:29 2025 +0100

    automation/cirrus-ci: add timestamps
    
    Such timestamps can still be disabled from the Web UI using a tick box.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 1256159f3cfcfef475b94dda39f68a85702bba64)
---
 .cirrus.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.cirrus.yml b/.cirrus.yml
index 1a39f5026f..aa195ba370 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -14,6 +14,7 @@ freebsd_template: &FREEBSD_ENV
     APPEND_LIB: /usr/local/lib
     APPEND_INCLUDES: /usr/local/include
     CIRRUS_CLONE_DEPTH: 1
+    CIRRUS_LOG_TIMESTAMP: true
 
 freebsd_artifacts: &FREEBSD_ARTIFACTS
   always:
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 10:44:34 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 10:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938109.1338922 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eXK-00085s-3E; Fri, 04 Apr 2025 10:44:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938109.1338922; Fri, 04 Apr 2025 10: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 1u0eXJ-00085j-Vn; Fri, 04 Apr 2025 10:44:33 +0000
Received: by outflank-mailman (input) for mailman id 938109;
 Fri, 04 Apr 2025 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 1u0eXI-00085P-HA
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 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 1u0eXI-00Bc1g-1c
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0eXI-00BSaU-1P
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 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=G+yJQ5zJIoA8hbRSsyf/gaxB/boIWs/MjzZ1zGrwk90=; b=Hiz84thx05tCZz95Fe9LD+f8Vd
	w5YZ+IGASL6Z9UIfAL33TnMNgdAy2b7fQaU5q7AbJM+eKGHeQBxUQ6KLTswfAY3XpTRDeH7QcY5Vg
	xxwOuo0FArBeJcxAnv4e3eDkhpa0Z5iwRhLfDFRSjiHyMLdQvqu3AIKv5ANfDsAZfAwk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] automation/cirrus-ci: update FreeBSD to 13.5
Message-Id: <E1u0eXI-00BSaU-1P@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 10:44:32 +0000

commit 44407a9d92613f85058658852611e0778383bcc2
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Mar 14 11:49:28 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:32:29 2025 +0100

    automation/cirrus-ci: update FreeBSD to 13.5
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 5395cd7b892daf11cd80e4eec0cfa45c4b319d35)
---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index aa195ba370..ce7588b7b6 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -1,7 +1,7 @@
 # https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
 freebsd_13: &FREEBSD_13
   freebsd_instance:
-    image_family: freebsd-13-4
+    image_family: freebsd-13-5
 freebsd_14: &FREEBSD_14
   freebsd_instance:
     image_family: freebsd-14-2
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 10:44:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 10:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938110.1338924 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eXU-00088O-3W; Fri, 04 Apr 2025 10:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938110.1338924; Fri, 04 Apr 2025 10: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 1u0eXU-00088G-0v; Fri, 04 Apr 2025 10:44:44 +0000
Received: by outflank-mailman (input) for mailman id 938110;
 Fri, 04 Apr 2025 10: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 1u0eXS-000881-K3
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 10: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 1u0eXS-00Bc22-1t
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0eXS-00BSca-1n
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10: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=bXfadFy2pCUZD159BJvnL5PSI0BgvgYVBw6Cc/aUBno=; b=gDpPFQ9Ubl+KHF1YWiQ/a6fc7J
	MvLMDQUmUSUQg6gB8hzb9Ex1D5usI8WJ+m+ASlsRCeyuvkpISpgHiwImDTAnXtge10PCsjUZBjArY
	3iCpmh7e1UXMCs5exiS0ZUxWkIn2KRoKMhqFw5AEw97Md2peUIq9cBS/daS0+usYJ3bc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] automation/cirrus-ci: store Xen Kconfig before doing a build
Message-Id: <E1u0eXS-00BSca-1n@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 10:44:42 +0000

commit 0b37231312e7bd01055d2388f66ec439c44dbab2
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Mar 14 11:55:48 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:32:29 2025 +0100

    automation/cirrus-ci: store Xen Kconfig before doing a build
    
    In case the build fails or gets stuck, store the Kconfig file ahead of
    starting the build.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 421c2bd58f35ede865fa81c82957ca5297e903a4)
---
 .cirrus.yml | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index ce7588b7b6..490f214f04 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -16,7 +16,7 @@ freebsd_template: &FREEBSD_ENV
     CIRRUS_CLONE_DEPTH: 1
     CIRRUS_LOG_TIMESTAMP: true
 
-freebsd_artifacts: &FREEBSD_ARTIFACTS
+freebsd_configure_artifacts: &FREEBSD_CONFIGURE_ARTIFACTS
   always:
     rename_script:
       - cp xen/.config xen-config
@@ -32,25 +32,30 @@ freebsd_full_build_template: &FREEBSD_FULL_BUILD_TEMPLATE
                                  yajl lzo2 pixman argp-standalone
                                  libxml2 glib git python3
 
-  build_script:
+  configure_script:
     - cc --version
     - ./configure --with-system-seabios=/usr/local/share/seabios/bios.bin
-    - gmake -j`sysctl -n hw.ncpu` clang=y
+    - gmake -j`sysctl -n hw.ncpu` -C xen clang=y defconfig
+
+  << : *FREEBSD_CONFIGURE_ARTIFACTS
 
-  << : *FREEBSD_ARTIFACTS
+  build_script:
+    - gmake -j`sysctl -n hw.ncpu` clang=y
 
 freebsd_randconfig_template: &FREEBSD_RANDCONFIG_TEMPLATE
   << : *FREEBSD_ENV
 
   install_script: pkg install -y gmake python3 bison
 
-  build_script:
+  configure_script:
     - cc --version
     - gmake -j`sysctl -n hw.ncpu` -C xen clang=y \
             KCONFIG_ALLCONFIG=tools/kconfig/allrandom.config randconfig
-    - gmake -j`sysctl -n hw.ncpu` build-xen clang=y
 
-  << : *FREEBSD_ARTIFACTS
+  << : *FREEBSD_CONFIGURE_ARTIFACTS
+
+  build_script:
+    - gmake -j`sysctl -n hw.ncpu` build-xen clang=y
 
 task:
   name: 'FreeBSD 13: full build'
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 10:44:54 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 10:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938111.1338928 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eXe-0008Ao-6C; Fri, 04 Apr 2025 10:44:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938111.1338928; Fri, 04 Apr 2025 10: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 1u0eXe-0008Ae-2J; Fri, 04 Apr 2025 10:44:54 +0000
Received: by outflank-mailman (input) for mailman id 938111;
 Fri, 04 Apr 2025 10: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 1u0eXc-0008AR-Mm
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 10: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 1u0eXc-00Bc5j-2B
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0eXc-00BSdZ-25
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10: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=qliTloPFpn0K7TR3KP/8MXqsSxPdbvJoGHPMOuqpTMw=; b=fanxTf8YMNPjLrhjqKZo/0pcQa
	2WA5QUVRZSxGdcsMUEG4CndOObXA0wZUYaHxFlOy8D4TWaYcikASu2y0qzJy7+pZpw8JtrYNhH+Ud
	qzBVh7vy8nx+xVnLNAjtbPzjwD2bwyIoMNC63Lj+izGGXjjDRWR6qpFVDCVVZVmWyWTM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] automation/console.exp: do not assume expect is always at /usr/bin/
Message-Id: <E1u0eXc-00BSdZ-25@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 10:44:52 +0000

commit 81189d7116bdc0e4cbe53c8cccd54e563c30d651
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Mar 17 10:31:07 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:32:29 2025 +0100

    automation/console.exp: do not assume expect is always at /usr/bin/
    
    Instead use env to find the location of expect.
    
    Additionally do not use the -f flag, as it's only meaningful when passing
    arguments on the command line, which we never do for console.exp.  From the
    expect 5.45.4 man page:
    
    > The -f flag prefaces a file from which to read commands from.  The flag
    > itself is optional as it is only useful when using the #! notation (see
    > above), so  that other arguments may be supplied on the command line.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit c6867d134eeb3aefcecf022f4ab20c325701ef30)
---
 automation/scripts/console.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/automation/scripts/console.exp b/automation/scripts/console.exp
index 310543c33e..31ce97b91b 100755
--- a/automation/scripts/console.exp
+++ b/automation/scripts/console.exp
@@ -1,4 +1,4 @@
-#!/usr/bin/expect -f
+#!/usr/bin/env expect
 
 if {[info exists env(TEST_TIMEOUT_OVERRIDE)]} {
     set timeout $env(TEST_TIMEOUT_OVERRIDE)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 10:45:04 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 10:45:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938112.1338932 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eXo-0008Dx-8D; Fri, 04 Apr 2025 10:45:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938112.1338932; Fri, 04 Apr 2025 10: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 1u0eXo-0008Dp-5X; Fri, 04 Apr 2025 10:45:04 +0000
Received: by outflank-mailman (input) for mailman id 938112;
 Fri, 04 Apr 2025 10: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 1u0eXm-0008DP-Pg
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 10: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 1u0eXm-00Bc6Z-2T
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:45:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0eXm-00BSf0-2M
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10: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=2hNRAZgkWOl14lqSrvrqUq/Z0DPVa8P95NNRgz+Fgjo=; b=qT8uoRZsZJ7WhRPACAg23mD1fo
	c6oEnSJuedUht+7eZluaewFCX1Ze48v1+VnFsHIZNbQVqFu03fbdWJaPDViR6Zf9JhLLnqitNc0Qs
	/LcMxFuDDtLhpcTOzaKB8Sy1R+2nNPwktGAvkWYOzZgVTgElIa2Rq47wl1T43xzjP/jM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] automation/cirrus-ci: use matrix keyword to generate per-version build tasks
Message-Id: <E1u0eXm-00BSf0-2M@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 10:45:02 +0000

commit cfa5bc6f0a1d0e2c63cd00b63cf71ebfcb3f4cd9
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Sat Mar 15 09:35:12 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:32:29 2025 +0100

    automation/cirrus-ci: use matrix keyword to generate per-version build tasks
    
    Move the current logic to use the matrix keyword to generate a task for
    each version of FreeBSD we want to build Xen on.  The matrix keyword
    however cannot be used in YAML aliases, so it needs to be explicitly used
    inside of each task, which creates a bit of duplication.  At least abstract
    the FreeBSD minor version numbers to avoid repetition of image names.
    
    Note that the full build uses matrix over an env variable instead of using
    it directly in image_family.  This is so that the alias can also be set
    based on the FreeBSD version, in preparation for adding further tasks that
    will depend on the full build having finished.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit b548a7dc4bb4202410983dd3ef7b5f1b469bdac3)
---
 .cirrus.yml | 78 +++++++++++++++++++++++++++++--------------------------------
 1 file changed, 37 insertions(+), 41 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 490f214f04..95d2d2d3db 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -1,13 +1,9 @@
 # https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
-freebsd_13: &FREEBSD_13
-  freebsd_instance:
-    image_family: freebsd-13-5
-freebsd_14: &FREEBSD_14
-  freebsd_instance:
-    image_family: freebsd-14-2
-freebsd_15: &FREEBSD_15
-  freebsd_instance:
-    image_family: freebsd-15-0-snap
+freebsd_versions: &FREEBSD_VERSIONS
+  env:
+    FREEBSD_LEGACY:     freebsd-13-5
+    FREEBSD_PRODUCTION: freebsd-14-2
+    FREEBSD_CURRENT:    freebsd-15-0-snap
 
 freebsd_template: &FREEBSD_ENV
   environment:
@@ -24,7 +20,24 @@ freebsd_configure_artifacts: &FREEBSD_CONFIGURE_ARTIFACTS
       path: xen-config
       type: text/plain
 
-freebsd_full_build_template: &FREEBSD_FULL_BUILD_TEMPLATE
+task:
+  name: 'FreeBSD: full build'
+
+  # It's not possible to use the matrix keyword in YAML aliases, as they
+  # keyword usage is restricted to task, docker_builder or pipe.  Attempting to
+  # use a YAML alias with the duplicated keys doesn't work either. Use an env
+  # variable so the version can also be appended to the task alias.
+  << : *FREEBSD_VERSIONS
+  env:
+    matrix:
+      FREEBSD_VERSION: $FREEBSD_LEGACY
+      FREEBSD_VERSION: $FREEBSD_PRODUCTION
+      FREEBSD_VERSION: $FREEBSD_CURRENT
+
+  alias: freebsd_full_$FREEBSD_VERSION
+  freebsd_instance:
+    image_family: $FREEBSD_VERSION
+
   << : *FREEBSD_ENV
 
   install_script: pkg install -y seabios gmake ninja bash
@@ -42,7 +55,20 @@ freebsd_full_build_template: &FREEBSD_FULL_BUILD_TEMPLATE
   build_script:
     - gmake -j`sysctl -n hw.ncpu` clang=y
 
-freebsd_randconfig_template: &FREEBSD_RANDCONFIG_TEMPLATE
+task:
+  name: 'FreeBSD: randconfig build'
+
+  # It's not possible to use the matrix keyword in YAML aliases, as they
+  # keyword usage is restricted to task, docker_builder or pipe.  Attempting to
+  # use a YAML alias with the duplicated `image_family` keys doesn't work
+  # either. Abstract the version numbers at least.
+  << : *FREEBSD_VERSIONS
+  freebsd_instance:
+    matrix:
+      image_family: $FREEBSD_LEGACY
+      image_family: $FREEBSD_PRODUCTION
+      image_family: $FREEBSD_CURRENT
+
   << : *FREEBSD_ENV
 
   install_script: pkg install -y gmake python3 bison
@@ -56,33 +82,3 @@ freebsd_randconfig_template: &FREEBSD_RANDCONFIG_TEMPLATE
 
   build_script:
     - gmake -j`sysctl -n hw.ncpu` build-xen clang=y
-
-task:
-  name: 'FreeBSD 13: full build'
-  << : *FREEBSD_13
-  << : *FREEBSD_FULL_BUILD_TEMPLATE
-
-task:
-  name: 'FreeBSD 14: full build'
-  << : *FREEBSD_14
-  << : *FREEBSD_FULL_BUILD_TEMPLATE
-
-task:
-  name: 'FreeBSD 15: full build'
-  << : *FREEBSD_15
-  << : *FREEBSD_FULL_BUILD_TEMPLATE
-
-task:
-  name: 'FreeBSD 13: randconfig'
-  << : *FREEBSD_13
-  << : *FREEBSD_RANDCONFIG_TEMPLATE
-
-task:
-  name: 'FreeBSD 14: randconfig'
-  << : *FREEBSD_14
-  << : *FREEBSD_RANDCONFIG_TEMPLATE
-
-task:
-  name: 'FreeBSD 15: randconfig'
-  << : *FREEBSD_15
-  << : *FREEBSD_RANDCONFIG_TEMPLATE
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 10:45:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 10:45:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938113.1338937 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eXy-0008GV-Af; Fri, 04 Apr 2025 10:45:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938113.1338937; Fri, 04 Apr 2025 10: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 1u0eXy-0008GN-70; Fri, 04 Apr 2025 10:45:14 +0000
Received: by outflank-mailman (input) for mailman id 938113;
 Fri, 04 Apr 2025 10: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 1u0eXw-0008G2-Sg
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 10: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 1u0eXw-00Bc6h-2m
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:45:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0eXw-00BSgQ-2e
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10: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=naAP3QzdZSZ6nLrE4iJc7Y5EnfjSlN+UFG1lekOZMYQ=; b=soj3m9StNssciaj1T5nGoNEzup
	KGQMzqaMy4zg6sFK5LeJHN22JUfU1MHM6Z5pbXWa/yZAVWCZWHRfur2onXFFQ9oPyeBvCYqvNNOup
	xwdmBmAoluJih6H9H9Azpy4w0JRPZdCF0elwyVqi5vZyxm7U/uv90mvyFzLUIOXg78Kg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] automation/cirrus-ci: build XTF
Message-Id: <E1u0eXw-00BSgQ-2e@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 10:45:12 +0000

commit e6816c375825cae788efd71c0467c847ad3bf425
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Mar 14 12:16:19 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:32:29 2025 +0100

    automation/cirrus-ci: build XTF
    
    In preparation for using the XTF selftests to smoke test the FreeBSD based
    Xen builds.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit a92c0a9888f14baf8e66a16e960bc524cc8194e6)
---
 .cirrus.yml | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/.cirrus.yml b/.cirrus.yml
index 95d2d2d3db..a6e4a5d030 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -12,6 +12,12 @@ freebsd_template: &FREEBSD_ENV
     CIRRUS_CLONE_DEPTH: 1
     CIRRUS_LOG_TIMESTAMP: true
 
+freebsd_template_latest: &FREEBSD_ENV_PRODUCTION
+  << : *FREEBSD_VERSIONS
+  freebsd_instance:
+    image_family: $FREEBSD_PRODUCTION
+  << : *FREEBSD_ENV
+
 freebsd_configure_artifacts: &FREEBSD_CONFIGURE_ARTIFACTS
   always:
     rename_script:
@@ -82,3 +88,21 @@ task:
 
   build_script:
     - gmake -j`sysctl -n hw.ncpu` build-xen clang=y
+
+task:
+  name: 'FreeBSD: XTF build'
+  alias: xtf
+
+  << : *FREEBSD_ENV_PRODUCTION
+
+  clone_script:
+    - pkg install -y git
+    - git clone --depth 1 https://xenbits.xen.org/git-http/xtf.git
+
+  install_script: pkg install -y gmake
+
+  build_script:
+    - cd xtf
+    - cc --version
+    - git rev-parse HEAD
+    - gmake -j`sysctl -n hw.ncpu` LLVM=y
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 10:45:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 10:45:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938114.1338939 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eY8-0008Im-Aq; Fri, 04 Apr 2025 10:45:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938114.1338939; Fri, 04 Apr 2025 10: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 1u0eY8-0008If-8Q; Fri, 04 Apr 2025 10:45:24 +0000
Received: by outflank-mailman (input) for mailman id 938114;
 Fri, 04 Apr 2025 10: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 1u0eY6-0008IV-VG
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 10: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 1u0eY6-00Bc6p-32
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:45:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0eY6-00BSho-2w
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10: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=4Cgwa2kTbmlXM+j+gL+qfdUpzlclxpu+TNpE+RdgYf8=; b=gPO1mrXaip9NkjlxjSl4qR8SIg
	vaxtrz7L9jercQ3wz0X/VtkzNixRo4t4phYzWYzOVOHCzIhtnH5ZQSWvpr0vygmJcm3sXHhwsZbjQ
	Z/WP67tRRm0wEfzyxdllPxoyDenuF6fyjGUBAEho9od0Lo67JepaKQL2aX/n/HFp8MZU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] automation/cirrus-ci: store XTF and Xen build artifacts
Message-Id: <E1u0eY6-00BSho-2w@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 10:45:22 +0000

commit fdbb32a9a90491c768d6fb26c24c9877d533bf19
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Mar 14 13:01:36 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:32:29 2025 +0100

    automation/cirrus-ci: store XTF and Xen build artifacts
    
    In preparation for adding some smoke tests that will consume those outputs.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit c9de0e2ce41700132ffb9f25930fcca9da5e78af)
---
 .cirrus.yml | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/.cirrus.yml b/.cirrus.yml
index a6e4a5d030..38b654f75c 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -61,6 +61,14 @@ task:
   build_script:
     - gmake -j`sysctl -n hw.ncpu` clang=y
 
+  xen_artifacts:
+    path: xen/xen
+    type: application/octet-stream
+
+  debug_artifacts:
+    path: xen/xen-syms
+    type: application/octet-stream
+
 task:
   name: 'FreeBSD: randconfig build'
 
@@ -106,3 +114,7 @@ task:
     - cc --version
     - git rev-parse HEAD
     - gmake -j`sysctl -n hw.ncpu` LLVM=y
+
+  xtf_artifacts:
+    path: xtf/tests/selftest/test-*-selftest
+    type: application/octet-stream
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 10:45:34 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 10:45:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938115.1338944 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eYI-0008LJ-Db; Fri, 04 Apr 2025 10:45:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938115.1338944; Fri, 04 Apr 2025 10: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 1u0eYI-0008LB-9q; Fri, 04 Apr 2025 10:45:34 +0000
Received: by outflank-mailman (input) for mailman id 938115;
 Fri, 04 Apr 2025 10: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 1u0eYH-0008Kw-1a
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 10: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 1u0eYH-00Bc70-04
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:45:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0eYG-00BSj9-3C
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10: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=I3s6V/UgaIWPjjTnSDo0It6MQR1LPcq6ryuSwi3HSAI=; b=qpclCGpX7VHVGtGy+7TlmTwB/q
	dekpcEoQ3WpAzvaXHKuDVvbmDAoejkui8Ag1piu15Zcw9NSqhsEW6IU59qmM6xwIOu76qJLsKF4rs
	NZEAJQQ5SiJPF2W1ogIuXWPVXvy42H+jEl1a3qwU4Pmab/E7n9Oa3IZJcMwFANUFFOcA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] automation/cirrus-ci: add smoke tests for the FreeBSD builds
Message-Id: <E1u0eYG-00BSj9-3C@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 10:45:32 +0000

commit dd81219b841ba1552d217aecb013103afcad5e4f
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Mar 14 13:37:46 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:32:29 2025 +0100

    automation/cirrus-ci: add smoke tests for the FreeBSD builds
    
    Introduce a basic set of smoke tests using the XTF selftest image, and run
    them on QEMU.  Use the matrix keyword to create a different task for each
    XTF flavor on each FreeBSD build.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Oleksii Kurochko<oleksii.kurochko@gmail.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 7973cba4dbf72f6b963c780e9d1e0b99fd9622b9)
---
 .cirrus.yml | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/.cirrus.yml b/.cirrus.yml
index 38b654f75c..3163ab8f11 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -5,6 +5,8 @@ freebsd_versions: &FREEBSD_VERSIONS
     FREEBSD_PRODUCTION: freebsd-14-2
     FREEBSD_CURRENT:    freebsd-15-0-snap
 
+# Build jobs
+
 freebsd_template: &FREEBSD_ENV
   environment:
     APPEND_LIB: /usr/local/lib
@@ -118,3 +120,55 @@ task:
   xtf_artifacts:
     path: xtf/tests/selftest/test-*-selftest
     type: application/octet-stream
+
+# Test jobs
+
+task:
+  name: 'FreeBSD: XTF selftest'
+
+  << : *FREEBSD_ENV_PRODUCTION
+
+  env:
+    matrix:
+      FREEBSD_BUILD: $FREEBSD_LEGACY
+      FREEBSD_BUILD: $FREEBSD_PRODUCTION
+      FREEBSD_BUILD: $FREEBSD_CURRENT
+
+  depends_on:
+    - freebsd_full_$FREEBSD_BUILD
+    - xtf
+
+  install_script: pkg install -y qemu-nox11 expect
+
+  env:
+    matrix:
+      XTF_ARCH: hvm32
+      XTF_ARCH: hvm32pae
+      XTF_ARCH: hvm32pse
+      XTF_ARCH: hvm64
+      XTF_ARCH: pv64
+
+  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
+    - unzip xtf.zip
+    - unzip xen.zip
+
+  test_script: |
+    case "$XTF_ARCH" in \
+      *hvm*) \
+        XEN_EXTRA_CMD="dom0=pvh dom0-iommu=none" \
+        ;; \
+    esac
+    export TEST_CMD="qemu-system-x86_64 -kernel xen/xen -initrd xtf/tests/selftest/test-${XTF_ARCH}-selftest \
+                                        -append \"loglvl=all console=com1 noreboot console_timestamps=boot dom0=verbose ${XEN_EXTRA_CMD}\" \
+                                        -m 512 -nographic -monitor none -serial stdio"
+    export TEST_LOG="serial-${FREEBSD_BUILD}-${XTF_ARCH}.txt"
+    export PASSED="Test result: SUCCESS"
+    export TEST_TIMEOUT=120
+    ./automation/scripts/console.exp | sed 's/\r\+$//'
+
+  always:
+    serial_artifacts:
+      path: serial-*.txt
+      type: text/plain
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 10:45:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 10:45:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938116.1338947 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eYS-0008Nf-Dx; Fri, 04 Apr 2025 10:45:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938116.1338947; Fri, 04 Apr 2025 10: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 1u0eYS-0008NX-BN; Fri, 04 Apr 2025 10:45:44 +0000
Received: by outflank-mailman (input) for mailman id 938116;
 Fri, 04 Apr 2025 10: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 1u0eYR-0008NO-4i
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 10: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 1u0eYR-00Bc7D-0N
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:45:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0eYR-00BSkb-0G
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10: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=JzpPo/lR3O339we/dIvEHHeoB/gILyDRRTJIBPxtyc0=; b=yp4CXwIo64vbLTyMOTpsyK1b5i
	L8jY5zLtKrhywTg0PMKtMq6yap25v94w+LrexcpRj9vPYNx+DGS9gwhJC+QuyXGwUi4cfTG2wXhaF
	AfFlRya8mw7Sx3UqMF5cUaLWXeHZkgDdJ2SMSjkWTny8d5yj2GKpAfwtWeh1UJk1N7ls=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] CI: Add yet another HW runner
Message-Id: <E1u0eYR-00BSkb-0G@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 10:45:43 +0000

commit e071b233944deeea5ad695248cdf86cd188557a2
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Fri Mar 14 04:06:26 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:32:29 2025 +0100

    CI: Add yet another HW runner
    
    This is AMD Zen2 (Ryzen 5 4500U specifically), in a HP Probook 445 G7.
    
    This one has working S3, so add a test for it here.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit debe8bf537ec2c69a4734393cd2b0c7f57f74c0c)
---
 automation/gitlab-ci/test.yaml | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 1822e3ea5f..3e583a2d29 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -140,6 +140,17 @@
   tags:
     - qubes-hw2
 
+.zen2-x86-64:
+  # it's really similar to the above
+  extends: .adl-x86-64
+  variables:
+    PCIDEV: "01:00.0"
+    PCIDEV_INTR: "MSI-X"
+    CONSOLE_OPTS: "console=com1 com1=115200,8n1,pci,msi,04:00.0"
+    SUT_ADDR: test-1.testnet
+  tags:
+    - qubes-hw1
+
 .zen3p-x86-64:
   # it's really similar to the above
   extends: .adl-x86-64
@@ -263,6 +274,22 @@ adl-pvshim-x86-64-gcc-debug:
     - *x86-64-test-needs
     - alpine-3.18-gcc-debug
 
+zen2-smoke-x86-64-gcc-debug:
+  extends: .zen2-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
+zen2-suspend-x86-64-gcc-debug:
+  extends: .zen2-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh s3 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
 zen3p-smoke-x86-64-gcc-debug:
   extends: .zen3p-x86-64
   script:
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 10:45:55 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 10:45:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938117.1338952 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eYd-0008QC-FK; Fri, 04 Apr 2025 10:45:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938117.1338952; Fri, 04 Apr 2025 10:45:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eYd-0008Q4-Cn; Fri, 04 Apr 2025 10:45:55 +0000
Received: by outflank-mailman (input) for mailman id 938117;
 Fri, 04 Apr 2025 10: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 1u0eYb-0008Pn-P0
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 10: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 1u0eYb-00Bc7N-2P
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:45:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0eYb-00BSnT-22
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10: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=nkOVdIvvUgAcQBsvbBRpBWTCQMj/oLm7tjE1QQd5wKs=; b=QK65HIl7L90Q2VU61ivEZMjm6j
	3AidGrO4p9Xc0lcbj8fEQz+fttfL9fnE0koixNYPtm090+ULOaV1KITFWoASucNS5NE6GQWQvnfc0
	ekqP2lizZBXjge8PiSzKrv/8hapOnnE4cXnZHc786ZgixJNjS7w5Z/fMQx6bNhuI48AQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] CI: Update to FreeBSD 14.2
Message-Id: <E1u0eYb-00BSnT-22@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 10:45:53 +0000

commit 55b792fee261eb78184ef6d32d80bf1196e3fa80
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Dec 3 08:14:46 2024 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:33:55 2025 +0100

    CI: Update to FreeBSD 14.2
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 0cc8845fb9fd4300313da49374b6c12346889f9a)
---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 1c2a6cb812..7b0ca4800e 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -23,7 +23,7 @@ task:
 task:
   name: 'FreeBSD 14'
   freebsd_instance:
-    image_family: freebsd-14-1
+    image_family: freebsd-14-2
   << : *FREEBSD_TEMPLATE
 
 task:
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 10:46:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 10:46:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938118.1338956 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eYn-0008T0-Gz; Fri, 04 Apr 2025 10:46:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938118.1338956; Fri, 04 Apr 2025 10:46:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eYn-0008Ss-EE; Fri, 04 Apr 2025 10:46:05 +0000
Received: by outflank-mailman (input) for mailman id 938118;
 Fri, 04 Apr 2025 10: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 1u0eYl-0008Sh-SR
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 10: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 1u0eYl-00Bc84-2l
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:46:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0eYl-00BSpB-2a
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10: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=AHirCReAXaWwb/6pPdDiXPWpG37FlyN0e62U6b5M2Qo=; b=6W+ur5aS6thFElx9g5WvKs4Yi6
	7EaTrT81OfT8XaTlnKuOIzND2rJ1XXXYAq9qKL89TS90I+wrqGt9Nng13eqOm48EEtdTK9TIe0pA+
	4E6SMvPnWW8YoBf83Au/ETK03ENFXUFIWaOcmBWXrXH64ViHyPPF9iblFR9aoKfhLyuo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] automation/cirrus-ci: update FreeBSD to 13.4
Message-Id: <E1u0eYl-00BSpB-2a@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 10:46:03 +0000

commit 376e63e98994f162915c8ab0104100f869d75bf3
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Jan 16 09:07:31 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:33:55 2025 +0100

    automation/cirrus-ci: update FreeBSD to 13.4
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 850a263b7863ae9c22296a357a50573d5e6ae9d7)
---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 7b0ca4800e..3d7a3e3d80 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -17,7 +17,7 @@ freebsd_template: &FREEBSD_TEMPLATE
 task:
   name: 'FreeBSD 13'
   freebsd_instance:
-    image_family: freebsd-13-3
+    image_family: freebsd-13-4
   << : *FREEBSD_TEMPLATE
 
 task:
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 10:46:15 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 10:46:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938119.1338960 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eYx-0008Vc-IT; Fri, 04 Apr 2025 10:46:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938119.1338960; Fri, 04 Apr 2025 10:46:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eYx-0008VU-Fb; Fri, 04 Apr 2025 10:46:15 +0000
Received: by outflank-mailman (input) for mailman id 938119;
 Fri, 04 Apr 2025 10:46: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 1u0eYv-0008VF-V2
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 10:46:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0eYv-00Bc8J-30
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:46:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0eYv-00BSqn-2v
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:46:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UKzKJm39nMDuLWTDLU2VAF01N3GMD2rwisnH080eUvA=; b=CjbSvk0H33iM6tqH6nyHoFpu1b
	OxVgoy2FVAUY3/a4ssMz40bX0ckQSL3mSgmmbqGOCrD4+VBy26OdGsC6r7/Eo8SmhQT69lDh4iqCs
	tRtDtulEw+0ZUXUphi+2rhZBZRz+qlWgZQ90/V4anin3orxo4t6Zg52B1i/nfZu+m7pY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] automation/cirrus-ci: introduce FreeBSD randconfig builds
Message-Id: <E1u0eYv-00BSqn-2v@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 10:46:13 +0000

commit e4e6e823874f65c0bb436a2d72fe68a957447537
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Jan 16 09:06:26 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:33:55 2025 +0100

    automation/cirrus-ci: introduce FreeBSD randconfig builds
    
    Add a new randconfig job for each FreeBSD version.  This requires some
    rework of the template so common parts can be shared between the full and
    the randconfig builds.  Such randconfig builds are relevant because FreeBSD
    is the only tested system that has a full non-GNU toolchain.
    
    While there replace the usage of the python311 package with python3, which is
    already using 3.11, and remove the install of the plain python package for full
    builds.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit c3f5d1bb40b57d467cb4051eafa86f5933ec9003)
---
 .cirrus.yml | 66 +++++++++++++++++++++++++++++++++++++++++++++++--------------
 1 file changed, 51 insertions(+), 15 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 3d7a3e3d80..7216729b69 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -1,33 +1,69 @@
 # https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
-freebsd_template: &FREEBSD_TEMPLATE
+freebsd_13: &FREEBSD_13
+  freebsd_instance:
+    image_family: freebsd-13-4
+freebsd_14: &FREEBSD_14
+  freebsd_instance:
+    image_family: freebsd-14-2
+freebsd_15: &FREEBSD_15
+  freebsd_instance:
+    image_family: freebsd-15-0-snap
+
+freebsd_template: &FREEBSD_ENV
   environment:
     APPEND_LIB: /usr/local/lib
     APPEND_INCLUDES: /usr/local/include
 
+freebsd_full_build_template: &FREEBSD_FULL_BUILD_TEMPLATE
+  << : *FREEBSD_ENV
+
   install_script: pkg install -y seabios gmake ninja bash
-                                 pkgconf python bison perl5
+                                 pkgconf bison perl5
                                  yajl lzo2 pixman argp-standalone
-                                 libxml2 glib git
+                                 libxml2 glib git python3
 
   build_script:
     - cc --version
     - ./configure --with-system-seabios=/usr/local/share/seabios/bios.bin
     - gmake -j`sysctl -n hw.ncpu` clang=y
 
+freebsd_randconfig_template: &FREEBSD_RANDCONFIG_TEMPLATE
+  << : *FREEBSD_ENV
+
+  install_script: pkg install -y gmake python3 bison
+
+  build_script:
+    - cc --version
+    - gmake -j`sysctl -n hw.ncpu` -C xen clang=y \
+            KCONFIG_ALLCONFIG=tools/kconfig/allrandom.config randconfig
+    - gmake -j`sysctl -n hw.ncpu` build-xen clang=y
+
 task:
-  name: 'FreeBSD 13'
-  freebsd_instance:
-    image_family: freebsd-13-4
-  << : *FREEBSD_TEMPLATE
+  name: 'FreeBSD 13: full build'
+  << : *FREEBSD_13
+  << : *FREEBSD_FULL_BUILD_TEMPLATE
 
 task:
-  name: 'FreeBSD 14'
-  freebsd_instance:
-    image_family: freebsd-14-2
-  << : *FREEBSD_TEMPLATE
+  name: 'FreeBSD 14: full build'
+  << : *FREEBSD_14
+  << : *FREEBSD_FULL_BUILD_TEMPLATE
 
 task:
-  name: 'FreeBSD 15'
-  freebsd_instance:
-    image_family: freebsd-15-0-snap
-  << : *FREEBSD_TEMPLATE
+  name: 'FreeBSD 15: full build'
+  << : *FREEBSD_15
+  << : *FREEBSD_FULL_BUILD_TEMPLATE
+
+task:
+  name: 'FreeBSD 13: randconfig'
+  << : *FREEBSD_13
+  << : *FREEBSD_RANDCONFIG_TEMPLATE
+
+task:
+  name: 'FreeBSD 14: randconfig'
+  << : *FREEBSD_14
+  << : *FREEBSD_RANDCONFIG_TEMPLATE
+
+task:
+  name: 'FreeBSD 15: randconfig'
+  << : *FREEBSD_15
+  << : *FREEBSD_RANDCONFIG_TEMPLATE
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 10:46:25 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 10:46:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938120.1338964 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eZ7-000078-M4; Fri, 04 Apr 2025 10:46:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938120.1338964; Fri, 04 Apr 2025 10:46:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eZ7-00006z-IO; Fri, 04 Apr 2025 10:46:25 +0000
Received: by outflank-mailman (input) for mailman id 938120;
 Fri, 04 Apr 2025 10:46: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 1u0eZ6-00006g-1Z
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 10:46: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 1u0eZ6-00Bc8U-04
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:46:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0eZ5-00BSsW-3B
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:46:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4O0Tgl5DGyy6r9D7G8UhMGcBLv+sXyCBZe6JTDqssXQ=; b=cq11ztqdOUCsDJe4nrvfd8awH7
	llw9nDIshXlJ5MTFobSC5oG9sxwrDGpEH/qGijd3mQGi/RhIfN4USuAdYt9fTuR+cZakhvYs2yABS
	o/4r5u77r9lYRCe/rQH4Q0jYKWeIlbn3mOfeTUyl33ADuIIExBi1hLkZxDLXCFJ1LFYo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] CirrusCI: Use shallow clone
Message-Id: <E1u0eZ5-00BSsW-3B@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 10:46:23 +0000

commit 65bdce95f69d06221fca6e2f88f4efb32393fdfc
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Feb 24 15:36:11 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:33:55 2025 +0100

    CirrusCI: Use shallow clone
    
    This reduces the Clone step from ~50s to ~3s.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 96970b46e5e84fa2666f76f5b0972b826a3ffba4)
---
 .cirrus.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.cirrus.yml b/.cirrus.yml
index 7216729b69..e2949d99d7 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -13,6 +13,7 @@ freebsd_template: &FREEBSD_ENV
   environment:
     APPEND_LIB: /usr/local/lib
     APPEND_INCLUDES: /usr/local/include
+    CIRRUS_CLONE_DEPTH: 1
 
 freebsd_full_build_template: &FREEBSD_FULL_BUILD_TEMPLATE
   << : *FREEBSD_ENV
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 10:46:35 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 10:46:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938121.1338967 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eZH-00009j-MY; Fri, 04 Apr 2025 10:46:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938121.1338967; Fri, 04 Apr 2025 10:46:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eZH-00009a-Js; Fri, 04 Apr 2025 10:46:35 +0000
Received: by outflank-mailman (input) for mailman id 938121;
 Fri, 04 Apr 2025 10:46: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 1u0eZG-00009J-4w
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 10:46: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 1u0eZG-00Bc8h-0L
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:46:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0eZG-00BSu0-0G
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:46: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=Yu/LB9zKThz5C920zYvOp7kFiWA/LTsE8fg7LwciXHg=; b=q3vUhAvuwSQC3YlhO5TyA+1aB6
	qI8+9sRl4gd9og71KQ4mBsXkquHCfGE+RCK4tPe3Jx4s9Sw0WHbmM2+0T8Hqd+R6dciRQkYkgQMxd
	nWftWcx2idXoPcwV5AiWM7ED/HE4UXpGnQ0hYC5P94WGbXMu2w/4xpJPLNOEVzbUmGP8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] automation/cirrus-ci: store xen/.config as an artifact
Message-Id: <E1u0eZG-00BSu0-0G@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 10:46:34 +0000

commit 37385333652969838f11ac7836919fafa59c8eb4
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Mar 10 18:41:57 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:33:55 2025 +0100

    automation/cirrus-ci: store xen/.config as an artifact
    
    Always store xen/.config as an artifact, renamed to xen-config to match
    the naming used in the Gitlab CI tests.
    
    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>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 318659c818546b6415c2311339a53384dc20c427)
---
 .cirrus.yml | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/.cirrus.yml b/.cirrus.yml
index e2949d99d7..1a39f5026f 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -15,6 +15,14 @@ freebsd_template: &FREEBSD_ENV
     APPEND_INCLUDES: /usr/local/include
     CIRRUS_CLONE_DEPTH: 1
 
+freebsd_artifacts: &FREEBSD_ARTIFACTS
+  always:
+    rename_script:
+      - cp xen/.config xen-config
+    config_artifacts:
+      path: xen-config
+      type: text/plain
+
 freebsd_full_build_template: &FREEBSD_FULL_BUILD_TEMPLATE
   << : *FREEBSD_ENV
 
@@ -28,6 +36,8 @@ freebsd_full_build_template: &FREEBSD_FULL_BUILD_TEMPLATE
     - ./configure --with-system-seabios=/usr/local/share/seabios/bios.bin
     - gmake -j`sysctl -n hw.ncpu` clang=y
 
+  << : *FREEBSD_ARTIFACTS
+
 freebsd_randconfig_template: &FREEBSD_RANDCONFIG_TEMPLATE
   << : *FREEBSD_ENV
 
@@ -39,6 +49,8 @@ freebsd_randconfig_template: &FREEBSD_RANDCONFIG_TEMPLATE
             KCONFIG_ALLCONFIG=tools/kconfig/allrandom.config randconfig
     - gmake -j`sysctl -n hw.ncpu` build-xen clang=y
 
+  << : *FREEBSD_ARTIFACTS
+
 task:
   name: 'FreeBSD 13: full build'
   << : *FREEBSD_13
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 10:46:45 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 10:46:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938122.1338971 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eZR-0000CO-Ni; Fri, 04 Apr 2025 10:46:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938122.1338971; Fri, 04 Apr 2025 10:46:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eZR-0000CH-LG; Fri, 04 Apr 2025 10:46:45 +0000
Received: by outflank-mailman (input) for mailman id 938122;
 Fri, 04 Apr 2025 10:46: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 1u0eZQ-0000Bz-7Q
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 10:46: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 1u0eZQ-00Bc8u-0e
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:46:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0eZQ-00BSv0-0W
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:46: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=kvLut5V3cqEJ0er9NY9fqL0ry8iN+LNfvtrJQ3IUjbU=; b=JysmyAQK9BW2gbFQ1ABtSaM/Vu
	asGFjNdk4mCo0QiTe8bJO3LOWesJy47leCXkagHNgcbSRN9Tsb9XzK70qAQXB+Pc5q3fEmp0sIaGM
	iz589pvyp5aT7dpKy+0kzIVidNnzy5K4+tYe9SIp72BwTFLyMRJaXsHWWkxuMSdg6KD0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] automation/cirrus-ci: add timestamps
Message-Id: <E1u0eZQ-00BSv0-0W@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 10:46:44 +0000

commit 57c100140c13190b25c8b311c50a7609b4f4da1b
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Mar 14 11:44:45 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:33:55 2025 +0100

    automation/cirrus-ci: add timestamps
    
    Such timestamps can still be disabled from the Web UI using a tick box.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 1256159f3cfcfef475b94dda39f68a85702bba64)
---
 .cirrus.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.cirrus.yml b/.cirrus.yml
index 1a39f5026f..aa195ba370 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -14,6 +14,7 @@ freebsd_template: &FREEBSD_ENV
     APPEND_LIB: /usr/local/lib
     APPEND_INCLUDES: /usr/local/include
     CIRRUS_CLONE_DEPTH: 1
+    CIRRUS_LOG_TIMESTAMP: true
 
 freebsd_artifacts: &FREEBSD_ARTIFACTS
   always:
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 10:46:55 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 10:46:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938123.1338976 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eZb-0000Et-PQ; Fri, 04 Apr 2025 10:46:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938123.1338976; Fri, 04 Apr 2025 10:46: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 1u0eZb-0000El-Mn; Fri, 04 Apr 2025 10:46:55 +0000
Received: by outflank-mailman (input) for mailman id 938123;
 Fri, 04 Apr 2025 10:46: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 1u0eZa-0000EZ-9l
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 10:46: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 1u0eZa-00Bc92-0t
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:46:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0eZa-00BSwl-0o
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:46: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=xZbBOQJVdIcG1IpKcrJKcFd3mWbDg57Xl/TKOse8ZdU=; b=xtJA2BOgoJnUe+QjAlbwM17Nw7
	RP8jbjUueQ80U3R7s1gN9F60+vuNOQk3nP94zkwOc3Grf2UgLVfgFALVC44pIWprWMmj+3JukSHcS
	jzYIKhKcm4tb8C3xRpNoeYzYtBnpZI3V/n7qqYM+UM8xhfYgNSPuahQMhGiEMdNfYm/c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] automation/cirrus-ci: update FreeBSD to 13.5
Message-Id: <E1u0eZa-00BSwl-0o@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 10:46:54 +0000

commit 606a0cb0d1f4a61d0764ad9995f819aa11b1c97c
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Mar 14 11:49:28 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:33:55 2025 +0100

    automation/cirrus-ci: update FreeBSD to 13.5
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 5395cd7b892daf11cd80e4eec0cfa45c4b319d35)
---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index aa195ba370..ce7588b7b6 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -1,7 +1,7 @@
 # https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
 freebsd_13: &FREEBSD_13
   freebsd_instance:
-    image_family: freebsd-13-4
+    image_family: freebsd-13-5
 freebsd_14: &FREEBSD_14
   freebsd_instance:
     image_family: freebsd-14-2
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 10:47:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 10:47:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938124.1338981 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eZl-0000Hq-R5; Fri, 04 Apr 2025 10:47:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938124.1338981; Fri, 04 Apr 2025 10:47: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 1u0eZl-0000Hh-OA; Fri, 04 Apr 2025 10:47:05 +0000
Received: by outflank-mailman (input) for mailman id 938124;
 Fri, 04 Apr 2025 10:47:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u0eZk-0000HT-CO
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 10:47: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 1u0eZk-00Bc9o-19
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:47:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0eZk-00BSyN-13
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:47: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=eCBGUAQPZ7lRDMhZR7ZBe1HTkhG+dYnZCySs0AyD1Y4=; b=R2l8WS03tE5K2xPKOG/acvMh7k
	i1sUn+oXkPNfcDDwS/bqwCG8OvqfsxtkcfG032vyopGwqkDnVXeoIWnZ1ftBBsW6y5zT1/oiYoOjg
	uL6r1pxXBcjYO332WYLfzDwmVOChfSXfR3K3+d1rC5lcIFsEjXgpJzs/R2OY8v09bW3I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] automation/cirrus-ci: store Xen Kconfig before doing a build
Message-Id: <E1u0eZk-00BSyN-13@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 10:47:04 +0000

commit 8edc2ad0596a22ecf5ec7732d7b6baea66603adb
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Mar 14 11:55:48 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:33:55 2025 +0100

    automation/cirrus-ci: store Xen Kconfig before doing a build
    
    In case the build fails or gets stuck, store the Kconfig file ahead of
    starting the build.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 421c2bd58f35ede865fa81c82957ca5297e903a4)
---
 .cirrus.yml | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index ce7588b7b6..490f214f04 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -16,7 +16,7 @@ freebsd_template: &FREEBSD_ENV
     CIRRUS_CLONE_DEPTH: 1
     CIRRUS_LOG_TIMESTAMP: true
 
-freebsd_artifacts: &FREEBSD_ARTIFACTS
+freebsd_configure_artifacts: &FREEBSD_CONFIGURE_ARTIFACTS
   always:
     rename_script:
       - cp xen/.config xen-config
@@ -32,25 +32,30 @@ freebsd_full_build_template: &FREEBSD_FULL_BUILD_TEMPLATE
                                  yajl lzo2 pixman argp-standalone
                                  libxml2 glib git python3
 
-  build_script:
+  configure_script:
     - cc --version
     - ./configure --with-system-seabios=/usr/local/share/seabios/bios.bin
-    - gmake -j`sysctl -n hw.ncpu` clang=y
+    - gmake -j`sysctl -n hw.ncpu` -C xen clang=y defconfig
+
+  << : *FREEBSD_CONFIGURE_ARTIFACTS
 
-  << : *FREEBSD_ARTIFACTS
+  build_script:
+    - gmake -j`sysctl -n hw.ncpu` clang=y
 
 freebsd_randconfig_template: &FREEBSD_RANDCONFIG_TEMPLATE
   << : *FREEBSD_ENV
 
   install_script: pkg install -y gmake python3 bison
 
-  build_script:
+  configure_script:
     - cc --version
     - gmake -j`sysctl -n hw.ncpu` -C xen clang=y \
             KCONFIG_ALLCONFIG=tools/kconfig/allrandom.config randconfig
-    - gmake -j`sysctl -n hw.ncpu` build-xen clang=y
 
-  << : *FREEBSD_ARTIFACTS
+  << : *FREEBSD_CONFIGURE_ARTIFACTS
+
+  build_script:
+    - gmake -j`sysctl -n hw.ncpu` build-xen clang=y
 
 task:
   name: 'FreeBSD 13: full build'
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 10:47:15 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 10:47:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938125.1338984 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eZv-0000KT-SC; Fri, 04 Apr 2025 10:47:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938125.1338984; Fri, 04 Apr 2025 10:47: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 1u0eZv-0000KJ-Pa; Fri, 04 Apr 2025 10:47:15 +0000
Received: by outflank-mailman (input) for mailman id 938125;
 Fri, 04 Apr 2025 10:47:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u0eZu-0000K9-Eo
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 10:47:14 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0eZu-00BcA8-1P
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:47:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0eZu-00BT1H-1K
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:47:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Q63dTt4z6WVpGD4R9aolY4ttzFlMubs9Edvuu8+P1F4=; b=INIXhw7B8P7sfMcWlRi7OO3/lk
	en72/BjcZr13HSqc5poVD0BbDZerrCKfYuqYR+OCNSIRvD3+3n3J2Hb4HfKQHPIIiwLAuBNnH2mng
	BxMy7SmBKBZkHnN/PdrmfEHxW39+11GglWiJKWEpxIXhEtR4o00VcDu8PKY/GqsctCDQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] automation/console.exp: do not assume expect is always at /usr/bin/
Message-Id: <E1u0eZu-00BT1H-1K@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 10:47:14 +0000

commit bbca8438629519497bacc7297cf52e67bb114748
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Mar 17 10:31:07 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:33:55 2025 +0100

    automation/console.exp: do not assume expect is always at /usr/bin/
    
    Instead use env to find the location of expect.
    
    Additionally do not use the -f flag, as it's only meaningful when passing
    arguments on the command line, which we never do for console.exp.  From the
    expect 5.45.4 man page:
    
    > The -f flag prefaces a file from which to read commands from.  The flag
    > itself is optional as it is only useful when using the #! notation (see
    > above), so  that other arguments may be supplied on the command line.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/scripts/console.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/automation/scripts/console.exp b/automation/scripts/console.exp
index 310543c33e..31ce97b91b 100755
--- a/automation/scripts/console.exp
+++ b/automation/scripts/console.exp
@@ -1,4 +1,4 @@
-#!/usr/bin/expect -f
+#!/usr/bin/env expect
 
 if {[info exists env(TEST_TIMEOUT_OVERRIDE)]} {
     set timeout $env(TEST_TIMEOUT_OVERRIDE)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 10:47:25 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 10:47:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938126.1338988 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0ea5-0000Mw-TV; Fri, 04 Apr 2025 10:47:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938126.1338988; Fri, 04 Apr 2025 10:47:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0ea5-0000Mo-Qz; Fri, 04 Apr 2025 10:47:25 +0000
Received: by outflank-mailman (input) for mailman id 938126;
 Fri, 04 Apr 2025 10:47:24 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u0ea4-0000Md-Ha
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 10:47:24 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0ea4-00BcAP-1f
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:47:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0ea4-00BT4m-1Z
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:47:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=chv4K2Jbp8cFpaLd5skemwTeN8c+iOP8S3DN5WH9wpA=; b=GjYezVYdc1S9qrI3VfpC0jY5zW
	3kWHj64NgX7FUAxQm3qd7FdsFumFvPMuXlU6QVZs6+l5HSTN27eTbIArBW6/nzAbWo1tDiGnUrKAO
	fUMGsZPpC1oOgX9WFzgzG4qC1jLCiRChOB0j7SUSSQgva7O+X5XUbDZP6PwCIerU+qnA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] automation/cirrus-ci: use matrix keyword to generate per-version build tasks
Message-Id: <E1u0ea4-00BT4m-1Z@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 10:47:24 +0000

commit 823ce77d851bbfba698ce408dac25830f8e5632d
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Sat Mar 15 09:35:12 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:33:55 2025 +0100

    automation/cirrus-ci: use matrix keyword to generate per-version build tasks
    
    Move the current logic to use the matrix keyword to generate a task for
    each version of FreeBSD we want to build Xen on.  The matrix keyword
    however cannot be used in YAML aliases, so it needs to be explicitly used
    inside of each task, which creates a bit of duplication.  At least abstract
    the FreeBSD minor version numbers to avoid repetition of image names.
    
    Note that the full build uses matrix over an env variable instead of using
    it directly in image_family.  This is so that the alias can also be set
    based on the FreeBSD version, in preparation for adding further tasks that
    will depend on the full build having finished.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit b548a7dc4bb4202410983dd3ef7b5f1b469bdac3)
---
 .cirrus.yml | 78 +++++++++++++++++++++++++++++--------------------------------
 1 file changed, 37 insertions(+), 41 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 490f214f04..95d2d2d3db 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -1,13 +1,9 @@
 # https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
-freebsd_13: &FREEBSD_13
-  freebsd_instance:
-    image_family: freebsd-13-5
-freebsd_14: &FREEBSD_14
-  freebsd_instance:
-    image_family: freebsd-14-2
-freebsd_15: &FREEBSD_15
-  freebsd_instance:
-    image_family: freebsd-15-0-snap
+freebsd_versions: &FREEBSD_VERSIONS
+  env:
+    FREEBSD_LEGACY:     freebsd-13-5
+    FREEBSD_PRODUCTION: freebsd-14-2
+    FREEBSD_CURRENT:    freebsd-15-0-snap
 
 freebsd_template: &FREEBSD_ENV
   environment:
@@ -24,7 +20,24 @@ freebsd_configure_artifacts: &FREEBSD_CONFIGURE_ARTIFACTS
       path: xen-config
       type: text/plain
 
-freebsd_full_build_template: &FREEBSD_FULL_BUILD_TEMPLATE
+task:
+  name: 'FreeBSD: full build'
+
+  # It's not possible to use the matrix keyword in YAML aliases, as they
+  # keyword usage is restricted to task, docker_builder or pipe.  Attempting to
+  # use a YAML alias with the duplicated keys doesn't work either. Use an env
+  # variable so the version can also be appended to the task alias.
+  << : *FREEBSD_VERSIONS
+  env:
+    matrix:
+      FREEBSD_VERSION: $FREEBSD_LEGACY
+      FREEBSD_VERSION: $FREEBSD_PRODUCTION
+      FREEBSD_VERSION: $FREEBSD_CURRENT
+
+  alias: freebsd_full_$FREEBSD_VERSION
+  freebsd_instance:
+    image_family: $FREEBSD_VERSION
+
   << : *FREEBSD_ENV
 
   install_script: pkg install -y seabios gmake ninja bash
@@ -42,7 +55,20 @@ freebsd_full_build_template: &FREEBSD_FULL_BUILD_TEMPLATE
   build_script:
     - gmake -j`sysctl -n hw.ncpu` clang=y
 
-freebsd_randconfig_template: &FREEBSD_RANDCONFIG_TEMPLATE
+task:
+  name: 'FreeBSD: randconfig build'
+
+  # It's not possible to use the matrix keyword in YAML aliases, as they
+  # keyword usage is restricted to task, docker_builder or pipe.  Attempting to
+  # use a YAML alias with the duplicated `image_family` keys doesn't work
+  # either. Abstract the version numbers at least.
+  << : *FREEBSD_VERSIONS
+  freebsd_instance:
+    matrix:
+      image_family: $FREEBSD_LEGACY
+      image_family: $FREEBSD_PRODUCTION
+      image_family: $FREEBSD_CURRENT
+
   << : *FREEBSD_ENV
 
   install_script: pkg install -y gmake python3 bison
@@ -56,33 +82,3 @@ freebsd_randconfig_template: &FREEBSD_RANDCONFIG_TEMPLATE
 
   build_script:
     - gmake -j`sysctl -n hw.ncpu` build-xen clang=y
-
-task:
-  name: 'FreeBSD 13: full build'
-  << : *FREEBSD_13
-  << : *FREEBSD_FULL_BUILD_TEMPLATE
-
-task:
-  name: 'FreeBSD 14: full build'
-  << : *FREEBSD_14
-  << : *FREEBSD_FULL_BUILD_TEMPLATE
-
-task:
-  name: 'FreeBSD 15: full build'
-  << : *FREEBSD_15
-  << : *FREEBSD_FULL_BUILD_TEMPLATE
-
-task:
-  name: 'FreeBSD 13: randconfig'
-  << : *FREEBSD_13
-  << : *FREEBSD_RANDCONFIG_TEMPLATE
-
-task:
-  name: 'FreeBSD 14: randconfig'
-  << : *FREEBSD_14
-  << : *FREEBSD_RANDCONFIG_TEMPLATE
-
-task:
-  name: 'FreeBSD 15: randconfig'
-  << : *FREEBSD_15
-  << : *FREEBSD_RANDCONFIG_TEMPLATE
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 10:47:36 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 10:47:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938127.1338993 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eaG-0000PX-08; Fri, 04 Apr 2025 10:47:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938127.1338993; Fri, 04 Apr 2025 10:47:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eaF-0000PL-SP; Fri, 04 Apr 2025 10:47:35 +0000
Received: by outflank-mailman (input) for mailman id 938127;
 Fri, 04 Apr 2025 10:47: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 1u0eaE-0000P6-Jw
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 10:47: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 1u0eaE-00BcAe-1u
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:47:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0eaE-00BT5v-1p
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:47: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=Fk4Og1woMJlszjPhk7q7JMAxgjTu1fQkoilzFWtBfuQ=; b=irGF1O3/nc2N1Mc+WZaetuCXH7
	8rk3Mf6wxIpxO0fX6/O0bupopJUAVqDlPPpjlCyKcWiv5bWIsqhxRyOYqSLTwK+05veaqhlFs6QuV
	dpEQwYNfn87f4EX7swSZmuqbXlrtg+3/OxiWo/UJopvCPCdn9cNHxsgq5yuh5EErrwQs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] automation/cirrus-ci: build XTF
Message-Id: <E1u0eaE-00BT5v-1p@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 10:47:34 +0000

commit c21d18664f90111dcbb3734843ab395b215b402c
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Mar 14 12:16:19 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:33:55 2025 +0100

    automation/cirrus-ci: build XTF
    
    In preparation for using the XTF selftests to smoke test the FreeBSD based
    Xen builds.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit a92c0a9888f14baf8e66a16e960bc524cc8194e6)
---
 .cirrus.yml | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/.cirrus.yml b/.cirrus.yml
index 95d2d2d3db..a6e4a5d030 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -12,6 +12,12 @@ freebsd_template: &FREEBSD_ENV
     CIRRUS_CLONE_DEPTH: 1
     CIRRUS_LOG_TIMESTAMP: true
 
+freebsd_template_latest: &FREEBSD_ENV_PRODUCTION
+  << : *FREEBSD_VERSIONS
+  freebsd_instance:
+    image_family: $FREEBSD_PRODUCTION
+  << : *FREEBSD_ENV
+
 freebsd_configure_artifacts: &FREEBSD_CONFIGURE_ARTIFACTS
   always:
     rename_script:
@@ -82,3 +88,21 @@ task:
 
   build_script:
     - gmake -j`sysctl -n hw.ncpu` build-xen clang=y
+
+task:
+  name: 'FreeBSD: XTF build'
+  alias: xtf
+
+  << : *FREEBSD_ENV_PRODUCTION
+
+  clone_script:
+    - pkg install -y git
+    - git clone --depth 1 https://xenbits.xen.org/git-http/xtf.git
+
+  install_script: pkg install -y gmake
+
+  build_script:
+    - cd xtf
+    - cc --version
+    - git rev-parse HEAD
+    - gmake -j`sysctl -n hw.ncpu` LLVM=y
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 10:47:46 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 10:47:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938128.1338995 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eaQ-0000Sa-1t; Fri, 04 Apr 2025 10:47:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938128.1338995; Fri, 04 Apr 2025 10:47: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 1u0eaP-0000SS-VZ; Fri, 04 Apr 2025 10:47:45 +0000
Received: by outflank-mailman (input) for mailman id 938128;
 Fri, 04 Apr 2025 10:47: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 1u0eaO-0000SK-MO
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 10:47: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 1u0eaO-00BcAv-29
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:47:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0eaO-00BT9T-25
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:47: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=pk7Of23e7rWrjx8y1TEzVXQ4GtU+z6begEAJZ17Dwq8=; b=NypqAjUXABNXEMEi/bSxjC/e4y
	VMcNFvPy0v35y4IGOeC4t7H0WjNhQVg0wMvkFSS6tzemAkVjwtb7EvBN3q1WJAovnyGAbVke0/l1i
	rsMSoI9PoxmwAxbHHQmmsD36XxZyuZ9vA6P4eTymsg2nCSQilaAvxKlUqJzTk/ud9TxY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] automation/cirrus-ci: store XTF and Xen build artifacts
Message-Id: <E1u0eaO-00BT9T-25@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 10:47:44 +0000

commit 4ac2ede7be75b5bb8f0154d2f5bdefefa5ce7e3c
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Mar 14 13:01:36 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:33:55 2025 +0100

    automation/cirrus-ci: store XTF and Xen build artifacts
    
    In preparation for adding some smoke tests that will consume those outputs.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit c9de0e2ce41700132ffb9f25930fcca9da5e78af)
---
 .cirrus.yml | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/.cirrus.yml b/.cirrus.yml
index a6e4a5d030..38b654f75c 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -61,6 +61,14 @@ task:
   build_script:
     - gmake -j`sysctl -n hw.ncpu` clang=y
 
+  xen_artifacts:
+    path: xen/xen
+    type: application/octet-stream
+
+  debug_artifacts:
+    path: xen/xen-syms
+    type: application/octet-stream
+
 task:
   name: 'FreeBSD: randconfig build'
 
@@ -106,3 +114,7 @@ task:
     - cc --version
     - git rev-parse HEAD
     - gmake -j`sysctl -n hw.ncpu` LLVM=y
+
+  xtf_artifacts:
+    path: xtf/tests/selftest/test-*-selftest
+    type: application/octet-stream
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 10:47:55 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 10:47:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938129.1339001 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eaZ-0000Ut-3b; Fri, 04 Apr 2025 10:47:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938129.1339001; Fri, 04 Apr 2025 10:47: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 1u0eaZ-0000Ul-0m; Fri, 04 Apr 2025 10:47:55 +0000
Received: by outflank-mailman (input) for mailman id 938129;
 Fri, 04 Apr 2025 10:47: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 1u0eaY-0000Ud-Os
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 10:47: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 1u0eaY-00BcB6-2P
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:47:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0eaY-00BTAP-2K
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:47: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=A3mPjJ5sGxzUTcwv5d+YsOeR47I5qij9qIykJExs3Wo=; b=CEqZao/dUzDgzSzQhp1Wisj91O
	vIX0rtLHM395BiLoZAaTqj8+luXLdK5kxPr9LNZpg79JHoHc6Xfxscvcdmwnnps8EKdJjG7axwDBa
	FrdSxCqBRdshPaYsvL2sNKfLYsJGF55mLnHkJ/me9PlN12IHT+NbbCsO1xKwOHJUbz7w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] automation/cirrus-ci: add smoke tests for the FreeBSD builds
Message-Id: <E1u0eaY-00BTAP-2K@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 10:47:54 +0000

commit 3724384488cbabc7841b761cb9a037fd0b4c4cd5
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Mar 14 13:37:46 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:33:55 2025 +0100

    automation/cirrus-ci: add smoke tests for the FreeBSD builds
    
    Introduce a basic set of smoke tests using the XTF selftest image, and run
    them on QEMU.  Use the matrix keyword to create a different task for each
    XTF flavor on each FreeBSD build.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Oleksii Kurochko<oleksii.kurochko@gmail.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 7973cba4dbf72f6b963c780e9d1e0b99fd9622b9)
---
 .cirrus.yml | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/.cirrus.yml b/.cirrus.yml
index 38b654f75c..3163ab8f11 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -5,6 +5,8 @@ freebsd_versions: &FREEBSD_VERSIONS
     FREEBSD_PRODUCTION: freebsd-14-2
     FREEBSD_CURRENT:    freebsd-15-0-snap
 
+# Build jobs
+
 freebsd_template: &FREEBSD_ENV
   environment:
     APPEND_LIB: /usr/local/lib
@@ -118,3 +120,55 @@ task:
   xtf_artifacts:
     path: xtf/tests/selftest/test-*-selftest
     type: application/octet-stream
+
+# Test jobs
+
+task:
+  name: 'FreeBSD: XTF selftest'
+
+  << : *FREEBSD_ENV_PRODUCTION
+
+  env:
+    matrix:
+      FREEBSD_BUILD: $FREEBSD_LEGACY
+      FREEBSD_BUILD: $FREEBSD_PRODUCTION
+      FREEBSD_BUILD: $FREEBSD_CURRENT
+
+  depends_on:
+    - freebsd_full_$FREEBSD_BUILD
+    - xtf
+
+  install_script: pkg install -y qemu-nox11 expect
+
+  env:
+    matrix:
+      XTF_ARCH: hvm32
+      XTF_ARCH: hvm32pae
+      XTF_ARCH: hvm32pse
+      XTF_ARCH: hvm64
+      XTF_ARCH: pv64
+
+  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
+    - unzip xtf.zip
+    - unzip xen.zip
+
+  test_script: |
+    case "$XTF_ARCH" in \
+      *hvm*) \
+        XEN_EXTRA_CMD="dom0=pvh dom0-iommu=none" \
+        ;; \
+    esac
+    export TEST_CMD="qemu-system-x86_64 -kernel xen/xen -initrd xtf/tests/selftest/test-${XTF_ARCH}-selftest \
+                                        -append \"loglvl=all console=com1 noreboot console_timestamps=boot dom0=verbose ${XEN_EXTRA_CMD}\" \
+                                        -m 512 -nographic -monitor none -serial stdio"
+    export TEST_LOG="serial-${FREEBSD_BUILD}-${XTF_ARCH}.txt"
+    export PASSED="Test result: SUCCESS"
+    export TEST_TIMEOUT=120
+    ./automation/scripts/console.exp | sed 's/\r\+$//'
+
+  always:
+    serial_artifacts:
+      path: serial-*.txt
+      type: text/plain
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 10:48:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 10:48:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938130.1339004 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0eak-0000Y5-54; Fri, 04 Apr 2025 10:48:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938130.1339004; Fri, 04 Apr 2025 10:48: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 1u0eak-0000Xs-2E; Fri, 04 Apr 2025 10:48:06 +0000
Received: by outflank-mailman (input) for mailman id 938130;
 Fri, 04 Apr 2025 10:48: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 1u0eai-0000XZ-RW
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 10:48: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 1u0eai-00BcBn-2f
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:48:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0eai-00BTBp-2Z
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:48: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=tVBlszr3yPA4hYsBPffgsmYg53GAvqcnZVOxRRYef9Y=; b=byk2Nyb2xI6ljPEMhOfmgAHAMY
	jqQc059dONXCSbb6f/DIdganLUZ29eg3JSizNaOond4WFXyw8QyCy8QfvDtITwOxOV9UZsMfRs1xh
	eYj7HdffQh53k3qVj/XmzvlLdt8hs6I4732oifsM25+M0k4irRz3wU+yECaaQwb0rlBY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] CI: Add yet another HW runner
Message-Id: <E1u0eai-00BTBp-2Z@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 10:48:04 +0000

commit 7fb1438bf4fcd37311c86cb4ee2965a2b52d5b52
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Fri Mar 14 04:06:26 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:33:55 2025 +0100

    CI: Add yet another HW runner
    
    This is AMD Zen2 (Ryzen 5 4500U specifically), in a HP Probook 445 G7.
    
    This one has working S3, so add a test for it here.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit debe8bf537ec2c69a4734393cd2b0c7f57f74c0c)
---
 automation/gitlab-ci/test.yaml | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 28bab21d05..325be5dc49 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -143,6 +143,17 @@
   tags:
     - qubes-hw2
 
+.zen2-x86-64:
+  # it's really similar to the above
+  extends: .adl-x86-64
+  variables:
+    PCIDEV: "01:00.0"
+    PCIDEV_INTR: "MSI-X"
+    CONSOLE_OPTS: "console=com1 com1=115200,8n1,pci,msi,04:00.0"
+    SUT_ADDR: test-1.testnet
+  tags:
+    - qubes-hw1
+
 .zen3p-x86-64:
   # it's really similar to the above
   extends: .adl-x86-64
@@ -250,6 +261,22 @@ adl-pvshim-x86-64-gcc-debug:
     - *x86-64-test-needs
     - alpine-3.18-gcc-debug
 
+zen2-smoke-x86-64-gcc-debug:
+  extends: .zen2-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
+zen2-suspend-x86-64-gcc-debug:
+  extends: .zen2-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh s3 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
 zen3p-smoke-x86-64-gcc-debug:
   extends: .zen3p-x86-64
   script:
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 10:55:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 10:55:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938131.1339007 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0ehT-00036W-LE; Fri, 04 Apr 2025 10:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938131.1339007; Fri, 04 Apr 2025 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 1u0ehT-00036O-Ii; Fri, 04 Apr 2025 10:55:03 +0000
Received: by outflank-mailman (input) for mailman id 938131;
 Fri, 04 Apr 2025 10:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u0ehS-000362-Ex
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 10:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0ehS-00BcRx-0u
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0ehS-00BUQB-0h
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 10:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=e3NE/WszFYKySIrpoQsxqCFtJd/0gmGSSgd2pD3rgzA=; b=oP+OZVezXSh9j2Yan8XGmp+faW
	HJUePm2EXK4HXSB33iLg2bDHe5qYYu8NEy28Xj9aLEab7+2EXbz5r2uDvTxaE72/Qxwh3tnmjkzse
	naCHjoDcTqsZtKM4oL+SJDOqKofLGlXBpkzK8aXURMjVzyc2ffjmyXpbofgiBncfsa4I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] update Xen version to 4.19.2
Message-Id: <E1u0ehS-00BUQB-0h@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 10:55:02 +0000

commit f3362182e028119e5ca2ab37e5628b9fa6d21254
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Apr 4 12:47:23 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Apr 4 12:47:23 2025 +0200

    update Xen version to 4.19.2
---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Makefile b/xen/Makefile
index 968971694c..26907392bb 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -6,7 +6,7 @@ this-makefile := $(call lastword,$(MAKEFILE_LIST))
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 19
-export XEN_EXTRAVERSION ?= .2-pre$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .2$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 12:11:09 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 12:11:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938175.1339032 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0ft1-0007Nq-Dh; Fri, 04 Apr 2025 12:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938175.1339032; Fri, 04 Apr 2025 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 1u0ft1-0007Ng-Ap; Fri, 04 Apr 2025 12:11:03 +0000
Received: by outflank-mailman (input) for mailman id 938175;
 Fri, 04 Apr 2025 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 1u0ft0-0007NU-6o
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 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 1u0fsz-00BeyI-2j
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0fsz-00BfdJ-2Z
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12: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=OmqLRqRVg5iLxDQ/TbAh2jL1pSVD28cp6zi+hfyDNlE=; b=j3N/ld9ntOGDpfU+llpZRyCZ6L
	zNBZ4495VIosVH0m1u7etxXlcwepIqI0RMPgh1wQ327Vk2IfyDAUzNBKKhRuDT7dq8gHsGJrhqDG9
	PY24vNjlJP1H2HJeE5D2+Yjm2YD94a/HySyBvo2wHEpe9BthKb4e4uAg/awPutWIeSk8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] CirrusCI: Use shallow clone
Message-Id: <E1u0fsz-00BfdJ-2Z@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 12:11:01 +0000

commit 2599ee0b601c89cd2efb8b803934024ee1e83d65
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Feb 24 15:36:11 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:32:29 2025 +0100

    CirrusCI: Use shallow clone
    
    This reduces the Clone step from ~50s to ~3s.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 96970b46e5e84fa2666f76f5b0972b826a3ffba4)
---
 .cirrus.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.cirrus.yml b/.cirrus.yml
index 7216729b69..e2949d99d7 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -13,6 +13,7 @@ freebsd_template: &FREEBSD_ENV
   environment:
     APPEND_LIB: /usr/local/lib
     APPEND_INCLUDES: /usr/local/include
+    CIRRUS_CLONE_DEPTH: 1
 
 freebsd_full_build_template: &FREEBSD_FULL_BUILD_TEMPLATE
   << : *FREEBSD_ENV
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 12:11:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 12:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938176.1339036 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0ftB-0007Pf-FQ; Fri, 04 Apr 2025 12:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938176.1339036; Fri, 04 Apr 2025 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 1u0ftB-0007PX-CJ; Fri, 04 Apr 2025 12:11:13 +0000
Received: by outflank-mailman (input) for mailman id 938176;
 Fri, 04 Apr 2025 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 1u0ft9-0007PL-WB
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 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 1u0ft9-00Beyf-35
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0ft9-00Bfew-2u
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12: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=r9DKSWJtcFXtqJg3P+xZXMjIUEjuE9Qv1glGjzzMS18=; b=AKTMjSvTc2RyAn66ebzeM1JLGF
	Zc4qs1oRQM3mP8diShbpWACTgsRRH9rbJdc+WFhwBySQsLkzaDcdxuKec0PKLX3xZDtjAZIe+C8XZ
	Y7t864kCeQhNrKNjRsAqsBnq6wiQ3TVHaGrzOHMQQhZC5rVhG8/eW/p76FhIy+5lLJl0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] automation/cirrus-ci: store xen/.config as an artifact
Message-Id: <E1u0ft9-00Bfew-2u@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 12:11:11 +0000

commit 8f94c1ec72093f7ee59c3d259ff2be37e0591395
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Mar 10 18:41:57 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:32:29 2025 +0100

    automation/cirrus-ci: store xen/.config as an artifact
    
    Always store xen/.config as an artifact, renamed to xen-config to match
    the naming used in the Gitlab CI tests.
    
    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>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 318659c818546b6415c2311339a53384dc20c427)
---
 .cirrus.yml | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/.cirrus.yml b/.cirrus.yml
index e2949d99d7..1a39f5026f 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -15,6 +15,14 @@ freebsd_template: &FREEBSD_ENV
     APPEND_INCLUDES: /usr/local/include
     CIRRUS_CLONE_DEPTH: 1
 
+freebsd_artifacts: &FREEBSD_ARTIFACTS
+  always:
+    rename_script:
+      - cp xen/.config xen-config
+    config_artifacts:
+      path: xen-config
+      type: text/plain
+
 freebsd_full_build_template: &FREEBSD_FULL_BUILD_TEMPLATE
   << : *FREEBSD_ENV
 
@@ -28,6 +36,8 @@ freebsd_full_build_template: &FREEBSD_FULL_BUILD_TEMPLATE
     - ./configure --with-system-seabios=/usr/local/share/seabios/bios.bin
     - gmake -j`sysctl -n hw.ncpu` clang=y
 
+  << : *FREEBSD_ARTIFACTS
+
 freebsd_randconfig_template: &FREEBSD_RANDCONFIG_TEMPLATE
   << : *FREEBSD_ENV
 
@@ -39,6 +49,8 @@ freebsd_randconfig_template: &FREEBSD_RANDCONFIG_TEMPLATE
             KCONFIG_ALLCONFIG=tools/kconfig/allrandom.config randconfig
     - gmake -j`sysctl -n hw.ncpu` build-xen clang=y
 
+  << : *FREEBSD_ARTIFACTS
+
 task:
   name: 'FreeBSD 13: full build'
   << : *FREEBSD_13
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 12:11:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 12:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938177.1339039 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0ftL-0007S5-GQ; Fri, 04 Apr 2025 12:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938177.1339039; Fri, 04 Apr 2025 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 1u0ftL-0007Ry-Dl; Fri, 04 Apr 2025 12:11:23 +0000
Received: by outflank-mailman (input) for mailman id 938177;
 Fri, 04 Apr 2025 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 1u0ftK-0007Rq-2r
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 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 1u0ftK-00Beyw-0B
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0ftK-00Bfi2-02
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 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=Ap39VQ2r6knGllhayrfQoWPcdUuaWtmzQFXZyfWGcII=; b=0FYXZGQMjiaJ2v45NrFpSpO9cj
	r5TGuCdRUArpY6t5vIZw0sPGAAC2xvDV4Vg3J60tHQ7+951Y8YQwMnYDfZwLa+qGaTAHfztYmO9fR
	z7Tq5h3RVmUxFpbM+Ss6xGyK1zD3Ej9rnaJStG15cNJpyTiY5FHoMdXb/s2zTUOrGcPE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] automation/cirrus-ci: add timestamps
Message-Id: <E1u0ftK-00Bfi2-02@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 12:11:22 +0000

commit 0a84ef273116c6e163a6b51014c2f27d584b05cb
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Mar 14 11:44:45 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:32:29 2025 +0100

    automation/cirrus-ci: add timestamps
    
    Such timestamps can still be disabled from the Web UI using a tick box.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 1256159f3cfcfef475b94dda39f68a85702bba64)
---
 .cirrus.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.cirrus.yml b/.cirrus.yml
index 1a39f5026f..aa195ba370 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -14,6 +14,7 @@ freebsd_template: &FREEBSD_ENV
     APPEND_LIB: /usr/local/lib
     APPEND_INCLUDES: /usr/local/include
     CIRRUS_CLONE_DEPTH: 1
+    CIRRUS_LOG_TIMESTAMP: true
 
 freebsd_artifacts: &FREEBSD_ARTIFACTS
   always:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 12:11:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 12:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938178.1339045 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0ftV-0007Uw-J2; Fri, 04 Apr 2025 12:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938178.1339045; Fri, 04 Apr 2025 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 1u0ftV-0007Uo-FY; Fri, 04 Apr 2025 12:11:33 +0000
Received: by outflank-mailman (input) for mailman id 938178;
 Fri, 04 Apr 2025 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 1u0ftU-0007Uf-5s
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 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 1u0ftU-00BezB-0V
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0ftU-00Bfj0-0M
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 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=eTOO4BFU9FtwmRPYZiN23O0XtfgDZOJ5bx9bOjhBLUE=; b=E3qhU2k6nenBiiL9ynA2nNoP8F
	bhdu+JpdhTTXQamQxgEvNzB16SGVSJjGWjZj5k2A1UhMx0TQLh4YhopC+rF5EGiosYjzj3jye2zGm
	QPA2d0nOT6yYqfYn+FIlMKoFRogRjaJ7xpUwK/WCrccHmJGhsn8tIsNksPiIjNgrgVSM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] automation/cirrus-ci: update FreeBSD to 13.5
Message-Id: <E1u0ftU-00Bfj0-0M@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 12:11:32 +0000

commit 44407a9d92613f85058658852611e0778383bcc2
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Mar 14 11:49:28 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:32:29 2025 +0100

    automation/cirrus-ci: update FreeBSD to 13.5
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 5395cd7b892daf11cd80e4eec0cfa45c4b319d35)
---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index aa195ba370..ce7588b7b6 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -1,7 +1,7 @@
 # https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
 freebsd_13: &FREEBSD_13
   freebsd_instance:
-    image_family: freebsd-13-4
+    image_family: freebsd-13-5
 freebsd_14: &FREEBSD_14
   freebsd_instance:
     image_family: freebsd-14-2
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 12:11:43 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 12:11:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938179.1339048 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0ftf-0007XU-Jf; Fri, 04 Apr 2025 12:11:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938179.1339048; Fri, 04 Apr 2025 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 1u0ftf-0007XM-H6; Fri, 04 Apr 2025 12:11:43 +0000
Received: by outflank-mailman (input) for mailman id 938179;
 Fri, 04 Apr 2025 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 1u0fte-0007X7-8h
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 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 1u0fte-00BezO-0m
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0fte-00Bfk9-0g
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 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=jqcqVcMnnd4bWsBBJxnlQ3txLefLIhS3oCHH4P+3gZY=; b=yt6wbJjz71XM/xrsm56jupLZiP
	h9KKsW1Pz6up3XbKI9PdGwLne7j5Qzw4DOneJE9l0UC4gFyEvArEr8H83cqO4dY92d1wdZI6twuSO
	q6Q6l1Jgi5Et7yHqMkMkXguRePof9WS66QeRnEYNIYdPBVdw8ujWWMbxjx4WldLaC/K8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] automation/cirrus-ci: store Xen Kconfig before doing a build
Message-Id: <E1u0fte-00Bfk9-0g@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 12:11:42 +0000

commit 0b37231312e7bd01055d2388f66ec439c44dbab2
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Mar 14 11:55:48 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:32:29 2025 +0100

    automation/cirrus-ci: store Xen Kconfig before doing a build
    
    In case the build fails or gets stuck, store the Kconfig file ahead of
    starting the build.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 421c2bd58f35ede865fa81c82957ca5297e903a4)
---
 .cirrus.yml | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index ce7588b7b6..490f214f04 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -16,7 +16,7 @@ freebsd_template: &FREEBSD_ENV
     CIRRUS_CLONE_DEPTH: 1
     CIRRUS_LOG_TIMESTAMP: true
 
-freebsd_artifacts: &FREEBSD_ARTIFACTS
+freebsd_configure_artifacts: &FREEBSD_CONFIGURE_ARTIFACTS
   always:
     rename_script:
       - cp xen/.config xen-config
@@ -32,25 +32,30 @@ freebsd_full_build_template: &FREEBSD_FULL_BUILD_TEMPLATE
                                  yajl lzo2 pixman argp-standalone
                                  libxml2 glib git python3
 
-  build_script:
+  configure_script:
     - cc --version
     - ./configure --with-system-seabios=/usr/local/share/seabios/bios.bin
-    - gmake -j`sysctl -n hw.ncpu` clang=y
+    - gmake -j`sysctl -n hw.ncpu` -C xen clang=y defconfig
+
+  << : *FREEBSD_CONFIGURE_ARTIFACTS
 
-  << : *FREEBSD_ARTIFACTS
+  build_script:
+    - gmake -j`sysctl -n hw.ncpu` clang=y
 
 freebsd_randconfig_template: &FREEBSD_RANDCONFIG_TEMPLATE
   << : *FREEBSD_ENV
 
   install_script: pkg install -y gmake python3 bison
 
-  build_script:
+  configure_script:
     - cc --version
     - gmake -j`sysctl -n hw.ncpu` -C xen clang=y \
             KCONFIG_ALLCONFIG=tools/kconfig/allrandom.config randconfig
-    - gmake -j`sysctl -n hw.ncpu` build-xen clang=y
 
-  << : *FREEBSD_ARTIFACTS
+  << : *FREEBSD_CONFIGURE_ARTIFACTS
+
+  build_script:
+    - gmake -j`sysctl -n hw.ncpu` build-xen clang=y
 
 task:
   name: 'FreeBSD 13: full build'
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 12:11:53 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 12:11:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938180.1339052 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0ftp-0007Zm-LA; Fri, 04 Apr 2025 12:11:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938180.1339052; Fri, 04 Apr 2025 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 1u0ftp-0007Ze-Ic; Fri, 04 Apr 2025 12:11:53 +0000
Received: by outflank-mailman (input) for mailman id 938180;
 Fri, 04 Apr 2025 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 1u0fto-0007ZU-BU
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 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 1u0fto-00Bezg-13
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:11:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0fto-00BflE-0x
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 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=KF+sfeXktFtnLzs+E5S7CV3cPBGBRJLfsSkPktCudz8=; b=2nOrUMC3M1Rk45yyPa+Cj8cYCj
	t4bs0u95TE1yZopBrA5yFM1TskVrMjSy5qBEqN89K8tlB0c/1xifw1TKaql4nXPJO6oarID7A6mMA
	S6k3JGjhb/aptGIucGzyiCwU7GbQHRDcg26LXAukK4U3IoWaFhbRUe8upt+soxaMZJDA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] automation/console.exp: do not assume expect is always at /usr/bin/
Message-Id: <E1u0fto-00BflE-0x@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 12:11:52 +0000

commit 81189d7116bdc0e4cbe53c8cccd54e563c30d651
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Mar 17 10:31:07 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:32:29 2025 +0100

    automation/console.exp: do not assume expect is always at /usr/bin/
    
    Instead use env to find the location of expect.
    
    Additionally do not use the -f flag, as it's only meaningful when passing
    arguments on the command line, which we never do for console.exp.  From the
    expect 5.45.4 man page:
    
    > The -f flag prefaces a file from which to read commands from.  The flag
    > itself is optional as it is only useful when using the #! notation (see
    > above), so  that other arguments may be supplied on the command line.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit c6867d134eeb3aefcecf022f4ab20c325701ef30)
---
 automation/scripts/console.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/automation/scripts/console.exp b/automation/scripts/console.exp
index 310543c33e..31ce97b91b 100755
--- a/automation/scripts/console.exp
+++ b/automation/scripts/console.exp
@@ -1,4 +1,4 @@
-#!/usr/bin/expect -f
+#!/usr/bin/env expect
 
 if {[info exists env(TEST_TIMEOUT_OVERRIDE)]} {
     set timeout $env(TEST_TIMEOUT_OVERRIDE)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 12:12:03 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 12:12:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938181.1339056 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0ftz-0007cA-Mk; Fri, 04 Apr 2025 12:12:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938181.1339056; Fri, 04 Apr 2025 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 1u0ftz-0007c2-K1; Fri, 04 Apr 2025 12:12:03 +0000
Received: by outflank-mailman (input) for mailman id 938181;
 Fri, 04 Apr 2025 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 1u0fty-0007bu-EF
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 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 1u0fty-00Bf0Q-1K
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:12:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0fty-00Bfmf-1E
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 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=W0h3nVFLL2QBp+fdogT6QpD6wJyDviilf4dlHSXnGCY=; b=l8LYDq6nMOQxKER5OTqe53Yg83
	h9gpevaAd7mR7NN1AoNVoIO5T5+Ws6Aon6VH+zo90hq4VCmdcmvP5vaZy6+GBY1Yl24olOmQ74WGM
	pN81XI1yu6t4VxrAPobHkKYyr/OKJU8FzZZn+gVGJhVIEF3Llfp8G7nA7vmvX5cLLrtE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] automation/cirrus-ci: use matrix keyword to generate per-version build tasks
Message-Id: <E1u0fty-00Bfmf-1E@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 12:12:02 +0000

commit cfa5bc6f0a1d0e2c63cd00b63cf71ebfcb3f4cd9
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Sat Mar 15 09:35:12 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:32:29 2025 +0100

    automation/cirrus-ci: use matrix keyword to generate per-version build tasks
    
    Move the current logic to use the matrix keyword to generate a task for
    each version of FreeBSD we want to build Xen on.  The matrix keyword
    however cannot be used in YAML aliases, so it needs to be explicitly used
    inside of each task, which creates a bit of duplication.  At least abstract
    the FreeBSD minor version numbers to avoid repetition of image names.
    
    Note that the full build uses matrix over an env variable instead of using
    it directly in image_family.  This is so that the alias can also be set
    based on the FreeBSD version, in preparation for adding further tasks that
    will depend on the full build having finished.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit b548a7dc4bb4202410983dd3ef7b5f1b469bdac3)
---
 .cirrus.yml | 78 +++++++++++++++++++++++++++++--------------------------------
 1 file changed, 37 insertions(+), 41 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 490f214f04..95d2d2d3db 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -1,13 +1,9 @@
 # https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
-freebsd_13: &FREEBSD_13
-  freebsd_instance:
-    image_family: freebsd-13-5
-freebsd_14: &FREEBSD_14
-  freebsd_instance:
-    image_family: freebsd-14-2
-freebsd_15: &FREEBSD_15
-  freebsd_instance:
-    image_family: freebsd-15-0-snap
+freebsd_versions: &FREEBSD_VERSIONS
+  env:
+    FREEBSD_LEGACY:     freebsd-13-5
+    FREEBSD_PRODUCTION: freebsd-14-2
+    FREEBSD_CURRENT:    freebsd-15-0-snap
 
 freebsd_template: &FREEBSD_ENV
   environment:
@@ -24,7 +20,24 @@ freebsd_configure_artifacts: &FREEBSD_CONFIGURE_ARTIFACTS
       path: xen-config
       type: text/plain
 
-freebsd_full_build_template: &FREEBSD_FULL_BUILD_TEMPLATE
+task:
+  name: 'FreeBSD: full build'
+
+  # It's not possible to use the matrix keyword in YAML aliases, as they
+  # keyword usage is restricted to task, docker_builder or pipe.  Attempting to
+  # use a YAML alias with the duplicated keys doesn't work either. Use an env
+  # variable so the version can also be appended to the task alias.
+  << : *FREEBSD_VERSIONS
+  env:
+    matrix:
+      FREEBSD_VERSION: $FREEBSD_LEGACY
+      FREEBSD_VERSION: $FREEBSD_PRODUCTION
+      FREEBSD_VERSION: $FREEBSD_CURRENT
+
+  alias: freebsd_full_$FREEBSD_VERSION
+  freebsd_instance:
+    image_family: $FREEBSD_VERSION
+
   << : *FREEBSD_ENV
 
   install_script: pkg install -y seabios gmake ninja bash
@@ -42,7 +55,20 @@ freebsd_full_build_template: &FREEBSD_FULL_BUILD_TEMPLATE
   build_script:
     - gmake -j`sysctl -n hw.ncpu` clang=y
 
-freebsd_randconfig_template: &FREEBSD_RANDCONFIG_TEMPLATE
+task:
+  name: 'FreeBSD: randconfig build'
+
+  # It's not possible to use the matrix keyword in YAML aliases, as they
+  # keyword usage is restricted to task, docker_builder or pipe.  Attempting to
+  # use a YAML alias with the duplicated `image_family` keys doesn't work
+  # either. Abstract the version numbers at least.
+  << : *FREEBSD_VERSIONS
+  freebsd_instance:
+    matrix:
+      image_family: $FREEBSD_LEGACY
+      image_family: $FREEBSD_PRODUCTION
+      image_family: $FREEBSD_CURRENT
+
   << : *FREEBSD_ENV
 
   install_script: pkg install -y gmake python3 bison
@@ -56,33 +82,3 @@ freebsd_randconfig_template: &FREEBSD_RANDCONFIG_TEMPLATE
 
   build_script:
     - gmake -j`sysctl -n hw.ncpu` build-xen clang=y
-
-task:
-  name: 'FreeBSD 13: full build'
-  << : *FREEBSD_13
-  << : *FREEBSD_FULL_BUILD_TEMPLATE
-
-task:
-  name: 'FreeBSD 14: full build'
-  << : *FREEBSD_14
-  << : *FREEBSD_FULL_BUILD_TEMPLATE
-
-task:
-  name: 'FreeBSD 15: full build'
-  << : *FREEBSD_15
-  << : *FREEBSD_FULL_BUILD_TEMPLATE
-
-task:
-  name: 'FreeBSD 13: randconfig'
-  << : *FREEBSD_13
-  << : *FREEBSD_RANDCONFIG_TEMPLATE
-
-task:
-  name: 'FreeBSD 14: randconfig'
-  << : *FREEBSD_14
-  << : *FREEBSD_RANDCONFIG_TEMPLATE
-
-task:
-  name: 'FreeBSD 15: randconfig'
-  << : *FREEBSD_15
-  << : *FREEBSD_RANDCONFIG_TEMPLATE
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 12:12:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 12:12:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938182.1339059 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0fu9-0007f4-O8; Fri, 04 Apr 2025 12:12:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938182.1339059; Fri, 04 Apr 2025 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 1u0fu9-0007ew-LM; Fri, 04 Apr 2025 12:12:13 +0000
Received: by outflank-mailman (input) for mailman id 938182;
 Fri, 04 Apr 2025 12: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 1u0fu8-0007ei-Gn
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 12: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 1u0fu8-00Bf0c-1a
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:12:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0fu8-00Bfny-1U
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 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=A94dmiVW/wAH1WBNEbT9hFzCl4+pYspOc0TsYHq9foA=; b=wwAH8xFFn/jDuhRWqytrmqeJFq
	Kqjf0Fz3kQfWW8YKeROfacCPtdwwcExH7Hz7VsdSGWFHsLT0iLIwG1bNkJMi//aDna1cJwlSezhET
	sabfksWmCMzEJjryuGSIcp62oIV0xlbL88yT979vXQ2lZJJE1utGVpL++JXaKMA6GdRM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] automation/cirrus-ci: build XTF
Message-Id: <E1u0fu8-00Bfny-1U@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 12:12:12 +0000

commit e6816c375825cae788efd71c0467c847ad3bf425
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Mar 14 12:16:19 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:32:29 2025 +0100

    automation/cirrus-ci: build XTF
    
    In preparation for using the XTF selftests to smoke test the FreeBSD based
    Xen builds.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit a92c0a9888f14baf8e66a16e960bc524cc8194e6)
---
 .cirrus.yml | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/.cirrus.yml b/.cirrus.yml
index 95d2d2d3db..a6e4a5d030 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -12,6 +12,12 @@ freebsd_template: &FREEBSD_ENV
     CIRRUS_CLONE_DEPTH: 1
     CIRRUS_LOG_TIMESTAMP: true
 
+freebsd_template_latest: &FREEBSD_ENV_PRODUCTION
+  << : *FREEBSD_VERSIONS
+  freebsd_instance:
+    image_family: $FREEBSD_PRODUCTION
+  << : *FREEBSD_ENV
+
 freebsd_configure_artifacts: &FREEBSD_CONFIGURE_ARTIFACTS
   always:
     rename_script:
@@ -82,3 +88,21 @@ task:
 
   build_script:
     - gmake -j`sysctl -n hw.ncpu` build-xen clang=y
+
+task:
+  name: 'FreeBSD: XTF build'
+  alias: xtf
+
+  << : *FREEBSD_ENV_PRODUCTION
+
+  clone_script:
+    - pkg install -y git
+    - git clone --depth 1 https://xenbits.xen.org/git-http/xtf.git
+
+  install_script: pkg install -y gmake
+
+  build_script:
+    - cd xtf
+    - cc --version
+    - git rev-parse HEAD
+    - gmake -j`sysctl -n hw.ncpu` LLVM=y
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 12:12:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 12:12:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938183.1339064 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0fuJ-0007i2-R2; Fri, 04 Apr 2025 12:12:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938183.1339064; Fri, 04 Apr 2025 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 1u0fuJ-0007hu-O2; Fri, 04 Apr 2025 12:12:23 +0000
Received: by outflank-mailman (input) for mailman id 938183;
 Fri, 04 Apr 2025 12: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 1u0fuI-0007hf-Je
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 12: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 1u0fuI-00Bf0t-1r
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:12:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0fuI-00Bfoz-1k
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12: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=lJHNz/WnpIF8SsXvI/5x5QhXeGe/zZVCbrH9f9Lp3lg=; b=2TRu/AokrjrBy4mZPIUogcDJo8
	S+ru/A3TsLfu2mJgC6xeDOn37Z/TDA1NKvltS3IkOPfYfE3887XJmsXBDmF7/7QJ72ox3dUDeRLz7
	inZgd9vrwY3l/nb+K5y2KDWXLp4qzq/wcj7/4kBeAs/wGe0Hdhd2PZtOvwqQC+DrWHaE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] automation/cirrus-ci: store XTF and Xen build artifacts
Message-Id: <E1u0fuI-00Bfoz-1k@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 12:12:22 +0000

commit fdbb32a9a90491c768d6fb26c24c9877d533bf19
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Mar 14 13:01:36 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:32:29 2025 +0100

    automation/cirrus-ci: store XTF and Xen build artifacts
    
    In preparation for adding some smoke tests that will consume those outputs.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit c9de0e2ce41700132ffb9f25930fcca9da5e78af)
---
 .cirrus.yml | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/.cirrus.yml b/.cirrus.yml
index a6e4a5d030..38b654f75c 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -61,6 +61,14 @@ task:
   build_script:
     - gmake -j`sysctl -n hw.ncpu` clang=y
 
+  xen_artifacts:
+    path: xen/xen
+    type: application/octet-stream
+
+  debug_artifacts:
+    path: xen/xen-syms
+    type: application/octet-stream
+
 task:
   name: 'FreeBSD: randconfig build'
 
@@ -106,3 +114,7 @@ task:
     - cc --version
     - git rev-parse HEAD
     - gmake -j`sysctl -n hw.ncpu` LLVM=y
+
+  xtf_artifacts:
+    path: xtf/tests/selftest/test-*-selftest
+    type: application/octet-stream
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 12:12:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 12:12:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938184.1339068 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0fuT-0007kJ-SS; Fri, 04 Apr 2025 12:12:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938184.1339068; Fri, 04 Apr 2025 12:12: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 1u0fuT-0007kB-PX; Fri, 04 Apr 2025 12:12:33 +0000
Received: by outflank-mailman (input) for mailman id 938184;
 Fri, 04 Apr 2025 12: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 1u0fuS-0007k5-Me
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 12: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 1u0fuS-00Bf1B-29
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:12:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0fuS-00Bfro-22
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12: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=eUuk/QNlh1OVWQMl07J7uDc1gUkjLgEKV++/WUamRkY=; b=GOPqXRcIqKYTp71j8Cd1B31A2D
	lxymmkVmIniP77h56/h8y4iWn6P9WGQit0Gs+zyOYKhkQdbeHgbMiPRfrTPuL1errK0BcIP86h7jG
	PCZcJ0HxfRy5Kpc6EsvI+g+bDH+CCmBMAh9K0/Td7Y6GMAE0slE++80/PnYFG33ES/lc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] automation/cirrus-ci: add smoke tests for the FreeBSD builds
Message-Id: <E1u0fuS-00Bfro-22@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 12:12:32 +0000

commit dd81219b841ba1552d217aecb013103afcad5e4f
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Mar 14 13:37:46 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:32:29 2025 +0100

    automation/cirrus-ci: add smoke tests for the FreeBSD builds
    
    Introduce a basic set of smoke tests using the XTF selftest image, and run
    them on QEMU.  Use the matrix keyword to create a different task for each
    XTF flavor on each FreeBSD build.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Oleksii Kurochko<oleksii.kurochko@gmail.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 7973cba4dbf72f6b963c780e9d1e0b99fd9622b9)
---
 .cirrus.yml | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/.cirrus.yml b/.cirrus.yml
index 38b654f75c..3163ab8f11 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -5,6 +5,8 @@ freebsd_versions: &FREEBSD_VERSIONS
     FREEBSD_PRODUCTION: freebsd-14-2
     FREEBSD_CURRENT:    freebsd-15-0-snap
 
+# Build jobs
+
 freebsd_template: &FREEBSD_ENV
   environment:
     APPEND_LIB: /usr/local/lib
@@ -118,3 +120,55 @@ task:
   xtf_artifacts:
     path: xtf/tests/selftest/test-*-selftest
     type: application/octet-stream
+
+# Test jobs
+
+task:
+  name: 'FreeBSD: XTF selftest'
+
+  << : *FREEBSD_ENV_PRODUCTION
+
+  env:
+    matrix:
+      FREEBSD_BUILD: $FREEBSD_LEGACY
+      FREEBSD_BUILD: $FREEBSD_PRODUCTION
+      FREEBSD_BUILD: $FREEBSD_CURRENT
+
+  depends_on:
+    - freebsd_full_$FREEBSD_BUILD
+    - xtf
+
+  install_script: pkg install -y qemu-nox11 expect
+
+  env:
+    matrix:
+      XTF_ARCH: hvm32
+      XTF_ARCH: hvm32pae
+      XTF_ARCH: hvm32pse
+      XTF_ARCH: hvm64
+      XTF_ARCH: pv64
+
+  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
+    - unzip xtf.zip
+    - unzip xen.zip
+
+  test_script: |
+    case "$XTF_ARCH" in \
+      *hvm*) \
+        XEN_EXTRA_CMD="dom0=pvh dom0-iommu=none" \
+        ;; \
+    esac
+    export TEST_CMD="qemu-system-x86_64 -kernel xen/xen -initrd xtf/tests/selftest/test-${XTF_ARCH}-selftest \
+                                        -append \"loglvl=all console=com1 noreboot console_timestamps=boot dom0=verbose ${XEN_EXTRA_CMD}\" \
+                                        -m 512 -nographic -monitor none -serial stdio"
+    export TEST_LOG="serial-${FREEBSD_BUILD}-${XTF_ARCH}.txt"
+    export PASSED="Test result: SUCCESS"
+    export TEST_TIMEOUT=120
+    ./automation/scripts/console.exp | sed 's/\r\+$//'
+
+  always:
+    serial_artifacts:
+      path: serial-*.txt
+      type: text/plain
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 12:12:43 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 12:12:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938185.1339072 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0fud-0007mp-Ti; Fri, 04 Apr 2025 12:12:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938185.1339072; Fri, 04 Apr 2025 12:12: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 1u0fud-0007mg-R1; Fri, 04 Apr 2025 12:12:43 +0000
Received: by outflank-mailman (input) for mailman id 938185;
 Fri, 04 Apr 2025 12:12: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 1u0fuc-0007mS-PD
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 12:12: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 1u0fuc-00Bf1O-2R
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:12:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0fuc-00Bfvg-2K
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:12: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=fmVjJR7jPA+kzKR4uuL3RBhSiZ7Mo5d+63HIVlUNCUU=; b=Rgg41DtoWoUizoBsOaE7kpO5MQ
	W9d0AZJanseLwenlZ43EzkiSdhM7sXdSv+n4ignj+XrhYLTZAITK8v0j+uGwqtbKs1mYQaWkwRBbZ
	9Y41sZgNjZbwZsHuCu7TpN5Q6yppN1Lx7gi4GCTE7dsHkM4VhrPn/MNPRCRLJhUwvYs8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] CI: Add yet another HW runner
Message-Id: <E1u0fuc-00Bfvg-2K@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 12:12:42 +0000

commit e071b233944deeea5ad695248cdf86cd188557a2
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Fri Mar 14 04:06:26 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:32:29 2025 +0100

    CI: Add yet another HW runner
    
    This is AMD Zen2 (Ryzen 5 4500U specifically), in a HP Probook 445 G7.
    
    This one has working S3, so add a test for it here.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit debe8bf537ec2c69a4734393cd2b0c7f57f74c0c)
---
 automation/gitlab-ci/test.yaml | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 1822e3ea5f..3e583a2d29 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -140,6 +140,17 @@
   tags:
     - qubes-hw2
 
+.zen2-x86-64:
+  # it's really similar to the above
+  extends: .adl-x86-64
+  variables:
+    PCIDEV: "01:00.0"
+    PCIDEV_INTR: "MSI-X"
+    CONSOLE_OPTS: "console=com1 com1=115200,8n1,pci,msi,04:00.0"
+    SUT_ADDR: test-1.testnet
+  tags:
+    - qubes-hw1
+
 .zen3p-x86-64:
   # it's really similar to the above
   extends: .adl-x86-64
@@ -263,6 +274,22 @@ adl-pvshim-x86-64-gcc-debug:
     - *x86-64-test-needs
     - alpine-3.18-gcc-debug
 
+zen2-smoke-x86-64-gcc-debug:
+  extends: .zen2-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
+zen2-suspend-x86-64-gcc-debug:
+  extends: .zen2-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh s3 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
 zen3p-smoke-x86-64-gcc-debug:
   extends: .zen3p-x86-64
   script:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 12:55:08 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 12:55:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938187.1339077 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0gZb-0000W8-Ps; Fri, 04 Apr 2025 12:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938187.1339077; Fri, 04 Apr 2025 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 1u0gZb-0000W1-MB; Fri, 04 Apr 2025 12:55:03 +0000
Received: by outflank-mailman (input) for mailman id 938187;
 Fri, 04 Apr 2025 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 1u0gZa-0000Vv-Su
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 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 1u0gZa-00BgSS-1r
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0gZa-00Blfe-1Z
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 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=LX5PML5S+xKeZ/62cq3lbs56sFN6hwsx+OZGgFpFmbs=; b=KBTyWPt8ZxMAX64BP/JOuratsk
	XHMGxZsrrWhV8jjbthN5d9K+rDIK5Om2xWH0mEiKgmET1gcrcls83WHkPH7u11JF7T3UVSM6jFADi
	BsCOsI519puTLgPCornfP7/Yf0ea6YuCx2Bj7yCI8Q+n/az8nVYqopM2W8KYqNrt/PZE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] CI: Update to FreeBSD 14.2
Message-Id: <E1u0gZa-00Blfe-1Z@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 12:55:02 +0000

commit 55b792fee261eb78184ef6d32d80bf1196e3fa80
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Dec 3 08:14:46 2024 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:33:55 2025 +0100

    CI: Update to FreeBSD 14.2
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 0cc8845fb9fd4300313da49374b6c12346889f9a)
---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 1c2a6cb812..7b0ca4800e 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -23,7 +23,7 @@ task:
 task:
   name: 'FreeBSD 14'
   freebsd_instance:
-    image_family: freebsd-14-1
+    image_family: freebsd-14-2
   << : *FREEBSD_TEMPLATE
 
 task:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 12:55:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 12:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938188.1339079 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0gZl-0000Y5-QL; Fri, 04 Apr 2025 12:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938188.1339079; Fri, 04 Apr 2025 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 1u0gZl-0000Xx-No; Fri, 04 Apr 2025 12:55:13 +0000
Received: by outflank-mailman (input) for mailman id 938188;
 Fri, 04 Apr 2025 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 1u0gZk-0000Xo-OV
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 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 1u0gZk-00BgSd-2L
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0gZk-00Blgo-21
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 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=IgnzQgLGW12q2rL4ta4iIskytReAKyW6R8qAFDvcLvo=; b=OFM4x9qoPXa1aiD4v904bwuv2S
	3jcdwD9/19+PINJJh/+weGOEIwq+8sQF+fGzhNgj2Xi6Hfk6SCftidSzz5F6Oe2uIZxVWSTfIjQRQ
	cvd8RB9r6NL0jiwmDFUnN0yI/IRKU3CVZdebFzsboIuK99+yqqgTKtRv7iTEmzTOP1A4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] automation/cirrus-ci: update FreeBSD to 13.4
Message-Id: <E1u0gZk-00Blgo-21@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 12:55:12 +0000

commit 376e63e98994f162915c8ab0104100f869d75bf3
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Jan 16 09:07:31 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:33:55 2025 +0100

    automation/cirrus-ci: update FreeBSD to 13.4
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 850a263b7863ae9c22296a357a50573d5e6ae9d7)
---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 7b0ca4800e..3d7a3e3d80 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -17,7 +17,7 @@ freebsd_template: &FREEBSD_TEMPLATE
 task:
   name: 'FreeBSD 13'
   freebsd_instance:
-    image_family: freebsd-13-3
+    image_family: freebsd-13-4
   << : *FREEBSD_TEMPLATE
 
 task:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 12:55:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 12:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938189.1339084 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0gZv-0000aV-Rv; Fri, 04 Apr 2025 12:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938189.1339084; Fri, 04 Apr 2025 12: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 1u0gZv-0000aN-PD; Fri, 04 Apr 2025 12:55:23 +0000
Received: by outflank-mailman (input) for mailman id 938189;
 Fri, 04 Apr 2025 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 1u0gZu-0000aE-Rt
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 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 1u0gZu-00BgSq-2g
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0gZu-00Blho-2V
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 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=d167i9QmQ1UqG0YevhI7UXCN2oTZ9why0/FkImj3Hsc=; b=3FBF32CU64tA4Qmtm91AAehS+Q
	e9I2AoJAqjHhc2PeRPDHYynzrd+6d41oaqhdaQWNIHiO6wp18UX6xWoQFm1UCPSj+GAv28LEUkWC4
	VNN8BdIndxs7MNXG9KBNIfYs9Lgb6HxwfA++tMnu7omW9ermwV+ucsKWEH/n2NK7ZCWs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] automation/cirrus-ci: introduce FreeBSD randconfig builds
Message-Id: <E1u0gZu-00Blho-2V@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 12:55:22 +0000

commit e4e6e823874f65c0bb436a2d72fe68a957447537
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Jan 16 09:06:26 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:33:55 2025 +0100

    automation/cirrus-ci: introduce FreeBSD randconfig builds
    
    Add a new randconfig job for each FreeBSD version.  This requires some
    rework of the template so common parts can be shared between the full and
    the randconfig builds.  Such randconfig builds are relevant because FreeBSD
    is the only tested system that has a full non-GNU toolchain.
    
    While there replace the usage of the python311 package with python3, which is
    already using 3.11, and remove the install of the plain python package for full
    builds.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit c3f5d1bb40b57d467cb4051eafa86f5933ec9003)
---
 .cirrus.yml | 66 +++++++++++++++++++++++++++++++++++++++++++++++--------------
 1 file changed, 51 insertions(+), 15 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 3d7a3e3d80..7216729b69 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -1,33 +1,69 @@
 # https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
-freebsd_template: &FREEBSD_TEMPLATE
+freebsd_13: &FREEBSD_13
+  freebsd_instance:
+    image_family: freebsd-13-4
+freebsd_14: &FREEBSD_14
+  freebsd_instance:
+    image_family: freebsd-14-2
+freebsd_15: &FREEBSD_15
+  freebsd_instance:
+    image_family: freebsd-15-0-snap
+
+freebsd_template: &FREEBSD_ENV
   environment:
     APPEND_LIB: /usr/local/lib
     APPEND_INCLUDES: /usr/local/include
 
+freebsd_full_build_template: &FREEBSD_FULL_BUILD_TEMPLATE
+  << : *FREEBSD_ENV
+
   install_script: pkg install -y seabios gmake ninja bash
-                                 pkgconf python bison perl5
+                                 pkgconf bison perl5
                                  yajl lzo2 pixman argp-standalone
-                                 libxml2 glib git
+                                 libxml2 glib git python3
 
   build_script:
     - cc --version
     - ./configure --with-system-seabios=/usr/local/share/seabios/bios.bin
     - gmake -j`sysctl -n hw.ncpu` clang=y
 
+freebsd_randconfig_template: &FREEBSD_RANDCONFIG_TEMPLATE
+  << : *FREEBSD_ENV
+
+  install_script: pkg install -y gmake python3 bison
+
+  build_script:
+    - cc --version
+    - gmake -j`sysctl -n hw.ncpu` -C xen clang=y \
+            KCONFIG_ALLCONFIG=tools/kconfig/allrandom.config randconfig
+    - gmake -j`sysctl -n hw.ncpu` build-xen clang=y
+
 task:
-  name: 'FreeBSD 13'
-  freebsd_instance:
-    image_family: freebsd-13-4
-  << : *FREEBSD_TEMPLATE
+  name: 'FreeBSD 13: full build'
+  << : *FREEBSD_13
+  << : *FREEBSD_FULL_BUILD_TEMPLATE
 
 task:
-  name: 'FreeBSD 14'
-  freebsd_instance:
-    image_family: freebsd-14-2
-  << : *FREEBSD_TEMPLATE
+  name: 'FreeBSD 14: full build'
+  << : *FREEBSD_14
+  << : *FREEBSD_FULL_BUILD_TEMPLATE
 
 task:
-  name: 'FreeBSD 15'
-  freebsd_instance:
-    image_family: freebsd-15-0-snap
-  << : *FREEBSD_TEMPLATE
+  name: 'FreeBSD 15: full build'
+  << : *FREEBSD_15
+  << : *FREEBSD_FULL_BUILD_TEMPLATE
+
+task:
+  name: 'FreeBSD 13: randconfig'
+  << : *FREEBSD_13
+  << : *FREEBSD_RANDCONFIG_TEMPLATE
+
+task:
+  name: 'FreeBSD 14: randconfig'
+  << : *FREEBSD_14
+  << : *FREEBSD_RANDCONFIG_TEMPLATE
+
+task:
+  name: 'FreeBSD 15: randconfig'
+  << : *FREEBSD_15
+  << : *FREEBSD_RANDCONFIG_TEMPLATE
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 12:55:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 12:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938190.1339088 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0ga5-0000d8-TK; Fri, 04 Apr 2025 12:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938190.1339088; Fri, 04 Apr 2025 12: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 1u0ga5-0000d1-Qd; Fri, 04 Apr 2025 12:55:33 +0000
Received: by outflank-mailman (input) for mailman id 938190;
 Fri, 04 Apr 2025 12:55:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u0ga4-0000cj-V8
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 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 1u0ga4-00BgT1-30
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0ga4-00BlkL-2r
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 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=93SVf5QgPzPLsBLzt9KIUjHxS2lGlATfqTh3OtnotC0=; b=J7QOAPDaX1Pu+opcBUniGiaY8I
	Dj3whzAxrSpABMPIGemJ15JkqF7kjGtRgdPidqh0gR1DhhnEKM8AdSZ0gXJ4yb+t2OAd71Jtu1+rd
	CNLIr1tufhxBAzLgOC1X2CxUifXLmKqzltEiGFvy5Xb1fgInPTHD6OPrTYtXBm+m2Pgo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] CirrusCI: Use shallow clone
Message-Id: <E1u0ga4-00BlkL-2r@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 12:55:32 +0000

commit 65bdce95f69d06221fca6e2f88f4efb32393fdfc
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Feb 24 15:36:11 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:33:55 2025 +0100

    CirrusCI: Use shallow clone
    
    This reduces the Clone step from ~50s to ~3s.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 96970b46e5e84fa2666f76f5b0972b826a3ffba4)
---
 .cirrus.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.cirrus.yml b/.cirrus.yml
index 7216729b69..e2949d99d7 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -13,6 +13,7 @@ freebsd_template: &FREEBSD_ENV
   environment:
     APPEND_LIB: /usr/local/lib
     APPEND_INCLUDES: /usr/local/include
+    CIRRUS_CLONE_DEPTH: 1
 
 freebsd_full_build_template: &FREEBSD_FULL_BUILD_TEMPLATE
   << : *FREEBSD_ENV
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 12:55:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 12:55:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938191.1339092 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0gaF-0000fg-VP; Fri, 04 Apr 2025 12:55:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938191.1339092; Fri, 04 Apr 2025 12:55:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0gaF-0000fY-SO; Fri, 04 Apr 2025 12:55:43 +0000
Received: by outflank-mailman (input) for mailman id 938191;
 Fri, 04 Apr 2025 12:55:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u0gaF-0000fS-1i
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 12:55:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0gaF-00BgTB-04
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:55:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0gaE-00BloQ-3B
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12: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=cOO1g9Aw2KUjPZ/QRx1A8ae2LVbvwdDEYNiSvmpFJmY=; b=pjHpWqxII06Eon97cHU9bSOvwh
	8RhIIMli/z5HVCiavHVn2APFbolUztUCIHmtgGajX8MuPb1s6lhtd37x1By7VKpHN5e5gE5ZNdzLL
	xxRgJ/4PSJHWEp/IHPyHA3odPI/8E7pOZ/1EwsBvA5piFVuRoMRo4tv/9ZwJyww7qQ0w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] automation/cirrus-ci: store xen/.config as an artifact
Message-Id: <E1u0gaE-00BloQ-3B@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 12:55:42 +0000

commit 37385333652969838f11ac7836919fafa59c8eb4
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Mar 10 18:41:57 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:33:55 2025 +0100

    automation/cirrus-ci: store xen/.config as an artifact
    
    Always store xen/.config as an artifact, renamed to xen-config to match
    the naming used in the Gitlab CI tests.
    
    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>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 318659c818546b6415c2311339a53384dc20c427)
---
 .cirrus.yml | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/.cirrus.yml b/.cirrus.yml
index e2949d99d7..1a39f5026f 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -15,6 +15,14 @@ freebsd_template: &FREEBSD_ENV
     APPEND_INCLUDES: /usr/local/include
     CIRRUS_CLONE_DEPTH: 1
 
+freebsd_artifacts: &FREEBSD_ARTIFACTS
+  always:
+    rename_script:
+      - cp xen/.config xen-config
+    config_artifacts:
+      path: xen-config
+      type: text/plain
+
 freebsd_full_build_template: &FREEBSD_FULL_BUILD_TEMPLATE
   << : *FREEBSD_ENV
 
@@ -28,6 +36,8 @@ freebsd_full_build_template: &FREEBSD_FULL_BUILD_TEMPLATE
     - ./configure --with-system-seabios=/usr/local/share/seabios/bios.bin
     - gmake -j`sysctl -n hw.ncpu` clang=y
 
+  << : *FREEBSD_ARTIFACTS
+
 freebsd_randconfig_template: &FREEBSD_RANDCONFIG_TEMPLATE
   << : *FREEBSD_ENV
 
@@ -39,6 +49,8 @@ freebsd_randconfig_template: &FREEBSD_RANDCONFIG_TEMPLATE
             KCONFIG_ALLCONFIG=tools/kconfig/allrandom.config randconfig
     - gmake -j`sysctl -n hw.ncpu` build-xen clang=y
 
+  << : *FREEBSD_ARTIFACTS
+
 task:
   name: 'FreeBSD 13: full build'
   << : *FREEBSD_13
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 12:55:54 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 12:55:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938192.1339096 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0gaQ-0000iD-2L; Fri, 04 Apr 2025 12:55:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938192.1339096; Fri, 04 Apr 2025 12: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 1u0gaP-0000i5-Vk; Fri, 04 Apr 2025 12:55:53 +0000
Received: by outflank-mailman (input) for mailman id 938192;
 Fri, 04 Apr 2025 12:55:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u0gaP-0000hz-5C
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 12:55: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 1u0gaP-00BgTN-0R
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:55:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0gaP-00Blqh-0G
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:55: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=5z9nqEyEf56iA26MAMCL/SHE+kkYKfTc4cIPk68aEpY=; b=04bWgq0DCFT3RrLhY4GqtmWPIi
	tfNwtRUUzUVp4bYeKMGbVW7YY1IfZXf/ak/Cc3A6NNXwZ7qwhCPgpofOB0xPwHp1QHIfCY6h8/3SF
	+N5ScawMgjdrjmD9hhVaCK+R3HfhmdSdynNL+0TpTeGrLgVZ13afN/F66jTZQ+wC+9QA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] automation/cirrus-ci: add timestamps
Message-Id: <E1u0gaP-00Blqh-0G@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 12:55:53 +0000

commit 57c100140c13190b25c8b311c50a7609b4f4da1b
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Mar 14 11:44:45 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:33:55 2025 +0100

    automation/cirrus-ci: add timestamps
    
    Such timestamps can still be disabled from the Web UI using a tick box.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 1256159f3cfcfef475b94dda39f68a85702bba64)
---
 .cirrus.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.cirrus.yml b/.cirrus.yml
index 1a39f5026f..aa195ba370 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -14,6 +14,7 @@ freebsd_template: &FREEBSD_ENV
     APPEND_LIB: /usr/local/lib
     APPEND_INCLUDES: /usr/local/include
     CIRRUS_CLONE_DEPTH: 1
+    CIRRUS_LOG_TIMESTAMP: true
 
 freebsd_artifacts: &FREEBSD_ARTIFACTS
   always:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 12:56:04 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 12:56:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938193.1339099 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0gaa-0000kq-3V; Fri, 04 Apr 2025 12:56:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938193.1339099; Fri, 04 Apr 2025 12: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 1u0gaa-0000ki-0v; Fri, 04 Apr 2025 12:56:04 +0000
Received: by outflank-mailman (input) for mailman id 938193;
 Fri, 04 Apr 2025 12:56:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u0gaZ-0000kc-8e
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 12:56:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0gaZ-00BgUa-0l
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:56:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0gaZ-00BlsN-0c
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:56:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3b1lDfvK9h8ay0+gOqDgcmwXTOTf14Fk4gSV3HtyE2s=; b=7DCEG0fxPWe+eGeDF0JVRaTSuJ
	OfvfeNBuvzLr985Rv9ApV7BC0jIxzQH3msAxf5UI3PipmJ2Cphih6cIJtCuaxK9ti5gpRQ/FcuzHX
	LCfvHD/CJzTsMBXSfjoYJqj94ky2eoc97ygntHMyAQqBkPt2YOp5Y8vu5xF6ocOwrgFc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] automation/cirrus-ci: update FreeBSD to 13.5
Message-Id: <E1u0gaZ-00BlsN-0c@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 12:56:03 +0000

commit 606a0cb0d1f4a61d0764ad9995f819aa11b1c97c
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Mar 14 11:49:28 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:33:55 2025 +0100

    automation/cirrus-ci: update FreeBSD to 13.5
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 5395cd7b892daf11cd80e4eec0cfa45c4b319d35)
---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index aa195ba370..ce7588b7b6 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -1,7 +1,7 @@
 # https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
 freebsd_13: &FREEBSD_13
   freebsd_instance:
-    image_family: freebsd-13-4
+    image_family: freebsd-13-5
 freebsd_14: &FREEBSD_14
   freebsd_instance:
     image_family: freebsd-14-2
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 12:56:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 12:56:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938194.1339104 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0gak-0000nt-5R; Fri, 04 Apr 2025 12:56:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938194.1339104; Fri, 04 Apr 2025 12: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 1u0gak-0000nl-2L; Fri, 04 Apr 2025 12:56:14 +0000
Received: by outflank-mailman (input) for mailman id 938194;
 Fri, 04 Apr 2025 12:56:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u0gaj-0000nf-Bj
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 12:56:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0gaj-00BgUp-14
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:56:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0gaj-00Blwt-0x
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:56:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=y/b+MpWwM+77ueCyKZnsFDpT/7MSerXEBlr/hif86Qw=; b=lIAlFguSluPWZsm9O1xqM3tQgU
	8Cx3Nyt8MiAd/4XCbd+2AkbD5kPX6eDxKHfAVoaRG9XCI952Z19APSXbEMNJ9HjjNP1Oh5nfLh7Ix
	uedy1MMelcvo6HEPISObINh/lUkyJh+B1xnbXIY5wNEZyYzhFicIxK25PemuyoDmRc2Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] automation/cirrus-ci: store Xen Kconfig before doing a build
Message-Id: <E1u0gaj-00Blwt-0x@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 12:56:13 +0000

commit 8edc2ad0596a22ecf5ec7732d7b6baea66603adb
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Mar 14 11:55:48 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:33:55 2025 +0100

    automation/cirrus-ci: store Xen Kconfig before doing a build
    
    In case the build fails or gets stuck, store the Kconfig file ahead of
    starting the build.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 421c2bd58f35ede865fa81c82957ca5297e903a4)
---
 .cirrus.yml | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index ce7588b7b6..490f214f04 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -16,7 +16,7 @@ freebsd_template: &FREEBSD_ENV
     CIRRUS_CLONE_DEPTH: 1
     CIRRUS_LOG_TIMESTAMP: true
 
-freebsd_artifacts: &FREEBSD_ARTIFACTS
+freebsd_configure_artifacts: &FREEBSD_CONFIGURE_ARTIFACTS
   always:
     rename_script:
       - cp xen/.config xen-config
@@ -32,25 +32,30 @@ freebsd_full_build_template: &FREEBSD_FULL_BUILD_TEMPLATE
                                  yajl lzo2 pixman argp-standalone
                                  libxml2 glib git python3
 
-  build_script:
+  configure_script:
     - cc --version
     - ./configure --with-system-seabios=/usr/local/share/seabios/bios.bin
-    - gmake -j`sysctl -n hw.ncpu` clang=y
+    - gmake -j`sysctl -n hw.ncpu` -C xen clang=y defconfig
+
+  << : *FREEBSD_CONFIGURE_ARTIFACTS
 
-  << : *FREEBSD_ARTIFACTS
+  build_script:
+    - gmake -j`sysctl -n hw.ncpu` clang=y
 
 freebsd_randconfig_template: &FREEBSD_RANDCONFIG_TEMPLATE
   << : *FREEBSD_ENV
 
   install_script: pkg install -y gmake python3 bison
 
-  build_script:
+  configure_script:
     - cc --version
     - gmake -j`sysctl -n hw.ncpu` -C xen clang=y \
             KCONFIG_ALLCONFIG=tools/kconfig/allrandom.config randconfig
-    - gmake -j`sysctl -n hw.ncpu` build-xen clang=y
 
-  << : *FREEBSD_ARTIFACTS
+  << : *FREEBSD_CONFIGURE_ARTIFACTS
+
+  build_script:
+    - gmake -j`sysctl -n hw.ncpu` build-xen clang=y
 
 task:
   name: 'FreeBSD 13: full build'
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 12:56:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 12:56:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938195.1339108 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0gau-0000qR-6W; Fri, 04 Apr 2025 12:56:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938195.1339108; Fri, 04 Apr 2025 12: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 1u0gau-0000qK-3m; Fri, 04 Apr 2025 12:56:24 +0000
Received: by outflank-mailman (input) for mailman id 938195;
 Fri, 04 Apr 2025 12: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 1u0gat-0000qC-Ea
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 12:56:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0gat-00BgXw-1M
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:56:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0gat-00Bly2-1E
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:56:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pS+2px7IkRTFCS6YKj35kkPrp2e0w7iDeza1piB69zE=; b=ZFuQdXC9FkV/n44QretwTBYi2M
	V9Ne9BgjnuPuiAlYpuVbz0XAr4CHVChQgLGsOwCpJn3PZ/julr2s4tIPOB+zIM2xbDol/BQ2Z+VB9
	214ZF6glYuoRSpwGOpwdCslK1VZXfzHlPzrVC+9e7IuGoxcp2GOMA035XmYIR5qBxv5E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] automation/console.exp: do not assume expect is always at /usr/bin/
Message-Id: <E1u0gat-00Bly2-1E@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 12:56:23 +0000

commit bbca8438629519497bacc7297cf52e67bb114748
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Mar 17 10:31:07 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:33:55 2025 +0100

    automation/console.exp: do not assume expect is always at /usr/bin/
    
    Instead use env to find the location of expect.
    
    Additionally do not use the -f flag, as it's only meaningful when passing
    arguments on the command line, which we never do for console.exp.  From the
    expect 5.45.4 man page:
    
    > The -f flag prefaces a file from which to read commands from.  The flag
    > itself is optional as it is only useful when using the #! notation (see
    > above), so  that other arguments may be supplied on the command line.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/scripts/console.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/automation/scripts/console.exp b/automation/scripts/console.exp
index 310543c33e..31ce97b91b 100755
--- a/automation/scripts/console.exp
+++ b/automation/scripts/console.exp
@@ -1,4 +1,4 @@
-#!/usr/bin/expect -f
+#!/usr/bin/env expect
 
 if {[info exists env(TEST_TIMEOUT_OVERRIDE)]} {
     set timeout $env(TEST_TIMEOUT_OVERRIDE)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 12:56:35 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 12:56:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938196.1339112 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0gb5-0000sx-85; Fri, 04 Apr 2025 12:56:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938196.1339112; Fri, 04 Apr 2025 12:56:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0gb5-0000sq-5a; Fri, 04 Apr 2025 12:56:35 +0000
Received: by outflank-mailman (input) for mailman id 938196;
 Fri, 04 Apr 2025 12: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 1u0gb3-0000sc-HU
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 12: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 1u0gb3-00BgZA-1e
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:56:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0gb3-00Blz2-1X
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:56:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kBNXFrb40d+juBeuQxCrUGvxfKTcU47+FwRLsXrdRQU=; b=SIG9gpUT+GoFABxsS4uVupaPJA
	aK2/VBsavAybej0gHtHVCSAjp3f7RjFSy0A6rh/p3NVLDxqe0PCXrKVXXra3CIFetYDvWhlQrXb9p
	9PkEO3FeqC+BIksiDS5nL4/NudgVa0jDX5/CKpQtULjPhnIzNrNIcWYXYht1Zd0Uz7tU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] automation/cirrus-ci: use matrix keyword to generate per-version build tasks
Message-Id: <E1u0gb3-00Blz2-1X@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 12:56:33 +0000

commit 823ce77d851bbfba698ce408dac25830f8e5632d
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Sat Mar 15 09:35:12 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:33:55 2025 +0100

    automation/cirrus-ci: use matrix keyword to generate per-version build tasks
    
    Move the current logic to use the matrix keyword to generate a task for
    each version of FreeBSD we want to build Xen on.  The matrix keyword
    however cannot be used in YAML aliases, so it needs to be explicitly used
    inside of each task, which creates a bit of duplication.  At least abstract
    the FreeBSD minor version numbers to avoid repetition of image names.
    
    Note that the full build uses matrix over an env variable instead of using
    it directly in image_family.  This is so that the alias can also be set
    based on the FreeBSD version, in preparation for adding further tasks that
    will depend on the full build having finished.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit b548a7dc4bb4202410983dd3ef7b5f1b469bdac3)
---
 .cirrus.yml | 78 +++++++++++++++++++++++++++++--------------------------------
 1 file changed, 37 insertions(+), 41 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 490f214f04..95d2d2d3db 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -1,13 +1,9 @@
 # https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
-freebsd_13: &FREEBSD_13
-  freebsd_instance:
-    image_family: freebsd-13-5
-freebsd_14: &FREEBSD_14
-  freebsd_instance:
-    image_family: freebsd-14-2
-freebsd_15: &FREEBSD_15
-  freebsd_instance:
-    image_family: freebsd-15-0-snap
+freebsd_versions: &FREEBSD_VERSIONS
+  env:
+    FREEBSD_LEGACY:     freebsd-13-5
+    FREEBSD_PRODUCTION: freebsd-14-2
+    FREEBSD_CURRENT:    freebsd-15-0-snap
 
 freebsd_template: &FREEBSD_ENV
   environment:
@@ -24,7 +20,24 @@ freebsd_configure_artifacts: &FREEBSD_CONFIGURE_ARTIFACTS
       path: xen-config
       type: text/plain
 
-freebsd_full_build_template: &FREEBSD_FULL_BUILD_TEMPLATE
+task:
+  name: 'FreeBSD: full build'
+
+  # It's not possible to use the matrix keyword in YAML aliases, as they
+  # keyword usage is restricted to task, docker_builder or pipe.  Attempting to
+  # use a YAML alias with the duplicated keys doesn't work either. Use an env
+  # variable so the version can also be appended to the task alias.
+  << : *FREEBSD_VERSIONS
+  env:
+    matrix:
+      FREEBSD_VERSION: $FREEBSD_LEGACY
+      FREEBSD_VERSION: $FREEBSD_PRODUCTION
+      FREEBSD_VERSION: $FREEBSD_CURRENT
+
+  alias: freebsd_full_$FREEBSD_VERSION
+  freebsd_instance:
+    image_family: $FREEBSD_VERSION
+
   << : *FREEBSD_ENV
 
   install_script: pkg install -y seabios gmake ninja bash
@@ -42,7 +55,20 @@ freebsd_full_build_template: &FREEBSD_FULL_BUILD_TEMPLATE
   build_script:
     - gmake -j`sysctl -n hw.ncpu` clang=y
 
-freebsd_randconfig_template: &FREEBSD_RANDCONFIG_TEMPLATE
+task:
+  name: 'FreeBSD: randconfig build'
+
+  # It's not possible to use the matrix keyword in YAML aliases, as they
+  # keyword usage is restricted to task, docker_builder or pipe.  Attempting to
+  # use a YAML alias with the duplicated `image_family` keys doesn't work
+  # either. Abstract the version numbers at least.
+  << : *FREEBSD_VERSIONS
+  freebsd_instance:
+    matrix:
+      image_family: $FREEBSD_LEGACY
+      image_family: $FREEBSD_PRODUCTION
+      image_family: $FREEBSD_CURRENT
+
   << : *FREEBSD_ENV
 
   install_script: pkg install -y gmake python3 bison
@@ -56,33 +82,3 @@ freebsd_randconfig_template: &FREEBSD_RANDCONFIG_TEMPLATE
 
   build_script:
     - gmake -j`sysctl -n hw.ncpu` build-xen clang=y
-
-task:
-  name: 'FreeBSD 13: full build'
-  << : *FREEBSD_13
-  << : *FREEBSD_FULL_BUILD_TEMPLATE
-
-task:
-  name: 'FreeBSD 14: full build'
-  << : *FREEBSD_14
-  << : *FREEBSD_FULL_BUILD_TEMPLATE
-
-task:
-  name: 'FreeBSD 15: full build'
-  << : *FREEBSD_15
-  << : *FREEBSD_FULL_BUILD_TEMPLATE
-
-task:
-  name: 'FreeBSD 13: randconfig'
-  << : *FREEBSD_13
-  << : *FREEBSD_RANDCONFIG_TEMPLATE
-
-task:
-  name: 'FreeBSD 14: randconfig'
-  << : *FREEBSD_14
-  << : *FREEBSD_RANDCONFIG_TEMPLATE
-
-task:
-  name: 'FreeBSD 15: randconfig'
-  << : *FREEBSD_15
-  << : *FREEBSD_RANDCONFIG_TEMPLATE
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 12:56:45 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 12:56:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938197.1339115 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0gbF-0000vI-9i; Fri, 04 Apr 2025 12:56:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938197.1339115; Fri, 04 Apr 2025 12:56: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 1u0gbF-0000vA-76; Fri, 04 Apr 2025 12:56:45 +0000
Received: by outflank-mailman (input) for mailman id 938197;
 Fri, 04 Apr 2025 12:56:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u0gbD-0000ux-KN
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 12:56:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0gbD-00BgZP-1x
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:56:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0gbD-00Bm07-1p
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:56:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=98ckqe5VESs5aJuZM/6FfspOnkK1xtrxbgtpdqQXUW0=; b=fw3VGzALKTrM7o0njpDl2frMzL
	5HndL/e3QGqRDWgjh8Z1/zlAoOFw0NuvL/zpYJmrgo6uVbMoF6bg62KPDlE5NOTmhNt70Csqm+14q
	wn4xBCwWbw4QcHlwnGk4HhMpkR3mBXPeFStXu7LeKWfKPDrh5F/IZUr3dGANBESGkt9U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] automation/cirrus-ci: build XTF
Message-Id: <E1u0gbD-00Bm07-1p@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 12:56:43 +0000

commit c21d18664f90111dcbb3734843ab395b215b402c
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Mar 14 12:16:19 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:33:55 2025 +0100

    automation/cirrus-ci: build XTF
    
    In preparation for using the XTF selftests to smoke test the FreeBSD based
    Xen builds.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit a92c0a9888f14baf8e66a16e960bc524cc8194e6)
---
 .cirrus.yml | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/.cirrus.yml b/.cirrus.yml
index 95d2d2d3db..a6e4a5d030 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -12,6 +12,12 @@ freebsd_template: &FREEBSD_ENV
     CIRRUS_CLONE_DEPTH: 1
     CIRRUS_LOG_TIMESTAMP: true
 
+freebsd_template_latest: &FREEBSD_ENV_PRODUCTION
+  << : *FREEBSD_VERSIONS
+  freebsd_instance:
+    image_family: $FREEBSD_PRODUCTION
+  << : *FREEBSD_ENV
+
 freebsd_configure_artifacts: &FREEBSD_CONFIGURE_ARTIFACTS
   always:
     rename_script:
@@ -82,3 +88,21 @@ task:
 
   build_script:
     - gmake -j`sysctl -n hw.ncpu` build-xen clang=y
+
+task:
+  name: 'FreeBSD: XTF build'
+  alias: xtf
+
+  << : *FREEBSD_ENV_PRODUCTION
+
+  clone_script:
+    - pkg install -y git
+    - git clone --depth 1 https://xenbits.xen.org/git-http/xtf.git
+
+  install_script: pkg install -y gmake
+
+  build_script:
+    - cd xtf
+    - cc --version
+    - git rev-parse HEAD
+    - gmake -j`sysctl -n hw.ncpu` LLVM=y
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 12:56:55 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 12:56:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938198.1339120 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0gbP-0000xj-BJ; Fri, 04 Apr 2025 12:56:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938198.1339120; Fri, 04 Apr 2025 12:56: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 1u0gbP-0000xb-8Z; Fri, 04 Apr 2025 12:56:55 +0000
Received: by outflank-mailman (input) for mailman id 938198;
 Fri, 04 Apr 2025 12:56: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 1u0gbN-0000xK-Mv
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 12:56: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 1u0gbN-00BgZb-2D
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:56:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0gbN-00Bm2s-27
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:56: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=fX6FChM+3s53e4DcR46oNGWDHYocp44mL0HDRjZ8BSA=; b=L43GCddfgHwRAIkhVR0sNZ5cDy
	BOffaVJzCbvQo0IFsVXvCqW53VOUXNbtRl7kOESnHQDt9wyqVoqWuj6NfDrJcz3QbPuo8pjSOzAaZ
	+VutRruvurczx49H193dKfxcwtfAzMN7MjdtX6Yj+78Tb9BToiqo74OLGY37EW0B33SI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] automation/cirrus-ci: store XTF and Xen build artifacts
Message-Id: <E1u0gbN-00Bm2s-27@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 12:56:53 +0000

commit 4ac2ede7be75b5bb8f0154d2f5bdefefa5ce7e3c
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Mar 14 13:01:36 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:33:55 2025 +0100

    automation/cirrus-ci: store XTF and Xen build artifacts
    
    In preparation for adding some smoke tests that will consume those outputs.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit c9de0e2ce41700132ffb9f25930fcca9da5e78af)
---
 .cirrus.yml | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/.cirrus.yml b/.cirrus.yml
index a6e4a5d030..38b654f75c 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -61,6 +61,14 @@ task:
   build_script:
     - gmake -j`sysctl -n hw.ncpu` clang=y
 
+  xen_artifacts:
+    path: xen/xen
+    type: application/octet-stream
+
+  debug_artifacts:
+    path: xen/xen-syms
+    type: application/octet-stream
+
 task:
   name: 'FreeBSD: randconfig build'
 
@@ -106,3 +114,7 @@ task:
     - cc --version
     - git rev-parse HEAD
     - gmake -j`sysctl -n hw.ncpu` LLVM=y
+
+  xtf_artifacts:
+    path: xtf/tests/selftest/test-*-selftest
+    type: application/octet-stream
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 12:57:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 12:57:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938199.1339125 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0gbZ-00010K-D6; Fri, 04 Apr 2025 12:57:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938199.1339125; Fri, 04 Apr 2025 12:57: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 1u0gbZ-00010C-9v; Fri, 04 Apr 2025 12:57:05 +0000
Received: by outflank-mailman (input) for mailman id 938199;
 Fri, 04 Apr 2025 12:57: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 1u0gbX-0000zo-PX
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 12:57: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 1u0gbX-00BgaR-2T
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:57:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0gbX-00Bm3r-2N
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:57: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=7rdMK7OGkrjZRpqr44AwGMBMQVxOty3ZkQId7nWZHOI=; b=zd5DBnz4eQ9ouv38gSVkruNMCL
	aOC1//2Hot98cM66LvRZze+mJMyAtBU7VcFu6DDFK0GxGdmID7ftKyQA3vodjb5J7E0OSmYVSGaEJ
	f+6oRqIn816CKDY6e62Co0uIQiBizw9vYKQWftInscVdx812XC3NGetz6T8v2CLX4n6Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] automation/cirrus-ci: add smoke tests for the FreeBSD builds
Message-Id: <E1u0gbX-00Bm3r-2N@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 12:57:03 +0000

commit 3724384488cbabc7841b761cb9a037fd0b4c4cd5
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Mar 14 13:37:46 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:33:55 2025 +0100

    automation/cirrus-ci: add smoke tests for the FreeBSD builds
    
    Introduce a basic set of smoke tests using the XTF selftest image, and run
    them on QEMU.  Use the matrix keyword to create a different task for each
    XTF flavor on each FreeBSD build.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Oleksii Kurochko<oleksii.kurochko@gmail.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 7973cba4dbf72f6b963c780e9d1e0b99fd9622b9)
---
 .cirrus.yml | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/.cirrus.yml b/.cirrus.yml
index 38b654f75c..3163ab8f11 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -5,6 +5,8 @@ freebsd_versions: &FREEBSD_VERSIONS
     FREEBSD_PRODUCTION: freebsd-14-2
     FREEBSD_CURRENT:    freebsd-15-0-snap
 
+# Build jobs
+
 freebsd_template: &FREEBSD_ENV
   environment:
     APPEND_LIB: /usr/local/lib
@@ -118,3 +120,55 @@ task:
   xtf_artifacts:
     path: xtf/tests/selftest/test-*-selftest
     type: application/octet-stream
+
+# Test jobs
+
+task:
+  name: 'FreeBSD: XTF selftest'
+
+  << : *FREEBSD_ENV_PRODUCTION
+
+  env:
+    matrix:
+      FREEBSD_BUILD: $FREEBSD_LEGACY
+      FREEBSD_BUILD: $FREEBSD_PRODUCTION
+      FREEBSD_BUILD: $FREEBSD_CURRENT
+
+  depends_on:
+    - freebsd_full_$FREEBSD_BUILD
+    - xtf
+
+  install_script: pkg install -y qemu-nox11 expect
+
+  env:
+    matrix:
+      XTF_ARCH: hvm32
+      XTF_ARCH: hvm32pae
+      XTF_ARCH: hvm32pse
+      XTF_ARCH: hvm64
+      XTF_ARCH: pv64
+
+  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
+    - unzip xtf.zip
+    - unzip xen.zip
+
+  test_script: |
+    case "$XTF_ARCH" in \
+      *hvm*) \
+        XEN_EXTRA_CMD="dom0=pvh dom0-iommu=none" \
+        ;; \
+    esac
+    export TEST_CMD="qemu-system-x86_64 -kernel xen/xen -initrd xtf/tests/selftest/test-${XTF_ARCH}-selftest \
+                                        -append \"loglvl=all console=com1 noreboot console_timestamps=boot dom0=verbose ${XEN_EXTRA_CMD}\" \
+                                        -m 512 -nographic -monitor none -serial stdio"
+    export TEST_LOG="serial-${FREEBSD_BUILD}-${XTF_ARCH}.txt"
+    export PASSED="Test result: SUCCESS"
+    export TEST_TIMEOUT=120
+    ./automation/scripts/console.exp | sed 's/\r\+$//'
+
+  always:
+    serial_artifacts:
+      path: serial-*.txt
+      type: text/plain
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 12:57:15 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 12:57:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938200.1339128 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0gbj-00013U-Fm; Fri, 04 Apr 2025 12:57:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938200.1339128; Fri, 04 Apr 2025 12:57: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 1u0gbj-00013M-DC; Fri, 04 Apr 2025 12:57:15 +0000
Received: by outflank-mailman (input) for mailman id 938200;
 Fri, 04 Apr 2025 12:57: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 1u0gbh-00013E-SE
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 12:57: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 1u0gbh-00Bgab-2i
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:57:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0gbh-00Bm55-2d
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:57: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=ixXyaBuvlVihgl2k7a7E0UOvWpRFfCD1aWJj5znSX4A=; b=LUoKDRRsp4AiYacDBilZLQ44Bn
	pqkBPUrCwbdEdK8FWTMEfCJxLfGM5MYvpei4Sx9bOm0p5ShtSdos9Y2DtSSOu2Sg8vJB/MF600BDi
	V6XuIK1tYDbXule1AkeU7Zvu7KV+qLJmDRmBwKfUNofUJhgh/G5bMbVDnRDf9Xto+q+I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] CI: Add yet another HW runner
Message-Id: <E1u0gbh-00Bm55-2d@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 12:57:13 +0000

commit 7fb1438bf4fcd37311c86cb4ee2965a2b52d5b52
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Fri Mar 14 04:06:26 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 4 11:33:55 2025 +0100

    CI: Add yet another HW runner
    
    This is AMD Zen2 (Ryzen 5 4500U specifically), in a HP Probook 445 G7.
    
    This one has working S3, so add a test for it here.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit debe8bf537ec2c69a4734393cd2b0c7f57f74c0c)
---
 automation/gitlab-ci/test.yaml | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 28bab21d05..325be5dc49 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -143,6 +143,17 @@
   tags:
     - qubes-hw2
 
+.zen2-x86-64:
+  # it's really similar to the above
+  extends: .adl-x86-64
+  variables:
+    PCIDEV: "01:00.0"
+    PCIDEV_INTR: "MSI-X"
+    CONSOLE_OPTS: "console=com1 com1=115200,8n1,pci,msi,04:00.0"
+    SUT_ADDR: test-1.testnet
+  tags:
+    - qubes-hw1
+
 .zen3p-x86-64:
   # it's really similar to the above
   extends: .adl-x86-64
@@ -250,6 +261,22 @@ adl-pvshim-x86-64-gcc-debug:
     - *x86-64-test-needs
     - alpine-3.18-gcc-debug
 
+zen2-smoke-x86-64-gcc-debug:
+  extends: .zen2-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
+zen2-suspend-x86-64-gcc-debug:
+  extends: .zen2-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh s3 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
 zen3p-smoke-x86-64-gcc-debug:
   extends: .zen3p-x86-64
   script:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 04 12:57:25 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2025 12:57:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.938201.1339132 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0gbt-00016Q-H7; Fri, 04 Apr 2025 12:57:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 938201.1339132; Fri, 04 Apr 2025 12:57:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u0gbt-00016I-EU; Fri, 04 Apr 2025 12:57:25 +0000
Received: by outflank-mailman (input) for mailman id 938201;
 Fri, 04 Apr 2025 12:57: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 1u0gbr-000163-Us
 for xen-changelog@lists.xenproject.org; Fri, 04 Apr 2025 12:57: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 1u0gbr-00Bgax-2z
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:57:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u0gbr-00Bm63-2u
 for xen-changelog@lists.xenproject.org;
 Fri, 04 Apr 2025 12:57: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=tCp0FfLa86yWVdOkj/A7vmjCpozSBNZoFGg8f2mfajc=; b=zRlpqXTtxLCOkTopeIlFvx2zS9
	YC6sH6A/kW5F/+IrVBwrYqEtk703bNVVWVS44uiTIMn7GJeJ0BLrYvbUPCbuCGMsm2+1B2xFzw97N
	xyINNrxUIxwTW/P06KoZOJz4J0Aacn/p5SkLReoxWymC6BSbho6x52C9eN+jIWJpqxwg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] update Xen version to 4.19.2
Message-Id: <E1u0gbr-00Bm63-2u@xenbits.xenproject.org>
Date: Fri, 04 Apr 2025 12:57:23 +0000

commit f3362182e028119e5ca2ab37e5628b9fa6d21254
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Apr 4 12:47:23 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Apr 4 12:47:23 2025 +0200

    update Xen version to 4.19.2
---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Makefile b/xen/Makefile
index 968971694c..26907392bb 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -6,7 +6,7 @@ this-makefile := $(call lastword,$(MAKEFILE_LIST))
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 19
-export XEN_EXTRAVERSION ?= .2-pre$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .2$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 10:22:11 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 10:22:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.939629.1339657 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1jcB-000373-Vh; Mon, 07 Apr 2025 10:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 939629.1339657; Mon, 07 Apr 2025 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 1u1jcB-00036v-Sv; Mon, 07 Apr 2025 10:22:03 +0000
Received: by outflank-mailman (input) for mailman id 939629;
 Mon, 07 Apr 2025 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 1u1jcA-00036c-J4
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 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 1u1jcA-000Dq7-10
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 10:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1jcA-00DGDU-0q
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 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=0t1P6jmvjgA+2tMAyyrSHyBiD8R5K0QUKx3e4SaXZuw=; b=sRNjiWQxvHhE3UcH03TUFYXjzF
	gGuloJmndxgZzf1V30LPphKOpaGI49GFU7uS+jipLl6Z5puvtfb62cqsUFAjnftD2k5J+m1+rwF0A
	pb5G5NmEJyYl8o3JO6Sez7nhuOJhxXuMk3etjrNX27NavzYk0wu+hmDRtLUnOHSG4yM4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86emul: replace _BYTES_PER_LONG
Message-Id: <E1u1jcA-00DGDU-0q@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 10:22:02 +0000

commit 115f639142b28b75b8964918e9218207ffe3ff2a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 7 12:16:43 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 7 12:16:43 2025 +0200

    x86emul: replace _BYTES_PER_LONG
    
    We can now easily use __SIZEOF_LONG__ instead. For this to also work in
    the test harness, move hvmloader's STR() to common-macros.h.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/firmware/hvmloader/util.h         | 3 ---
 tools/include/xen-tools/common-macros.h | 3 +++
 xen/arch/x86/x86_emulate/private.h      | 4 +---
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/tools/firmware/hvmloader/util.h b/tools/firmware/hvmloader/util.h
index 17ed3783f2..644450c51c 100644
--- a/tools/firmware/hvmloader/util.h
+++ b/tools/firmware/hvmloader/util.h
@@ -21,9 +21,6 @@ enum {
 /* Cause xs_wire.h to give us xsd_errors[]. */
 #define EINVAL EINVAL
 
-#define __STR(...) #__VA_ARGS__
-#define STR(...) __STR(__VA_ARGS__)
-
 /* GDT selector values. */
 #define SEL_CODE16          0x0008
 #define SEL_DATA16          0x0010
diff --git a/tools/include/xen-tools/common-macros.h b/tools/include/xen-tools/common-macros.h
index 60912225cb..0088208c2e 100644
--- a/tools/include/xen-tools/common-macros.h
+++ b/tools/include/xen-tools/common-macros.h
@@ -88,6 +88,9 @@
     (type *)((char *)mptr__ - offsetof(type, member));  \
 })
 
+#define __STR(...) #__VA_ARGS__
+#define STR(...) __STR(__VA_ARGS__)
+
 #define __AC(X, Y)   (X ## Y)
 #define _AC(X, Y)    __AC(X, Y)
 
diff --git a/xen/arch/x86/x86_emulate/private.h b/xen/arch/x86/x86_emulate/private.h
index f33330c787..30be595470 100644
--- a/xen/arch/x86/x86_emulate/private.h
+++ b/xen/arch/x86/x86_emulate/private.h
@@ -641,11 +641,9 @@ amd_like(const struct x86_emulate_ctxt *ctxt)
 #if defined(__x86_64__)
 #define _LO32 "k"          /* force 32-bit operand */
 #define _STK  "%%rsp"      /* stack pointer */
-#define _BYTES_PER_LONG "8"
 #elif defined(__i386__)
 #define _LO32 ""           /* force 32-bit operand */
 #define _STK  "%%esp"      /* stack pointer */
-#define _BYTES_PER_LONG "4"
 #endif
 
 /* Before executing instruction: restore necessary bits in EFLAGS. */
@@ -659,7 +657,7 @@ amd_like(const struct x86_emulate_ctxt *ctxt)
 "pushf; "                                                       \
 "notl %"_LO32 _tmp"; "                                          \
 "andl %"_LO32 _tmp",("_STK"); "                                 \
-"andl %"_LO32 _tmp",2*"_BYTES_PER_LONG"("_STK"); "              \
+"andl %"_LO32 _tmp", 2 * " STR(__SIZEOF_LONG__) "("_STK"); "    \
 "pop  %"_tmp"; "                                                \
 "orl  %"_LO32 _tmp",("_STK"); "                                 \
 "popf; "                                                        \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 10:22:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 10:22:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.939631.1339662 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1jcM-00039L-0i; Mon, 07 Apr 2025 10:22:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 939631.1339662; Mon, 07 Apr 2025 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 1u1jcL-00039D-UI; Mon, 07 Apr 2025 10:22:13 +0000
Received: by outflank-mailman (input) for mailman id 939631;
 Mon, 07 Apr 2025 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 1u1jcK-000392-EE
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 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 1u1jcK-000DqT-1K
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 10:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1jcK-00DGEh-1B
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 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=aZFDsqpVCAKjLCsC8k2Z5TEhIklOgRREq1tKgZNelG8=; b=z18WXwxhal778q2KfouSFeaeZ2
	EOdLS0iHW2sEv2oJvxe4pr1m6vid/4F6yt72tD1QNrrox6DqxtI9CPATEJa3YZbp1nB9mBYMJvBYq
	W1y0tuNCTftv2OCpR+Cdv9JWzBIxhoJtT6ISixKRTCpNNfAq2eAgork+8+7vFDXIhAXg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] time: drop cast from NOW()
Message-Id: <E1u1jcK-00DGEh-1B@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 10:22:12 +0000

commit abc4ba58079696505c5a341d224b4afcd7106c6a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 7 12:17:06 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 7 12:17:06 2025 +0200

    time: drop cast from NOW()
    
    It gives the wrong impression of there being a type change, when
    get_s_time() really returns s_time_t itself (kind of naturally given its
    name).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/xen/time.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/xen/time.h b/xen/include/xen/time.h
index 21e479aac8..fe0d7a578a 100644
--- a/xen/include/xen/time.h
+++ b/xen/include/xen/time.h
@@ -53,7 +53,7 @@ struct tm gmtime(unsigned long t);
 struct tm wallclock_time(uint64_t *ns);
 
 #define SYSTEM_TIME_HZ  1000000000ULL
-#define NOW()           ((s_time_t)get_s_time())
+#define NOW()           get_s_time()
 #define DAYS(_d)        SECONDS((_d) * 86400ULL)
 #define SECONDS(_s)     ((s_time_t)((_s)  * 1000000000ULL))
 #define MILLISECS(_ms)  ((s_time_t)((_ms) * 1000000ULL))
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 10:22:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 10:22:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.939632.1339666 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1jcW-0003CG-27; Mon, 07 Apr 2025 10:22:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 939632.1339666; Mon, 07 Apr 2025 10:22:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1jcV-0003C8-Vp; Mon, 07 Apr 2025 10:22:23 +0000
Received: by outflank-mailman (input) for mailman id 939632;
 Mon, 07 Apr 2025 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 1u1jcU-0003Bu-Hw
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 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 1u1jcU-000Dqb-1f
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 10:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1jcU-00DGHM-1U
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 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=XIkUJQb2C/NAeXygjbPmoLRVllOIk2iZRjYP39lRevM=; b=tkQjZmGMgEkcwLCs6gFUQxl2Af
	Xh8ltDOrqagbWKSXKrBg1fYTUr/SuNR1Vj1F1JBNVovsT6QR7L7Ly4Au70rEc1tok00LGCAzXAKeo
	pKcL9iZnkMi1qdAMq4023N61N4b0x90ENAlL5WoUDiFd8zhfOXgtZZMv1Be/tyiTVNBs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] sched/null: avoid another crash after failed domU creation
Message-Id: <E1u1jcU-00DGHM-1U@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 10:22:22 +0000

commit 54fe207f29f86c4226a62a4dd289f10d9d2abc40
Author:     Stewart Hildebrand <stewart.hildebrand@amd.com>
AuthorDate: Mon Apr 7 12:17:31 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 7 12:17:31 2025 +0200

    sched/null: avoid another crash after failed domU creation
    
    The following sequence of events may lead a debug build of Xen to crash
    when using the null scheduler:
    
    1. domain creation (e.g. d1) failed due to bad configuration
    2. complete_domain_destroy() was deferred
    3. domain creation (e.g. d2) succeeds
    
    At this point, d2 is running, while the zombie d1 is not fully cleaned
    up:
    
    (XEN) Online Cpus: 0-3
    (XEN) Cpupool 0:
    (XEN) Cpus: 0-3
    (XEN) Scheduling granularity: cpu, 1 CPU per sched-resource
    (XEN) Scheduler: null Scheduler (null)
    (XEN)   cpus_free = 3
    (XEN) Domain info:
    (XEN)   Domain: 0
    (XEN)     1: [0.0] pcpu=0
    (XEN)     2: [0.1] pcpu=1
    (XEN)   Domain: 1
    (XEN)     3: [1.0] pcpu=2
    (XEN)   Domain: 2
    (XEN)     4: [2.0] pcpu=2
    
    4. complete_domain_destroy() gets called for d1 and triggers the
    following:
    
    (XEN) Xen call trace:
    (XEN)    [<00000a0000322ed4>] null.c#unit_deassign+0x2d8/0xb70 (PC)
    (XEN)    [<00000a000032457c>] null.c#null_unit_remove+0x670/0xba8 (LR)
    (XEN)    [<00000a000032457c>] null.c#null_unit_remove+0x670/0xba8
    (XEN)    [<00000a0000336404>] sched_destroy_vcpu+0x354/0x8fc
    (XEN)    [<00000a0000227324>] domain.c#complete_domain_destroy+0x11c/0x49c
    (XEN)    [<00000a000029fbd0>] rcupdate.c#rcu_do_batch+0x94/0x3d0
    (XEN)    [<00000a00002a10c0>] rcupdate.c#__rcu_process_callbacks+0x160/0x5f4
    (XEN)    [<00000a00002a1e60>] rcupdate.c#rcu_process_callbacks+0xcc/0x1b0
    (XEN)    [<00000a00002a3460>] softirq.c#__do_softirq+0x1f4/0x3d8
    (XEN)    [<00000a00002a37c4>] do_softirq+0x14/0x1c
    (XEN)    [<00000a0000465260>] traps.c#check_for_pcpu_work+0x30/0xb8
    (XEN)    [<00000a000046bb08>] leave_hypervisor_to_guest+0x28/0x198
    (XEN)    [<00000a0000409c84>] entry.o#guest_sync_slowpath+0xac/0xd8
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 0:
    (XEN) Assertion 'npc->unit == unit' failed at common/sched/null.c:383
    (XEN) ****************************************
    
    Fix by skipping unit_deassign() when the unit to be removed does not
    match the pcpu's currently assigned unit.
    
    Fixes: c2eae2614c8f ("sched/null: avoid crash after failed domU creation")
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 xen/common/sched/null.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/sched/null.c b/xen/common/sched/null.c
index 7e31440e5b..c8e327e3cd 100644
--- a/xen/common/sched/null.c
+++ b/xen/common/sched/null.c
@@ -557,7 +557,7 @@ static void cf_check null_unit_remove(
 
     cpu = sched_unit_master(unit);
     npc = get_sched_res(cpu)->sched_priv;
-    if ( npc->unit )
+    if ( npc->unit == unit )
         unit_deassign(prv, unit);
 
  out:
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 12:00:09 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 12:00:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.939789.1339760 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1l91-0005EY-Pc; Mon, 07 Apr 2025 12:00:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 939789.1339760; Mon, 07 Apr 2025 12:00:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1l91-0005E6-MR; Mon, 07 Apr 2025 12:00:03 +0000
Received: by outflank-mailman (input) for mailman id 939789;
 Mon, 07 Apr 2025 12: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 1u1l90-0004xQ-FO
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 12: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 1u1l90-000G2D-0p
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 12:00:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1l90-00Dc4F-0g
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 12: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=+Ant6/d0au+iiWa2+jQe/gVdYDklfLzibbDX+hY0xLM=; b=n7b3DqBmxYQzvJgXeXZb5FTMNX
	AHrhgDwQoOmBotYplyUHlwc/GJpSUGckZ7yQwv8//pEhPI8BFr0wJUgvMmahQVk+PzCwnU0ekRqAn
	TVwIi1NsPHskMlkX91oXxMNC0sbiYoo4zc0ssz6mi1O04Jnex6CvueOxHafd8VmRS6/c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: drop XSAVEOPT and CLWB build flags
Message-Id: <E1u1l90-00Dc4F-0g@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 12:00:02 +0000

commit 87541439838b8d3b30ae1183c03533694b8e5670
Author:     Alexander M. Merritt <alexander@edera.dev>
AuthorDate: Thu Apr 3 23:22:19 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 7 12:55:06 2025 +0100

    x86: drop XSAVEOPT and CLWB build flags
    
    The new toolchain baseline knows both the XSAVEOPT and CLWB instructions.
    
    It knows CLFLUSHOPT too, so fix up those.
    
    No functional change.
    
    Resolves: https://gitlab.com/xen-project/xen/-/work_items/205
    Signed-off-by: "Alexander M. Merritt" <alexander@edera.dev>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/arch.mk              |  2 --
 xen/arch/x86/flushtlb.c           | 30 ++----------------------------
 xen/arch/x86/include/asm/system.h |  9 +--------
 3 files changed, 3 insertions(+), 38 deletions(-)

diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk
index 3bbaee2a44..8615533697 100644
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -11,9 +11,7 @@ CFLAGS += -msoft-float
 $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
 $(call cc-option-add,CFLAGS,CC,-Wnested-externs)
 $(call as-option-add,CFLAGS,CC,"rdrand %eax",-DHAVE_AS_RDRAND)
-$(call as-option-add,CFLAGS,CC,"xsaveopt (%rax)",-DHAVE_AS_XSAVEOPT)
 $(call as-option-add,CFLAGS,CC,"rdseed %eax",-DHAVE_AS_RDSEED)
-$(call as-option-add,CFLAGS,CC,"clwb (%rax)",-DHAVE_AS_CLWB)
 $(call as-option-add,CFLAGS,CC,".equ \"x\"$(comma)1",-DHAVE_AS_QUOTED_SYM)
 $(call as-option-add,CFLAGS,CC,"movdiri %rax$(comma)(%rax)",-DHAVE_AS_MOVDIR)
 $(call as-option-add,CFLAGS,CC,"enqcmd (%rax)$(comma)%rax",-DHAVE_AS_ENQCMD)
diff --git a/xen/arch/x86/flushtlb.c b/xen/arch/x86/flushtlb.c
index 65be0474a8..1e0011d5b1 100644
--- a/xen/arch/x86/flushtlb.c
+++ b/xen/arch/x86/flushtlb.c
@@ -287,7 +287,7 @@ void cache_flush(const void *addr, unsigned int size)
          * of letting the alternative framework fill the gap by appending nops.
          */
         alternative_input("ds; clflush %[p]",/* Semicolon for Clang-IAS < 12 */
-                          "data16 clflush %[p]", /* clflushopt */
+                          "clflushopt %[p]",
                            X86_FEATURE_CLFLUSHOPT,
                            [p] "m" (*(const char *)(addr)));
     }
@@ -313,33 +313,7 @@ void cache_writeback(const void *addr, unsigned int size)
     clflush_size = current_cpu_data.x86_clflush_size ?: 16;
     addr -= (unsigned long)addr & (clflush_size - 1);
     for ( ; addr < end; addr += clflush_size )
-    {
-/*
- * The arguments to a macro must not include preprocessor directives. Doing so
- * results in undefined behavior, so we have to create some defines here in
- * order to avoid it.
- */
-#if defined(HAVE_AS_CLWB)
-# define CLWB_ENCODING "clwb %[p]"
-#elif defined(HAVE_AS_XSAVEOPT)
-# define CLWB_ENCODING "data16 xsaveopt %[p]" /* clwb */
-#else
-# define CLWB_ENCODING ".byte 0x66, 0x0f, 0xae, 0x30" /* clwb (%%rax) */
-#endif
-
-#define BASE_INPUT(addr) [p] "m" (*(const char *)(addr))
-#if defined(HAVE_AS_CLWB) || defined(HAVE_AS_XSAVEOPT)
-# define INPUT BASE_INPUT
-#else
-# define INPUT(addr) "a" (addr), BASE_INPUT(addr)
-#endif
-
-        asm volatile (CLWB_ENCODING :: INPUT(addr));
-
-#undef INPUT
-#undef BASE_INPUT
-#undef CLWB_ENCODING
-    }
+        clwb(addr);
 
     asm volatile ("sfence" ::: "memory");
 }
diff --git a/xen/arch/x86/include/asm/system.h b/xen/arch/x86/include/asm/system.h
index 8ceaaf45d1..57446c5b46 100644
--- a/xen/arch/x86/include/asm/system.h
+++ b/xen/arch/x86/include/asm/system.h
@@ -23,19 +23,12 @@ static inline void clflush(const void *p)
 
 static inline void clflushopt(const void *p)
 {
-    asm volatile ( "data16 clflush %0" :: "m" (*(const char *)p) );
+    asm volatile ( "clflushopt %0" :: "m" (*(const char *)p) );
 }
 
 static inline void clwb(const void *p)
 {
-#if defined(HAVE_AS_CLWB)
     asm volatile ( "clwb %0" :: "m" (*(const char *)p) );
-#elif defined(HAVE_AS_XSAVEOPT)
-    asm volatile ( "data16 xsaveopt %0" :: "m" (*(const char *)p) );
-#else
-    asm volatile ( ".byte 0x66, 0x0f, 0xae, 0x32"
-                   :: "d" (p), "m" (*(const char *)p) );
-#endif
 }
 
 #define xchg(ptr,v) \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 12:00:12 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 12:00:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.939790.1339763 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1l9A-0005iJ-QS; Mon, 07 Apr 2025 12:00:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 939790.1339763; Mon, 07 Apr 2025 12: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 1u1l9A-0005iB-Ns; Mon, 07 Apr 2025 12:00:12 +0000
Received: by outflank-mailman (input) for mailman id 939790;
 Mon, 07 Apr 2025 12: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 1u1l9A-0005i4-Cf
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 12: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 1u1l9A-000G2R-1A
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 12:00:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1l9A-00DcBq-10
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 12:00:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=eyAc78k+eiirWj9WeZ9amWyHaMecJ7R58QaORjxVsV0=; b=d4ale5ntYh41o1PiJf43kcG8PX
	EaUfd+TQrvRoBGUtQ58psL5Ma1+gZIcSN/l40+xtfMF1eav6Zr7h8jyeZ6N5JPUUx8gMw+TmUgsP4
	o56S0AxfP1Yti5pyq0niPuAleU1TWoVGt7X/xho7EvLJ5UkAXBXnOv/s6yiCF2zb9nGw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/emulate: Remove HAVE_AS_RDRAND and HAVE_AS_RDSEED
Message-Id: <E1u1l9A-00DcBq-10@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 12:00:12 +0000

commit 05bf9f1f0f52e02036dad5e82dec83866b486a4e
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Sat Apr 5 01:25:07 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 7 12:55:06 2025 +0100

    x86/emulate: Remove HAVE_AS_RDRAND and HAVE_AS_RDSEED
    
    The new toolchain baseline knows the RDRAND and RDSEED instructions; no need
    to carry the workaround in the code.
    
    Fix up arch_get_random() too.
    
    No functional change.
    
    Resolves: https://gitlab.com/xen-project/xen/-/work_items/208
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/arch.mk              |  2 --
 xen/arch/x86/include/asm/random.h |  2 +-
 xen/arch/x86/x86_emulate/0fc7.c   | 15 +++++----------
 3 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk
index 8615533697..7882fb895e 100644
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -10,8 +10,6 @@ CFLAGS += -msoft-float
 
 $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
 $(call cc-option-add,CFLAGS,CC,-Wnested-externs)
-$(call as-option-add,CFLAGS,CC,"rdrand %eax",-DHAVE_AS_RDRAND)
-$(call as-option-add,CFLAGS,CC,"rdseed %eax",-DHAVE_AS_RDSEED)
 $(call as-option-add,CFLAGS,CC,".equ \"x\"$(comma)1",-DHAVE_AS_QUOTED_SYM)
 $(call as-option-add,CFLAGS,CC,"movdiri %rax$(comma)(%rax)",-DHAVE_AS_MOVDIR)
 $(call as-option-add,CFLAGS,CC,"enqcmd (%rax)$(comma)%rax",-DHAVE_AS_ENQCMD)
diff --git a/xen/arch/x86/include/asm/random.h b/xen/arch/x86/include/asm/random.h
index 9e1fe0bc1d..cd0f650b63 100644
--- a/xen/arch/x86/include/asm/random.h
+++ b/xen/arch/x86/include/asm/random.h
@@ -8,7 +8,7 @@ static inline unsigned int arch_get_random(void)
     unsigned int val = 0;
 
     if ( cpu_has(&current_cpu_data, X86_FEATURE_RDRAND) )
-        asm volatile ( ".byte 0x0f,0xc7,0xf0" : "+a" (val) );
+        asm volatile ( "rdrand %0" : "=r" (val) );
 
     return val;
 }
diff --git a/xen/arch/x86/x86_emulate/0fc7.c b/xen/arch/x86/x86_emulate/0fc7.c
index 5268d5cafd..58c8f79501 100644
--- a/xen/arch/x86/x86_emulate/0fc7.c
+++ b/xen/arch/x86/x86_emulate/0fc7.c
@@ -32,7 +32,6 @@ int x86emul_0fc7(struct x86_emulate_state *s,
             return X86EMUL_UNRECOGNIZED;
 
         case 6: /* rdrand */
-#ifdef HAVE_AS_RDRAND
             generate_exception_if(s->vex.pfx >= vex_f3, X86_EXC_UD);
             host_and_vcpu_must_have(rdrand);
             *dst = s->ea;
@@ -43,12 +42,12 @@ int x86emul_0fc7(struct x86_emulate_state *s,
                       : "=r" (dst->val), ASM_FLAG_OUT("=@ccc", "=qm") (carry) );
                 break;
             default:
-# ifdef __x86_64__
+#ifdef __x86_64__
                 asm ( "rdrand %k0" ASM_FLAG_OUT(, "; setc %1")
                       : "=r" (dst->val), ASM_FLAG_OUT("=@ccc", "=qm") (carry) );
                 break;
             case 8:
-# endif
+#endif
                 asm ( "rdrand %0" ASM_FLAG_OUT(, "; setc %1")
                       : "=r" (dst->val), ASM_FLAG_OUT("=@ccc", "=qm") (carry) );
                 break;
@@ -57,9 +56,6 @@ int x86emul_0fc7(struct x86_emulate_state *s,
             if ( carry )
                 regs->eflags |= X86_EFLAGS_CF;
             break;
-#else
-            return X86EMUL_UNIMPLEMENTED;
-#endif
 
         case 7: /* rdseed / rdpid */
             if ( s->vex.pfx == vex_f3 ) /* rdpid */
@@ -77,7 +73,7 @@ int x86emul_0fc7(struct x86_emulate_state *s,
                 dst->bytes = 4;
                 break;
             }
-#ifdef HAVE_AS_RDSEED
+
             generate_exception_if(s->vex.pfx >= vex_f3, X86_EXC_UD);
             host_and_vcpu_must_have(rdseed);
             *dst = s->ea;
@@ -88,12 +84,12 @@ int x86emul_0fc7(struct x86_emulate_state *s,
                       : "=r" (dst->val), ASM_FLAG_OUT("=@ccc", "=qm") (carry) );
                 break;
             default:
-# ifdef __x86_64__
+#ifdef __x86_64__
                 asm ( "rdseed %k0" ASM_FLAG_OUT(, "; setc %1")
                       : "=r" (dst->val), ASM_FLAG_OUT("=@ccc", "=qm") (carry) );
                 break;
             case 8:
-# endif
+#endif
                 asm ( "rdseed %0" ASM_FLAG_OUT(, "; setc %1")
                       : "=r" (dst->val), ASM_FLAG_OUT("=@ccc", "=qm") (carry) );
                 break;
@@ -102,7 +98,6 @@ int x86emul_0fc7(struct x86_emulate_state *s,
             if ( carry )
                 regs->eflags |= X86_EFLAGS_CF;
             break;
-#endif
         }
     }
     else
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 12:00:22 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 12:00:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.939795.1339768 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1l9K-0005lY-SB; Mon, 07 Apr 2025 12:00:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 939795.1339768; Mon, 07 Apr 2025 12: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 1u1l9K-0005lQ-PG; Mon, 07 Apr 2025 12:00:22 +0000
Received: by outflank-mailman (input) for mailman id 939795;
 Mon, 07 Apr 2025 12: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 1u1l9K-0005lI-Fg
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 12: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 1u1l9K-000G2V-1T
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 12:00:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1l9K-00DcCU-1L
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 12: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=J+ZhLfBkfqwePclg/8Rde/iDvA85qIJ4exy+gavAcZg=; b=2p+U5iUYc7uvwk9fcyytTpV3n4
	MsjZE5N+vvCyD9SJeEnylxQaJH7M9Qz5gumyyqoxQ1bo2BacOMkNJ0NA1acP7vhY9MUIwgJ90HKci
	VwSWicXD6WEezj6AP01JKm67fFxIL0ejyisnejekBoI6ecr0EZfdPy0rkJmSvU98TqNE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/vmx: Rework VMX wrappers using `asm goto()`
Message-Id: <E1u1l9K-00DcCU-1L@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 12:00:22 +0000

commit fc3db01db6fb5eb5fbd89170d2714ff3a130a0de
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Sat Apr 5 01:27:57 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 7 12:55:06 2025 +0100

    x86/vmx: Rework VMX wrappers using `asm goto()`
    
    Improve error handling in VMX wrappers by switching to `asm goto()` where
    possible.
    
    No functional change.
    
    Resolves: https://gitlab.com/xen-project/xen/-/work_items/210
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/include/asm/hvm/vmx/vmx.h | 128 +++++++++++++++++----------------
 1 file changed, 67 insertions(+), 61 deletions(-)

diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmx.h b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
index affb3a8bd6..33d3d43a38 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
@@ -294,28 +294,30 @@ extern uint8_t posted_intr_vector;
 
 static always_inline void __vmptrld(u64 addr)
 {
-    asm volatile ( "vmptrld %0\n\t"
-                   /* CF==1 or ZF==1 --> BUG() */
-                   UNLIKELY_START(be, vmptrld)
-                   _ASM_BUGFRAME_TEXT(0)
-                   UNLIKELY_END_SECTION
-                   :
-                   : "m" (addr),
-                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
-                   : "memory" );
+    asm goto ( "vmptrld %[addr]\n\t"
+               "jbe %l[vmfail]"
+               :
+               : [addr] "m" (addr)
+               : "memory"
+               : vmfail );
+    return;
+
+ vmfail:
+    BUG();
 }
 
 static always_inline void __vmpclear(u64 addr)
 {
-    asm volatile ( "vmclear %0\n\t"
-                   /* CF==1 or ZF==1 --> BUG() */
-                   UNLIKELY_START(be, vmclear)
-                   _ASM_BUGFRAME_TEXT(0)
-                   UNLIKELY_END_SECTION
-                   :
-                   : "m" (addr),
-                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
-                   : "memory" );
+    asm goto ( "vmclear %[addr]\n\t"
+               "jbe %l[vmfail]"
+               :
+               : [addr] "m" (addr)
+               : "memory"
+               : vmfail );
+    return;
+
+ vmfail:
+    BUG();
 }
 
 static always_inline void __vmread(unsigned long field, unsigned long *value)
@@ -332,14 +334,16 @@ static always_inline void __vmread(unsigned long field, unsigned long *value)
 
 static always_inline void __vmwrite(unsigned long field, unsigned long value)
 {
-    asm volatile ( "vmwrite %1, %0\n"
-                   /* CF==1 or ZF==1 --> BUG() */
-                   UNLIKELY_START(be, vmwrite)
-                   _ASM_BUGFRAME_TEXT(0)
-                   UNLIKELY_END_SECTION
-                   :
-                   : "r" (field) , "rm" (value),
-                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0) );
+    asm goto ( "vmwrite %[value], %[field]\n\t"
+               "jbe %l[vmfail]"
+               :
+               : [field] "r" (field), [value] "rm" (value)
+               :
+               : vmfail );
+    return;
+
+ vmfail:
+    BUG();
 }
 
 static inline enum vmx_insn_errno vmread_safe(unsigned long field,
@@ -367,22 +371,22 @@ static inline enum vmx_insn_errno vmread_safe(unsigned long field,
 static inline enum vmx_insn_errno vmwrite_safe(unsigned long field,
                                                unsigned long value)
 {
-    unsigned long ret = VMX_INSN_SUCCEED;
-    bool fail_invalid, fail_valid;
-
-    asm volatile ( "vmwrite %[value], %[field]\n\t"
-                   ASM_FLAG_OUT(, "setc %[invalid]\n\t")
-                   ASM_FLAG_OUT(, "setz %[valid]\n\t")
-                   : ASM_FLAG_OUT("=@ccc", [invalid] "=rm") (fail_invalid),
-                     ASM_FLAG_OUT("=@ccz", [valid] "=rm") (fail_valid)
-                   : [field] "r" (field),
-                     [value] "rm" (value) );
-
-    if ( unlikely(fail_invalid) )
-        ret = VMX_INSN_FAIL_INVALID;
-    else if ( unlikely(fail_valid) )
-        __vmread(VM_INSTRUCTION_ERROR, &ret);
-
+    unsigned long ret;
+
+    asm goto ( "vmwrite %[value], %[field]\n\t"
+               "jc %l[vmfail_invalid]\n\t"
+               "jz %l[vmfail_error]"
+               :
+               : [field] "r" (field), [value] "rm" (value)
+               :
+               : vmfail_invalid, vmfail_error );
+    return VMX_INSN_SUCCEED;
+
+ vmfail_invalid:
+    return VMX_INSN_FAIL_INVALID;
+
+ vmfail_error:
+    __vmread(VM_INSTRUCTION_ERROR, &ret);
     return ret;
 }
 
@@ -400,15 +404,16 @@ static always_inline void __invept(unsigned long type, uint64_t eptp)
          !cpu_has_vmx_ept_invept_single_context )
         type = INVEPT_ALL_CONTEXT;
 
-    asm volatile ( "invept %0, %1\n\t"
-                   /* CF==1 or ZF==1 --> BUG() */
-                   UNLIKELY_START(be, invept)
-                   _ASM_BUGFRAME_TEXT(0)
-                   UNLIKELY_END_SECTION
-                   :
-                   : "m" (operand), "r" (type),
-                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
-                   : "memory" );
+    asm goto ( "invept %[operand], %[type]\n\t"
+               "jbe %l[vmfail]"
+               :
+               : [operand] "m" (operand), [type] "r" (type)
+               : "memory"
+               : vmfail );
+    return;
+
+ vmfail:
+    BUG();
 }
 
 static always_inline void __invvpid(unsigned long type, u16 vpid, u64 gva)
@@ -420,16 +425,17 @@ static always_inline void __invvpid(unsigned long type, u16 vpid, u64 gva)
     }  operand = {vpid, 0, gva};
 
     /* Fix up #UD exceptions which occur when TLBs are flushed before VMXON. */
-    asm volatile ( "1: invvpid %0, %1\n\t"
-                   /* CF==1 or ZF==1 --> BUG() */
-                   UNLIKELY_START(be, invvpid)
-                   _ASM_BUGFRAME_TEXT(0)
-                   UNLIKELY_END_SECTION "\n"
-                   "2:" _ASM_EXTABLE(1b, 2b)
-                   :
-                   : "m" (operand), "r" (type),
-                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
-                   : "memory" );
+    asm goto ( "1: invvpid %[operand], %[type]\n\t"
+               "   jbe %l[vmfail]\n\t"
+               "2:" _ASM_EXTABLE(1b, 2b)
+               :
+               : [operand] "m" (operand), [type] "r" (type)
+               : "memory"
+               : vmfail );
+    return;
+
+ vmfail:
+    BUG();
 }
 
 static inline void ept_sync_all(void)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 12:00:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 12:00:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.939798.1339775 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1l9V-0005sx-48; Mon, 07 Apr 2025 12:00:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 939798.1339775; Mon, 07 Apr 2025 12: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 1u1l9V-0005sA-1I; Mon, 07 Apr 2025 12:00:33 +0000
Received: by outflank-mailman (input) for mailman id 939798;
 Mon, 07 Apr 2025 12: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 1u1l9U-0005qC-Io
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 12: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 1u1l9U-000G2Z-1k
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 12:00:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1l9U-00DcDl-1e
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 12: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=PCIqCplpaN0CtrFnNFkMnk5v8Dm6FHVmEBCNUjluW6s=; b=mTNvsgi5B0Ank1MMcYytwhjnQe
	pj0yokub6D3xVS3ai3EirwjF2gVwR7C89IjKv+C3BmSCYgW3QALPR5ZtEGb4la/hDY+iM7M2md6NJ
	f7E1OBxW5iKP7MmA+yom3gvJv0IoZGzo7DQTxvRqEpwypyxWf2hk+kU5yKJsgA4N2sXY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libxl: do not use `-c -E` compiler options together
Message-Id: <E1u1l9U-00DcDl-1e@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 12:00:32 +0000

commit a235f856e4bbd270b085590e1f5fc9599234dcdf
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Apr 7 13:09:38 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 7 12:55:06 2025 +0100

    tools/libxl: do not use `-c -E` compiler options together
    
    It makes no sense to request for preprocessor only output and also request
    object file generation.  Fix the _libxl.api-for-check target to only use
    -E (preprocessor output).
    
    Also Clang 20.0 reports an error if both options are used.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Fixes: 2862bf5b6c81 ('libxl: enforce prohibitions of internal callers')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/light/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
index 37e4d16709..b690d92159 100644
--- a/tools/libs/light/Makefile
+++ b/tools/libs/light/Makefile
@@ -195,7 +195,7 @@ libxl.api-ok: check-libxl-api-rules _libxl.api-for-check
 	touch $@
 
 _libxl.api-for-check: $(XEN_INCLUDE)/libxl.h
-	$(CC) $(CPPFLAGS) $(CFLAGS) -c -E $< $(APPEND_CFLAGS) \
+	$(CC) $(CPPFLAGS) $(CFLAGS) -E $< $(APPEND_CFLAGS) \
 		-DLIBXL_EXTERNAL_CALLERS_ONLY=LIBXL_EXTERNAL_CALLERS_ONLY \
 		>$@.new
 	mv -f $@.new $@
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 13:11:10 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 13:11:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.940081.1339946 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1mFj-0007Ln-Mw; Mon, 07 Apr 2025 13:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 940081.1339946; Mon, 07 Apr 2025 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 1u1mFj-0007Lf-KL; Mon, 07 Apr 2025 13:11:03 +0000
Received: by outflank-mailman (input) for mailman id 940081;
 Mon, 07 Apr 2025 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 1u1mFi-0007LT-4k
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 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 1u1mFh-000Hhd-2U
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 13:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1mFh-00DsXM-2J
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 13: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=KME0i6fTGLbZrg/C5d4FypWKglhAz7pjwQopFzbZMaQ=; b=hT/UsNJL1/ItjT7Z09Pzl2ILOh
	cZdd4vIuS0/RwdHYs7rnaobhNHdWtDW+vx97GfB+8KMFKz37L4T92Xy+6JA6y+bVz2np1DVuwSL7I
	g8VyqIC8iHkOTO1daoHsecGp2xwOVvZ8tyhChgTXh6ga7uNLWLquIdq5mvRruclS0kL4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86emul: replace _BYTES_PER_LONG
Message-Id: <E1u1mFh-00DsXM-2J@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 13:11:01 +0000

commit 115f639142b28b75b8964918e9218207ffe3ff2a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 7 12:16:43 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 7 12:16:43 2025 +0200

    x86emul: replace _BYTES_PER_LONG
    
    We can now easily use __SIZEOF_LONG__ instead. For this to also work in
    the test harness, move hvmloader's STR() to common-macros.h.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/firmware/hvmloader/util.h         | 3 ---
 tools/include/xen-tools/common-macros.h | 3 +++
 xen/arch/x86/x86_emulate/private.h      | 4 +---
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/tools/firmware/hvmloader/util.h b/tools/firmware/hvmloader/util.h
index 17ed3783f2..644450c51c 100644
--- a/tools/firmware/hvmloader/util.h
+++ b/tools/firmware/hvmloader/util.h
@@ -21,9 +21,6 @@ enum {
 /* Cause xs_wire.h to give us xsd_errors[]. */
 #define EINVAL EINVAL
 
-#define __STR(...) #__VA_ARGS__
-#define STR(...) __STR(__VA_ARGS__)
-
 /* GDT selector values. */
 #define SEL_CODE16          0x0008
 #define SEL_DATA16          0x0010
diff --git a/tools/include/xen-tools/common-macros.h b/tools/include/xen-tools/common-macros.h
index 60912225cb..0088208c2e 100644
--- a/tools/include/xen-tools/common-macros.h
+++ b/tools/include/xen-tools/common-macros.h
@@ -88,6 +88,9 @@
     (type *)((char *)mptr__ - offsetof(type, member));  \
 })
 
+#define __STR(...) #__VA_ARGS__
+#define STR(...) __STR(__VA_ARGS__)
+
 #define __AC(X, Y)   (X ## Y)
 #define _AC(X, Y)    __AC(X, Y)
 
diff --git a/xen/arch/x86/x86_emulate/private.h b/xen/arch/x86/x86_emulate/private.h
index f33330c787..30be595470 100644
--- a/xen/arch/x86/x86_emulate/private.h
+++ b/xen/arch/x86/x86_emulate/private.h
@@ -641,11 +641,9 @@ amd_like(const struct x86_emulate_ctxt *ctxt)
 #if defined(__x86_64__)
 #define _LO32 "k"          /* force 32-bit operand */
 #define _STK  "%%rsp"      /* stack pointer */
-#define _BYTES_PER_LONG "8"
 #elif defined(__i386__)
 #define _LO32 ""           /* force 32-bit operand */
 #define _STK  "%%esp"      /* stack pointer */
-#define _BYTES_PER_LONG "4"
 #endif
 
 /* Before executing instruction: restore necessary bits in EFLAGS. */
@@ -659,7 +657,7 @@ amd_like(const struct x86_emulate_ctxt *ctxt)
 "pushf; "                                                       \
 "notl %"_LO32 _tmp"; "                                          \
 "andl %"_LO32 _tmp",("_STK"); "                                 \
-"andl %"_LO32 _tmp",2*"_BYTES_PER_LONG"("_STK"); "              \
+"andl %"_LO32 _tmp", 2 * " STR(__SIZEOF_LONG__) "("_STK"); "    \
 "pop  %"_tmp"; "                                                \
 "orl  %"_LO32 _tmp",("_STK"); "                                 \
 "popf; "                                                        \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 13:11:12 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 13:11:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.940082.1339949 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1mFs-0007QR-OQ; Mon, 07 Apr 2025 13:11:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 940082.1339949; Mon, 07 Apr 2025 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 1u1mFs-0007QK-Lf; Mon, 07 Apr 2025 13:11:12 +0000
Received: by outflank-mailman (input) for mailman id 940082;
 Mon, 07 Apr 2025 13: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 1u1mFr-0007QA-Sx
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 13: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 1u1mFr-000Hhh-2n
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 13:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1mFr-00DsZS-2g
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 13: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=w9e0+0+MOWXFOts+vSjx5tYsxAVnyiqM4CueuP56/8A=; b=0mXQK6xwzu2hsArfV49FL2vjDw
	BmR1fqI5ozKJB7B8WCVA4gBklgzHT1PdMKk3wp33V9LRPNXW+C191CPa+5i1TCmdIlHuXWHz4VOSu
	r+O6l27Lwv4GW2HPON74scfIp2LEZsojsb/Lf9sTyQ+hB6sdCl5C2kElD2eYOEvg6Jo0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] time: drop cast from NOW()
Message-Id: <E1u1mFr-00DsZS-2g@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 13:11:11 +0000

commit abc4ba58079696505c5a341d224b4afcd7106c6a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 7 12:17:06 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 7 12:17:06 2025 +0200

    time: drop cast from NOW()
    
    It gives the wrong impression of there being a type change, when
    get_s_time() really returns s_time_t itself (kind of naturally given its
    name).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/xen/time.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/xen/time.h b/xen/include/xen/time.h
index 21e479aac8..fe0d7a578a 100644
--- a/xen/include/xen/time.h
+++ b/xen/include/xen/time.h
@@ -53,7 +53,7 @@ struct tm gmtime(unsigned long t);
 struct tm wallclock_time(uint64_t *ns);
 
 #define SYSTEM_TIME_HZ  1000000000ULL
-#define NOW()           ((s_time_t)get_s_time())
+#define NOW()           get_s_time()
 #define DAYS(_d)        SECONDS((_d) * 86400ULL)
 #define SECONDS(_s)     ((s_time_t)((_s)  * 1000000000ULL))
 #define MILLISECS(_ms)  ((s_time_t)((_ms) * 1000000ULL))
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 13:11:22 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 13:11:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.940084.1339954 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1mG2-0007e1-RL; Mon, 07 Apr 2025 13:11:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 940084.1339954; Mon, 07 Apr 2025 13: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 1u1mG2-0007dt-Oh; Mon, 07 Apr 2025 13:11:22 +0000
Received: by outflank-mailman (input) for mailman id 940084;
 Mon, 07 Apr 2025 13:11:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u1mG1-0007dl-WF
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 13:11:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1mG1-000Hhl-35
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 13:11:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1mG1-00Dsb0-2x
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 13: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=D6Wz3N4VBIm2UcYeOXDnWTZ5bPUMtUfvJl4vbeeFt/s=; b=Qunz4ujQ/mG2zmDzCEP0czrbAK
	3XBqunkTZdQHXhX8xn9sV6kk0ipgX3kYsi7R3E/621I8fA7SaBCxGFB/uTjOVTBdD9SnIVcNenkGU
	xnCoEOlpO8uoki45szOezW1L7BxtynMsf9HKYaYXaLoG+uvUgS0W/r2DONft0Hp6QOWw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] sched/null: avoid another crash after failed domU creation
Message-Id: <E1u1mG1-00Dsb0-2x@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 13:11:21 +0000

commit 54fe207f29f86c4226a62a4dd289f10d9d2abc40
Author:     Stewart Hildebrand <stewart.hildebrand@amd.com>
AuthorDate: Mon Apr 7 12:17:31 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 7 12:17:31 2025 +0200

    sched/null: avoid another crash after failed domU creation
    
    The following sequence of events may lead a debug build of Xen to crash
    when using the null scheduler:
    
    1. domain creation (e.g. d1) failed due to bad configuration
    2. complete_domain_destroy() was deferred
    3. domain creation (e.g. d2) succeeds
    
    At this point, d2 is running, while the zombie d1 is not fully cleaned
    up:
    
    (XEN) Online Cpus: 0-3
    (XEN) Cpupool 0:
    (XEN) Cpus: 0-3
    (XEN) Scheduling granularity: cpu, 1 CPU per sched-resource
    (XEN) Scheduler: null Scheduler (null)
    (XEN)   cpus_free = 3
    (XEN) Domain info:
    (XEN)   Domain: 0
    (XEN)     1: [0.0] pcpu=0
    (XEN)     2: [0.1] pcpu=1
    (XEN)   Domain: 1
    (XEN)     3: [1.0] pcpu=2
    (XEN)   Domain: 2
    (XEN)     4: [2.0] pcpu=2
    
    4. complete_domain_destroy() gets called for d1 and triggers the
    following:
    
    (XEN) Xen call trace:
    (XEN)    [<00000a0000322ed4>] null.c#unit_deassign+0x2d8/0xb70 (PC)
    (XEN)    [<00000a000032457c>] null.c#null_unit_remove+0x670/0xba8 (LR)
    (XEN)    [<00000a000032457c>] null.c#null_unit_remove+0x670/0xba8
    (XEN)    [<00000a0000336404>] sched_destroy_vcpu+0x354/0x8fc
    (XEN)    [<00000a0000227324>] domain.c#complete_domain_destroy+0x11c/0x49c
    (XEN)    [<00000a000029fbd0>] rcupdate.c#rcu_do_batch+0x94/0x3d0
    (XEN)    [<00000a00002a10c0>] rcupdate.c#__rcu_process_callbacks+0x160/0x5f4
    (XEN)    [<00000a00002a1e60>] rcupdate.c#rcu_process_callbacks+0xcc/0x1b0
    (XEN)    [<00000a00002a3460>] softirq.c#__do_softirq+0x1f4/0x3d8
    (XEN)    [<00000a00002a37c4>] do_softirq+0x14/0x1c
    (XEN)    [<00000a0000465260>] traps.c#check_for_pcpu_work+0x30/0xb8
    (XEN)    [<00000a000046bb08>] leave_hypervisor_to_guest+0x28/0x198
    (XEN)    [<00000a0000409c84>] entry.o#guest_sync_slowpath+0xac/0xd8
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 0:
    (XEN) Assertion 'npc->unit == unit' failed at common/sched/null.c:383
    (XEN) ****************************************
    
    Fix by skipping unit_deassign() when the unit to be removed does not
    match the pcpu's currently assigned unit.
    
    Fixes: c2eae2614c8f ("sched/null: avoid crash after failed domU creation")
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 xen/common/sched/null.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/sched/null.c b/xen/common/sched/null.c
index 7e31440e5b..c8e327e3cd 100644
--- a/xen/common/sched/null.c
+++ b/xen/common/sched/null.c
@@ -557,7 +557,7 @@ static void cf_check null_unit_remove(
 
     cpu = sched_unit_master(unit);
     npc = get_sched_res(cpu)->sched_priv;
-    if ( npc->unit )
+    if ( npc->unit == unit )
         unit_deassign(prv, unit);
 
  out:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 13:11:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 13:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.940086.1339958 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1mGD-0007mn-Sz; Mon, 07 Apr 2025 13:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 940086.1339958; Mon, 07 Apr 2025 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 1u1mGD-0007me-QD; Mon, 07 Apr 2025 13:11:33 +0000
Received: by outflank-mailman (input) for mailman id 940086;
 Mon, 07 Apr 2025 13:11:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u1mGC-0007mL-2P
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 13:11:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1mGC-000Hhu-08
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 13:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1mGC-00DseV-02
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 13:11:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tGvrdT1oeFN17eE8rmhjLmOfZFzX1dP8l6vAC//RaM4=; b=RB1ESEVo4Jmy0v9XAI0Rt1CQIw
	pkl05hiEDHaeNiFVMe8pGWfNWRyhnuESS9sAMkH3V/667btJl9XNNkHmw4+YKLSE77JK2OAP39fyd
	oJEepJYPalRQd7unF6rjAbK6eDfXU7vPuWCZ+M4GflE66ylPVYo/zEb1G3D7W34JU4I8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: drop XSAVEOPT and CLWB build flags
Message-Id: <E1u1mGC-00DseV-02@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 13:11:32 +0000

commit 87541439838b8d3b30ae1183c03533694b8e5670
Author:     Alexander M. Merritt <alexander@edera.dev>
AuthorDate: Thu Apr 3 23:22:19 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 7 12:55:06 2025 +0100

    x86: drop XSAVEOPT and CLWB build flags
    
    The new toolchain baseline knows both the XSAVEOPT and CLWB instructions.
    
    It knows CLFLUSHOPT too, so fix up those.
    
    No functional change.
    
    Resolves: https://gitlab.com/xen-project/xen/-/work_items/205
    Signed-off-by: "Alexander M. Merritt" <alexander@edera.dev>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/arch.mk              |  2 --
 xen/arch/x86/flushtlb.c           | 30 ++----------------------------
 xen/arch/x86/include/asm/system.h |  9 +--------
 3 files changed, 3 insertions(+), 38 deletions(-)

diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk
index 3bbaee2a44..8615533697 100644
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -11,9 +11,7 @@ CFLAGS += -msoft-float
 $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
 $(call cc-option-add,CFLAGS,CC,-Wnested-externs)
 $(call as-option-add,CFLAGS,CC,"rdrand %eax",-DHAVE_AS_RDRAND)
-$(call as-option-add,CFLAGS,CC,"xsaveopt (%rax)",-DHAVE_AS_XSAVEOPT)
 $(call as-option-add,CFLAGS,CC,"rdseed %eax",-DHAVE_AS_RDSEED)
-$(call as-option-add,CFLAGS,CC,"clwb (%rax)",-DHAVE_AS_CLWB)
 $(call as-option-add,CFLAGS,CC,".equ \"x\"$(comma)1",-DHAVE_AS_QUOTED_SYM)
 $(call as-option-add,CFLAGS,CC,"movdiri %rax$(comma)(%rax)",-DHAVE_AS_MOVDIR)
 $(call as-option-add,CFLAGS,CC,"enqcmd (%rax)$(comma)%rax",-DHAVE_AS_ENQCMD)
diff --git a/xen/arch/x86/flushtlb.c b/xen/arch/x86/flushtlb.c
index 65be0474a8..1e0011d5b1 100644
--- a/xen/arch/x86/flushtlb.c
+++ b/xen/arch/x86/flushtlb.c
@@ -287,7 +287,7 @@ void cache_flush(const void *addr, unsigned int size)
          * of letting the alternative framework fill the gap by appending nops.
          */
         alternative_input("ds; clflush %[p]",/* Semicolon for Clang-IAS < 12 */
-                          "data16 clflush %[p]", /* clflushopt */
+                          "clflushopt %[p]",
                            X86_FEATURE_CLFLUSHOPT,
                            [p] "m" (*(const char *)(addr)));
     }
@@ -313,33 +313,7 @@ void cache_writeback(const void *addr, unsigned int size)
     clflush_size = current_cpu_data.x86_clflush_size ?: 16;
     addr -= (unsigned long)addr & (clflush_size - 1);
     for ( ; addr < end; addr += clflush_size )
-    {
-/*
- * The arguments to a macro must not include preprocessor directives. Doing so
- * results in undefined behavior, so we have to create some defines here in
- * order to avoid it.
- */
-#if defined(HAVE_AS_CLWB)
-# define CLWB_ENCODING "clwb %[p]"
-#elif defined(HAVE_AS_XSAVEOPT)
-# define CLWB_ENCODING "data16 xsaveopt %[p]" /* clwb */
-#else
-# define CLWB_ENCODING ".byte 0x66, 0x0f, 0xae, 0x30" /* clwb (%%rax) */
-#endif
-
-#define BASE_INPUT(addr) [p] "m" (*(const char *)(addr))
-#if defined(HAVE_AS_CLWB) || defined(HAVE_AS_XSAVEOPT)
-# define INPUT BASE_INPUT
-#else
-# define INPUT(addr) "a" (addr), BASE_INPUT(addr)
-#endif
-
-        asm volatile (CLWB_ENCODING :: INPUT(addr));
-
-#undef INPUT
-#undef BASE_INPUT
-#undef CLWB_ENCODING
-    }
+        clwb(addr);
 
     asm volatile ("sfence" ::: "memory");
 }
diff --git a/xen/arch/x86/include/asm/system.h b/xen/arch/x86/include/asm/system.h
index 8ceaaf45d1..57446c5b46 100644
--- a/xen/arch/x86/include/asm/system.h
+++ b/xen/arch/x86/include/asm/system.h
@@ -23,19 +23,12 @@ static inline void clflush(const void *p)
 
 static inline void clflushopt(const void *p)
 {
-    asm volatile ( "data16 clflush %0" :: "m" (*(const char *)p) );
+    asm volatile ( "clflushopt %0" :: "m" (*(const char *)p) );
 }
 
 static inline void clwb(const void *p)
 {
-#if defined(HAVE_AS_CLWB)
     asm volatile ( "clwb %0" :: "m" (*(const char *)p) );
-#elif defined(HAVE_AS_XSAVEOPT)
-    asm volatile ( "data16 xsaveopt %0" :: "m" (*(const char *)p) );
-#else
-    asm volatile ( ".byte 0x66, 0x0f, 0xae, 0x32"
-                   :: "d" (p), "m" (*(const char *)p) );
-#endif
 }
 
 #define xchg(ptr,v) \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 13:11:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 13:11:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.940088.1339963 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1mGN-0007tg-Uh; Mon, 07 Apr 2025 13:11:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 940088.1339963; Mon, 07 Apr 2025 13: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 1u1mGN-0007tY-Rl; Mon, 07 Apr 2025 13:11:43 +0000
Received: by outflank-mailman (input) for mailman id 940088;
 Mon, 07 Apr 2025 13:11:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u1mGM-0007rt-5F
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 13:11:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1mGM-000Hi0-0Q
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 13:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1mGM-00DsmK-0J
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 13:11:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3Ul+UHTArNZKAePXFTRX967nw6kMN6wWznGhx4faOXo=; b=oI2KPOtwuvRD1FL5nLqqCuxPtd
	iHStUH4QzVIJm6QIEC/ih345RpUbtlHSpfHJU9m/BiiBDkJtufFNg62QMBTQErxFAeWmjyibxZwEc
	vJ3on1zcp8El1DgmnWop1sR2672Anguo+DMpylwtt4aQ57W0iiqaVxnnZd0oKdy2tCxo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/emulate: Remove HAVE_AS_RDRAND and HAVE_AS_RDSEED
Message-Id: <E1u1mGM-00DsmK-0J@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 13:11:42 +0000

commit 05bf9f1f0f52e02036dad5e82dec83866b486a4e
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Sat Apr 5 01:25:07 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 7 12:55:06 2025 +0100

    x86/emulate: Remove HAVE_AS_RDRAND and HAVE_AS_RDSEED
    
    The new toolchain baseline knows the RDRAND and RDSEED instructions; no need
    to carry the workaround in the code.
    
    Fix up arch_get_random() too.
    
    No functional change.
    
    Resolves: https://gitlab.com/xen-project/xen/-/work_items/208
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/arch.mk              |  2 --
 xen/arch/x86/include/asm/random.h |  2 +-
 xen/arch/x86/x86_emulate/0fc7.c   | 15 +++++----------
 3 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk
index 8615533697..7882fb895e 100644
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -10,8 +10,6 @@ CFLAGS += -msoft-float
 
 $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
 $(call cc-option-add,CFLAGS,CC,-Wnested-externs)
-$(call as-option-add,CFLAGS,CC,"rdrand %eax",-DHAVE_AS_RDRAND)
-$(call as-option-add,CFLAGS,CC,"rdseed %eax",-DHAVE_AS_RDSEED)
 $(call as-option-add,CFLAGS,CC,".equ \"x\"$(comma)1",-DHAVE_AS_QUOTED_SYM)
 $(call as-option-add,CFLAGS,CC,"movdiri %rax$(comma)(%rax)",-DHAVE_AS_MOVDIR)
 $(call as-option-add,CFLAGS,CC,"enqcmd (%rax)$(comma)%rax",-DHAVE_AS_ENQCMD)
diff --git a/xen/arch/x86/include/asm/random.h b/xen/arch/x86/include/asm/random.h
index 9e1fe0bc1d..cd0f650b63 100644
--- a/xen/arch/x86/include/asm/random.h
+++ b/xen/arch/x86/include/asm/random.h
@@ -8,7 +8,7 @@ static inline unsigned int arch_get_random(void)
     unsigned int val = 0;
 
     if ( cpu_has(&current_cpu_data, X86_FEATURE_RDRAND) )
-        asm volatile ( ".byte 0x0f,0xc7,0xf0" : "+a" (val) );
+        asm volatile ( "rdrand %0" : "=r" (val) );
 
     return val;
 }
diff --git a/xen/arch/x86/x86_emulate/0fc7.c b/xen/arch/x86/x86_emulate/0fc7.c
index 5268d5cafd..58c8f79501 100644
--- a/xen/arch/x86/x86_emulate/0fc7.c
+++ b/xen/arch/x86/x86_emulate/0fc7.c
@@ -32,7 +32,6 @@ int x86emul_0fc7(struct x86_emulate_state *s,
             return X86EMUL_UNRECOGNIZED;
 
         case 6: /* rdrand */
-#ifdef HAVE_AS_RDRAND
             generate_exception_if(s->vex.pfx >= vex_f3, X86_EXC_UD);
             host_and_vcpu_must_have(rdrand);
             *dst = s->ea;
@@ -43,12 +42,12 @@ int x86emul_0fc7(struct x86_emulate_state *s,
                       : "=r" (dst->val), ASM_FLAG_OUT("=@ccc", "=qm") (carry) );
                 break;
             default:
-# ifdef __x86_64__
+#ifdef __x86_64__
                 asm ( "rdrand %k0" ASM_FLAG_OUT(, "; setc %1")
                       : "=r" (dst->val), ASM_FLAG_OUT("=@ccc", "=qm") (carry) );
                 break;
             case 8:
-# endif
+#endif
                 asm ( "rdrand %0" ASM_FLAG_OUT(, "; setc %1")
                       : "=r" (dst->val), ASM_FLAG_OUT("=@ccc", "=qm") (carry) );
                 break;
@@ -57,9 +56,6 @@ int x86emul_0fc7(struct x86_emulate_state *s,
             if ( carry )
                 regs->eflags |= X86_EFLAGS_CF;
             break;
-#else
-            return X86EMUL_UNIMPLEMENTED;
-#endif
 
         case 7: /* rdseed / rdpid */
             if ( s->vex.pfx == vex_f3 ) /* rdpid */
@@ -77,7 +73,7 @@ int x86emul_0fc7(struct x86_emulate_state *s,
                 dst->bytes = 4;
                 break;
             }
-#ifdef HAVE_AS_RDSEED
+
             generate_exception_if(s->vex.pfx >= vex_f3, X86_EXC_UD);
             host_and_vcpu_must_have(rdseed);
             *dst = s->ea;
@@ -88,12 +84,12 @@ int x86emul_0fc7(struct x86_emulate_state *s,
                       : "=r" (dst->val), ASM_FLAG_OUT("=@ccc", "=qm") (carry) );
                 break;
             default:
-# ifdef __x86_64__
+#ifdef __x86_64__
                 asm ( "rdseed %k0" ASM_FLAG_OUT(, "; setc %1")
                       : "=r" (dst->val), ASM_FLAG_OUT("=@ccc", "=qm") (carry) );
                 break;
             case 8:
-# endif
+#endif
                 asm ( "rdseed %0" ASM_FLAG_OUT(, "; setc %1")
                       : "=r" (dst->val), ASM_FLAG_OUT("=@ccc", "=qm") (carry) );
                 break;
@@ -102,7 +98,6 @@ int x86emul_0fc7(struct x86_emulate_state *s,
             if ( carry )
                 regs->eflags |= X86_EFLAGS_CF;
             break;
-#endif
         }
     }
     else
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 13:11:54 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 13:11:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.940090.1339966 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1mGX-00083y-Vv; Mon, 07 Apr 2025 13:11:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 940090.1339966; Mon, 07 Apr 2025 13: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 1u1mGX-00083q-TB; Mon, 07 Apr 2025 13:11:53 +0000
Received: by outflank-mailman (input) for mailman id 940090;
 Mon, 07 Apr 2025 13:11:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u1mGW-00083i-8K
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 13:11:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1mGW-000Hi4-0i
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 13:11:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1mGW-00DsvI-0b
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 13:11:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8FmAd8QVg1JpJiwRj8w8WpSV3f2DCWMnTXd0Xol959U=; b=G9Z2GeOokI9moXj8U8NRtT90fp
	k6hzFSf8I4rhuZOlR++qlkeOKg1GDODENB7GoxsIrkk0xsv5NsePa3UJ6s+0hdB0fFdXW9upXioC5
	f8/rHFf4DHc9C1/s0Z/ACTPtlKUYioj2empiWXcp3yCzO64jfRf98aQBM1J/YZ5YJDSY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/vmx: Rework VMX wrappers using `asm goto()`
Message-Id: <E1u1mGW-00DsvI-0b@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 13:11:52 +0000

commit fc3db01db6fb5eb5fbd89170d2714ff3a130a0de
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Sat Apr 5 01:27:57 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 7 12:55:06 2025 +0100

    x86/vmx: Rework VMX wrappers using `asm goto()`
    
    Improve error handling in VMX wrappers by switching to `asm goto()` where
    possible.
    
    No functional change.
    
    Resolves: https://gitlab.com/xen-project/xen/-/work_items/210
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/include/asm/hvm/vmx/vmx.h | 128 +++++++++++++++++----------------
 1 file changed, 67 insertions(+), 61 deletions(-)

diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmx.h b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
index affb3a8bd6..33d3d43a38 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
@@ -294,28 +294,30 @@ extern uint8_t posted_intr_vector;
 
 static always_inline void __vmptrld(u64 addr)
 {
-    asm volatile ( "vmptrld %0\n\t"
-                   /* CF==1 or ZF==1 --> BUG() */
-                   UNLIKELY_START(be, vmptrld)
-                   _ASM_BUGFRAME_TEXT(0)
-                   UNLIKELY_END_SECTION
-                   :
-                   : "m" (addr),
-                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
-                   : "memory" );
+    asm goto ( "vmptrld %[addr]\n\t"
+               "jbe %l[vmfail]"
+               :
+               : [addr] "m" (addr)
+               : "memory"
+               : vmfail );
+    return;
+
+ vmfail:
+    BUG();
 }
 
 static always_inline void __vmpclear(u64 addr)
 {
-    asm volatile ( "vmclear %0\n\t"
-                   /* CF==1 or ZF==1 --> BUG() */
-                   UNLIKELY_START(be, vmclear)
-                   _ASM_BUGFRAME_TEXT(0)
-                   UNLIKELY_END_SECTION
-                   :
-                   : "m" (addr),
-                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
-                   : "memory" );
+    asm goto ( "vmclear %[addr]\n\t"
+               "jbe %l[vmfail]"
+               :
+               : [addr] "m" (addr)
+               : "memory"
+               : vmfail );
+    return;
+
+ vmfail:
+    BUG();
 }
 
 static always_inline void __vmread(unsigned long field, unsigned long *value)
@@ -332,14 +334,16 @@ static always_inline void __vmread(unsigned long field, unsigned long *value)
 
 static always_inline void __vmwrite(unsigned long field, unsigned long value)
 {
-    asm volatile ( "vmwrite %1, %0\n"
-                   /* CF==1 or ZF==1 --> BUG() */
-                   UNLIKELY_START(be, vmwrite)
-                   _ASM_BUGFRAME_TEXT(0)
-                   UNLIKELY_END_SECTION
-                   :
-                   : "r" (field) , "rm" (value),
-                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0) );
+    asm goto ( "vmwrite %[value], %[field]\n\t"
+               "jbe %l[vmfail]"
+               :
+               : [field] "r" (field), [value] "rm" (value)
+               :
+               : vmfail );
+    return;
+
+ vmfail:
+    BUG();
 }
 
 static inline enum vmx_insn_errno vmread_safe(unsigned long field,
@@ -367,22 +371,22 @@ static inline enum vmx_insn_errno vmread_safe(unsigned long field,
 static inline enum vmx_insn_errno vmwrite_safe(unsigned long field,
                                                unsigned long value)
 {
-    unsigned long ret = VMX_INSN_SUCCEED;
-    bool fail_invalid, fail_valid;
-
-    asm volatile ( "vmwrite %[value], %[field]\n\t"
-                   ASM_FLAG_OUT(, "setc %[invalid]\n\t")
-                   ASM_FLAG_OUT(, "setz %[valid]\n\t")
-                   : ASM_FLAG_OUT("=@ccc", [invalid] "=rm") (fail_invalid),
-                     ASM_FLAG_OUT("=@ccz", [valid] "=rm") (fail_valid)
-                   : [field] "r" (field),
-                     [value] "rm" (value) );
-
-    if ( unlikely(fail_invalid) )
-        ret = VMX_INSN_FAIL_INVALID;
-    else if ( unlikely(fail_valid) )
-        __vmread(VM_INSTRUCTION_ERROR, &ret);
-
+    unsigned long ret;
+
+    asm goto ( "vmwrite %[value], %[field]\n\t"
+               "jc %l[vmfail_invalid]\n\t"
+               "jz %l[vmfail_error]"
+               :
+               : [field] "r" (field), [value] "rm" (value)
+               :
+               : vmfail_invalid, vmfail_error );
+    return VMX_INSN_SUCCEED;
+
+ vmfail_invalid:
+    return VMX_INSN_FAIL_INVALID;
+
+ vmfail_error:
+    __vmread(VM_INSTRUCTION_ERROR, &ret);
     return ret;
 }
 
@@ -400,15 +404,16 @@ static always_inline void __invept(unsigned long type, uint64_t eptp)
          !cpu_has_vmx_ept_invept_single_context )
         type = INVEPT_ALL_CONTEXT;
 
-    asm volatile ( "invept %0, %1\n\t"
-                   /* CF==1 or ZF==1 --> BUG() */
-                   UNLIKELY_START(be, invept)
-                   _ASM_BUGFRAME_TEXT(0)
-                   UNLIKELY_END_SECTION
-                   :
-                   : "m" (operand), "r" (type),
-                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
-                   : "memory" );
+    asm goto ( "invept %[operand], %[type]\n\t"
+               "jbe %l[vmfail]"
+               :
+               : [operand] "m" (operand), [type] "r" (type)
+               : "memory"
+               : vmfail );
+    return;
+
+ vmfail:
+    BUG();
 }
 
 static always_inline void __invvpid(unsigned long type, u16 vpid, u64 gva)
@@ -420,16 +425,17 @@ static always_inline void __invvpid(unsigned long type, u16 vpid, u64 gva)
     }  operand = {vpid, 0, gva};
 
     /* Fix up #UD exceptions which occur when TLBs are flushed before VMXON. */
-    asm volatile ( "1: invvpid %0, %1\n\t"
-                   /* CF==1 or ZF==1 --> BUG() */
-                   UNLIKELY_START(be, invvpid)
-                   _ASM_BUGFRAME_TEXT(0)
-                   UNLIKELY_END_SECTION "\n"
-                   "2:" _ASM_EXTABLE(1b, 2b)
-                   :
-                   : "m" (operand), "r" (type),
-                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
-                   : "memory" );
+    asm goto ( "1: invvpid %[operand], %[type]\n\t"
+               "   jbe %l[vmfail]\n\t"
+               "2:" _ASM_EXTABLE(1b, 2b)
+               :
+               : [operand] "m" (operand), [type] "r" (type)
+               : "memory"
+               : vmfail );
+    return;
+
+ vmfail:
+    BUG();
 }
 
 static inline void ept_sync_all(void)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 13:12:04 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 13:12:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.940092.1339969 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1mGi-00088U-1A; Mon, 07 Apr 2025 13:12:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 940092.1339969; Mon, 07 Apr 2025 13: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 1u1mGh-00088M-Ub; Mon, 07 Apr 2025 13:12:03 +0000
Received: by outflank-mailman (input) for mailman id 940092;
 Mon, 07 Apr 2025 13: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 1u1mGg-000886-B1
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 13: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 1u1mGg-000Hik-0z
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 13:12:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1mGg-00Dt1X-0t
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 13: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=vRXmbYciklSbckvHbmosdDwBLD8oB6WQZgOPTUXvvEI=; b=4+bTpiFARIQYCaBv0Jlb0R3Fet
	2oAnOAVgiyevXfF8UEqVgtbTtwZoNDEYEecw043mkaB2cO/xvyviXPU5rudkXpGqbRpXCzvm5oog6
	8+o6AeFcEStZWMGdB75EvN2GLazAE6fmm8+Q7Daewu4YoKGhApln4OjvGG0Yz6Ro/+7w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libxl: do not use `-c -E` compiler options together
Message-Id: <E1u1mGg-00Dt1X-0t@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 13:12:02 +0000

commit a235f856e4bbd270b085590e1f5fc9599234dcdf
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Apr 7 13:09:38 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 7 12:55:06 2025 +0100

    tools/libxl: do not use `-c -E` compiler options together
    
    It makes no sense to request for preprocessor only output and also request
    object file generation.  Fix the _libxl.api-for-check target to only use
    -E (preprocessor output).
    
    Also Clang 20.0 reports an error if both options are used.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Fixes: 2862bf5b6c81 ('libxl: enforce prohibitions of internal callers')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/light/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
index 37e4d16709..b690d92159 100644
--- a/tools/libs/light/Makefile
+++ b/tools/libs/light/Makefile
@@ -195,7 +195,7 @@ libxl.api-ok: check-libxl-api-rules _libxl.api-for-check
 	touch $@
 
 _libxl.api-for-check: $(XEN_INCLUDE)/libxl.h
-	$(CC) $(CPPFLAGS) $(CFLAGS) -c -E $< $(APPEND_CFLAGS) \
+	$(CC) $(CPPFLAGS) $(CFLAGS) -E $< $(APPEND_CFLAGS) \
 		-DLIBXL_EXTERNAL_CALLERS_ONLY=LIBXL_EXTERNAL_CALLERS_ONLY \
 		>$@.new
 	mv -f $@.new $@
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 21:11:09 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 21:11:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941193.1340703 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1tkF-00046S-So; Mon, 07 Apr 2025 21:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941193.1340703; Mon, 07 Apr 2025 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 1u1tkF-00046K-QD; Mon, 07 Apr 2025 21:11:03 +0000
Received: by outflank-mailman (input) for mailman id 941193;
 Mon, 07 Apr 2025 21: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 1u1tkE-000468-Nv
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 21: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 1u1tkE-000Tda-19
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 21:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1tkE-00HAPx-0w
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 21: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=YZ2P3Lhbzflkix3fRABKrMBgiVrQWg8G7CcsJN5GzWg=; b=RUtYUpEvMCgTUbyfdwVceVdS/5
	ze7tr9VJBahCNAwi1QgSXY0DKPKXSo2lqtSun81dh3aLt22mnbVWdE4czDCUSGdPqgpZk7Izd00Dm
	IWPhQOtuoF8oSd6zMbhw+puZKiqemY+RFlXNhmEGs5YXGPBR4K3yEPWLWoatUzf/efQQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/link: Drop .fixup section from non-x86 architectures
Message-Id: <E1u1tkE-00HAPx-0w@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 21:11:02 +0000

commit a6978dc09890796b91b1e35bbee68741b2a912eb
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Apr 3 11:49:02 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 7 19:17:38 2025 +0100

    xen/link: Drop .fixup section from non-x86 architectures
    
    The fixup section is only used by x86, and we're working to remove it there
    too.  Logic in the fixup section is unconnected to it's origin site, and
    interferes with backtraces/etc.
    
    Remove the section from the architectures which don't use it.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/arm/xen.lds.S   | 1 -
 xen/arch/ppc/xen.lds.S   | 1 -
 xen/arch/riscv/xen.lds.S | 1 -
 3 files changed, 3 deletions(-)

diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index 86a6e311cf..ae1903246f 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -45,7 +45,6 @@ SECTIONS
        *(.text.*)
 #endif
 
-       *(.fixup)
        *(.gnu.warning)
        _etext = .;             /* End of text section */
   } :text = 0x9090
diff --git a/xen/arch/ppc/xen.lds.S b/xen/arch/ppc/xen.lds.S
index 3f2a7676ec..1366e2819e 100644
--- a/xen/arch/ppc/xen.lds.S
+++ b/xen/arch/ppc/xen.lds.S
@@ -38,7 +38,6 @@ SECTIONS
         *(.text.*)
 #endif
 
-        *(.fixup)
         *(.gnu.warning)
         . = ALIGN(POINTER_ALIGN);
         _etext = .;             /* End of text section */
diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv/xen.lds.S
index dffc6ae119..818aa43669 100644
--- a/xen/arch/riscv/xen.lds.S
+++ b/xen/arch/riscv/xen.lds.S
@@ -33,7 +33,6 @@ SECTIONS
         *(.text.ident)
         _ident_end = .;
 
-        *(.fixup)
         *(.gnu.warning)
         . = ALIGN(POINTER_ALIGN);
         _etext = .;             /* End of text section */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 21:11:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 21:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941194.1340708 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1tkP-0004Gr-UH; Mon, 07 Apr 2025 21:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941194.1340708; Mon, 07 Apr 2025 21: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 1u1tkP-0004Gi-Ra; Mon, 07 Apr 2025 21:11:13 +0000
Received: by outflank-mailman (input) for mailman id 941194;
 Mon, 07 Apr 2025 21: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 1u1tkO-0004GX-GO
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 21: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 1u1tkO-000Tdw-1X
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 21:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1tkO-00HARa-1M
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 21: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=9g4Rg9wQ9bWypG8tk7W0mK0O84TgGYqfOVPwhDlU2+g=; b=WDn5EulkFDi/LI+TppNTbLhKV7
	W037HC4QrQtHNZxMjdP5qSj125vRJTOr6ZSL9zcomlLcfX3qss32enzd0dOudKFC9s7uvg4nzk6Kr
	L4FEk4j6KbHvn3atYyyS91dPg3v3SqwBSpf+JjHiJEWu8aGNkWa4XNDH+qiEoPMoxPW8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: Consistently use 'static' first
Message-Id: <E1u1tkO-00HARa-1M@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 21:11:12 +0000

commit a50ea5b12c147bc0c3740a45d659022534436f92
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Apr 3 21:39:19 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 7 19:17:38 2025 +0100

    xen: Consistently use 'static' first
    
    MISRA C:2012 Amendment 3 (which is under consideration, but not used by Xen
    yet) is more particular about having the storage class specifier first.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/gic-v2.c         | 2 +-
 xen/arch/x86/genapic/x2apic.c | 4 ++--
 xen/arch/x86/hvm/dom0_build.c | 4 ++--
 xen/include/xen/init.h        | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
index 02043c0d4b..b23e72a3d0 100644
--- a/xen/arch/arm/gic-v2.c
+++ b/xen/arch/arm/gic-v2.c
@@ -1311,7 +1311,7 @@ static void gicv2_do_LPI(unsigned int lpi)
     BUG();
 }
 
-const static struct gic_hw_operations gicv2_ops = {
+static const struct gic_hw_operations gicv2_ops = {
     .info                = &gicv2_info,
     .init                = gicv2_init,
     .secondary_init      = gicv2_secondary_cpu_init,
diff --git a/xen/arch/x86/genapic/x2apic.c b/xen/arch/x86/genapic/x2apic.c
index 74a6d808ac..1d55eb6b8a 100644
--- a/xen/arch/x86/genapic/x2apic.c
+++ b/xen/arch/x86/genapic/x2apic.c
@@ -216,9 +216,9 @@ static struct notifier_block x2apic_cpu_nfb = {
 static int8_t __initdata x2apic_phys = -1;
 boolean_param("x2apic_phys", x2apic_phys);
 
-enum {
+static enum {
    unset, physical, mixed
-} static __initdata x2apic_mode = unset;
+} x2apic_mode __initdata = unset;
 
 static int __init cf_check parse_x2apic_mode(const char *s)
 {
diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index daf1b6f88b..9fd68df7b9 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -91,10 +91,10 @@ static int __init pvh_populate_memory_range(struct domain *d,
                                             unsigned long start,
                                             unsigned long nr_pages)
 {
-    struct {
+    static const struct {
         unsigned long align;
         unsigned int order;
-    } static const __initconst orders[] = {
+    } orders[] __initconst = {
         /* NB: must be sorted by decreasing size. */
         { .align = PFN_DOWN(GB(1)), .order = PAGE_ORDER_1G },
         { .align = PFN_DOWN(MB(2)), .order = PAGE_ORDER_2M },
diff --git a/xen/include/xen/init.h b/xen/include/xen/init.h
index 0a42238337..abf275f0eb 100644
--- a/xen/include/xen/init.h
+++ b/xen/include/xen/init.h
@@ -63,9 +63,9 @@ typedef int (*initcall_t)(void);
 typedef void (*exitcall_t)(void);
 
 #define presmp_initcall(fn) \
-    const static initcall_t __initcall_##fn __init_call("presmp") = (fn)
+    static const initcall_t __initcall_##fn __init_call("presmp") = (fn)
 #define __initcall(fn) \
-    const static initcall_t __initcall_##fn __init_call("1") = (fn)
+    static const initcall_t __initcall_##fn __init_call("1") = (fn)
 #define __exitcall(fn) \
     static exitcall_t __exitcall_##fn __exit_call = fn
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 21:11:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 21:11:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941196.1340711 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1tkZ-0004Mw-VW; Mon, 07 Apr 2025 21:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941196.1340711; Mon, 07 Apr 2025 21: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 1u1tkZ-0004Mo-Sx; Mon, 07 Apr 2025 21:11:23 +0000
Received: by outflank-mailman (input) for mailman id 941196;
 Mon, 07 Apr 2025 21: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 1u1tkY-0004Me-Jg
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 21: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 1u1tkY-000Te0-1s
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 21:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1tkY-00HASn-1j
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 21: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=NkLrROJzs24xvHUCkHpxIpA9QcPyrBpgX0pvUCVMFG0=; b=ccTxUvjGUr7XQ2MDjZk4PIXtvS
	WuRn/Z4temBfnWJiLcnjoSXkdo1kiH6YAjIpl3nVEOjJurbgkWzt338Hal5LYRV5RZMTSV2aiOfFt
	RphQor/lE+txQG3YBPoLWQ0jZyiZr3bpKbwm5bLdzlYRdUoRcNLvI9EgoHIv3+zq7hqQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/AMD: Convert wrmsr_amd_safe() to use asm goto()
Message-Id: <E1u1tkY-00HASn-1j@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 21:11:22 +0000

commit b3d8b3e3f3aa4dcb1cf11acb90cfe368837e9534
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Apr 3 15:37:23 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 7 19:17:38 2025 +0100

    x86/AMD: Convert wrmsr_amd_safe() to use asm goto()
    
    Bloat-o-meter reports:
    
      add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-29 (-29)
      Function                                     old     new   delta
      _probe_mask_msr                               99      94      -5
      init_amd                                    2418    2394     -24
    
    but this under-reports because .fixup doesn't contain sized/typed symbols.
    This also drops two "mov -EFAULT, %reg; jmp ...;" sequences too, so the net
    saving is -50.
    
    wrmsr_amd_safe()'s return value is only checked against 0 (if at all), and
    because of this, the compiler can now avoid manifesting the 0/-EFAULT
    constants entirely, and the %[fault] label simply lands on the right basic
    block.
    
    Convert to Xen style while rewriting.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/amd.c | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 597b0f073d..ce4e1df710 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -74,21 +74,19 @@ static inline int rdmsr_amd_safe(unsigned int msr, unsigned int *lo,
 }
 
 static inline int wrmsr_amd_safe(unsigned int msr, unsigned int lo,
-				 unsigned int hi)
+                                 unsigned int hi)
 {
-	int err;
+    asm goto ( "1: wrmsr\n\t"
+               _ASM_EXTABLE(1b, %l[fault])
+               :
+               : "c" (msr), "a" (lo), "d" (hi), "D" (0x9c5a203a)
+               :
+               : fault );
 
-	asm volatile("1: wrmsr\n2:\n"
-		     ".section .fixup,\"ax\"\n"
-		     "3: movl %6,%0\n"
-		     "   jmp 2b\n"
-		     ".previous\n"
-		     _ASM_EXTABLE(1b, 3b)
-		     : "=r" (err)
-		     : "c" (msr), "a" (lo), "d" (hi), "D" (0x9c5a203a),
-		       "0" (0), "i" (-EFAULT));
+    return 0;
 
-	return err;
+ fault:
+    return -EFAULT;
 }
 
 static void wrmsr_amd(unsigned int msr, uint64_t val)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 21:11:34 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 21:11:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941198.1340717 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1tkk-0004WQ-12; Mon, 07 Apr 2025 21:11:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941198.1340717; Mon, 07 Apr 2025 21: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 1u1tkj-0004WI-UL; Mon, 07 Apr 2025 21:11:33 +0000
Received: by outflank-mailman (input) for mailman id 941198;
 Mon, 07 Apr 2025 21: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 1u1tki-0004Vt-MS
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 21: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 1u1tki-000Te7-29
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 21:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1tki-00HAUn-22
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 21: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=zWEv/nne5vZtoPVh8/rAcrU+6CTupMKcMT1PqK1Jih0=; b=uVaJgmdVhh3nmdgVx/4/cTjTWo
	qf1iXcvZbH3axe4+1XRxHOCcIcRefCLahU7eGM43rXhDUNt4cpPruULUoq7dMEq9ODB0tmj7xBJSf
	pIF8TnTrS0fTDdyVDlBCSPHZzL/ZcIJhYQeiULdeCqEKD57vlCl9Mt3HuJOREQVTid50=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: prevent grub unpacking initramfs
Message-Id: <E1u1tki-00HAUn-22@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 21:11:32 +0000

commit 32e6d052c2d88437c6fcec81e5369bc8016ac7e9
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Mon Apr 7 14:31:01 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 7 19:17:38 2025 +0100

    CI: prevent grub unpacking initramfs
    
    It fails on larger initramfs (~250MB one) and sometimes even smaller
    depending on memory size/memory map, let Linux do it.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/scripts/qubes-x86-64.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index f272964459..8e78b7984e 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -248,7 +248,7 @@ CONTROLLER=control@thor.testnet
 echo "
 multiboot2 (http)/gitlab-ci/xen $CONSOLE_OPTS loglvl=all guest_loglvl=all dom0_mem=4G console_timestamps=boot $extra_xen_opts
 module2 (http)/gitlab-ci/vmlinuz console=hvc0 root=/dev/ram0 earlyprintk=xen
-module2 (http)/gitlab-ci/initrd-dom0
+module2 --nounzip (http)/gitlab-ci/initrd-dom0
 " > $TFTP/grub.cfg
 
 echo "#!ipxe
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 21:11:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 21:11:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941200.1340720 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1tku-0004ZP-23; Mon, 07 Apr 2025 21:11:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941200.1340720; Mon, 07 Apr 2025 21: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 1u1tkt-0004ZG-Vj; Mon, 07 Apr 2025 21:11:43 +0000
Received: by outflank-mailman (input) for mailman id 941200;
 Mon, 07 Apr 2025 21: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 1u1tks-0004Yu-PR
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 21: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 1u1tks-000TeB-2S
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 21:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1tks-00HAbP-2K
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 21: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=rR+prkadbrP6EKYl5FOT+X5jiAY3lXDASwpA+eyhwOI=; b=YDnd6klDVNqWK4uqSKR85CBl7+
	fc7SzOyRmI39G/+GDxNKUTOprSrifTJBIAPslj5j2Axrg7AJaAqIhlA4p5eHz7UR0QfOES2st5JdZ
	SzMlymKgi6kunG+MAOlymodXhWX8q1Cr+Y40e+sweNmUfCQzHlITaaECgaCm2S+R0PWE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: enable XHCI console in Xen debug build on Alpine
Message-Id: <E1u1tks-00HAbP-2K@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 21:11:42 +0000

commit 17cf98d73043d4737783781df6526488b90d1565
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Mon Apr 7 14:31:03 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 7 19:17:38 2025 +0100

    CI: enable XHCI console in Xen debug build on Alpine
    
    This build is used for hardware tests, and some runners use XHCI console
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/gitlab-ci/build.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 2513908b05..169bebe3c7 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -341,6 +341,7 @@ alpine-3.18-gcc-debug:
       CONFIG_ARGO=y
       CONFIG_UBSAN=y
       CONFIG_UBSAN_FATAL=y
+      CONFIG_XHCI=y
 
 debian-12-x86_64-gcc-debug:
   extends: .gcc-x86-64-build-debug
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 21:11:54 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 21:11:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941202.1340724 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1tl4-0004bo-3O; Mon, 07 Apr 2025 21:11:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941202.1340724; Mon, 07 Apr 2025 21: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 1u1tl4-0004bg-0q; Mon, 07 Apr 2025 21:11:54 +0000
Received: by outflank-mailman (input) for mailman id 941202;
 Mon, 07 Apr 2025 21: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 1u1tl2-0004bY-SB
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 21: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 1u1tl2-000TeH-2j
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 21:11:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1tl2-00HAew-2d
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 21: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=4pIATCo+15ec7pRZgp3MXy/6XYIohm2KubIQeALwydU=; b=HONV7R3OaWPJSH9QlJwPOjGne/
	TktJcBsP7jIZhHIIrLx6z4vOHfR2eKhp3anT5UwURxaXIvhyTqkWzlWMUBPYogQ7e3d2iG2nTwHVF
	f8DFbxJ3ZQW5TdxMOmQLYkaOhkpwai9kj4uGiIq7pLMqWK6lQvQGqMIX4pzZYA4bi5Mw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: include domU kernel messages in the console output log
Message-Id: <E1u1tl2-00HAew-2d@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 21:11:52 +0000

commit 1804064f68d52a47f1fc1454a3b254c16abe192b
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Mon Apr 7 14:31:04 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 7 19:17:38 2025 +0100

    CI: include domU kernel messages in the console output log
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 automation/scripts/qubes-x86-64.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index 8e78b7984e..80000854bc 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -175,6 +175,8 @@ if [ -n "$domU_check" ]; then
     rm var/run
     echo "#!/bin/sh
 
+echo 8 > /proc/sys/kernel/printk
+
 ${domU_check}
 " > etc/local.d/xen.start
     chmod +x etc/local.d/xen.start
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 21:12:04 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 21:12:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941204.1340728 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1tlE-0004g5-55; Mon, 07 Apr 2025 21:12:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941204.1340728; Mon, 07 Apr 2025 21: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 1u1tlE-0004fx-2G; Mon, 07 Apr 2025 21:12:04 +0000
Received: by outflank-mailman (input) for mailman id 941204;
 Mon, 07 Apr 2025 21: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 1u1tlC-0004fk-V5
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 21: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 1u1tlC-000Tee-30
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 21:12:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1tlC-00HAht-2t
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 21: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=9D2WtIQ1TtgAxkw2wANfm4Ty5y91/pJS063da11COLg=; b=OFM9J7MXL+xVw5++taUpNjSawx
	sa2GN6CghCOi+vv7W8Tetmdf2vRSUoYIXVSf3UWjmmyXRoIRdkNAWS2Af48EzXYYEQUIPhQWZoy7S
	MT4kbeg5Y4YGE9CALPQ9MCUJxgYKPP7wSWWGPd110pw+af4KCEMkqtF+6BBAmVyb88lw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: increase verbosity of starting a domain
Message-Id: <E1u1tlC-00HAht-2t@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 21:12:02 +0000

commit b8d41a9b22bbe9a08c8438eacf7b705500f20cea
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Mon Apr 7 14:31:05 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 7 19:17:38 2025 +0100

    CI: increase verbosity of starting a domain
    
    And start collecting qemu log earlier, so it isn't lost in case of a
    timeout during domain startup.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/scripts/qemu-alpine-x86_64.sh       | 2 +-
 automation/scripts/qemu-smoke-dom0-arm32.sh    | 2 +-
 automation/scripts/qemu-smoke-dom0-arm64.sh    | 2 +-
 automation/scripts/qubes-x86-64.sh             | 4 ++--
 automation/scripts/xilinx-smoke-dom0-x86_64.sh | 4 ++--
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
index 1ff689b577..17e2141d62 100755
--- a/automation/scripts/qemu-alpine-x86_64.sh
+++ b/automation/scripts/qemu-alpine-x86_64.sh
@@ -56,7 +56,7 @@ bash /etc/init.d/xencommons start
 
 xl list
 
-xl create -c /root/test.cfg
+xl -vvv create -c /root/test.cfg
 
 " > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
diff --git a/automation/scripts/qemu-smoke-dom0-arm32.sh b/automation/scripts/qemu-smoke-dom0-arm32.sh
index e1cd838809..0c60a66e25 100755
--- a/automation/scripts/qemu-smoke-dom0-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm32.sh
@@ -21,7 +21,7 @@ echo "#!/bin/bash
 
 xl list
 
-xl create -c /root/test.cfg
+xl -vvv create -c /root/test.cfg
 
 " > ./root/xen.start
 echo "bash /root/xen.start" >> ./etc/init.d/xen-watchdog
diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
index 4d22a124df..8774a87012 100755
--- a/automation/scripts/qemu-smoke-dom0-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
@@ -52,7 +52,7 @@ bash /etc/init.d/xencommons start
 
 xl list
 
-xl create -c /root/test.cfg
+xl -vvv create -c /root/test.cfg
 
 " > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index 80000854bc..7867724ebd 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -122,7 +122,6 @@ echo \"${passed}\"
 "
 
         dom0_check="
-tail -F /var/log/xen/qemu-dm-domU.log &
 until grep -q \"^domU Welcome to Alpine Linux\" /var/log/xen/console/guest-domU.log; do
     sleep 1
 done
@@ -222,7 +221,8 @@ if [ -n "$domU_check" ]; then
     echo "
 # get domU console content into test log
 tail -F /var/log/xen/console/guest-domU.log 2>/dev/null | sed -e \"s/^/(domU) /\" &
-xl create /etc/xen/domU.cfg
+tail -F /var/log/xen/qemu-dm-domU.log 2>/dev/null | sed -e \"s/^/(qemu-dm) /\" &
+xl -vvv create /etc/xen/domU.cfg
 ${dom0_check}
 " >> etc/local.d/xen.start
 else
diff --git a/automation/scripts/xilinx-smoke-dom0-x86_64.sh b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
index f70cfdc155..7834ffbe05 100755
--- a/automation/scripts/xilinx-smoke-dom0-x86_64.sh
+++ b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
@@ -49,7 +49,7 @@ ifconfig xenbr0 up
 ifconfig xenbr0 192.168.0.1
 # get domU console content into test log
 tail -F /var/log/xen/console/guest-domU.log 2>/dev/null | sed -e \"s/^/(domU) /\" &
-xl create /etc/xen/domU.cfg
+xl -vvv create /etc/xen/domU.cfg
 set +x
 until grep -q \"${DOMU_MSG}\" /var/log/xen/console/guest-domU.log; do
     sleep 1
@@ -75,7 +75,7 @@ done | argo-exec -p 28333 -d 0 -- /bin/echo
 "
     DOM0_CMD="
 insmod /root/xen-argo.ko
-xl create /etc/xen/domU.cfg
+xl -vvv create /etc/xen/domU.cfg
 argo-exec -l -p 28333 -- /bin/echo
 "
 copy_dom0_files ()
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 21:12:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 21:12:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941206.1340731 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1tlO-0004ik-6L; Mon, 07 Apr 2025 21:12:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941206.1340731; Mon, 07 Apr 2025 21: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 1u1tlO-0004id-3k; Mon, 07 Apr 2025 21:12:14 +0000
Received: by outflank-mailman (input) for mailman id 941206;
 Mon, 07 Apr 2025 21: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 1u1tlN-0004iM-1v
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 21: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 1u1tlN-000Tf2-05
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 21:12:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1tlM-00HAmE-3A
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 21: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=V+Zml4XxPBa2cLDqFnC/9MhKmUHfBc3Ud1EnBtNOfLs=; b=VwZ3I2z2VOv0umPQn2SdVTT69m
	FNTMFj5jfLQeErcxV3QdcrVzoSzveBwrsJnwO6h6K8aPO+LvM1LQ5X+G6/ZcRiXQaEZl5gulIMz+x
	Xw041iB6KYD0M5NgS+kZZMX6XV7ba49Sufw7X3q94E6BJ0T/YIjdgabV1JcTOiWhq4C0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: consistently use DOCKER_CMD in makefiles
Message-Id: <E1u1tlM-00HAmE-3A@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 21:12:12 +0000

commit 5606b982acd44cc1f0715c424a11b2e76420aa18
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Mon Apr 7 14:31:06 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 7 19:17:38 2025 +0100

    CI: consistently use DOCKER_CMD in makefiles
    
    This allows rebuilding containers using podman too.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/build/Makefile           | 4 ++--
 automation/tests-artifacts/Makefile | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/automation/build/Makefile b/automation/build/Makefile
index 4df43b0407..fedf7524da 100644
--- a/automation/build/Makefile
+++ b/automation/build/Makefile
@@ -31,8 +31,8 @@ clean:
 define CLEAN_RULE
 .PHONY: clean-$(1)
 clean-$(1):
-	if [ -n "$$$$(docker image ls -q $(REGISTRY)/$(subst /,:,$(1)))" ]; then \
-		docker image rm $(REGISTRY)/$(subst /,:,$(1)); \
+	if [ -n "$$$$($(DOCKER_CMD) image ls -q $(REGISTRY)/$(subst /,:,$(1)))" ]; then \
+		$(DOCKER_CMD) image rm $(REGISTRY)/$(subst /,:,$(1)); \
 	fi
 
 endef
diff --git a/automation/tests-artifacts/Makefile b/automation/tests-artifacts/Makefile
index d055cd696b..80a60a94f3 100644
--- a/automation/tests-artifacts/Makefile
+++ b/automation/tests-artifacts/Makefile
@@ -10,9 +10,9 @@ help:
 	@echo "To push container builds, set the env var PUSH"
 
 %: %.dockerfile ## Builds containers
-	docker build --pull -t $(REGISTRY)/$(@D):$(@F) -f $< $(<D)
+	$(DOCKER_CMD) build --pull -t $(REGISTRY)/$(@D):$(@F) -f $< $(<D)
 	@if [ ! -z $${PUSH+x} ]; then \
-		docker push $(REGISTRY)/$(@D):$(@F); \
+		$(DOCKER_CMD) push $(REGISTRY)/$(@D):$(@F); \
 	fi
 
 .PHONY: all
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 21:12:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 21:12:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941208.1340736 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1tlY-0004lj-9M; Mon, 07 Apr 2025 21:12:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941208.1340736; Mon, 07 Apr 2025 21: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 1u1tlY-0004lb-6h; Mon, 07 Apr 2025 21:12:24 +0000
Received: by outflank-mailman (input) for mailman id 941208;
 Mon, 07 Apr 2025 21: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 1u1tlX-0004lR-4b
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 21: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 1u1tlX-000TfA-0M
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 21:12:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1tlX-00HAoY-0F
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 21: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=Yu3IHcD7m436bP5419kLU7S6sdc8idQxJ0hZR0MODDU=; b=npeeyGlIruGEZEgm9Ldb70OOOE
	FS0FEunfn4Hs3cv8YW2Rl4PKcf/q/gwSJs0vsi9GCprOnwvVzM9G6djxMOwOFD/Vg0oJcPedPRHyn
	tYkAPCwbhlccbOzQCSOvMD9doOHzxlDnvIqUPcuxDEmgxF2lSvCZqyR6XupIRKB33Lkc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: wait for the network interface in PCI passthrough tests
Message-Id: <E1u1tlX-00HAoY-0F@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 21:12:23 +0000

commit 6e3fe711fbf3a659160ab7ef2c293dffd62bbda4
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Mon Apr 7 14:31:07 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 7 19:17:38 2025 +0100

    CI: wait for the network interface in PCI passthrough tests
    
    The network driver initializes asynchronously, and it may not be ready
    yet by the time the startup script is called. This is especially the
    case for USB network adapter (where the PCI device is the USB
    controller) in the upcoming runner.
    
    Don't bother about separate timeout - test timeout will cover this part
    too.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/scripts/qubes-x86-64.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index 7867724ebd..2b04d281d7 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -104,6 +104,7 @@ on_reboot = "destroy"
         domU_check="
 set -x -e
 interface=eth0
+while ! [ -e \"/sys/class/net/\$interface\" ]; do sleep 1; done
 ip link set \"\$interface\" up
 timeout 30s udhcpc -i \"\$interface\"
 pingip=\$(ip -o -4 r show default|cut -f 3 -d ' ')
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 21:12:34 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 21:12:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941210.1340739 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1tli-0004oT-AY; Mon, 07 Apr 2025 21:12:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941210.1340739; Mon, 07 Apr 2025 21: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 1u1tli-0004oL-83; Mon, 07 Apr 2025 21:12:34 +0000
Received: by outflank-mailman (input) for mailman id 941210;
 Mon, 07 Apr 2025 21: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 1u1tlh-0004o4-7B
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 21: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 1u1tlh-000TfH-0c
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 21:12:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1tlh-00HAqK-0X
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 21: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=+4w+UBE/27gzYk5jjmRAIjZcZAYkSf7Eo9lwt2TcFds=; b=jemh6KCBfoxUhBGurfmEFbuBHM
	E+4RVQD5PVsJEVaB4Lr/1m7Hgyy1u3JUkZcfI4EDHO5Ka/CXuddTszyQJd0Ed0K6AzAk/9Qw1Ub93
	pYYp/88hXAeaRMz+QS0eY4apwvrLKPCkTEEKIPdECuxyRAT31zOKo2uWvbIqBXgBzMi0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: adjust resolving network interface into PCI device
Message-Id: <E1u1tlh-00HAqK-0X@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 21:12:33 +0000

commit 930279d96ca706f05e5860bef4126fc97457d256
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Mon Apr 7 14:31:09 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 7 19:17:38 2025 +0100

    CI: adjust resolving network interface into PCI device
    
    Change how PCI device lookup is done to handle also USB devices, in
    which case get the USB controller. Instead of taking basename of the
    'device' symlink, resolve the full path (example:
    /sys/devices/pci0000:00/0000:00:09.0/usb4/4-7/4-7:1.0) and take the
    first part after pci0000:00. Theoretically it could be a bridge, but VM
    has flat PCI topology.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/scripts/qubes-x86-64.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index 2b04d281d7..a964ac4b7a 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -110,7 +110,8 @@ timeout 30s udhcpc -i \"\$interface\"
 pingip=\$(ip -o -4 r show default|cut -f 3 -d ' ')
 ping -c 10 \"\$pingip\"
 echo domU started
-pcidevice=\$(basename \$(readlink /sys/class/net/\$interface/device))
+pcidevice=\$(realpath /sys/class/net/\$interface/device |
+             sed 's#.*pci0000:00/\\([^/]*\\).*#\\1#')
 lspci -vs \$pcidevice
 "
         if [ -n "$PCIDEV_INTR" ]; then
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 23:55:11 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 23:55:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941293.1340796 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1wIy-0000kI-HB; Mon, 07 Apr 2025 23:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941293.1340796; Mon, 07 Apr 2025 23: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 1u1wIy-0000kA-Ed; Mon, 07 Apr 2025 23:55:04 +0000
Received: by outflank-mailman (input) for mailman id 941293;
 Mon, 07 Apr 2025 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 1u1wIw-0000k4-Or
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 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 1u1wIw-000XZm-1M
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 23:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1wIw-0009Cx-19
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 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=khqk3wHzSOXTvS89wgAJL/9Rn/9uhzfJq36/ZQ6Ctks=; b=QC70WaAU/+cLd2EFX0OCvLidYK
	+iVFCRFM+OrIKiwkHKsZXyd6yFHFvxukVLazmUMysuXzVtsKGjK1mXlobWMwj0Pw3M26eBHFOANRJ
	JWMy/9wGaL5b0+SbqkAGQmXB8w5XtuZqvP0uGPk/G8N8NmLZF2YB7vlAM3KtsIThw+9Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/link: Drop .fixup section from non-x86 architectures
Message-Id: <E1u1wIw-0009Cx-19@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 23:55:02 +0000

commit a6978dc09890796b91b1e35bbee68741b2a912eb
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Apr 3 11:49:02 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 7 19:17:38 2025 +0100

    xen/link: Drop .fixup section from non-x86 architectures
    
    The fixup section is only used by x86, and we're working to remove it there
    too.  Logic in the fixup section is unconnected to it's origin site, and
    interferes with backtraces/etc.
    
    Remove the section from the architectures which don't use it.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/arm/xen.lds.S   | 1 -
 xen/arch/ppc/xen.lds.S   | 1 -
 xen/arch/riscv/xen.lds.S | 1 -
 3 files changed, 3 deletions(-)

diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index 86a6e311cf..ae1903246f 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -45,7 +45,6 @@ SECTIONS
        *(.text.*)
 #endif
 
-       *(.fixup)
        *(.gnu.warning)
        _etext = .;             /* End of text section */
   } :text = 0x9090
diff --git a/xen/arch/ppc/xen.lds.S b/xen/arch/ppc/xen.lds.S
index 3f2a7676ec..1366e2819e 100644
--- a/xen/arch/ppc/xen.lds.S
+++ b/xen/arch/ppc/xen.lds.S
@@ -38,7 +38,6 @@ SECTIONS
         *(.text.*)
 #endif
 
-        *(.fixup)
         *(.gnu.warning)
         . = ALIGN(POINTER_ALIGN);
         _etext = .;             /* End of text section */
diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv/xen.lds.S
index dffc6ae119..818aa43669 100644
--- a/xen/arch/riscv/xen.lds.S
+++ b/xen/arch/riscv/xen.lds.S
@@ -33,7 +33,6 @@ SECTIONS
         *(.text.ident)
         _ident_end = .;
 
-        *(.fixup)
         *(.gnu.warning)
         . = ALIGN(POINTER_ALIGN);
         _etext = .;             /* End of text section */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 23:55:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 23:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941294.1340801 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1wJ8-0000lp-Ig; Mon, 07 Apr 2025 23:55:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941294.1340801; Mon, 07 Apr 2025 23: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 1u1wJ8-0000lh-Fz; Mon, 07 Apr 2025 23:55:14 +0000
Received: by outflank-mailman (input) for mailman id 941294;
 Mon, 07 Apr 2025 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 1u1wJ6-0000lU-II
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 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 1u1wJ6-000Xa6-1i
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 23:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1wJ6-0009GI-1Y
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 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=UMOKpVY9AHsdZxyT1plOcecqyWI4uaMLRoOzN5+vLyY=; b=avUcod4xh1hAmDHEv4VFH6Pea7
	SWIpSjPUji2Wp1Mu/g7ugNtaiVG2ROVMH+lz63wClYMdU4tWJqzZ+OG/8oFQPSMu+48NQ9ukyCgmq
	OG+pZ7sAMAFH0l7TJvpR4seB/EpCn7jZWSMWheWEOLy7awBTm3pseicXceGm4VwcHwMc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: Consistently use 'static' first
Message-Id: <E1u1wJ6-0009GI-1Y@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 23:55:12 +0000

commit a50ea5b12c147bc0c3740a45d659022534436f92
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Apr 3 21:39:19 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 7 19:17:38 2025 +0100

    xen: Consistently use 'static' first
    
    MISRA C:2012 Amendment 3 (which is under consideration, but not used by Xen
    yet) is more particular about having the storage class specifier first.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/gic-v2.c         | 2 +-
 xen/arch/x86/genapic/x2apic.c | 4 ++--
 xen/arch/x86/hvm/dom0_build.c | 4 ++--
 xen/include/xen/init.h        | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
index 02043c0d4b..b23e72a3d0 100644
--- a/xen/arch/arm/gic-v2.c
+++ b/xen/arch/arm/gic-v2.c
@@ -1311,7 +1311,7 @@ static void gicv2_do_LPI(unsigned int lpi)
     BUG();
 }
 
-const static struct gic_hw_operations gicv2_ops = {
+static const struct gic_hw_operations gicv2_ops = {
     .info                = &gicv2_info,
     .init                = gicv2_init,
     .secondary_init      = gicv2_secondary_cpu_init,
diff --git a/xen/arch/x86/genapic/x2apic.c b/xen/arch/x86/genapic/x2apic.c
index 74a6d808ac..1d55eb6b8a 100644
--- a/xen/arch/x86/genapic/x2apic.c
+++ b/xen/arch/x86/genapic/x2apic.c
@@ -216,9 +216,9 @@ static struct notifier_block x2apic_cpu_nfb = {
 static int8_t __initdata x2apic_phys = -1;
 boolean_param("x2apic_phys", x2apic_phys);
 
-enum {
+static enum {
    unset, physical, mixed
-} static __initdata x2apic_mode = unset;
+} x2apic_mode __initdata = unset;
 
 static int __init cf_check parse_x2apic_mode(const char *s)
 {
diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index daf1b6f88b..9fd68df7b9 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -91,10 +91,10 @@ static int __init pvh_populate_memory_range(struct domain *d,
                                             unsigned long start,
                                             unsigned long nr_pages)
 {
-    struct {
+    static const struct {
         unsigned long align;
         unsigned int order;
-    } static const __initconst orders[] = {
+    } orders[] __initconst = {
         /* NB: must be sorted by decreasing size. */
         { .align = PFN_DOWN(GB(1)), .order = PAGE_ORDER_1G },
         { .align = PFN_DOWN(MB(2)), .order = PAGE_ORDER_2M },
diff --git a/xen/include/xen/init.h b/xen/include/xen/init.h
index 0a42238337..abf275f0eb 100644
--- a/xen/include/xen/init.h
+++ b/xen/include/xen/init.h
@@ -63,9 +63,9 @@ typedef int (*initcall_t)(void);
 typedef void (*exitcall_t)(void);
 
 #define presmp_initcall(fn) \
-    const static initcall_t __initcall_##fn __init_call("presmp") = (fn)
+    static const initcall_t __initcall_##fn __init_call("presmp") = (fn)
 #define __initcall(fn) \
-    const static initcall_t __initcall_##fn __init_call("1") = (fn)
+    static const initcall_t __initcall_##fn __init_call("1") = (fn)
 #define __exitcall(fn) \
     static exitcall_t __exitcall_##fn __exit_call = fn
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 23:55:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 23:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941295.1340806 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1wJI-0000oZ-KZ; Mon, 07 Apr 2025 23:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941295.1340806; Mon, 07 Apr 2025 23: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 1u1wJI-0000oR-HU; Mon, 07 Apr 2025 23:55:24 +0000
Received: by outflank-mailman (input) for mailman id 941295;
 Mon, 07 Apr 2025 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 1u1wJG-0000o2-LO
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 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 1u1wJG-000XaA-20
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 23:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1wJG-0009JQ-1t
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 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=P9pQPKY5hGVlOEC8KkHqU1ArHJ6bGXuUr/0XcJSz2p8=; b=svYnFqP2AMY3NsjUs1KG+WYKfF
	AVH+esEs0P3aV35DjjLzTidgjbrifvMku1+kwek0gX2oAewFOIuXpaRqyyZJT6ooOpRur32oynKYm
	LG5qjmLx0Vgbo/ejivb05YlmiOaLTgXdoNzSgxNMCR0rOshtLN/LCRzhFniFjG5qOg8U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/AMD: Convert wrmsr_amd_safe() to use asm goto()
Message-Id: <E1u1wJG-0009JQ-1t@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 23:55:22 +0000

commit b3d8b3e3f3aa4dcb1cf11acb90cfe368837e9534
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Apr 3 15:37:23 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 7 19:17:38 2025 +0100

    x86/AMD: Convert wrmsr_amd_safe() to use asm goto()
    
    Bloat-o-meter reports:
    
      add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-29 (-29)
      Function                                     old     new   delta
      _probe_mask_msr                               99      94      -5
      init_amd                                    2418    2394     -24
    
    but this under-reports because .fixup doesn't contain sized/typed symbols.
    This also drops two "mov -EFAULT, %reg; jmp ...;" sequences too, so the net
    saving is -50.
    
    wrmsr_amd_safe()'s return value is only checked against 0 (if at all), and
    because of this, the compiler can now avoid manifesting the 0/-EFAULT
    constants entirely, and the %[fault] label simply lands on the right basic
    block.
    
    Convert to Xen style while rewriting.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/amd.c | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 597b0f073d..ce4e1df710 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -74,21 +74,19 @@ static inline int rdmsr_amd_safe(unsigned int msr, unsigned int *lo,
 }
 
 static inline int wrmsr_amd_safe(unsigned int msr, unsigned int lo,
-				 unsigned int hi)
+                                 unsigned int hi)
 {
-	int err;
+    asm goto ( "1: wrmsr\n\t"
+               _ASM_EXTABLE(1b, %l[fault])
+               :
+               : "c" (msr), "a" (lo), "d" (hi), "D" (0x9c5a203a)
+               :
+               : fault );
 
-	asm volatile("1: wrmsr\n2:\n"
-		     ".section .fixup,\"ax\"\n"
-		     "3: movl %6,%0\n"
-		     "   jmp 2b\n"
-		     ".previous\n"
-		     _ASM_EXTABLE(1b, 3b)
-		     : "=r" (err)
-		     : "c" (msr), "a" (lo), "d" (hi), "D" (0x9c5a203a),
-		       "0" (0), "i" (-EFAULT));
+    return 0;
 
-	return err;
+ fault:
+    return -EFAULT;
 }
 
 static void wrmsr_amd(unsigned int msr, uint64_t val)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 23:55:34 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 23:55:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941298.1340809 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1wJS-0000qb-LM; Mon, 07 Apr 2025 23:55:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941298.1340809; Mon, 07 Apr 2025 23: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 1u1wJS-0000qT-Iq; Mon, 07 Apr 2025 23:55:34 +0000
Received: by outflank-mailman (input) for mailman id 941298;
 Mon, 07 Apr 2025 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 1u1wJQ-0000qL-Nl
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 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 1u1wJQ-000XaH-2H
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 23:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1wJQ-0009N7-2A
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 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=JEOGpqGx0L6pRPlJygw1r/JyagI03iGdbWYms86NfVQ=; b=nzl7RZRCnpb8pI0yhKIUNGac1h
	nI3P2h/uNp9+XWkQJOuAe25MgUnp0XLcxvL1XSlgrkXXGS7l0Ue2X7er/5ZGO/iYjdx6mq/kwjQBC
	pLSJAVg26i36H4+Q/67LuxNcOa2stfQ4hWn9b+1jkt/9j32Ao8sXeO9yv+ip6y9eWmw8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: prevent grub unpacking initramfs
Message-Id: <E1u1wJQ-0009N7-2A@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 23:55:32 +0000

commit 32e6d052c2d88437c6fcec81e5369bc8016ac7e9
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Mon Apr 7 14:31:01 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 7 19:17:38 2025 +0100

    CI: prevent grub unpacking initramfs
    
    It fails on larger initramfs (~250MB one) and sometimes even smaller
    depending on memory size/memory map, let Linux do it.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/scripts/qubes-x86-64.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index f272964459..8e78b7984e 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -248,7 +248,7 @@ CONTROLLER=control@thor.testnet
 echo "
 multiboot2 (http)/gitlab-ci/xen $CONSOLE_OPTS loglvl=all guest_loglvl=all dom0_mem=4G console_timestamps=boot $extra_xen_opts
 module2 (http)/gitlab-ci/vmlinuz console=hvc0 root=/dev/ram0 earlyprintk=xen
-module2 (http)/gitlab-ci/initrd-dom0
+module2 --nounzip (http)/gitlab-ci/initrd-dom0
 " > $TFTP/grub.cfg
 
 echo "#!ipxe
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 23:55:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 23:55:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941300.1340813 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1wJc-0000sx-NT; Mon, 07 Apr 2025 23:55:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941300.1340813; Mon, 07 Apr 2025 23: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 1u1wJc-0000sm-KB; Mon, 07 Apr 2025 23:55:44 +0000
Received: by outflank-mailman (input) for mailman id 941300;
 Mon, 07 Apr 2025 23: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 1u1wJa-0000sZ-R5
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 23: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 1u1wJa-000XaL-2c
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 23:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1wJa-0009O5-2S
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 23: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=of+NKiHTEENhobBoOQmdjzbuGgIYzTwgtOH4Q94f+S0=; b=ugXjpgzaN3I5CF0rBPJPpQKA9h
	y9q5oRKfEayLjhwLTxsVSnkNX/6GTZr38MavOUgd+U1xLuw8Gff6ivSD7yu1BGtFruTqI7sXrMTvJ
	YU3Y7QxmxPy4W3eS0ua+2xiGGwRmuBO+7/YVoJCnV9nrMpSHKYRo4/LBqKVcIYxD/1A8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: enable XHCI console in Xen debug build on Alpine
Message-Id: <E1u1wJa-0009O5-2S@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 23:55:42 +0000

commit 17cf98d73043d4737783781df6526488b90d1565
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Mon Apr 7 14:31:03 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 7 19:17:38 2025 +0100

    CI: enable XHCI console in Xen debug build on Alpine
    
    This build is used for hardware tests, and some runners use XHCI console
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/gitlab-ci/build.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 2513908b05..169bebe3c7 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -341,6 +341,7 @@ alpine-3.18-gcc-debug:
       CONFIG_ARGO=y
       CONFIG_UBSAN=y
       CONFIG_UBSAN_FATAL=y
+      CONFIG_XHCI=y
 
 debian-12-x86_64-gcc-debug:
   extends: .gcc-x86-64-build-debug
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 23:55:54 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 23:55:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941302.1340817 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1wJm-0000v1-OP; Mon, 07 Apr 2025 23:55:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941302.1340817; Mon, 07 Apr 2025 23: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 1u1wJm-0000ut-LW; Mon, 07 Apr 2025 23:55:54 +0000
Received: by outflank-mailman (input) for mailman id 941302;
 Mon, 07 Apr 2025 23: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 1u1wJk-0000ul-UJ
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 23: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 1u1wJk-000XaR-2v
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 23:55:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1wJk-0009PR-2n
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 23: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=t9bS29n3BxpXlWRbinscryjHyZvg1Zl0s7tCNj7nqzs=; b=bBcANkrdBQdlcgThRORihX5lkZ
	/t8jMC0SpDrTWgko9P4dz1Ua+aDDwRgq0cgfieP2BBiMV5YGkPbW2i0VZ90p3VdIdwcHSz3kbxYPq
	EVfoLiCeDrJ2AajYfjwHyQQ/jvuT7TSvFuU0LzPLEvpu8QjzxIJksyL098K5pE9CSKRE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: include domU kernel messages in the console output log
Message-Id: <E1u1wJk-0009PR-2n@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 23:55:52 +0000

commit 1804064f68d52a47f1fc1454a3b254c16abe192b
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Mon Apr 7 14:31:04 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 7 19:17:38 2025 +0100

    CI: include domU kernel messages in the console output log
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 automation/scripts/qubes-x86-64.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index 8e78b7984e..80000854bc 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -175,6 +175,8 @@ if [ -n "$domU_check" ]; then
     rm var/run
     echo "#!/bin/sh
 
+echo 8 > /proc/sys/kernel/printk
+
 ${domU_check}
 " > etc/local.d/xen.start
     chmod +x etc/local.d/xen.start
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 23:56:03 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 23:56:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941304.1340821 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1wJv-0000yA-ST; Mon, 07 Apr 2025 23:56:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941304.1340821; Mon, 07 Apr 2025 23:56: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 1u1wJv-0000y2-PZ; Mon, 07 Apr 2025 23:56:03 +0000
Received: by outflank-mailman (input) for mailman id 941304;
 Mon, 07 Apr 2025 23:56:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u1wJv-0000xu-14
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 23:56:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1wJv-000Xai-00
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 23:56:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1wJu-0009RM-36
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 23: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=KBU7uXhSjUqEjXskY62sxa02V2q/n69gR3LW4prBwKM=; b=5r76V41Ztf3wRpe6urogeZp+wa
	gBWutU8fhSqb1NgswMzvZz/K8Bk99/BIMBBqVPqm4h/N171Xzhdan3I7R5vDrqUB94JT8PtEgS7pL
	6JeL+jCLM37h5zRUWEjWz00ulpLBRE6+6/HMr/jA+J88KWbeRg/+bJD8QnLgynvroqt4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: increase verbosity of starting a domain
Message-Id: <E1u1wJu-0009RM-36@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 23:56:02 +0000

commit b8d41a9b22bbe9a08c8438eacf7b705500f20cea
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Mon Apr 7 14:31:05 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 7 19:17:38 2025 +0100

    CI: increase verbosity of starting a domain
    
    And start collecting qemu log earlier, so it isn't lost in case of a
    timeout during domain startup.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/scripts/qemu-alpine-x86_64.sh       | 2 +-
 automation/scripts/qemu-smoke-dom0-arm32.sh    | 2 +-
 automation/scripts/qemu-smoke-dom0-arm64.sh    | 2 +-
 automation/scripts/qubes-x86-64.sh             | 4 ++--
 automation/scripts/xilinx-smoke-dom0-x86_64.sh | 4 ++--
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
index 1ff689b577..17e2141d62 100755
--- a/automation/scripts/qemu-alpine-x86_64.sh
+++ b/automation/scripts/qemu-alpine-x86_64.sh
@@ -56,7 +56,7 @@ bash /etc/init.d/xencommons start
 
 xl list
 
-xl create -c /root/test.cfg
+xl -vvv create -c /root/test.cfg
 
 " > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
diff --git a/automation/scripts/qemu-smoke-dom0-arm32.sh b/automation/scripts/qemu-smoke-dom0-arm32.sh
index e1cd838809..0c60a66e25 100755
--- a/automation/scripts/qemu-smoke-dom0-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm32.sh
@@ -21,7 +21,7 @@ echo "#!/bin/bash
 
 xl list
 
-xl create -c /root/test.cfg
+xl -vvv create -c /root/test.cfg
 
 " > ./root/xen.start
 echo "bash /root/xen.start" >> ./etc/init.d/xen-watchdog
diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
index 4d22a124df..8774a87012 100755
--- a/automation/scripts/qemu-smoke-dom0-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
@@ -52,7 +52,7 @@ bash /etc/init.d/xencommons start
 
 xl list
 
-xl create -c /root/test.cfg
+xl -vvv create -c /root/test.cfg
 
 " > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index 80000854bc..7867724ebd 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -122,7 +122,6 @@ echo \"${passed}\"
 "
 
         dom0_check="
-tail -F /var/log/xen/qemu-dm-domU.log &
 until grep -q \"^domU Welcome to Alpine Linux\" /var/log/xen/console/guest-domU.log; do
     sleep 1
 done
@@ -222,7 +221,8 @@ if [ -n "$domU_check" ]; then
     echo "
 # get domU console content into test log
 tail -F /var/log/xen/console/guest-domU.log 2>/dev/null | sed -e \"s/^/(domU) /\" &
-xl create /etc/xen/domU.cfg
+tail -F /var/log/xen/qemu-dm-domU.log 2>/dev/null | sed -e \"s/^/(qemu-dm) /\" &
+xl -vvv create /etc/xen/domU.cfg
 ${dom0_check}
 " >> etc/local.d/xen.start
 else
diff --git a/automation/scripts/xilinx-smoke-dom0-x86_64.sh b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
index f70cfdc155..7834ffbe05 100755
--- a/automation/scripts/xilinx-smoke-dom0-x86_64.sh
+++ b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
@@ -49,7 +49,7 @@ ifconfig xenbr0 up
 ifconfig xenbr0 192.168.0.1
 # get domU console content into test log
 tail -F /var/log/xen/console/guest-domU.log 2>/dev/null | sed -e \"s/^/(domU) /\" &
-xl create /etc/xen/domU.cfg
+xl -vvv create /etc/xen/domU.cfg
 set +x
 until grep -q \"${DOMU_MSG}\" /var/log/xen/console/guest-domU.log; do
     sleep 1
@@ -75,7 +75,7 @@ done | argo-exec -p 28333 -d 0 -- /bin/echo
 "
     DOM0_CMD="
 insmod /root/xen-argo.ko
-xl create /etc/xen/domU.cfg
+xl -vvv create /etc/xen/domU.cfg
 argo-exec -l -p 28333 -- /bin/echo
 "
 copy_dom0_files ()
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 23:56:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 23:56:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941306.1340825 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1wK5-00010O-Tq; Mon, 07 Apr 2025 23:56:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941306.1340825; Mon, 07 Apr 2025 23:56: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 1u1wK5-00010G-R0; Mon, 07 Apr 2025 23:56:13 +0000
Received: by outflank-mailman (input) for mailman id 941306;
 Mon, 07 Apr 2025 23:56:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u1wK5-00010A-3r
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 23:56:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1wK5-000Xb9-0I
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 23:56:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1wK5-0009Sn-0B
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 23:56:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TUDEUwX5fiEp01kEQZ67auev0z2RLCwY1eLZRa5R+T0=; b=QVfiNfI8Arcx1bPfYB3XX6uPFI
	+DN4aksKdsB6zlfOjXfecmRirtSCPCY9I/Zrwqe2a6nil3y4sS2KrjWmoMtftrU3V8BDkBThx/kI1
	fejXhZMVJplGFFFQROgFXuSwQ7Kk2E9SrKLqPTu7jlQ5rMlXXez5o7lZPhDqNQ4jRQgk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: consistently use DOCKER_CMD in makefiles
Message-Id: <E1u1wK5-0009Sn-0B@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 23:56:13 +0000

commit 5606b982acd44cc1f0715c424a11b2e76420aa18
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Mon Apr 7 14:31:06 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 7 19:17:38 2025 +0100

    CI: consistently use DOCKER_CMD in makefiles
    
    This allows rebuilding containers using podman too.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/build/Makefile           | 4 ++--
 automation/tests-artifacts/Makefile | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/automation/build/Makefile b/automation/build/Makefile
index 4df43b0407..fedf7524da 100644
--- a/automation/build/Makefile
+++ b/automation/build/Makefile
@@ -31,8 +31,8 @@ clean:
 define CLEAN_RULE
 .PHONY: clean-$(1)
 clean-$(1):
-	if [ -n "$$$$(docker image ls -q $(REGISTRY)/$(subst /,:,$(1)))" ]; then \
-		docker image rm $(REGISTRY)/$(subst /,:,$(1)); \
+	if [ -n "$$$$($(DOCKER_CMD) image ls -q $(REGISTRY)/$(subst /,:,$(1)))" ]; then \
+		$(DOCKER_CMD) image rm $(REGISTRY)/$(subst /,:,$(1)); \
 	fi
 
 endef
diff --git a/automation/tests-artifacts/Makefile b/automation/tests-artifacts/Makefile
index d055cd696b..80a60a94f3 100644
--- a/automation/tests-artifacts/Makefile
+++ b/automation/tests-artifacts/Makefile
@@ -10,9 +10,9 @@ help:
 	@echo "To push container builds, set the env var PUSH"
 
 %: %.dockerfile ## Builds containers
-	docker build --pull -t $(REGISTRY)/$(@D):$(@F) -f $< $(<D)
+	$(DOCKER_CMD) build --pull -t $(REGISTRY)/$(@D):$(@F) -f $< $(<D)
 	@if [ ! -z $${PUSH+x} ]; then \
-		docker push $(REGISTRY)/$(@D):$(@F); \
+		$(DOCKER_CMD) push $(REGISTRY)/$(@D):$(@F); \
 	fi
 
 .PHONY: all
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 23:56:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 23:56:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941308.1340829 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1wKF-00012Z-V8; Mon, 07 Apr 2025 23:56:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941308.1340829; Mon, 07 Apr 2025 23:56:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1wKF-00012S-SQ; Mon, 07 Apr 2025 23:56:23 +0000
Received: by outflank-mailman (input) for mailman id 941308;
 Mon, 07 Apr 2025 23: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 1u1wKF-00012M-74
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 23:56:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1wKF-000XbD-0c
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 23:56:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1wKF-0009Tk-0T
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 23:56:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HWu14V5rVVlqAn5fi7Jv8C2+BiA79VdAXJCmnomiNi8=; b=mS3OpdnDG6OHiasa7ptyGshGaz
	UBF2PvhgQPxr1Cs8IWg2Ggi/LaoUQ+IEr60EZsRlAjMN/ir3JCNZ/mFU8SHF2vTRHaXHGplP3O9Pw
	HnCFmDvZy298wAXu0wkE+yakXN5tkFIPedBu9VYOtAq/xIOUQhvkOqQ0dqkeNXg6HQRg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: wait for the network interface in PCI passthrough tests
Message-Id: <E1u1wKF-0009Tk-0T@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 23:56:23 +0000

commit 6e3fe711fbf3a659160ab7ef2c293dffd62bbda4
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Mon Apr 7 14:31:07 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 7 19:17:38 2025 +0100

    CI: wait for the network interface in PCI passthrough tests
    
    The network driver initializes asynchronously, and it may not be ready
    yet by the time the startup script is called. This is especially the
    case for USB network adapter (where the PCI device is the USB
    controller) in the upcoming runner.
    
    Don't bother about separate timeout - test timeout will cover this part
    too.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/scripts/qubes-x86-64.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index 7867724ebd..2b04d281d7 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -104,6 +104,7 @@ on_reboot = "destroy"
         domU_check="
 set -x -e
 interface=eth0
+while ! [ -e \"/sys/class/net/\$interface\" ]; do sleep 1; done
 ip link set \"\$interface\" up
 timeout 30s udhcpc -i \"\$interface\"
 pingip=\$(ip -o -4 r show default|cut -f 3 -d ' ')
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 07 23:56:34 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 07 Apr 2025 23:56:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941310.1340833 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u1wKQ-00014y-0c; Mon, 07 Apr 2025 23:56:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941310.1340833; Mon, 07 Apr 2025 23: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 1u1wKP-00014r-U2; Mon, 07 Apr 2025 23:56:33 +0000
Received: by outflank-mailman (input) for mailman id 941310;
 Mon, 07 Apr 2025 23: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 1u1wKP-00014k-9u
 for xen-changelog@lists.xenproject.org; Mon, 07 Apr 2025 23: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 1u1wKP-000Xeo-0t
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 23:56:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u1wKP-0009Up-0o
 for xen-changelog@lists.xenproject.org;
 Mon, 07 Apr 2025 23:56:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aPWw6MkKm593OIg2vdgt5tQHojaX7jsq2YZY2EYy4ns=; b=pZwQR43BydGf6EPeQ5Phzo6562
	+b0rUhgnUjOEdYTByN8Ig21sbEx323WQkkcO3dJnD1D86gvzKmN6nNFjHKCeHTl5UHQNAk07Wn0Cu
	ImU+J46qtAxt2Ik60oFX+tIgPkfIWjgt/SX04GtiRw9wU9oe2adBAih3W4/rP1QhV8vk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: adjust resolving network interface into PCI device
Message-Id: <E1u1wKP-0009Up-0o@xenbits.xenproject.org>
Date: Mon, 07 Apr 2025 23:56:33 +0000

commit 930279d96ca706f05e5860bef4126fc97457d256
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Mon Apr 7 14:31:09 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 7 19:17:38 2025 +0100

    CI: adjust resolving network interface into PCI device
    
    Change how PCI device lookup is done to handle also USB devices, in
    which case get the USB controller. Instead of taking basename of the
    'device' symlink, resolve the full path (example:
    /sys/devices/pci0000:00/0000:00:09.0/usb4/4-7/4-7:1.0) and take the
    first part after pci0000:00. Theoretically it could be a bridge, but VM
    has flat PCI topology.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/scripts/qubes-x86-64.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index 2b04d281d7..a964ac4b7a 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -110,7 +110,8 @@ timeout 30s udhcpc -i \"\$interface\"
 pingip=\$(ip -o -4 r show default|cut -f 3 -d ' ')
 ping -c 10 \"\$pingip\"
 echo domU started
-pcidevice=\$(basename \$(readlink /sys/class/net/\$interface/device))
+pcidevice=\$(realpath /sys/class/net/\$interface/device |
+             sed 's#.*pci0000:00/\\([^/]*\\).*#\\1#')
 lspci -vs \$pcidevice
 "
         if [ -n "$PCIDEV_INTR" ]; then
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 08 07:55:09 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 08 Apr 2025 07:55:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941528.1340976 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u23nT-0002hI-Kw; Tue, 08 Apr 2025 07:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941528.1340976; Tue, 08 Apr 2025 07: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 1u23nT-0002h9-I2; Tue, 08 Apr 2025 07:55:03 +0000
Received: by outflank-mailman (input) for mailman id 941528;
 Tue, 08 Apr 2025 07:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u23nS-0002h3-Lq
 for xen-changelog@lists.xenproject.org; Tue, 08 Apr 2025 07:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u23nS-002ChR-13
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 07:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u23nS-003hHf-0n
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 07:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CmisfyBYlTntwV9nbpnFMsCzK5M4WWaa24u3dm6hnnI=; b=cjoomDwzrwH8iZSsht1MaZj9Ec
	ZbIOv8xfDChkXr4edwj6UECR4b39+OGnt8JsdJmR7K26xo0sLL/VICX91SEWg+zKUTtogc4Do/7gM
	gzx1zEThlQ4ufnPeqnUpMSaaogyoWDIwnGvM6DtO2QRFnnOKfpdIJh1kQ1ITWwM/WyXI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] docs: update xenstore migration stream definition
Message-Id: <E1u23nS-003hHf-0n@xenbits.xenproject.org>
Date: Tue, 08 Apr 2025 07:55:02 +0000

commit 60649eafb52fbd27ddbf74daa8b8632126ed1f1b
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Apr 8 09:36:21 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 8 09:36:21 2025 +0200

    docs: update xenstore migration stream definition
    
    In order to close a race window for Xenstore live update when using
    the new unique_id of domains, the migration stream needs to contain
    this unique_id for each domain known by Xenstore.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 docs/designs/xenstore-migration.md | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/docs/designs/xenstore-migration.md b/docs/designs/xenstore-migration.md
index 082314bf72..a0acd76ce1 100644
--- a/docs/designs/xenstore-migration.md
+++ b/docs/designs/xenstore-migration.md
@@ -156,7 +156,7 @@ the domain being migrated.
 ```
     0       1       2       3       4       5       6       7    octet
 +-------+-------+-------+-------+-------+-------+-------+-------+
-| conn-id                       | conn-type     |               |
+| conn-id                       | conn-type     | fields        |
 +-------------------------------+---------------+---------------+
 | conn-spec
 ...
@@ -165,6 +165,9 @@ the domain being migrated.
 +---------------+---------------+-------------------------------+
 | data
 ...
++---------------------------------------------------------------+
+| unique-id                                                     |
++---------------------------------------------------------------+
 ```
 
 
@@ -178,6 +181,16 @@ the domain being migrated.
 |                | 0x0001: socket                               |
 |                | 0x0002 - 0xFFFF: reserved for future use     |
 |                |                                              |
+| `fields`       | A collection of flags indicating presence    |
+|                | of additional fields after the variable      |
+|                | length `data` part. The additional fields    |
+|                | will start after a possible padding for      |
+|                | aligning to a 8 octet boundary.              |
+|                | Defined flag values (to be or-ed):           |
+|                | 0x0001: `unique_id` present (only needed for |
+|                |         `shared ring` connection in live     |
+|                |         update streams).                     |
+|                |                                              |
 | `conn-spec`    | See below                                    |
 |                |                                              |
 | `in-data-len`  | The length (in octets) of any data read      |
@@ -193,6 +206,9 @@ the domain being migrated.
 | `data`         | Pending data: first in-data-len octets of    |
 |                | read data, then out-data-len octets of       |
 |                | written data (any of both may be empty)      |
+|                |                                              |
+| `unique-id`    | Unique identifier of a domain                |
+|                |                                              |
 
 In case of live update the connection record for the connection via which
 the live update command was issued will contain the response for the live
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 08 07:55:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 08 Apr 2025 07:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941529.1340981 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u23nd-0002j6-Ms; Tue, 08 Apr 2025 07:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941529.1340981; Tue, 08 Apr 2025 07: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 1u23nd-0002iy-JY; Tue, 08 Apr 2025 07:55:13 +0000
Received: by outflank-mailman (input) for mailman id 941529;
 Tue, 08 Apr 2025 07:55:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u23nc-0002io-ET
 for xen-changelog@lists.xenproject.org; Tue, 08 Apr 2025 07:55:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u23nc-002Che-1M
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 07:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u23nc-003hJa-1E
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 07:55:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0Huy+syzYpFv/wILXxBf5LN9vCv6hIIu48nDJzBB9w8=; b=rcSqUzL0s3EoRPII+uDU1jJqfs
	WamtNTzJeCb+1jZBTa5EIhnZD4SCeP4Nr/Nfu76LJRU6iHa4Ovj6yjtdVJumNUKBO9JvtrqCroGAu
	SIjc+KBUnOmDVcKG9a0VKY9mZXG0lZehS6t/zd26bEUchZIyxfZ3w+sirJbzlDTflRnU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: vm_event: do not do vm_event_op for an invalid domain
Message-Id: <E1u23nc-003hJa-1E@xenbits.xenproject.org>
Date: Tue, 08 Apr 2025 07:55:12 +0000

commit 6a884750f3b86a45ee5ffbd825c346fcbce86080
Author:     Volodymyr Babchuk <volodymyr_babchuk@epam.com>
AuthorDate: Tue Apr 8 09:36:38 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 8 09:36:38 2025 +0200

    xen: vm_event: do not do vm_event_op for an invalid domain
    
    A privileged domain can issue XEN_DOMCTL_vm_event_op with
    op->domain == DOMID_INVALID. In this case vm_event_domctl()
    function will get NULL as the first parameter and this will
    cause hypervisor panic, as it tries to derefer this pointer.
    
    Fix the issue by checking if valid domain is passed in.
    
    Fixes: 48b84249459f ("xen/vm-event: Drop unused u_domctl parameter from vm_event_domctl()")
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/common/vm_event.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/common/vm_event.c b/xen/common/vm_event.c
index fbf1aa0848..1666ff615f 100644
--- a/xen/common/vm_event.c
+++ b/xen/common/vm_event.c
@@ -600,6 +600,10 @@ int vm_event_domctl(struct domain *d, struct xen_domctl_vm_event_op *vec)
         return 0;
     }
 
+    /* All other subops need to target a real domain. */
+    if ( unlikely(d == NULL) )
+        return -ESRCH;
+
     rc = xsm_vm_event_control(XSM_PRIV, d, vec->mode, vec->op);
     if ( rc )
         return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 08 07:55:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 08 Apr 2025 07:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941531.1340984 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u23nn-0002ls-Nn; Tue, 08 Apr 2025 07:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941531.1340984; Tue, 08 Apr 2025 07: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 1u23nn-0002lk-L8; Tue, 08 Apr 2025 07:55:23 +0000
Received: by outflank-mailman (input) for mailman id 941531;
 Tue, 08 Apr 2025 07:55:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u23nm-0002lX-IB
 for xen-changelog@lists.xenproject.org; Tue, 08 Apr 2025 07:55:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u23nm-002Ci7-1j
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 07:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u23nm-003hLg-1W
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 07:55:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hp47z6W5Ldd+UoFzw53BG8CY3UQatltIOw9fOFbVUmc=; b=ZYM62JUcBxUvj8hpic++hkN1ka
	5K0+FCg8AVhbRVYrDJ9hI8X1lFT9w5GlEnSDAzEuxrNqlGeK9XkNaIv7A0W5p75d/icai/+nCXbyz
	2wTDas9Aa5e1CYBIxUumZPjCzWKWd1zHAJAzzO3lVUyefXxj1ngT/+uesfq8YCA+YD0U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/cpu: Validate CPUID leaf 0x2 EDX output
Message-Id: <E1u23nm-003hLg-1W@xenbits.xenproject.org>
Date: Tue, 08 Apr 2025 07:55:22 +0000

commit a47b44a8f0a58a6015faf6465921cd203f0b51d1
Author:     Ahmed S. Darwish <darwi@linutronix.de>
AuthorDate: Tue Apr 8 09:37:38 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 8 09:37:38 2025 +0200

    x86/cpu: Validate CPUID leaf 0x2 EDX output
    
    CPUID leaf 0x2 emits one-byte descriptors in its four output registers
    EAX, EBX, ECX, and EDX.  For these descriptors to be valid, the most
    significant bit (MSB) of each register must be clear.
    
    Leaf 0x2 parsing at intel.c only validated the MSBs of EAX, EBX, and
    ECX, but left EDX unchecked.
    
    Validate EDX's most-significant bit as well.
    
    Fixes: 1aa6feb63bfd ("Port CPU setup code from Linux 2.6")
    Signed-off-by: Ahmed S. Darwish <darwi@linutronix.de>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Link: https://lore.kernel.org/r/20250304085152.51092-3-darwi@linutronix.de
    
    Use ARRAY_SIZE() though.
    
    Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 1881148215c6
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/intel_cacheinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/intel_cacheinfo.c b/xen/arch/x86/cpu/intel_cacheinfo.c
index 9cfb759be0..e88faa7545 100644
--- a/xen/arch/x86/cpu/intel_cacheinfo.c
+++ b/xen/arch/x86/cpu/intel_cacheinfo.c
@@ -186,7 +186,7 @@ void init_intel_cacheinfo(struct cpuinfo_x86 *c)
 			cpuid(2, &regs[0], &regs[1], &regs[2], &regs[3]);
 
 			/* If bit 31 is set, this is an unknown format */
-			for ( j = 0 ; j < 3 ; j++ ) {
+			for ( j = 0; j < ARRAY_SIZE(regs); j++ ) {
 				if ( regs[j] >> 31 )
 					regs[j] = 0;
 			}
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 08 07:55:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 08 Apr 2025 07:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941533.1340990 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u23nx-0002o6-Py; Tue, 08 Apr 2025 07:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941533.1340990; Tue, 08 Apr 2025 07: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 1u23nx-0002nw-Mf; Tue, 08 Apr 2025 07:55:33 +0000
Received: by outflank-mailman (input) for mailman id 941533;
 Tue, 08 Apr 2025 07:55:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u23nw-0002nl-LF
 for xen-changelog@lists.xenproject.org; Tue, 08 Apr 2025 07:55:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u23nw-002CiG-21
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 07:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u23nw-003hO1-1u
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 07:55:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Q8kPmPDblkzeE+JyMrpi/VWIjYMbQaic42JKSZfuYN4=; b=xSfdITvZvKEgPnvBol68Fta6sL
	/hZagekiXKxfw2gK6c3PhzkaFuUth/dtt9ueVV738RS8zTMNSBCmylJZ4dzOY66Tk5R8N/t8j7o5v
	Z0nQdhXbfY2oObwcMz8CvOZ/1YdGnLnuzWdhpc8OShXGnasf6jzNcdhuMz0P9prO9brE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libxl: search PATH for QEMU if `QEMU_XEN_PATH` is not absolute
Message-Id: <E1u23nw-003hO1-1u@xenbits.xenproject.org>
Date: Tue, 08 Apr 2025 07:55:32 +0000

commit f3ba5baf54de38efa1fb46c315b52bfaa7035292
Author:     Hongbo <hehongbo@mail.com>
AuthorDate: Tue Apr 8 09:38:07 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 8 09:38:07 2025 +0200

    tools/libxl: search PATH for QEMU if `QEMU_XEN_PATH` is not absolute
    
    `QEMU_XEN_PATH` will be configured as `qemu-system-i386` with no clue where, if
    `--with-system-qemu` is set without giving a path (as matched in the case `yes`
    but not `*`). However, the existence of the executable is checked by `access()`,
    that will not look for anywhere in $PATH but the current directory. And since it
    is possible for `qemu-system-i386` (or any other configured values) to be
    executed from PATH later, we'd better find that in PATH and return the full path
    for the caller to check against.
    
    Signed-off-by: Hongbo <hehongbo@mail.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/light/libxl_dm.c | 38 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 36 insertions(+), 2 deletions(-)

diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
index b193a5dc37..8f0bbd5d64 100644
--- a/tools/libs/light/libxl_dm.c
+++ b/tools/libs/light/libxl_dm.c
@@ -331,9 +331,43 @@ const char *libxl__domain_device_model(libxl__gc *gc,
         case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
             dm = libxl__abs_path(gc, "qemu-dm", libxl__private_bindir_path());
             break;
-        case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
-            dm = qemu_xen_path(gc);
+        case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN: {
+            const char *configured_dm = qemu_xen_path(gc);
+            if (configured_dm[0] == '/')
+            {
+                dm = configured_dm;
+            }
+            else
+            {
+                const char *path_env = getenv("PATH");
+                if (!path_env)
+                {
+                    dm = configured_dm;
+                }
+                else
+                {
+                    char *path_dup = libxl__strdup(gc, path_env);
+                    char *saveptr;
+
+                    char *path = strtok_r(path_dup, ":", &saveptr);
+                    dm = NULL;
+                    while (path)
+                    {
+                        char *candidate = libxl__abs_path(gc, configured_dm, path);
+                        if (access(candidate, X_OK) == 0)
+                        {
+                            dm = candidate;
+                            break;
+                        }
+                        path = strtok_r(NULL, ":", &saveptr);
+                    }
+
+                    if (!dm)
+                        dm = configured_dm;
+                }
+            }
             break;
+        }
         default:
             LOG(ERROR, "invalid device model version %d",
                 info->device_model_version);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 08 07:55:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 08 Apr 2025 07:55:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941535.1340993 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u23o7-0002rQ-Sb; Tue, 08 Apr 2025 07:55:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941535.1340993; Tue, 08 Apr 2025 07:55:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u23o7-0002rI-Py; Tue, 08 Apr 2025 07:55:43 +0000
Received: by outflank-mailman (input) for mailman id 941535;
 Tue, 08 Apr 2025 07:55:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u23o6-0002r8-OB
 for xen-changelog@lists.xenproject.org; Tue, 08 Apr 2025 07:55:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u23o6-002CiN-2K
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 07:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u23o6-003hTz-2C
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 07:55:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=slffxfzU5zeJfW9gL3R5OvSgNtZJDZDhasZLPq2Qj3M=; b=U96U+tmg+miw8rFGeLsRzlMk6b
	4D3ttUrz49RjFba7ymIJzVdStD139Zr9CaZP2MAM7vbNPpE6emXv1Zd/YIhxVNjVxrnze/EXxpxMr
	Um4wwZSGLiIj6ixXxDiGZH2NjtuuFAATGoVxHRYpaVR6tOYLXrYUnxtvq0qRPjh398cY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] Config.mk: correct gcc5 check
Message-Id: <E1u23o6-003hTz-2C@xenbits.xenproject.org>
Date: Tue, 08 Apr 2025 07:55:42 +0000

commit 140b3b0974a961853bbbcc03037679b41174564e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 8 09:38:36 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 8 09:38:36 2025 +0200

    Config.mk: correct gcc5 check
    
    Passing the -dumpversion option to gcc may only print the major version
    (my system 4.x.y printed major and minor, which in nowaday's scheme is
    then indeed just 5 for 5.x, which in turn is what my secondary system
    compiler does).
    
    Fixes: 40458f752550 ("Xen: Update compiler baseline checks")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 Config.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Config.mk b/Config.mk
index 8a60d4a55a..8be7733d9e 100644
--- a/Config.mk
+++ b/Config.mk
@@ -125,8 +125,8 @@ define cc-ver-check-closure
     endif
 endef
 
-# Require GCC v5.1 as the project global baseline
-check-$(gcc) = $(call cc-ver-check,CC,0x050100,"Xen requires at least GCC 5.1")
+# Require GCC v5 as the project global baseline
+check-$(gcc) = $(call cc-ver-check,CC,0x050000,"Xen requires at least GCC 5")
 $(eval $(check-y))
 
 ld-ver-build-id = $(shell $(1) --build-id 2>&1 | \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 08 07:55:53 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 08 Apr 2025 07:55:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941537.1340997 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u23oH-0002tl-U3; Tue, 08 Apr 2025 07:55:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941537.1340997; Tue, 08 Apr 2025 07:55:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u23oH-0002td-RO; Tue, 08 Apr 2025 07:55:53 +0000
Received: by outflank-mailman (input) for mailman id 941537;
 Tue, 08 Apr 2025 07: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 1u23oG-0002tT-Qv
 for xen-changelog@lists.xenproject.org; Tue, 08 Apr 2025 07:55:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u23oG-002CiU-2b
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 07:55:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u23oG-003hcZ-2V
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 07:55:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8gRXUMil8njEtHAUE+6slGCJBJaa3ojChjtJ7v50IEc=; b=Nk77+0jX30n7e989+4AgYooYqb
	VJlmyX3FoEBag7TR8L4rmiI4y4c0E+Sv9k/1NYqhKJvVghNLInqjEZ4TrJ6zn62sge2eLCwH8JtJr
	COCkiwFKrpnOrfvbRduefJHL3SshWckV6WVZGaJagwpPX+hg1xVxh/crFuWAAafblj08=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/MTRR: make hold_mtrr_updates_on_aps static and bool
Message-Id: <E1u23oG-003hcZ-2V@xenbits.xenproject.org>
Date: Tue, 08 Apr 2025 07:55:52 +0000

commit 4c1f1cae7b4e9fd221081a9cc3a42dd39aa69fb2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 8 09:39:11 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 8 09:39:11 2025 +0200

    x86/MTRR: make hold_mtrr_updates_on_aps static and bool
    
    It's not used outside of the CU defining it, and it is clearly of
    boolean nature.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/mtrr/main.c    | 6 +++---
 xen/arch/x86/include/asm/mtrr.h | 1 -
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/cpu/mtrr/main.c b/xen/arch/x86/cpu/mtrr/main.c
index 24cddcaddf..d4f549d92e 100644
--- a/xen/arch/x86/cpu/mtrr/main.c
+++ b/xen/arch/x86/cpu/mtrr/main.c
@@ -118,7 +118,7 @@ struct set_mtrr_data {
  * After all the cpus have came up, then mtrr_aps_sync_end() synchronizes all 
  * the cpus and updates mtrrs on all of them. Then this flag is turned off.
  */
-int hold_mtrr_updates_on_aps;
+static bool hold_mtrr_updates_on_aps;
 
 static void cf_check ipi_handler(void *info)
 /*  [SUMMARY] Synchronisation handler. Executed by "other" CPUs.
@@ -600,14 +600,14 @@ void mtrr_save_state(void)
 
 void mtrr_aps_sync_begin(void)
 {
-	hold_mtrr_updates_on_aps = 1;
+	hold_mtrr_updates_on_aps = true;
 }
 
 void mtrr_aps_sync_end(void)
 {
 	if (mtrr_if)
 		set_mtrr(~0U, 0, 0, 0);
-	hold_mtrr_updates_on_aps = 0;
+	hold_mtrr_updates_on_aps = false;
 }
 
 void asmlinkage mtrr_bp_restore(void)
diff --git a/xen/arch/x86/include/asm/mtrr.h b/xen/arch/x86/include/asm/mtrr.h
index 48b59d2620..25d442659d 100644
--- a/xen/arch/x86/include/asm/mtrr.h
+++ b/xen/arch/x86/include/asm/mtrr.h
@@ -63,7 +63,6 @@ extern uint32_t get_pat_flags(struct vcpu *v, uint32_t gl1e_flags,
                               paddr_t gpaddr, paddr_t spaddr,
                               uint8_t gmtrr_mtype);
 extern uint8_t pat_type_2_pte_flags(uint8_t pat_type);
-extern int hold_mtrr_updates_on_aps;
 extern void mtrr_aps_sync_begin(void);
 extern void mtrr_aps_sync_end(void);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 08 07:56:03 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 08 Apr 2025 07:56:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941539.1341001 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u23oR-0002wL-VX; Tue, 08 Apr 2025 07:56:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941539.1341001; Tue, 08 Apr 2025 07:56: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 1u23oR-0002wD-Sl; Tue, 08 Apr 2025 07:56:03 +0000
Received: by outflank-mailman (input) for mailman id 941539;
 Tue, 08 Apr 2025 07: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 1u23oQ-0002w4-U2
 for xen-changelog@lists.xenproject.org; Tue, 08 Apr 2025 07: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 1u23oQ-002Cio-2t
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 07:56:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u23oQ-003hjC-2n
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 07: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=HKmUeX1dh96owOeznGZW2++FZ7CarN6gPQSCroVvL6g=; b=EPFs9liKEEeKHNXf/REfhXPAsw
	7h2afZ0CGEfTMGYGApkzeRfPjlk9WAtNWEvvDqbe1IF4F6mKeJO2nw65FTykY+FC9BIcgoVVZxRLw
	wQJLrtCwNvMY+jXIRb80Vq2mG9XCzOVs9QixQ/m6uBIEvnvNCTMd+hwYqQ6Q/yRNL1TM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] libxl{,u}: replace TOSTRING()
Message-Id: <E1u23oQ-003hjC-2n@xenbits.xenproject.org>
Date: Tue, 08 Apr 2025 07:56:02 +0000

commit 36ce9faad9e7f18e380092070484a0d7004974e8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 8 09:39:50 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 8 09:39:50 2025 +0200

    libxl{,u}: replace TOSTRING()
    
    Now that common-macros.h has STR() available, which is even slightly
    more flexible, use that and drop the custom macros.
    
    No difference in generated code (except for line numbers, of course,
    where embedded in code/data).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/light/libxl_disk.c     | 2 +-
 tools/libs/light/libxl_internal.h | 3 ---
 tools/libs/util/libxlu_disk_l.c   | 2 +-
 tools/libs/util/libxlu_disk_l.l   | 2 +-
 tools/libs/util/libxlu_internal.h | 6 ++----
 5 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/tools/libs/light/libxl_disk.c b/tools/libs/light/libxl_disk.c
index 15055380c6..6a0b6e06fe 100644
--- a/tools/libs/light/libxl_disk.c
+++ b/tools/libs/light/libxl_disk.c
@@ -53,7 +53,7 @@ static void disk_eject_xswatch_callback(libxl__egc *egc, libxl__ev_xswatch *w,
     }
 
     sscanf(backend,
-            "/local/domain/%d/backend/%" TOSTRING(BACKEND_STRING_SIZE)
+           "/local/domain/%d/backend/%" STR(BACKEND_STRING_SIZE)
            "[a-z]/%*d/%*d",
            &disk->backend_domid, backend_type);
     if (!strcmp(backend_type, "tap") ||
diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_internal.h
index cfac8e18b6..408a771310 100644
--- a/tools/libs/light/libxl_internal.h
+++ b/tools/libs/light/libxl_internal.h
@@ -2093,9 +2093,6 @@ _hidden int libxl__init_recursive_mutex(libxl_ctx *ctx, pthread_mutex_t *lock);
 
 _hidden int libxl__gettimeofday(libxl__gc *gc, struct timeval *now_r);
 
-#define STRINGIFY(x) #x
-#define TOSTRING(x) STRINGIFY(x)
-
 /* from libxl_qmp */
 typedef struct libxl__qmp_handler libxl__qmp_handler;
 
diff --git a/tools/libs/util/libxlu_disk_l.c b/tools/libs/util/libxlu_disk_l.c
index 9213dd957c..0c180fff52 100644
--- a/tools/libs/util/libxlu_disk_l.c
+++ b/tools/libs/util/libxlu_disk_l.c
@@ -1152,7 +1152,7 @@ void xlu__disk_yyset_column(int  column_no, yyscan_t yyscanner);
 #define DSET(dpc,member,enumname,str,valname) do{			\
 	if (dpc->disk->member != LIBXL_DISK_##enumname##_UNKNOWN &&	\
 	    dpc->disk->member != LIBXL_DISK_##enumname##_##valname) {	\
-	    xlu__disk_err(dpc, str, TOSTRING(member) " respecified");	\
+	    xlu__disk_err(dpc, str, STR(member) " respecified");	\
 	} else {							\
 	    dpc->disk->member = LIBXL_DISK_##enumname##_##valname;	\
 	}								\
diff --git a/tools/libs/util/libxlu_disk_l.l b/tools/libs/util/libxlu_disk_l.l
index f37dd443bd..14c9fa1112 100644
--- a/tools/libs/util/libxlu_disk_l.l
+++ b/tools/libs/util/libxlu_disk_l.l
@@ -64,7 +64,7 @@ void xlu__disk_yyset_column(int  column_no, yyscan_t yyscanner);
 #define DSET(dpc,member,enumname,str,valname) do{			\
 	if (dpc->disk->member != LIBXL_DISK_##enumname##_UNKNOWN &&	\
 	    dpc->disk->member != LIBXL_DISK_##enumname##_##valname) {	\
-	    xlu__disk_err(dpc, str, TOSTRING(member) " respecified");	\
+	    xlu__disk_err(dpc, str, STR(member) " respecified");	\
 	} else {							\
 	    dpc->disk->member = LIBXL_DISK_##enumname##_##valname;	\
 	}								\
diff --git a/tools/libs/util/libxlu_internal.h b/tools/libs/util/libxlu_internal.h
index 1f7559ecd9..a82385fbb5 100644
--- a/tools/libs/util/libxlu_internal.h
+++ b/tools/libs/util/libxlu_internal.h
@@ -25,6 +25,8 @@
 
 #include "libxlutil.h"
 
+#include <xen-tools/common-macros.h>
+
 struct XLU_ConfigList {
     int avalues; /* available slots */
     int nvalues; /* actual occupied slots */
@@ -69,10 +71,6 @@ typedef struct {
     void *scanner;
 } CfgParseContext;
 
-
-#define STRINGIFY(x) #x
-#define TOSTRING(x) STRINGIFY(x)
-
 #endif /*LIBXLU_INTERNAL_H*/
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 08 07:56:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 08 Apr 2025 07:56:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941541.1341004 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u23oc-0002zS-0W; Tue, 08 Apr 2025 07:56:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941541.1341004; Tue, 08 Apr 2025 07:56: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 1u23ob-0002zK-UC; Tue, 08 Apr 2025 07:56:13 +0000
Received: by outflank-mailman (input) for mailman id 941541;
 Tue, 08 Apr 2025 07:56:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u23ob-0002z7-0n
 for xen-changelog@lists.xenproject.org; Tue, 08 Apr 2025 07:56:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u23oa-002Ciw-3D
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 07:56:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u23oa-003hoA-34
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 07: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=K05rw2HeGDuL2PbiPDJq6HNmEuAW8FDa5RhvSiEaSSc=; b=Rk/yz8I0gRlrWF5AiR72/jp513
	SOOsGBE7sUXeQyEhI9s69W/PhxKlilxkjYZdzimWBnXo6IRvsgOOhf19fvEkxK5HCxKONK2LPs3Ab
	n+R3i4IxsHgF0medtBIBOZprLnJ+B00e9/yPKq+vdcueWoDW1w0m+4Nf8VY3wfkQddcU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: x86: irq: initialize irq desc in create_irq()
Message-Id: <E1u23oa-003hoA-34@xenbits.xenproject.org>
Date: Tue, 08 Apr 2025 07:56:12 +0000

commit 7a4484d90b3003171f1700e424ad45b931200ba6
Author:     Volodymyr Babchuk <volodymyr_babchuk@epam.com>
AuthorDate: Tue Apr 8 09:40:39 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 8 09:40:39 2025 +0200

    xen: x86: irq: initialize irq desc in create_irq()
    
    While building xen with GCC 14.2.1 with "-fcondition-coverage" option
    or with "-Og", the compiler produces a false positive warning:
    
      arch/x86/irq.c: In function ‘create_irq’:
      arch/x86/irq.c:281:11: error: ‘desc’ may be used uninitialized [-Werror=maybe-uninitialized]
        281 |     ret = init_one_irq_desc(desc);
            |           ^~~~~~~~~~~~~~~~~~~~~~~
      arch/x86/irq.c:269:22: note: ‘desc’ was declared here
        269 |     struct irq_desc *desc;
            |                      ^~~~
      cc1: all warnings being treated as errors
      make[2]: *** [Rules.mk:252: arch/x86/irq.o] Error 1
    
    While we have signed/unsigned comparison both in "for" loop and in
    "if" statement, this still can't lead to use of uninitialized "desc",
    as either loop will be executed at least once, or the function will
    return early. So this is a clearly false positive warning due to a
    bug [1] in GCC.
    
    Initialize "desc" with NULL to make GCC happy.
    
    [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119665
    
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index dd8d921f18..38ac0823d7 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -265,7 +265,7 @@ void __init clear_irq_vector(int irq)
 int create_irq(nodeid_t node, bool grant_access)
 {
     int irq, ret;
-    struct irq_desc *desc;
+    struct irq_desc *desc = NULL ; /* gcc14 -Og or -fcondition-coverage */
 
     for (irq = nr_irqs_gsi; irq < nr_irqs; irq++)
     {
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 08 10:44:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 08 Apr 2025 10:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941764.1341160 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u26R0-00088N-4r; Tue, 08 Apr 2025 10:44:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941764.1341160; Tue, 08 Apr 2025 10: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 1u26R0-00088D-1F; Tue, 08 Apr 2025 10:44:02 +0000
Received: by outflank-mailman (input) for mailman id 941764;
 Tue, 08 Apr 2025 10:44:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u26Qz-000887-Ka
 for xen-changelog@lists.xenproject.org; Tue, 08 Apr 2025 10:44:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u26Qz-002HUq-1N
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 10:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u26Qz-004q6q-1A
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 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=Fio+17hJ+WrbfPAInEP3UZxO2i5RCXm2EOwPa3/zR8g=; b=vw4HY8gaNKRC1wCZ8UqM0Z+I9g
	6pMf+7nUrrNsqTtRkJLWOKQlC0Zj7ZYmtp0lngtGNptPvkCEESjN0K+UWwJ+sidXQhzybEiAzC/70
	m6IMT9PCVxtgndiZGAcSAerM0O37Qrey6N4dFrWEaQPL5KTsoCSuP90V1nj+NaXsM248=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] Revert "tools/libxl: search PATH for QEMU if `QEMU_XEN_PATH` is not absolute"
Message-Id: <E1u26Qz-004q6q-1A@xenbits.xenproject.org>
Date: Tue, 08 Apr 2025 10:44:01 +0000

commit e4ff0e4f8344f721e17bc7608829329e20258f47
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 8 12:37:37 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 8 12:37:37 2025 +0200

    Revert "tools/libxl: search PATH for QEMU if `QEMU_XEN_PATH` is not absolute"
    
    This reverts commit f3ba5baf54de38efa1fb46c315b52bfaa7035292, for
    breaking the build in gitlab CI.
---
 tools/libs/light/libxl_dm.c | 38 ++------------------------------------
 1 file changed, 2 insertions(+), 36 deletions(-)

diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
index 8f0bbd5d64..b193a5dc37 100644
--- a/tools/libs/light/libxl_dm.c
+++ b/tools/libs/light/libxl_dm.c
@@ -331,43 +331,9 @@ const char *libxl__domain_device_model(libxl__gc *gc,
         case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
             dm = libxl__abs_path(gc, "qemu-dm", libxl__private_bindir_path());
             break;
-        case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN: {
-            const char *configured_dm = qemu_xen_path(gc);
-            if (configured_dm[0] == '/')
-            {
-                dm = configured_dm;
-            }
-            else
-            {
-                const char *path_env = getenv("PATH");
-                if (!path_env)
-                {
-                    dm = configured_dm;
-                }
-                else
-                {
-                    char *path_dup = libxl__strdup(gc, path_env);
-                    char *saveptr;
-
-                    char *path = strtok_r(path_dup, ":", &saveptr);
-                    dm = NULL;
-                    while (path)
-                    {
-                        char *candidate = libxl__abs_path(gc, configured_dm, path);
-                        if (access(candidate, X_OK) == 0)
-                        {
-                            dm = candidate;
-                            break;
-                        }
-                        path = strtok_r(NULL, ":", &saveptr);
-                    }
-
-                    if (!dm)
-                        dm = configured_dm;
-                }
-            }
+        case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
+            dm = qemu_xen_path(gc);
             break;
-        }
         default:
             LOG(ERROR, "invalid device model version %d",
                 info->device_model_version);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 08 12:00:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 08 Apr 2025 12:00:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941825.1341203 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u27cZ-0000wt-7a; Tue, 08 Apr 2025 12:00:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941825.1341203; Tue, 08 Apr 2025 12:00:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u27cZ-0000wM-4s; Tue, 08 Apr 2025 12:00:03 +0000
Received: by outflank-mailman (input) for mailman id 941825;
 Tue, 08 Apr 2025 12: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 1u27cY-0000nC-JB
 for xen-changelog@lists.xenproject.org; Tue, 08 Apr 2025 12: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 1u27cY-002JTN-17
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 12:00:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u27cY-005iXB-0t
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 12: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=dSVYvgon/E5bQAC6jLE7on7kPfKNFkmiMA20sV+XqsQ=; b=Y41IlkP5H9U6bz5GXW5uK7BT1w
	VHU5SfjSk4sNm2gmQ2Aotonvrh2xwJqzCE6QP7qSPKzVxCII6c4P5cd7VvtgWXwyxeG2LWa4tAVtZ
	YsB6YwOGuAApx/wHKEagjeAnT66KG5OpaCEKgPbdfzWbeuagT6zARwa+0pUqE0lrA1+U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] docs: update xenstore migration stream definition
Message-Id: <E1u27cY-005iXB-0t@xenbits.xenproject.org>
Date: Tue, 08 Apr 2025 12:00:02 +0000

commit 60649eafb52fbd27ddbf74daa8b8632126ed1f1b
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Apr 8 09:36:21 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 8 09:36:21 2025 +0200

    docs: update xenstore migration stream definition
    
    In order to close a race window for Xenstore live update when using
    the new unique_id of domains, the migration stream needs to contain
    this unique_id for each domain known by Xenstore.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 docs/designs/xenstore-migration.md | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/docs/designs/xenstore-migration.md b/docs/designs/xenstore-migration.md
index 082314bf72..a0acd76ce1 100644
--- a/docs/designs/xenstore-migration.md
+++ b/docs/designs/xenstore-migration.md
@@ -156,7 +156,7 @@ the domain being migrated.
 ```
     0       1       2       3       4       5       6       7    octet
 +-------+-------+-------+-------+-------+-------+-------+-------+
-| conn-id                       | conn-type     |               |
+| conn-id                       | conn-type     | fields        |
 +-------------------------------+---------------+---------------+
 | conn-spec
 ...
@@ -165,6 +165,9 @@ the domain being migrated.
 +---------------+---------------+-------------------------------+
 | data
 ...
++---------------------------------------------------------------+
+| unique-id                                                     |
++---------------------------------------------------------------+
 ```
 
 
@@ -178,6 +181,16 @@ the domain being migrated.
 |                | 0x0001: socket                               |
 |                | 0x0002 - 0xFFFF: reserved for future use     |
 |                |                                              |
+| `fields`       | A collection of flags indicating presence    |
+|                | of additional fields after the variable      |
+|                | length `data` part. The additional fields    |
+|                | will start after a possible padding for      |
+|                | aligning to a 8 octet boundary.              |
+|                | Defined flag values (to be or-ed):           |
+|                | 0x0001: `unique_id` present (only needed for |
+|                |         `shared ring` connection in live     |
+|                |         update streams).                     |
+|                |                                              |
 | `conn-spec`    | See below                                    |
 |                |                                              |
 | `in-data-len`  | The length (in octets) of any data read      |
@@ -193,6 +206,9 @@ the domain being migrated.
 | `data`         | Pending data: first in-data-len octets of    |
 |                | read data, then out-data-len octets of       |
 |                | written data (any of both may be empty)      |
+|                |                                              |
+| `unique-id`    | Unique identifier of a domain                |
+|                |                                              |
 
 In case of live update the connection record for the connection via which
 the live update command was issued will contain the response for the live
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 08 12:00:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 08 Apr 2025 12:00:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941826.1341207 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u27cj-0001Xn-8g; Tue, 08 Apr 2025 12:00:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941826.1341207; Tue, 08 Apr 2025 12: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 1u27cj-0001Xf-6D; Tue, 08 Apr 2025 12:00:13 +0000
Received: by outflank-mailman (input) for mailman id 941826;
 Tue, 08 Apr 2025 12: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 1u27ci-0001XX-FP
 for xen-changelog@lists.xenproject.org; Tue, 08 Apr 2025 12: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 1u27ci-002JTR-1R
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 12:00:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u27ci-005if5-1I
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 12:00:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=j7QOaZQs/NRwfbWpL/a8udNM9Fpjo8oiPID4i/ASBMo=; b=y3cE7ofBdubSScmgkOT/CtjZ9O
	gIgrFCPIBEktGdX9Y6x1HA6ACmk/HqCrKfYigOiRmnbCTke4EfFoQyRXSsHfCmJafC1epTVzfsyFu
	UN/c+NyNkr843cMkStVsGAU6NF5f2Jwv5xlkzRerWUsLe3fYULoVU1q+/fqimcgd10yk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: vm_event: do not do vm_event_op for an invalid domain
Message-Id: <E1u27ci-005if5-1I@xenbits.xenproject.org>
Date: Tue, 08 Apr 2025 12:00:12 +0000

commit 6a884750f3b86a45ee5ffbd825c346fcbce86080
Author:     Volodymyr Babchuk <volodymyr_babchuk@epam.com>
AuthorDate: Tue Apr 8 09:36:38 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 8 09:36:38 2025 +0200

    xen: vm_event: do not do vm_event_op for an invalid domain
    
    A privileged domain can issue XEN_DOMCTL_vm_event_op with
    op->domain == DOMID_INVALID. In this case vm_event_domctl()
    function will get NULL as the first parameter and this will
    cause hypervisor panic, as it tries to derefer this pointer.
    
    Fix the issue by checking if valid domain is passed in.
    
    Fixes: 48b84249459f ("xen/vm-event: Drop unused u_domctl parameter from vm_event_domctl()")
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/common/vm_event.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/common/vm_event.c b/xen/common/vm_event.c
index fbf1aa0848..1666ff615f 100644
--- a/xen/common/vm_event.c
+++ b/xen/common/vm_event.c
@@ -600,6 +600,10 @@ int vm_event_domctl(struct domain *d, struct xen_domctl_vm_event_op *vec)
         return 0;
     }
 
+    /* All other subops need to target a real domain. */
+    if ( unlikely(d == NULL) )
+        return -ESRCH;
+
     rc = xsm_vm_event_control(XSM_PRIV, d, vec->mode, vec->op);
     if ( rc )
         return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 08 12:00:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 08 Apr 2025 12:00:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941828.1341210 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u27ct-0001aH-AB; Tue, 08 Apr 2025 12:00:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941828.1341210; Tue, 08 Apr 2025 12:00:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u27ct-0001a9-7f; Tue, 08 Apr 2025 12:00:23 +0000
Received: by outflank-mailman (input) for mailman id 941828;
 Tue, 08 Apr 2025 12: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 1u27cs-0001Zw-Iq
 for xen-changelog@lists.xenproject.org; Tue, 08 Apr 2025 12: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 1u27cs-002JXF-1l
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 12:00:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u27cs-005ikF-1c
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 12: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=aWK2skj1shmhoqpz+lRWGDEqm/y2wfr2riqWmhbuV5g=; b=vT2A/k7Pv78zQe6cTF5sh8QFBd
	Reo6uuG5gyf+Q+bO5rOzBdxkjyQ0CudsaseT81A+D1Hoj0MgctY8UNJR2VaB0YXntGt/CFCi33JWZ
	LpCz7IbHlt/7zMwj88oAOXE8BbbxXiS5yn1y4ZeGVki7SZzUiOC6sShJkpoptsNr+RxU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/cpu: Validate CPUID leaf 0x2 EDX output
Message-Id: <E1u27cs-005ikF-1c@xenbits.xenproject.org>
Date: Tue, 08 Apr 2025 12:00:22 +0000

commit a47b44a8f0a58a6015faf6465921cd203f0b51d1
Author:     Ahmed S. Darwish <darwi@linutronix.de>
AuthorDate: Tue Apr 8 09:37:38 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 8 09:37:38 2025 +0200

    x86/cpu: Validate CPUID leaf 0x2 EDX output
    
    CPUID leaf 0x2 emits one-byte descriptors in its four output registers
    EAX, EBX, ECX, and EDX.  For these descriptors to be valid, the most
    significant bit (MSB) of each register must be clear.
    
    Leaf 0x2 parsing at intel.c only validated the MSBs of EAX, EBX, and
    ECX, but left EDX unchecked.
    
    Validate EDX's most-significant bit as well.
    
    Fixes: 1aa6feb63bfd ("Port CPU setup code from Linux 2.6")
    Signed-off-by: Ahmed S. Darwish <darwi@linutronix.de>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Link: https://lore.kernel.org/r/20250304085152.51092-3-darwi@linutronix.de
    
    Use ARRAY_SIZE() though.
    
    Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 1881148215c6
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/intel_cacheinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/intel_cacheinfo.c b/xen/arch/x86/cpu/intel_cacheinfo.c
index 9cfb759be0..e88faa7545 100644
--- a/xen/arch/x86/cpu/intel_cacheinfo.c
+++ b/xen/arch/x86/cpu/intel_cacheinfo.c
@@ -186,7 +186,7 @@ void init_intel_cacheinfo(struct cpuinfo_x86 *c)
 			cpuid(2, &regs[0], &regs[1], &regs[2], &regs[3]);
 
 			/* If bit 31 is set, this is an unknown format */
-			for ( j = 0 ; j < 3 ; j++ ) {
+			for ( j = 0; j < ARRAY_SIZE(regs); j++ ) {
 				if ( regs[j] >> 31 )
 					regs[j] = 0;
 			}
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 08 12:00:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 08 Apr 2025 12:00:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941830.1341214 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u27d3-0001cY-BW; Tue, 08 Apr 2025 12:00:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941830.1341214; Tue, 08 Apr 2025 12: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 1u27d3-0001cR-96; Tue, 08 Apr 2025 12:00:33 +0000
Received: by outflank-mailman (input) for mailman id 941830;
 Tue, 08 Apr 2025 12: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 1u27d2-0001cL-MR
 for xen-changelog@lists.xenproject.org; Tue, 08 Apr 2025 12: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 1u27d2-002JXL-26
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 12:00:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u27d2-005inG-1x
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 12: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=a9Bi/MXXZhxxKotxWwjRI8bUo+SLFYCDb77R7ZlFPng=; b=U+E1WEgtP8rkLUfQhJ7IJWs1RK
	kAcr4vMtbye7VYul3491W/6a2QdPBPPTV6pJi9FMtsbm9cVxZjO8LIcmCSEtCv6Nsv93PiSJBE7BW
	wllmuiJINu8JxVev4QwBTu7krndt0l74tM+IU8pwwUxJKAboBYBH2IDa2XqTbJPl0hRA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libxl: search PATH for QEMU if `QEMU_XEN_PATH` is not absolute
Message-Id: <E1u27d2-005inG-1x@xenbits.xenproject.org>
Date: Tue, 08 Apr 2025 12:00:32 +0000

commit f3ba5baf54de38efa1fb46c315b52bfaa7035292
Author:     Hongbo <hehongbo@mail.com>
AuthorDate: Tue Apr 8 09:38:07 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 8 09:38:07 2025 +0200

    tools/libxl: search PATH for QEMU if `QEMU_XEN_PATH` is not absolute
    
    `QEMU_XEN_PATH` will be configured as `qemu-system-i386` with no clue where, if
    `--with-system-qemu` is set without giving a path (as matched in the case `yes`
    but not `*`). However, the existence of the executable is checked by `access()`,
    that will not look for anywhere in $PATH but the current directory. And since it
    is possible for `qemu-system-i386` (or any other configured values) to be
    executed from PATH later, we'd better find that in PATH and return the full path
    for the caller to check against.
    
    Signed-off-by: Hongbo <hehongbo@mail.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/light/libxl_dm.c | 38 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 36 insertions(+), 2 deletions(-)

diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
index b193a5dc37..8f0bbd5d64 100644
--- a/tools/libs/light/libxl_dm.c
+++ b/tools/libs/light/libxl_dm.c
@@ -331,9 +331,43 @@ const char *libxl__domain_device_model(libxl__gc *gc,
         case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
             dm = libxl__abs_path(gc, "qemu-dm", libxl__private_bindir_path());
             break;
-        case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
-            dm = qemu_xen_path(gc);
+        case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN: {
+            const char *configured_dm = qemu_xen_path(gc);
+            if (configured_dm[0] == '/')
+            {
+                dm = configured_dm;
+            }
+            else
+            {
+                const char *path_env = getenv("PATH");
+                if (!path_env)
+                {
+                    dm = configured_dm;
+                }
+                else
+                {
+                    char *path_dup = libxl__strdup(gc, path_env);
+                    char *saveptr;
+
+                    char *path = strtok_r(path_dup, ":", &saveptr);
+                    dm = NULL;
+                    while (path)
+                    {
+                        char *candidate = libxl__abs_path(gc, configured_dm, path);
+                        if (access(candidate, X_OK) == 0)
+                        {
+                            dm = candidate;
+                            break;
+                        }
+                        path = strtok_r(NULL, ":", &saveptr);
+                    }
+
+                    if (!dm)
+                        dm = configured_dm;
+                }
+            }
             break;
+        }
         default:
             LOG(ERROR, "invalid device model version %d",
                 info->device_model_version);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 08 12:00:43 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 08 Apr 2025 12:00:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941832.1341219 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u27dD-0002jT-Dm; Tue, 08 Apr 2025 12:00:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941832.1341219; Tue, 08 Apr 2025 12:00:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u27dD-0002jL-Al; Tue, 08 Apr 2025 12:00:43 +0000
Received: by outflank-mailman (input) for mailman id 941832;
 Tue, 08 Apr 2025 12: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 1u27dC-0002eY-PY
 for xen-changelog@lists.xenproject.org; Tue, 08 Apr 2025 12: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 1u27dC-002JXP-2S
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 12:00:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u27dC-005isU-2I
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 12: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=RCgxLw46/oM3q6R+CRC+0m3yC7K2ApU4Q7+wH9g/2hY=; b=k6H6ufuryJz+SPErNSWdbiYwDX
	kDiEchG24A1x1BINQJcVLA6n9L9V81b7EkwviwN4UEUhucMO/MgzWN7sPmsKCfFg0TYQP5C+mYzO/
	35LUSh3ORCKHRlQRojo2tTJi9JZraDAjGO1YJHHs7nF8WfCmXGspRnuNQjhkDzluGAZ8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Config.mk: correct gcc5 check
Message-Id: <E1u27dC-005isU-2I@xenbits.xenproject.org>
Date: Tue, 08 Apr 2025 12:00:42 +0000

commit 140b3b0974a961853bbbcc03037679b41174564e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 8 09:38:36 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 8 09:38:36 2025 +0200

    Config.mk: correct gcc5 check
    
    Passing the -dumpversion option to gcc may only print the major version
    (my system 4.x.y printed major and minor, which in nowaday's scheme is
    then indeed just 5 for 5.x, which in turn is what my secondary system
    compiler does).
    
    Fixes: 40458f752550 ("Xen: Update compiler baseline checks")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 Config.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Config.mk b/Config.mk
index 8a60d4a55a..8be7733d9e 100644
--- a/Config.mk
+++ b/Config.mk
@@ -125,8 +125,8 @@ define cc-ver-check-closure
     endif
 endef
 
-# Require GCC v5.1 as the project global baseline
-check-$(gcc) = $(call cc-ver-check,CC,0x050100,"Xen requires at least GCC 5.1")
+# Require GCC v5 as the project global baseline
+check-$(gcc) = $(call cc-ver-check,CC,0x050000,"Xen requires at least GCC 5")
 $(eval $(check-y))
 
 ld-ver-build-id = $(shell $(1) --build-id 2>&1 | \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 08 12:00:54 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 08 Apr 2025 12:00:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941834.1341223 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u27dO-0002rc-Ev; Tue, 08 Apr 2025 12:00:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941834.1341223; Tue, 08 Apr 2025 12:00: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 1u27dO-0002rU-CH; Tue, 08 Apr 2025 12:00:54 +0000
Received: by outflank-mailman (input) for mailman id 941834;
 Tue, 08 Apr 2025 12: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 1u27dM-0002rJ-SC
 for xen-changelog@lists.xenproject.org; Tue, 08 Apr 2025 12: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 1u27dM-002JXT-2j
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 12:00:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u27dM-005ixo-2d
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 12: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=VMwhNTUbrVydNlS1/EFe+ZQd79OS4lsWxdpu5CR0tfE=; b=x8OAzqTnG2nVuG1J6t8PhGTJ5x
	nat91iWav4yL5UZughkZHJ1Q27azJvTItUfLJCrRQqyTiDcS/DYIzo9SnwkItenpt0WY/Azg5A0Dn
	0s4Rak2b68DuPiNOUzD4pYME1jOoxkYNJ+DgvM5KJyy/BTHr/iLwT+vV8+JKcvuNv6cs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/MTRR: make hold_mtrr_updates_on_aps static and bool
Message-Id: <E1u27dM-005ixo-2d@xenbits.xenproject.org>
Date: Tue, 08 Apr 2025 12:00:52 +0000

commit 4c1f1cae7b4e9fd221081a9cc3a42dd39aa69fb2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 8 09:39:11 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 8 09:39:11 2025 +0200

    x86/MTRR: make hold_mtrr_updates_on_aps static and bool
    
    It's not used outside of the CU defining it, and it is clearly of
    boolean nature.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/mtrr/main.c    | 6 +++---
 xen/arch/x86/include/asm/mtrr.h | 1 -
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/cpu/mtrr/main.c b/xen/arch/x86/cpu/mtrr/main.c
index 24cddcaddf..d4f549d92e 100644
--- a/xen/arch/x86/cpu/mtrr/main.c
+++ b/xen/arch/x86/cpu/mtrr/main.c
@@ -118,7 +118,7 @@ struct set_mtrr_data {
  * After all the cpus have came up, then mtrr_aps_sync_end() synchronizes all 
  * the cpus and updates mtrrs on all of them. Then this flag is turned off.
  */
-int hold_mtrr_updates_on_aps;
+static bool hold_mtrr_updates_on_aps;
 
 static void cf_check ipi_handler(void *info)
 /*  [SUMMARY] Synchronisation handler. Executed by "other" CPUs.
@@ -600,14 +600,14 @@ void mtrr_save_state(void)
 
 void mtrr_aps_sync_begin(void)
 {
-	hold_mtrr_updates_on_aps = 1;
+	hold_mtrr_updates_on_aps = true;
 }
 
 void mtrr_aps_sync_end(void)
 {
 	if (mtrr_if)
 		set_mtrr(~0U, 0, 0, 0);
-	hold_mtrr_updates_on_aps = 0;
+	hold_mtrr_updates_on_aps = false;
 }
 
 void asmlinkage mtrr_bp_restore(void)
diff --git a/xen/arch/x86/include/asm/mtrr.h b/xen/arch/x86/include/asm/mtrr.h
index 48b59d2620..25d442659d 100644
--- a/xen/arch/x86/include/asm/mtrr.h
+++ b/xen/arch/x86/include/asm/mtrr.h
@@ -63,7 +63,6 @@ extern uint32_t get_pat_flags(struct vcpu *v, uint32_t gl1e_flags,
                               paddr_t gpaddr, paddr_t spaddr,
                               uint8_t gmtrr_mtype);
 extern uint8_t pat_type_2_pte_flags(uint8_t pat_type);
-extern int hold_mtrr_updates_on_aps;
 extern void mtrr_aps_sync_begin(void);
 extern void mtrr_aps_sync_end(void);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 08 12:01:04 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 08 Apr 2025 12:01:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941837.1341227 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u27dY-0002uJ-Gk; Tue, 08 Apr 2025 12:01:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941837.1341227; Tue, 08 Apr 2025 12:01: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 1u27dY-0002uC-Di; Tue, 08 Apr 2025 12:01:04 +0000
Received: by outflank-mailman (input) for mailman id 941837;
 Tue, 08 Apr 2025 12:01: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 1u27dW-0002u1-VZ
 for xen-changelog@lists.xenproject.org; Tue, 08 Apr 2025 12: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 1u27dW-002JXm-33
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 12:01:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u27dW-005j3j-2w
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 12: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=2mXJoB40jJUBQXvjvv/P4OqgXBpMlo4P1F+Kezodmxo=; b=ICwlGZmhCjrfUQiyKBwgPYxx8/
	pAaM+iZEoPPdqxMSU9UI0xrj45C7ycrc268O9TRvPIIpKClg79nj0cLvpCOWKHA1azsxxeJVFh3Ul
	o0HjK0zp37zUw9XLU3r+8vEPI1nTMJ6hrsp3V9djLdyypuJah1+RU2cnemTGT0+mSu0k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] libxl{,u}: replace TOSTRING()
Message-Id: <E1u27dW-005j3j-2w@xenbits.xenproject.org>
Date: Tue, 08 Apr 2025 12:01:02 +0000

commit 36ce9faad9e7f18e380092070484a0d7004974e8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 8 09:39:50 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 8 09:39:50 2025 +0200

    libxl{,u}: replace TOSTRING()
    
    Now that common-macros.h has STR() available, which is even slightly
    more flexible, use that and drop the custom macros.
    
    No difference in generated code (except for line numbers, of course,
    where embedded in code/data).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/light/libxl_disk.c     | 2 +-
 tools/libs/light/libxl_internal.h | 3 ---
 tools/libs/util/libxlu_disk_l.c   | 2 +-
 tools/libs/util/libxlu_disk_l.l   | 2 +-
 tools/libs/util/libxlu_internal.h | 6 ++----
 5 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/tools/libs/light/libxl_disk.c b/tools/libs/light/libxl_disk.c
index 15055380c6..6a0b6e06fe 100644
--- a/tools/libs/light/libxl_disk.c
+++ b/tools/libs/light/libxl_disk.c
@@ -53,7 +53,7 @@ static void disk_eject_xswatch_callback(libxl__egc *egc, libxl__ev_xswatch *w,
     }
 
     sscanf(backend,
-            "/local/domain/%d/backend/%" TOSTRING(BACKEND_STRING_SIZE)
+           "/local/domain/%d/backend/%" STR(BACKEND_STRING_SIZE)
            "[a-z]/%*d/%*d",
            &disk->backend_domid, backend_type);
     if (!strcmp(backend_type, "tap") ||
diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_internal.h
index cfac8e18b6..408a771310 100644
--- a/tools/libs/light/libxl_internal.h
+++ b/tools/libs/light/libxl_internal.h
@@ -2093,9 +2093,6 @@ _hidden int libxl__init_recursive_mutex(libxl_ctx *ctx, pthread_mutex_t *lock);
 
 _hidden int libxl__gettimeofday(libxl__gc *gc, struct timeval *now_r);
 
-#define STRINGIFY(x) #x
-#define TOSTRING(x) STRINGIFY(x)
-
 /* from libxl_qmp */
 typedef struct libxl__qmp_handler libxl__qmp_handler;
 
diff --git a/tools/libs/util/libxlu_disk_l.c b/tools/libs/util/libxlu_disk_l.c
index 9213dd957c..0c180fff52 100644
--- a/tools/libs/util/libxlu_disk_l.c
+++ b/tools/libs/util/libxlu_disk_l.c
@@ -1152,7 +1152,7 @@ void xlu__disk_yyset_column(int  column_no, yyscan_t yyscanner);
 #define DSET(dpc,member,enumname,str,valname) do{			\
 	if (dpc->disk->member != LIBXL_DISK_##enumname##_UNKNOWN &&	\
 	    dpc->disk->member != LIBXL_DISK_##enumname##_##valname) {	\
-	    xlu__disk_err(dpc, str, TOSTRING(member) " respecified");	\
+	    xlu__disk_err(dpc, str, STR(member) " respecified");	\
 	} else {							\
 	    dpc->disk->member = LIBXL_DISK_##enumname##_##valname;	\
 	}								\
diff --git a/tools/libs/util/libxlu_disk_l.l b/tools/libs/util/libxlu_disk_l.l
index f37dd443bd..14c9fa1112 100644
--- a/tools/libs/util/libxlu_disk_l.l
+++ b/tools/libs/util/libxlu_disk_l.l
@@ -64,7 +64,7 @@ void xlu__disk_yyset_column(int  column_no, yyscan_t yyscanner);
 #define DSET(dpc,member,enumname,str,valname) do{			\
 	if (dpc->disk->member != LIBXL_DISK_##enumname##_UNKNOWN &&	\
 	    dpc->disk->member != LIBXL_DISK_##enumname##_##valname) {	\
-	    xlu__disk_err(dpc, str, TOSTRING(member) " respecified");	\
+	    xlu__disk_err(dpc, str, STR(member) " respecified");	\
 	} else {							\
 	    dpc->disk->member = LIBXL_DISK_##enumname##_##valname;	\
 	}								\
diff --git a/tools/libs/util/libxlu_internal.h b/tools/libs/util/libxlu_internal.h
index 1f7559ecd9..a82385fbb5 100644
--- a/tools/libs/util/libxlu_internal.h
+++ b/tools/libs/util/libxlu_internal.h
@@ -25,6 +25,8 @@
 
 #include "libxlutil.h"
 
+#include <xen-tools/common-macros.h>
+
 struct XLU_ConfigList {
     int avalues; /* available slots */
     int nvalues; /* actual occupied slots */
@@ -69,10 +71,6 @@ typedef struct {
     void *scanner;
 } CfgParseContext;
 
-
-#define STRINGIFY(x) #x
-#define TOSTRING(x) STRINGIFY(x)
-
 #endif /*LIBXLU_INTERNAL_H*/
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 08 12:01:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 08 Apr 2025 12:01:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941839.1341232 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u27di-0002xY-Jn; Tue, 08 Apr 2025 12:01:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941839.1341232; Tue, 08 Apr 2025 12: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 1u27di-0002xQ-GV; Tue, 08 Apr 2025 12:01:14 +0000
Received: by outflank-mailman (input) for mailman id 941839;
 Tue, 08 Apr 2025 12:01: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 1u27dh-0002xF-1q
 for xen-changelog@lists.xenproject.org; Tue, 08 Apr 2025 12:01: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 1u27dh-002JXs-06
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 12:01:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u27dh-005jBe-01
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 12:01: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=mbj+lcgUUnUaYeWDYxUiTR5vJ3Zrmix7PssFWakSG0w=; b=Yo8wnjPaPPyePNZo4HJufWVUST
	uVbe34/M8EHq6PFaiGwEASIDWvW/7X//uE4LqbrSStw0Sb3NrEoXKhdcEeojtiJjfzA7N1WTTd+iJ
	NJkqF+yFiNA1x1gFcwEx3sdD7OpPetUfIKsx2+piZUqspRqqqvVFRlL67VcMQzY5VMNA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: x86: irq: initialize irq desc in create_irq()
Message-Id: <E1u27dh-005jBe-01@xenbits.xenproject.org>
Date: Tue, 08 Apr 2025 12:01:13 +0000

commit 7a4484d90b3003171f1700e424ad45b931200ba6
Author:     Volodymyr Babchuk <volodymyr_babchuk@epam.com>
AuthorDate: Tue Apr 8 09:40:39 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 8 09:40:39 2025 +0200

    xen: x86: irq: initialize irq desc in create_irq()
    
    While building xen with GCC 14.2.1 with "-fcondition-coverage" option
    or with "-Og", the compiler produces a false positive warning:
    
      arch/x86/irq.c: In function ‘create_irq’:
      arch/x86/irq.c:281:11: error: ‘desc’ may be used uninitialized [-Werror=maybe-uninitialized]
        281 |     ret = init_one_irq_desc(desc);
            |           ^~~~~~~~~~~~~~~~~~~~~~~
      arch/x86/irq.c:269:22: note: ‘desc’ was declared here
        269 |     struct irq_desc *desc;
            |                      ^~~~
      cc1: all warnings being treated as errors
      make[2]: *** [Rules.mk:252: arch/x86/irq.o] Error 1
    
    While we have signed/unsigned comparison both in "for" loop and in
    "if" statement, this still can't lead to use of uninitialized "desc",
    as either loop will be executed at least once, or the function will
    return early. So this is a clearly false positive warning due to a
    bug [1] in GCC.
    
    Initialize "desc" with NULL to make GCC happy.
    
    [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119665
    
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index dd8d921f18..38ac0823d7 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -265,7 +265,7 @@ void __init clear_irq_vector(int irq)
 int create_irq(nodeid_t node, bool grant_access)
 {
     int irq, ret;
-    struct irq_desc *desc;
+    struct irq_desc *desc = NULL ; /* gcc14 -Og or -fcondition-coverage */
 
     for (irq = nr_irqs_gsi; irq < nr_irqs; irq++)
     {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 08 12:01:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 08 Apr 2025 12:01:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.941841.1341235 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u27ds-00030K-KV; Tue, 08 Apr 2025 12:01:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 941841.1341235; Tue, 08 Apr 2025 12: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 1u27ds-00030D-Hu; Tue, 08 Apr 2025 12:01:24 +0000
Received: by outflank-mailman (input) for mailman id 941841;
 Tue, 08 Apr 2025 12:01: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 1u27dr-000302-4c
 for xen-changelog@lists.xenproject.org; Tue, 08 Apr 2025 12:01: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 1u27dr-002JYE-0N
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 12:01:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u27dr-005jHp-0H
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 12:01: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=wM7Xx6JzmKrD23eteifSj6iLPF5cGbPRSuiMHPwz8hU=; b=tZEsb45e17OfB7sr+FUq/ZPWOr
	tu3ENaQboeFj56BVEOGrhFau6caVfN3UkILLkTERaR3Hx20mrOMRVGKtYZkmhNFog7b/0tC8Jdioi
	lR3zeYtqh34z6JIGqqOzZOAWMtnKlMCo9vqpNkC8wGVfxQXHdOdRFqrfNSbl+25UDWXk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Revert "tools/libxl: search PATH for QEMU if `QEMU_XEN_PATH` is not absolute"
Message-Id: <E1u27dr-005jHp-0H@xenbits.xenproject.org>
Date: Tue, 08 Apr 2025 12:01:23 +0000

commit e4ff0e4f8344f721e17bc7608829329e20258f47
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 8 12:37:37 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 8 12:37:37 2025 +0200

    Revert "tools/libxl: search PATH for QEMU if `QEMU_XEN_PATH` is not absolute"
    
    This reverts commit f3ba5baf54de38efa1fb46c315b52bfaa7035292, for
    breaking the build in gitlab CI.
---
 tools/libs/light/libxl_dm.c | 38 ++------------------------------------
 1 file changed, 2 insertions(+), 36 deletions(-)

diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
index 8f0bbd5d64..b193a5dc37 100644
--- a/tools/libs/light/libxl_dm.c
+++ b/tools/libs/light/libxl_dm.c
@@ -331,43 +331,9 @@ const char *libxl__domain_device_model(libxl__gc *gc,
         case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
             dm = libxl__abs_path(gc, "qemu-dm", libxl__private_bindir_path());
             break;
-        case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN: {
-            const char *configured_dm = qemu_xen_path(gc);
-            if (configured_dm[0] == '/')
-            {
-                dm = configured_dm;
-            }
-            else
-            {
-                const char *path_env = getenv("PATH");
-                if (!path_env)
-                {
-                    dm = configured_dm;
-                }
-                else
-                {
-                    char *path_dup = libxl__strdup(gc, path_env);
-                    char *saveptr;
-
-                    char *path = strtok_r(path_dup, ":", &saveptr);
-                    dm = NULL;
-                    while (path)
-                    {
-                        char *candidate = libxl__abs_path(gc, configured_dm, path);
-                        if (access(candidate, X_OK) == 0)
-                        {
-                            dm = candidate;
-                            break;
-                        }
-                        path = strtok_r(NULL, ":", &saveptr);
-                    }
-
-                    if (!dm)
-                        dm = configured_dm;
-                }
-            }
+        case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
+            dm = qemu_xen_path(gc);
             break;
-        }
         default:
             LOG(ERROR, "invalid device model version %d",
                 info->device_model_version);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 08 17:11:08 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 08 Apr 2025 17:11:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.943171.1342042 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2CTX-0005Vp-03; Tue, 08 Apr 2025 17:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 943171.1342042; Tue, 08 Apr 2025 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 1u2CTW-0005Vh-To; Tue, 08 Apr 2025 17:11:02 +0000
Received: by outflank-mailman (input) for mailman id 943171;
 Tue, 08 Apr 2025 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 1u2CTV-0005VV-Rt
 for xen-changelog@lists.xenproject.org; Tue, 08 Apr 2025 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 1u2CTV-002RdS-2H
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 17:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2CTV-007k5N-24
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 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=eK8qZzcEEFbHeWOnCOJq/DGjdVfURULA5U54GQBJoiE=; b=azchdlZ9gk6sYddwqDwBz+x0nk
	9kbS0VJlbzBYh0gbAdguGYPO1EDqeoc02jmxnEKW/4cJzEgyUEMoCXTm8UpBbi6IgJv1Nqc5SJSKh
	bcR1wUw/hl47uWXuNgWuc0jbYcHX7VEo8v4VPuNPuXOSxhOXQ8ia7pgL4erOsyLm8cfA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/ucode: Extend AMD digest checks to cover Zen5 CPUs
Message-Id: <E1u2CTV-007k5N-24@xenbits.xenproject.org>
Date: Tue, 08 Apr 2025 17:11:01 +0000

commit b63951467e964bcc927f823fc943e40069fac0c9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 8 17:09:15 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 8 17:51:45 2025 +0100

    x86/ucode: Extend AMD digest checks to cover Zen5 CPUs
    
    AMD have updated the SB-7033 advisory to include Zen5 CPUs.  Extend the digest
    check to cover Zen5 too.
    
    In practice, cover everything until further notice.
    
    Observant readers may be wondering where the update to the digest list is.  At
    the time of writing, no Zen5 patches are available via a verifiable channel.
    
    Link: https://www.amd.com/en/resources/product-security/bulletin/amd-sb-7033.html
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/cpu/microcode/amd.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index ee7de5282b..4bc490dedc 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -117,8 +117,12 @@ static bool check_digest(const struct container_microcode *mc)
     const struct patch_digest *pd;
     uint8_t digest[SHA2_256_DIGEST_SIZE];
 
-    /* Only Fam17h/19h are known to need extra checks.  Skip other families. */
-    if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x19 ||
+    /*
+     * Zen1 thru Zen5 CPUs are known to use a weak signature algorithm on
+     * microcode updates.  Mitigate by checking the digest of the patch
+     * against a list of known provenance.
+     */
+    if ( boot_cpu_data.x86 < 0x17 ||
          !opt_digest_check )
         return true;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 08 19:33:08 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 08 Apr 2025 19:33:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.943218.1342056 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2Egx-00089P-PX; Tue, 08 Apr 2025 19:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 943218.1342056; Tue, 08 Apr 2025 19: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 1u2Egx-00089I-N4; Tue, 08 Apr 2025 19:33:03 +0000
Received: by outflank-mailman (input) for mailman id 943218;
 Tue, 08 Apr 2025 19: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 1u2Egw-00089C-Ea
 for xen-changelog@lists.xenproject.org; Tue, 08 Apr 2025 19: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 1u2Egw-002Uxj-06
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 19:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2Egv-0087eP-3B
 for xen-changelog@lists.xenproject.org;
 Tue, 08 Apr 2025 19:33:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=//C/iaWOO7D1wZeu47hCiFU9AzPHCK1AboRhrt1R+Ek=; b=re/WYAd7T5FsIDBjkUHOycrZEc
	qW2OHN4SP3XnXNOZf998/Wq3IDpk9RJvvXQitHRC65dljtGjQOo+oRVNvCWRTmrXc7+FP4n4eBzfR
	XCrwE+NPHl4QffXrrASrXrt8U4piftfHVXREgg9l8p3A8YJKusFWfIPZR6SsCUXYcy+g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/ucode: Extend AMD digest checks to cover Zen5 CPUs
Message-Id: <E1u2Egv-0087eP-3B@xenbits.xenproject.org>
Date: Tue, 08 Apr 2025 19:33:01 +0000

commit b63951467e964bcc927f823fc943e40069fac0c9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 8 17:09:15 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 8 17:51:45 2025 +0100

    x86/ucode: Extend AMD digest checks to cover Zen5 CPUs
    
    AMD have updated the SB-7033 advisory to include Zen5 CPUs.  Extend the digest
    check to cover Zen5 too.
    
    In practice, cover everything until further notice.
    
    Observant readers may be wondering where the update to the digest list is.  At
    the time of writing, no Zen5 patches are available via a verifiable channel.
    
    Link: https://www.amd.com/en/resources/product-security/bulletin/amd-sb-7033.html
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/cpu/microcode/amd.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index ee7de5282b..4bc490dedc 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -117,8 +117,12 @@ static bool check_digest(const struct container_microcode *mc)
     const struct patch_digest *pd;
     uint8_t digest[SHA2_256_DIGEST_SIZE];
 
-    /* Only Fam17h/19h are known to need extra checks.  Skip other families. */
-    if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x19 ||
+    /*
+     * Zen1 thru Zen5 CPUs are known to use a weak signature algorithm on
+     * microcode updates.  Mitigate by checking the digest of the patch
+     * against a list of known provenance.
+     */
+    if ( boot_cpu_data.x86 < 0x17 ||
          !opt_digest_check )
         return true;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 09 10:55:09 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 09 Apr 2025 10:55:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.943898.1342500 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2T5E-0002CW-55; Wed, 09 Apr 2025 10:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 943898.1342500; Wed, 09 Apr 2025 10: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 1u2T5E-0002CO-2P; Wed, 09 Apr 2025 10:55:04 +0000
Received: by outflank-mailman (input) for mailman id 943898;
 Wed, 09 Apr 2025 10:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u2T5C-0002CI-Ht
 for xen-changelog@lists.xenproject.org; Wed, 09 Apr 2025 10:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2T5C-004JZt-0r
 for xen-changelog@lists.xenproject.org;
 Wed, 09 Apr 2025 10:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2T5C-00DAem-0h
 for xen-changelog@lists.xenproject.org;
 Wed, 09 Apr 2025 10:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=F81yV4dlukEycQZsWwaf9t12pOC4dUvUJ6S+7Jgolxs=; b=gG4xI5hEfjpizDdZaayTfwrsc2
	xdqbzMyHjdIexpZyVJLkiGB1YzeIbxvWeMAsDNJ22lMJIOrLVGjEDRjy2WZwpvFGQgGbIR/jjMxcO
	7UiBeuyxVn7k4siU5D7dpgB45LXSyqXr4ZkIZAEQl357OZEGLBqNsnFL54nw5RSnTce8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] automation/dockers: add to README how to rebuild all containers
Message-Id: <E1u2T5C-00DAem-0h@xenbits.xenproject.org>
Date: Wed, 09 Apr 2025 10:55:02 +0000

commit 7dc3b362f4ec7a0b47d8c110d82bc657f0a0fdad
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Mar 31 18:56:01 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Wed Apr 9 10:42:52 2025 +0200

    automation/dockers: add to README how to rebuild all containers
    
    Document in the README how to rebuild all containers.  This is helpful when
    populating a local docker registry for testing purposes.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/build/README.md | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/automation/build/README.md b/automation/build/README.md
index ecc898680c..6c647b1b2a 100644
--- a/automation/build/README.md
+++ b/automation/build/README.md
@@ -108,6 +108,13 @@ env CONTAINER_NO_PULL=1 \
 make -C automation/build opensuse/tumbleweed-x86_64 PUSH=1
 ```
 
+To rebuild all containers the `all` make target can be used, with or without
+the `PUSH` environment variable:
+
+```
+make -C automation/build all PUSH=1
+```
+
 [BuildKit]: https://docs.docker.com/build/buildkit/
 [registry]: https://gitlab.com/xen-project/xen/container_registry
 [registry help]: https://docs.gitlab.com/ee/user/packages/container_registry/
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 09 10:55:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 09 Apr 2025 10:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.943899.1342503 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2T5O-0002EE-6o; Wed, 09 Apr 2025 10:55:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 943899.1342503; Wed, 09 Apr 2025 10: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 1u2T5O-0002E6-3l; Wed, 09 Apr 2025 10:55:14 +0000
Received: by outflank-mailman (input) for mailman id 943899;
 Wed, 09 Apr 2025 10:55:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u2T5M-0002Dp-DE
 for xen-changelog@lists.xenproject.org; Wed, 09 Apr 2025 10:55:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2T5M-004JZx-1E
 for xen-changelog@lists.xenproject.org;
 Wed, 09 Apr 2025 10:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2T5M-00DAo5-15
 for xen-changelog@lists.xenproject.org;
 Wed, 09 Apr 2025 10:55:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5PfKp/MJe1VBhi7mP79pReODXj3Bvs7VdsVrJFtdRWc=; b=hI34OTSRc+3hU1ylfVci7pJ60m
	DNj0Y5Ag7cqPp82Sx8r5ppBS4J3hyfJWMkLrDkheURo/vyzUKtBSpV/HrpXTCFo0Eebdw1WN2Xqfy
	NBwOm3addYtG3dnBjvfKHttLNl4fK/xrHK/T9Uc5WTnR0TAw1cRVeHcIJnVszn686o74=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/hvm: remove unreachable MMCFG write emulation
Message-Id: <E1u2T5M-00DAo5-15@xenbits.xenproject.org>
Date: Wed, 09 Apr 2025 10:55:12 +0000

commit 81f91e128f3935514770af18823e31656d99b5b5
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Apr 8 10:58:09 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Wed Apr 9 10:42:52 2025 +0200

    x86/hvm: remove unreachable MMCFG write emulation
    
    The current implementation of PVH dom0 relies on vPCI to trap and handle
    accesses to the MMCFG area.  Previous implementation of PVH dom0 (v1)
    didn't have vPCI, and as a classic PV dom0, relied on the MMCFG range being
    RO.  As such hvm_emulate_one_mmio() had to special case write accesses to
    the MMCFG area.
    
    With PVH dom0 using vPCI, and the MMCFG accesses being fully handled there,
    hvm_emulate_one_mmio() should never handle accesses to MMCFG, making the
    code effectively unreachable.
    
    Remove it and leave an ASSERT to make sure MMCFG accesses never get into
    hvm_emulate_one_mmio().  As a result of the removal of one of the users of
    mmcfg_intercept_write(), the function can now be moved into the same
    translation unit where it's solely used, allowing it to be made static and
    effectively built only when PV support is enabled.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/emulate.c      | 22 ++++++++--------------
 xen/arch/x86/include/asm/mm.h   |  3 ---
 xen/arch/x86/mm.c               | 31 -------------------------------
 xen/arch/x86/pv/ro-page-fault.c | 31 +++++++++++++++++++++++++++++++
 4 files changed, 39 insertions(+), 48 deletions(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 04d07ccaf6..9fff1b82f7 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -2858,12 +2858,6 @@ int hvm_emulate_one(
 
 int hvm_emulate_one_mmio(unsigned long mfn, unsigned long gla)
 {
-    static const struct x86_emulate_ops hvm_intercept_ops_mmcfg = {
-        .read       = x86emul_unhandleable_rw,
-        .insn_fetch = hvmemul_insn_fetch,
-        .write      = mmcfg_intercept_write,
-        .validate   = hvmemul_validate,
-    };
     static const struct x86_emulate_ops hvm_ro_emulate_ops_mmio = {
         .read       = x86emul_unhandleable_rw,
         .insn_fetch = hvmemul_insn_fetch,
@@ -2872,28 +2866,28 @@ int hvm_emulate_one_mmio(unsigned long mfn, unsigned long gla)
     };
     struct mmio_ro_emulate_ctxt mmio_ro_ctxt = { .cr2 = gla, .mfn = _mfn(mfn) };
     struct hvm_emulate_ctxt ctxt;
-    const struct x86_emulate_ops *ops;
     unsigned int seg, bdf;
     int rc;
 
     if ( pci_ro_mmcfg_decode(mfn, &seg, &bdf) )
     {
-        mmio_ro_ctxt.seg = seg;
-        mmio_ro_ctxt.bdf = bdf;
-        ops = &hvm_intercept_ops_mmcfg;
+        /* Should be always handled by vPCI for PVH dom0. */
+        gdprintk(XENLOG_ERR, "unhandled MMCFG access for %pp\n",
+                 &PCI_SBDF(seg, bdf));
+        ASSERT_UNREACHABLE();
+        return X86EMUL_UNHANDLEABLE;
     }
-    else
-        ops = &hvm_ro_emulate_ops_mmio;
 
     hvm_emulate_init_once(&ctxt, x86_insn_is_mem_write,
                           guest_cpu_user_regs());
     ctxt.ctxt.data = &mmio_ro_ctxt;
 
-    switch ( rc = _hvm_emulate_one(&ctxt, ops, VIO_no_completion) )
+    switch ( rc = _hvm_emulate_one(&ctxt, &hvm_ro_emulate_ops_mmio,
+                                   VIO_no_completion) )
     {
     case X86EMUL_UNHANDLEABLE:
     case X86EMUL_UNIMPLEMENTED:
-        hvm_dump_emulation_state(XENLOG_G_WARNING, "MMCFG", &ctxt, rc);
+        hvm_dump_emulation_state(XENLOG_G_WARNING, "r/o MMIO", &ctxt, rc);
         break;
     case X86EMUL_EXCEPTION:
         hvm_inject_event(&ctxt.ctxt.event);
diff --git a/xen/arch/x86/include/asm/mm.h b/xen/arch/x86/include/asm/mm.h
index 6c7e66ee21..a1bc8cc274 100644
--- a/xen/arch/x86/include/asm/mm.h
+++ b/xen/arch/x86/include/asm/mm.h
@@ -553,9 +553,6 @@ struct mmio_ro_emulate_ctxt {
 int cf_check mmio_ro_emulated_write(
     enum x86_segment seg, unsigned long offset, void *p_data,
     unsigned int bytes, struct x86_emulate_ctxt *ctxt);
-int cf_check mmcfg_intercept_write(
-    enum x86_segment seg, unsigned long offset, void *p_data,
-    unsigned int bytes, struct x86_emulate_ctxt *ctxt);
 
 int audit_adjust_pgtables(struct domain *d, int dir, int noisy);
 
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index b294497a14..4fecd37aec 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5200,37 +5200,6 @@ int cf_check mmio_ro_emulated_write(
     return X86EMUL_OKAY;
 }
 
-int cf_check mmcfg_intercept_write(
-    enum x86_segment seg,
-    unsigned long offset,
-    void *p_data,
-    unsigned int bytes,
-    struct x86_emulate_ctxt *ctxt)
-{
-    struct mmio_ro_emulate_ctxt *mmio_ctxt = ctxt->data;
-
-    /*
-     * Only allow naturally-aligned stores no wider than 4 bytes to the
-     * original %cr2 address.
-     */
-    if ( ((bytes | offset) & (bytes - 1)) || bytes > 4 || !bytes ||
-         offset != mmio_ctxt->cr2 )
-    {
-        gdprintk(XENLOG_WARNING, "bad write (cr2=%lx, addr=%lx, bytes=%u)\n",
-                mmio_ctxt->cr2, offset, bytes);
-        return X86EMUL_UNHANDLEABLE;
-    }
-
-    offset &= 0xfff;
-    if ( pci_conf_write_intercept(mmio_ctxt->seg, mmio_ctxt->bdf,
-                                  offset, bytes, p_data) >= 0 )
-        pci_mmcfg_write(mmio_ctxt->seg, PCI_BUS(mmio_ctxt->bdf),
-                        PCI_DEVFN(mmio_ctxt->bdf), offset, bytes,
-                        *(uint32_t *)p_data);
-
-    return X86EMUL_OKAY;
-}
-
 /*
  * For these PTE APIs, the caller must follow the alloc-map-unmap-free
  * lifecycle, which means explicitly mapping the PTE pages before accessing
diff --git a/xen/arch/x86/pv/ro-page-fault.c b/xen/arch/x86/pv/ro-page-fault.c
index 372187e9a0..11b01c479e 100644
--- a/xen/arch/x86/pv/ro-page-fault.c
+++ b/xen/arch/x86/pv/ro-page-fault.c
@@ -298,6 +298,37 @@ static int ptwr_do_page_fault(struct x86_emulate_ctxt *ctxt,
  * fault handling for read-only MMIO pages
  */
 
+static int cf_check mmcfg_intercept_write(
+    enum x86_segment seg,
+    unsigned long offset,
+    void *p_data,
+    unsigned int bytes,
+    struct x86_emulate_ctxt *ctxt)
+{
+    struct mmio_ro_emulate_ctxt *mmio_ctxt = ctxt->data;
+
+    /*
+     * Only allow naturally-aligned stores no wider than 4 bytes to the
+     * original %cr2 address.
+     */
+    if ( ((bytes | offset) & (bytes - 1)) || bytes > 4 || !bytes ||
+         offset != mmio_ctxt->cr2 )
+    {
+        gdprintk(XENLOG_WARNING, "bad write (cr2=%lx, addr=%lx, bytes=%u)\n",
+                mmio_ctxt->cr2, offset, bytes);
+        return X86EMUL_UNHANDLEABLE;
+    }
+
+    offset &= 0xfff;
+    if ( pci_conf_write_intercept(mmio_ctxt->seg, mmio_ctxt->bdf,
+                                  offset, bytes, p_data) >= 0 )
+        pci_mmcfg_write(mmio_ctxt->seg, PCI_BUS(mmio_ctxt->bdf),
+                        PCI_DEVFN(mmio_ctxt->bdf), offset, bytes,
+                        *(uint32_t *)p_data);
+
+    return X86EMUL_OKAY;
+}
+
 static const struct x86_emulate_ops mmio_ro_emulate_ops = {
     .read       = x86emul_unhandleable_rw,
     .insn_fetch = ptwr_emulated_insn_fetch,
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 09 11:00:03 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 09 Apr 2025 11:00:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.943915.1342518 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2TA2-0003AI-Q0; Wed, 09 Apr 2025 11:00:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 943915.1342518; Wed, 09 Apr 2025 11:00:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2TA2-0003A9-MX; Wed, 09 Apr 2025 11:00:02 +0000
Received: by outflank-mailman (input) for mailman id 943915;
 Wed, 09 Apr 2025 11: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 1u2TA2-00034O-79
 for xen-changelog@lists.xenproject.org; Wed, 09 Apr 2025 11: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 1u2TA2-004Jij-0a
 for xen-changelog@lists.xenproject.org;
 Wed, 09 Apr 2025 11:00:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2TA2-00DHF4-0T
 for xen-changelog@lists.xenproject.org;
 Wed, 09 Apr 2025 11: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=j4UL6mnFcSIl5L/b4Dl1culVDV+lKhUdxZnKiTLBnt8=; b=Vhe4bgHTe4dJSUjP03Z9mTwIZm
	RUjtw5K/6mEXG8MaxEPJAMSr3Ox/tGZE3WcbbeW/ihRUZGm2bxf0kOplAMncvgb+/ha9HHoD5le8q
	vAMhimyT/CrqlWGn9PoqxxFm8xyuDUOsAh+XfZlyWSgbpUCSvw82xAxJOy/bSRzgAN6U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/ucode: Extend warning about disabling digest check too
Message-Id: <E1u2TA2-00DHF4-0T@xenbits.xenproject.org>
Date: Wed, 09 Apr 2025 11:00:02 +0000

commit 59bb316ea89e7f9461690fe00547d7d2af96321d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Apr 9 11:36:40 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 9 11:55:03 2025 +0100

    x86/ucode: Extend warning about disabling digest check too
    
    This was missed by accident.
    
    Fixes: b63951467e96 ("x86/ucode: Extend AMD digest checks to cover Zen5 CPUs")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/cpu/microcode/amd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 4bc490dedc..ebd9ecbeef 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -516,8 +516,7 @@ static const struct microcode_ops __initconst_cf_clobber amd_ucode_ops = {
 
 void __init ucode_probe_amd(struct microcode_ops *ops)
 {
-    if ( !opt_digest_check &&
-         boot_cpu_data.x86 >= 0x17 && boot_cpu_data.x86 <= 0x19 )
+    if ( !opt_digest_check && boot_cpu_data.x86 >= 0x17 )
     {
         printk(XENLOG_WARNING
                "Microcode patch additional digest checks disabled");
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 09 13:44:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 09 Apr 2025 13:44:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.944147.1342683 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2Vil-00033X-HE; Wed, 09 Apr 2025 13:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 944147.1342683; Wed, 09 Apr 2025 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 1u2Vil-00033P-Dr; Wed, 09 Apr 2025 13:44:03 +0000
Received: by outflank-mailman (input) for mailman id 944147;
 Wed, 09 Apr 2025 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 1u2Vik-00033J-3l
 for xen-changelog@lists.xenproject.org; Wed, 09 Apr 2025 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 1u2Vij-004NSm-2u
 for xen-changelog@lists.xenproject.org;
 Wed, 09 Apr 2025 13:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2Vij-00EYG0-2h
 for xen-changelog@lists.xenproject.org;
 Wed, 09 Apr 2025 13:44:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aUza7EMC2w0M93fwc4Ah9jySIr0pnlUvR8TSJHTAfIE=; b=T5xvkciDb84qrt53NNFNfmq8Vp
	sQnZ7aOpIqRDgCoyoOAbI+AeDe5S4yHryJ0rv0cIXL5FTqebYO3HnW0ANgewJDLpOELdbepFG6IdG
	n0pxzgyTdQQjGflx/vsFsCorOVMELbzh+Ea/y75a7hW3jQnzy08EaLS6+YwNDvQLNzHg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation/dockers: add to README how to rebuild all containers
Message-Id: <E1u2Vij-00EYG0-2h@xenbits.xenproject.org>
Date: Wed, 09 Apr 2025 13:44:01 +0000

commit 7dc3b362f4ec7a0b47d8c110d82bc657f0a0fdad
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Mar 31 18:56:01 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Wed Apr 9 10:42:52 2025 +0200

    automation/dockers: add to README how to rebuild all containers
    
    Document in the README how to rebuild all containers.  This is helpful when
    populating a local docker registry for testing purposes.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/build/README.md | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/automation/build/README.md b/automation/build/README.md
index ecc898680c..6c647b1b2a 100644
--- a/automation/build/README.md
+++ b/automation/build/README.md
@@ -108,6 +108,13 @@ env CONTAINER_NO_PULL=1 \
 make -C automation/build opensuse/tumbleweed-x86_64 PUSH=1
 ```
 
+To rebuild all containers the `all` make target can be used, with or without
+the `PUSH` environment variable:
+
+```
+make -C automation/build all PUSH=1
+```
+
 [BuildKit]: https://docs.docker.com/build/buildkit/
 [registry]: https://gitlab.com/xen-project/xen/container_registry
 [registry help]: https://docs.gitlab.com/ee/user/packages/container_registry/
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 09 13:44:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 09 Apr 2025 13:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.944148.1342686 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2Viv-00035E-Hn; Wed, 09 Apr 2025 13:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 944148.1342686; Wed, 09 Apr 2025 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 1u2Viv-000356-FD; Wed, 09 Apr 2025 13:44:13 +0000
Received: by outflank-mailman (input) for mailman id 944148;
 Wed, 09 Apr 2025 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 1u2Viu-00034u-1O
 for xen-changelog@lists.xenproject.org; Wed, 09 Apr 2025 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 1u2Viu-004NWH-02
 for xen-changelog@lists.xenproject.org;
 Wed, 09 Apr 2025 13:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2Vit-00EYHQ-38
 for xen-changelog@lists.xenproject.org;
 Wed, 09 Apr 2025 13: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=F7koA9JcjJuM8pqRyilLCCbNdKBNOD71D46MgBE50b0=; b=jeAKfHdrBTD4Tziu1kelRsXAyo
	VD/ev4+zv3LFHO7cYADP0OOOHvIvzlKzzntw1cyiXS2tO8atuL/D87ih2m5vnBUS9y6EookRgCiNh
	HmvJlpTAVha+IA0F6g7elJdecQF7Hb8tthOK12kKeCAdfrW+pvBkO+ULk4fRIWS9woy4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/hvm: remove unreachable MMCFG write emulation
Message-Id: <E1u2Vit-00EYHQ-38@xenbits.xenproject.org>
Date: Wed, 09 Apr 2025 13:44:11 +0000

commit 81f91e128f3935514770af18823e31656d99b5b5
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Apr 8 10:58:09 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Wed Apr 9 10:42:52 2025 +0200

    x86/hvm: remove unreachable MMCFG write emulation
    
    The current implementation of PVH dom0 relies on vPCI to trap and handle
    accesses to the MMCFG area.  Previous implementation of PVH dom0 (v1)
    didn't have vPCI, and as a classic PV dom0, relied on the MMCFG range being
    RO.  As such hvm_emulate_one_mmio() had to special case write accesses to
    the MMCFG area.
    
    With PVH dom0 using vPCI, and the MMCFG accesses being fully handled there,
    hvm_emulate_one_mmio() should never handle accesses to MMCFG, making the
    code effectively unreachable.
    
    Remove it and leave an ASSERT to make sure MMCFG accesses never get into
    hvm_emulate_one_mmio().  As a result of the removal of one of the users of
    mmcfg_intercept_write(), the function can now be moved into the same
    translation unit where it's solely used, allowing it to be made static and
    effectively built only when PV support is enabled.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/emulate.c      | 22 ++++++++--------------
 xen/arch/x86/include/asm/mm.h   |  3 ---
 xen/arch/x86/mm.c               | 31 -------------------------------
 xen/arch/x86/pv/ro-page-fault.c | 31 +++++++++++++++++++++++++++++++
 4 files changed, 39 insertions(+), 48 deletions(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 04d07ccaf6..9fff1b82f7 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -2858,12 +2858,6 @@ int hvm_emulate_one(
 
 int hvm_emulate_one_mmio(unsigned long mfn, unsigned long gla)
 {
-    static const struct x86_emulate_ops hvm_intercept_ops_mmcfg = {
-        .read       = x86emul_unhandleable_rw,
-        .insn_fetch = hvmemul_insn_fetch,
-        .write      = mmcfg_intercept_write,
-        .validate   = hvmemul_validate,
-    };
     static const struct x86_emulate_ops hvm_ro_emulate_ops_mmio = {
         .read       = x86emul_unhandleable_rw,
         .insn_fetch = hvmemul_insn_fetch,
@@ -2872,28 +2866,28 @@ int hvm_emulate_one_mmio(unsigned long mfn, unsigned long gla)
     };
     struct mmio_ro_emulate_ctxt mmio_ro_ctxt = { .cr2 = gla, .mfn = _mfn(mfn) };
     struct hvm_emulate_ctxt ctxt;
-    const struct x86_emulate_ops *ops;
     unsigned int seg, bdf;
     int rc;
 
     if ( pci_ro_mmcfg_decode(mfn, &seg, &bdf) )
     {
-        mmio_ro_ctxt.seg = seg;
-        mmio_ro_ctxt.bdf = bdf;
-        ops = &hvm_intercept_ops_mmcfg;
+        /* Should be always handled by vPCI for PVH dom0. */
+        gdprintk(XENLOG_ERR, "unhandled MMCFG access for %pp\n",
+                 &PCI_SBDF(seg, bdf));
+        ASSERT_UNREACHABLE();
+        return X86EMUL_UNHANDLEABLE;
     }
-    else
-        ops = &hvm_ro_emulate_ops_mmio;
 
     hvm_emulate_init_once(&ctxt, x86_insn_is_mem_write,
                           guest_cpu_user_regs());
     ctxt.ctxt.data = &mmio_ro_ctxt;
 
-    switch ( rc = _hvm_emulate_one(&ctxt, ops, VIO_no_completion) )
+    switch ( rc = _hvm_emulate_one(&ctxt, &hvm_ro_emulate_ops_mmio,
+                                   VIO_no_completion) )
     {
     case X86EMUL_UNHANDLEABLE:
     case X86EMUL_UNIMPLEMENTED:
-        hvm_dump_emulation_state(XENLOG_G_WARNING, "MMCFG", &ctxt, rc);
+        hvm_dump_emulation_state(XENLOG_G_WARNING, "r/o MMIO", &ctxt, rc);
         break;
     case X86EMUL_EXCEPTION:
         hvm_inject_event(&ctxt.ctxt.event);
diff --git a/xen/arch/x86/include/asm/mm.h b/xen/arch/x86/include/asm/mm.h
index 6c7e66ee21..a1bc8cc274 100644
--- a/xen/arch/x86/include/asm/mm.h
+++ b/xen/arch/x86/include/asm/mm.h
@@ -553,9 +553,6 @@ struct mmio_ro_emulate_ctxt {
 int cf_check mmio_ro_emulated_write(
     enum x86_segment seg, unsigned long offset, void *p_data,
     unsigned int bytes, struct x86_emulate_ctxt *ctxt);
-int cf_check mmcfg_intercept_write(
-    enum x86_segment seg, unsigned long offset, void *p_data,
-    unsigned int bytes, struct x86_emulate_ctxt *ctxt);
 
 int audit_adjust_pgtables(struct domain *d, int dir, int noisy);
 
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index b294497a14..4fecd37aec 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5200,37 +5200,6 @@ int cf_check mmio_ro_emulated_write(
     return X86EMUL_OKAY;
 }
 
-int cf_check mmcfg_intercept_write(
-    enum x86_segment seg,
-    unsigned long offset,
-    void *p_data,
-    unsigned int bytes,
-    struct x86_emulate_ctxt *ctxt)
-{
-    struct mmio_ro_emulate_ctxt *mmio_ctxt = ctxt->data;
-
-    /*
-     * Only allow naturally-aligned stores no wider than 4 bytes to the
-     * original %cr2 address.
-     */
-    if ( ((bytes | offset) & (bytes - 1)) || bytes > 4 || !bytes ||
-         offset != mmio_ctxt->cr2 )
-    {
-        gdprintk(XENLOG_WARNING, "bad write (cr2=%lx, addr=%lx, bytes=%u)\n",
-                mmio_ctxt->cr2, offset, bytes);
-        return X86EMUL_UNHANDLEABLE;
-    }
-
-    offset &= 0xfff;
-    if ( pci_conf_write_intercept(mmio_ctxt->seg, mmio_ctxt->bdf,
-                                  offset, bytes, p_data) >= 0 )
-        pci_mmcfg_write(mmio_ctxt->seg, PCI_BUS(mmio_ctxt->bdf),
-                        PCI_DEVFN(mmio_ctxt->bdf), offset, bytes,
-                        *(uint32_t *)p_data);
-
-    return X86EMUL_OKAY;
-}
-
 /*
  * For these PTE APIs, the caller must follow the alloc-map-unmap-free
  * lifecycle, which means explicitly mapping the PTE pages before accessing
diff --git a/xen/arch/x86/pv/ro-page-fault.c b/xen/arch/x86/pv/ro-page-fault.c
index 372187e9a0..11b01c479e 100644
--- a/xen/arch/x86/pv/ro-page-fault.c
+++ b/xen/arch/x86/pv/ro-page-fault.c
@@ -298,6 +298,37 @@ static int ptwr_do_page_fault(struct x86_emulate_ctxt *ctxt,
  * fault handling for read-only MMIO pages
  */
 
+static int cf_check mmcfg_intercept_write(
+    enum x86_segment seg,
+    unsigned long offset,
+    void *p_data,
+    unsigned int bytes,
+    struct x86_emulate_ctxt *ctxt)
+{
+    struct mmio_ro_emulate_ctxt *mmio_ctxt = ctxt->data;
+
+    /*
+     * Only allow naturally-aligned stores no wider than 4 bytes to the
+     * original %cr2 address.
+     */
+    if ( ((bytes | offset) & (bytes - 1)) || bytes > 4 || !bytes ||
+         offset != mmio_ctxt->cr2 )
+    {
+        gdprintk(XENLOG_WARNING, "bad write (cr2=%lx, addr=%lx, bytes=%u)\n",
+                mmio_ctxt->cr2, offset, bytes);
+        return X86EMUL_UNHANDLEABLE;
+    }
+
+    offset &= 0xfff;
+    if ( pci_conf_write_intercept(mmio_ctxt->seg, mmio_ctxt->bdf,
+                                  offset, bytes, p_data) >= 0 )
+        pci_mmcfg_write(mmio_ctxt->seg, PCI_BUS(mmio_ctxt->bdf),
+                        PCI_DEVFN(mmio_ctxt->bdf), offset, bytes,
+                        *(uint32_t *)p_data);
+
+    return X86EMUL_OKAY;
+}
+
 static const struct x86_emulate_ops mmio_ro_emulate_ops = {
     .read       = x86emul_unhandleable_rw,
     .insn_fetch = ptwr_emulated_insn_fetch,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 09 13:44:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 09 Apr 2025 13:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.944150.1342690 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2Vj5-00037s-JD; Wed, 09 Apr 2025 13:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 944150.1342690; Wed, 09 Apr 2025 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 1u2Vj5-00037k-Gd; Wed, 09 Apr 2025 13:44:23 +0000
Received: by outflank-mailman (input) for mailman id 944150;
 Wed, 09 Apr 2025 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 1u2Vj4-00037R-4n
 for xen-changelog@lists.xenproject.org; Wed, 09 Apr 2025 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 1u2Vj4-004NWL-0M
 for xen-changelog@lists.xenproject.org;
 Wed, 09 Apr 2025 13:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2Vj4-00EYJV-0D
 for xen-changelog@lists.xenproject.org;
 Wed, 09 Apr 2025 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=t38xphu6NL+EplSRWKqRdZ57+l2yAvTAhRUOSALY8mM=; b=qNtt1RtgnQ9IEbmkr7dHeuc3Jv
	k20L2Wp7KvPS0h2e60AKAnuCuVA07f86MvNpXWxMTwbZ/BO2w9yDXoBvR0HmrBmS7HTMQ4I7crUt3
	0qRQ3fzkugAmNR1QBP0bPUcy+bSB4CnWn5IjqhAyPyj8ZypjMwkQSN7rPxey60hZFM2E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/ucode: Extend warning about disabling digest check too
Message-Id: <E1u2Vj4-00EYJV-0D@xenbits.xenproject.org>
Date: Wed, 09 Apr 2025 13:44:22 +0000

commit 59bb316ea89e7f9461690fe00547d7d2af96321d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Apr 9 11:36:40 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 9 11:55:03 2025 +0100

    x86/ucode: Extend warning about disabling digest check too
    
    This was missed by accident.
    
    Fixes: b63951467e96 ("x86/ucode: Extend AMD digest checks to cover Zen5 CPUs")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/cpu/microcode/amd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 4bc490dedc..ebd9ecbeef 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -516,8 +516,7 @@ static const struct microcode_ops __initconst_cf_clobber amd_ucode_ops = {
 
 void __init ucode_probe_amd(struct microcode_ops *ops)
 {
-    if ( !opt_digest_check &&
-         boot_cpu_data.x86 >= 0x17 && boot_cpu_data.x86 <= 0x19 )
+    if ( !opt_digest_check && boot_cpu_data.x86 >= 0x17 )
     {
         printk(XENLOG_WARNING
                "Microcode patch additional digest checks disabled");
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 09 13:44:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 09 Apr 2025 13:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.944152.1342693 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2VjF-0003Aq-Ku; Wed, 09 Apr 2025 13:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 944152.1342693; Wed, 09 Apr 2025 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 1u2VjF-0003Ai-I3; Wed, 09 Apr 2025 13:44:33 +0000
Received: by outflank-mailman (input) for mailman id 944152;
 Wed, 09 Apr 2025 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 1u2VjE-0003AP-L3
 for xen-changelog@lists.xenproject.org; Wed, 09 Apr 2025 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 1u2VjE-004NWP-20
 for xen-changelog@lists.xenproject.org;
 Wed, 09 Apr 2025 13:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2VjE-00EYMT-1s
 for xen-changelog@lists.xenproject.org;
 Wed, 09 Apr 2025 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=31fVZVPSjhtCN/615/SbOEuSsbFdQ1x3qthelXLwNeA=; b=zYYz9ch5cUIYt6bAtx7AurutCQ
	taYazwoTTkXzq5b5QhpJxWZeJwgRT5F0+sUAUvRVcjszXMfKp5NbHueyDkwXfMFRbh/dmAp//LdzP
	+PcuOb/Oqu0xBPoOsa48FbLfkswIUY/lBF9cFQgwtxQ2bR83+ibm9zbqDyvXsCTkEQbI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] libxc/PM: correct (not just) error handling in xc_get_cpufreq_para()
Message-Id: <E1u2VjE-00EYMT-1s@xenbits.xenproject.org>
Date: Wed, 09 Apr 2025 13:44:32 +0000

commit cf1995fa8a24c7e51e781010680b042f49b38eda
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Apr 9 15:30:15 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 9 15:30:15 2025 +0200

    libxc/PM: correct (not just) error handling in xc_get_cpufreq_para()
    
    From their introduction all xc_hypercall_bounce_pre() uses, when they
    failed, would properly cause exit from the function including cleanup,
    yet without informing the caller of the failure. Purge the unlock_1
    label for being both pointless and mis-named.
    
    An earlier attempt to switch to the usual split between return value and
    errno wasn't quite complete.
    
    HWP work made the cleanup of the "available governors" array
    conditional, neglecting the fact that the condition used may not be the
    condition that was used to allocate the buffer (as the structure field
    is updated upon getting back EAGAIN). Since cleanup can be done even if
    no buffer was allocated, drop the conditional there again.
    
    Fixes: 4513025a8790 ("libxc: convert sysctl interfaces over to hypercall buffers")
    Amends: 73367cf3b4b4 ("libxc: Fix xc_pm API calls to return negative error and stash error in errno")
    Fixes: 31e264c672bc ("pmstat&xenpm: Re-arrage for cpufreq union")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/ctrl/xc_pm.c | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/tools/libs/ctrl/xc_pm.c b/tools/libs/ctrl/xc_pm.c
index b27b45c3dc..ff7b5ada05 100644
--- a/tools/libs/ctrl/xc_pm.c
+++ b/tools/libs/ctrl/xc_pm.c
@@ -212,10 +212,7 @@ int xc_get_cpufreq_para(xc_interface *xch, int cpuid,
     DECLARE_NAMED_HYPERCALL_BOUNCE(scaling_available_governors,
 			 user_para->scaling_available_governors,
 			 user_para->gov_num * CPUFREQ_NAME_LEN * sizeof(char), XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
-
-    bool has_num = user_para->cpu_num &&
-                     user_para->freq_num &&
-                     user_para->gov_num;
+    bool has_num = user_para->cpu_num && user_para->freq_num;
 
     if ( has_num )
     {
@@ -226,12 +223,15 @@ int xc_get_cpufreq_para(xc_interface *xch, int cpuid,
             errno = EINVAL;
             return -1;
         }
-        if ( xc_hypercall_bounce_pre(xch, affected_cpus) )
-            goto unlock_1;
-        if ( xc_hypercall_bounce_pre(xch, scaling_available_frequencies) )
+        ret = xc_hypercall_bounce_pre(xch, affected_cpus);
+        if ( ret )
+            return ret;
+        ret = xc_hypercall_bounce_pre(xch, scaling_available_frequencies);
+        if ( ret )
             goto unlock_2;
-        if ( user_para->gov_num &&
-             xc_hypercall_bounce_pre(xch, scaling_available_governors) )
+        if ( user_para->gov_num )
+            ret = xc_hypercall_bounce_pre(xch, scaling_available_governors);
+        if ( ret )
             goto unlock_3;
 
         set_xen_guest_handle(sys_para->affected_cpus, affected_cpus);
@@ -256,12 +256,11 @@ int xc_get_cpufreq_para(xc_interface *xch, int cpuid,
             user_para->cpu_num  = sys_para->cpu_num;
             user_para->freq_num = sys_para->freq_num;
             user_para->gov_num  = sys_para->gov_num;
-            ret = -errno;
         }
 
         if ( has_num )
             goto unlock_4;
-        goto unlock_1;
+        return ret;
     }
     else
     {
@@ -298,13 +297,12 @@ int xc_get_cpufreq_para(xc_interface *xch, int cpuid,
     }
 
 unlock_4:
-    if ( user_para->gov_num )
-        xc_hypercall_bounce_post(xch, scaling_available_governors);
+    xc_hypercall_bounce_post(xch, scaling_available_governors);
 unlock_3:
     xc_hypercall_bounce_post(xch, scaling_available_frequencies);
 unlock_2:
     xc_hypercall_bounce_post(xch, affected_cpus);
-unlock_1:
+
     return ret;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 09 13:44:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 09 Apr 2025 13:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.944154.1342697 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2VjQ-0003DU-M2; Wed, 09 Apr 2025 13:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 944154.1342697; Wed, 09 Apr 2025 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 1u2VjQ-0003DN-JZ; Wed, 09 Apr 2025 13:44:44 +0000
Received: by outflank-mailman (input) for mailman id 944154;
 Wed, 09 Apr 2025 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 1u2VjO-0003D6-Ot
 for xen-changelog@lists.xenproject.org; Wed, 09 Apr 2025 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 1u2VjO-004NWV-2O
 for xen-changelog@lists.xenproject.org;
 Wed, 09 Apr 2025 13:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2VjO-00EYOP-2G
 for xen-changelog@lists.xenproject.org;
 Wed, 09 Apr 2025 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=hoA6tVZ1JQe+2wsS35SbyPkzIff+aP2bRJ/pA+gCF/0=; b=HEiyOUBag3WPQZe0X11OqmiWNB
	YEXtexjdp05PyGOD9U+CaZeoXRI4zodK6gpCO1vKA4RucDpBIH5hkvORND/regq/qnBYed9eu3Ide
	zzNx4KpXcnsxUlpPG6tiNpBI2cWXu6QyO/wypHlEv7s2/3ClbQ0kUxVKL41Hb+6Fmhu0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86emul/test: drop check for AVX512-4FMAPS
Message-Id: <E1u2VjO-00EYOP-2G@xenbits.xenproject.org>
Date: Wed, 09 Apr 2025 13:44:42 +0000

commit 4bb846f32c870b19decc926f4759eac3fecfc04c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Apr 9 15:30:51 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 9 15:30:51 2025 +0200

    x86emul/test: drop check for AVX512-4FMAPS
    
    Use of Xeon Phi features was dropped earlier on; this one was overlooked.
    
    Fixes: 85191cf32180 ("x86: drop Xeon Phi support")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/tests/x86_emulator/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/tests/x86_emulator/Makefile b/tools/tests/x86_emulator/Makefile
index 294d27ebaa..3f57ac6159 100644
--- a/tools/tests/x86_emulator/Makefile
+++ b/tools/tests/x86_emulator/Makefile
@@ -105,7 +105,7 @@ TARGET-$(shell echo 'int i;' | $(CC) -x c -c -o /dev/null -m$(1) - || echo y) :=
 endef
 
 ISA := bmi bmi2 tbm sse4.1 sse4.2 sse4a avx avx2 f16c
-ISA += $(addprefix avx512,f bw dq 4fmaps)
+ISA += $(addprefix avx512,f bw dq)
 $(foreach isa,$(ISA),$(eval $(call isa-check-cc,$(isa))))
 
 # Also explicitly check for {evex} pseudo-prefix support, which got introduced
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 09 13:44:54 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 09 Apr 2025 13:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.944156.1342701 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2Vja-0003Fx-Nq; Wed, 09 Apr 2025 13:44:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 944156.1342701; Wed, 09 Apr 2025 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 1u2Vja-0003Fq-L1; Wed, 09 Apr 2025 13:44:54 +0000
Received: by outflank-mailman (input) for mailman id 944156;
 Wed, 09 Apr 2025 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 1u2VjY-0003FZ-SD
 for xen-changelog@lists.xenproject.org; Wed, 09 Apr 2025 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 1u2VjY-004NWs-2i
 for xen-changelog@lists.xenproject.org;
 Wed, 09 Apr 2025 13:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2VjY-00EYPx-2c
 for xen-changelog@lists.xenproject.org;
 Wed, 09 Apr 2025 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=obMf/t86wgPpjLjPdFnMIzUwndiU258CqD4qEHLQT9U=; b=lMpJqtAnr/qAHvKlCtx1NyPxQY
	mP1yEWBYkoY9YYogCttzQuHTZXksOPfLgMP/6jLb926E7+cMJOV8c0eoE+3vJPnlNyfHBQgC3cNQP
	OGECbodueDwPubOTyq5SbHOrxfRMa+09TBaWx4B+vIz23Y65J8h1GalH3x54SH4JrFOM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/boot: introduce boot domain
Message-Id: <E1u2VjY-00EYPx-2c@xenbits.xenproject.org>
Date: Wed, 09 Apr 2025 13:44:52 +0000

commit 839b37f1633a9451cc7081135b0c4b3109b6d051
Author:     Daniel P. Smith <dpsmith@apertussolutions.com>
AuthorDate: Wed Apr 9 15:32:02 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 9 15:32:02 2025 +0200

    x86/boot: introduce boot domain
    
    To begin moving toward allowing the hypervisor to construct more than one
    domain at boot, a container is needed for a domain's build information.
    Introduce a new header, <xen/asm/bootdomain.h>, that contains the initial
    struct boot_domain that encapsulate the build information for a domain.
    
    Add a kernel and ramdisk boot module reference along with a struct domain
    reference to the new struct boot_domain. This allows a struct boot_domain
    reference to be the only parameter necessary to pass down through the domain
    construction call chain.
    
    Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Signed-off-by: Alejandro Vallejo <agarciav@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/dom0_build.c              |  8 +++++---
 xen/arch/x86/hvm/dom0_build.c          | 23 ++++++++---------------
 xen/arch/x86/include/asm/boot-domain.h | 28 ++++++++++++++++++++++++++++
 xen/arch/x86/include/asm/bootinfo.h    |  5 +++++
 xen/arch/x86/include/asm/dom0_build.h  |  6 +++---
 xen/arch/x86/include/asm/setup.h       |  4 ++--
 xen/arch/x86/pv/dom0_build.c           | 24 ++++++++----------------
 xen/arch/x86/setup.c                   | 24 ++++++++++--------------
 8 files changed, 69 insertions(+), 53 deletions(-)

diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index 8191d90a22..0b467fd4a4 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -13,6 +13,7 @@
 #include <xen/softirq.h>
 
 #include <asm/amd.h>
+#include <asm/bootinfo.h>
 #include <asm/dom0_build.h>
 #include <asm/guest.h>
 #include <asm/hpet.h>
@@ -614,9 +615,10 @@ int __init dom0_setup_permissions(struct domain *d)
     return rc;
 }
 
-int __init construct_dom0(struct boot_info *bi, struct domain *d)
+int __init construct_dom0(const struct boot_domain *bd)
 {
     int rc;
+    const struct domain *d = bd->d;
 
     /* Sanity! */
     BUG_ON(!pv_shim && d->domain_id != 0);
@@ -626,9 +628,9 @@ int __init construct_dom0(struct boot_info *bi, struct domain *d)
     process_pending_softirqs();
 
     if ( is_hvm_domain(d) )
-        rc = dom0_construct_pvh(bi, d);
+        rc = dom0_construct_pvh(bd);
     else if ( is_pv_domain(d) )
-        rc = dom0_construct_pv(bi, d);
+        rc = dom0_construct_pv(bd);
     else
         panic("Cannot construct Dom0. No guest interface available\n");
 
diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index 9fd68df7b9..2a094b3145 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -644,9 +644,11 @@ static bool __init check_and_adjust_load_address(
 }
 
 static int __init pvh_load_kernel(
-    struct domain *d, struct boot_module *image, struct boot_module *initrd,
-    paddr_t *entry, paddr_t *start_info_addr)
+    const struct boot_domain *bd, paddr_t *entry, paddr_t *start_info_addr)
 {
+    struct domain *d = bd->d;
+    struct boot_module *image = bd->kernel;
+    struct boot_module *initrd = bd->module;
     void *image_base = bootstrap_map_bm(image);
     void *image_start = image_base + image->headroom;
     unsigned long image_len = image->size;
@@ -1328,26 +1330,17 @@ static void __hwdom_init pvh_setup_mmcfg(struct domain *d)
     }
 }
 
-int __init dom0_construct_pvh(struct boot_info *bi, struct domain *d)
+int __init dom0_construct_pvh(const struct boot_domain *bd)
 {
     paddr_t entry, start_info;
-    struct boot_module *image;
-    struct boot_module *initrd = NULL;
-    unsigned int idx;
+    struct domain *d = bd->d;
     int rc;
 
     printk(XENLOG_INFO "*** Building a PVH Dom%d ***\n", d->domain_id);
 
-    idx = first_boot_module_index(bi, BOOTMOD_KERNEL);
-    if ( idx >= bi->nr_modules )
+    if ( bd->kernel == NULL )
         panic("Missing kernel boot module for %pd construction\n", d);
 
-    image = &bi->mods[idx];
-
-    idx = first_boot_module_index(bi, BOOTMOD_RAMDISK);
-    if ( idx < bi->nr_modules )
-        initrd = &bi->mods[idx];
-
     if ( is_hardware_domain(d) )
     {
         /*
@@ -1385,7 +1378,7 @@ int __init dom0_construct_pvh(struct boot_info *bi, struct domain *d)
         return rc;
     }
 
-    rc = pvh_load_kernel(d, image, initrd, &entry, &start_info);
+    rc = pvh_load_kernel(bd, &entry, &start_info);
     if ( rc )
     {
         printk("Failed to load Dom0 kernel\n");
diff --git a/xen/arch/x86/include/asm/boot-domain.h b/xen/arch/x86/include/asm/boot-domain.h
new file mode 100644
index 0000000000..5e1e1a0b61
--- /dev/null
+++ b/xen/arch/x86/include/asm/boot-domain.h
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (c) 2024 Apertus Solutions, LLC
+ * Author: Daniel P. Smith <dpsmith@apertussolutions.com>
+ * Copyright (c) 2024 Christopher Clark <christopher.w.clark@gmail.com>
+ */
+
+#ifndef __XEN_X86_BOOTDOMAIN_H__
+#define __XEN_X86_BOOTDOMAIN_H__
+
+struct boot_domain {
+    struct boot_module *kernel;
+    struct boot_module *module;
+
+    struct domain *d;
+};
+
+#endif
+
+/*
+ * 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/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
index f8b4229130..3afc214c17 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -11,10 +11,14 @@
 #include <xen/init.h>
 #include <xen/multiboot.h>
 #include <xen/types.h>
+#include <asm/boot-domain.h>
 
 /* Max number of boot modules a bootloader can provide in addition to Xen */
 #define MAX_NR_BOOTMODS 63
 
+/* Max number of boot domains that Xen can construct */
+#define MAX_NR_BOOTDOMS 1
+
 /* Boot module binary type / purpose */
 enum bootmod_type {
     BOOTMOD_UNKNOWN,
@@ -78,6 +82,7 @@ struct boot_info {
 
     unsigned int nr_modules;
     struct boot_module mods[MAX_NR_BOOTMODS + 1];
+    struct boot_domain domains[MAX_NR_BOOTDOMS];
 };
 
 /*
diff --git a/xen/arch/x86/include/asm/dom0_build.h b/xen/arch/x86/include/asm/dom0_build.h
index 2d67b17213..ff021c24af 100644
--- a/xen/arch/x86/include/asm/dom0_build.h
+++ b/xen/arch/x86/include/asm/dom0_build.h
@@ -13,9 +13,9 @@ unsigned long dom0_compute_nr_pages(struct domain *d,
                                     unsigned long initrd_len);
 int dom0_setup_permissions(struct domain *d);
 
-struct boot_info;
-int dom0_construct_pv(struct boot_info *bi, struct domain *d);
-int dom0_construct_pvh(struct boot_info *bi, struct domain *d);
+struct boot_domain;
+int dom0_construct_pv(const struct boot_domain *bd);
+int dom0_construct_pvh(const struct boot_domain *bd);
 
 unsigned long dom0_paging_pages(const struct domain *d,
                                 unsigned long nr_pages);
diff --git a/xen/arch/x86/include/asm/setup.h b/xen/arch/x86/include/asm/setup.h
index 5c2391a868..ac34c69855 100644
--- a/xen/arch/x86/include/asm/setup.h
+++ b/xen/arch/x86/include/asm/setup.h
@@ -26,8 +26,8 @@ void subarch_init_memory(void);
 
 void init_IRQ(void);
 
-struct boot_info;
-int construct_dom0(struct boot_info *bi, struct domain *d);
+struct boot_domain;
+int construct_dom0(const struct boot_domain *bd);
 
 void setup_io_bitmap(struct domain *d);
 
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index 96e28c7b6a..b485eea05f 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -355,7 +355,7 @@ static struct page_info * __init alloc_chunk(struct domain *d,
     return page;
 }
 
-static int __init dom0_construct(struct boot_info *bi, struct domain *d)
+static int __init dom0_construct(const struct boot_domain *bd)
 {
     unsigned int i;
     int rc, order, machine;
@@ -371,14 +371,15 @@ static int __init dom0_construct(struct boot_info *bi, struct domain *d)
     struct page_info *page = NULL;
     unsigned int flush_flags = 0;
     start_info_t *si;
+    struct domain *d = bd->d;
     struct vcpu *v = d->vcpu[0];
 
-    struct boot_module *image;
-    struct boot_module *initrd = NULL;
+    struct boot_module *image = bd->kernel;
+    struct boot_module *initrd = bd->module;
     void *image_base;
     unsigned long image_len;
     void *image_start;
-    unsigned long initrd_len = 0;
+    unsigned long initrd_len = initrd ? initrd->size : 0;
 
     l4_pgentry_t *l4tab = NULL, *l4start = NULL;
     l3_pgentry_t *l3tab = NULL, *l3start = NULL;
@@ -416,22 +417,13 @@ static int __init dom0_construct(struct boot_info *bi, struct domain *d)
 
     printk(XENLOG_INFO "*** Building a PV Dom%d ***\n", d->domain_id);
 
-    i = first_boot_module_index(bi, BOOTMOD_KERNEL);
-    if ( i >= bi->nr_modules )
+    if ( !image )
         panic("Missing kernel boot module for %pd construction\n", d);
 
-    image = &bi->mods[i];
     image_base = bootstrap_map_bm(image);
     image_len = image->size;
     image_start = image_base + image->headroom;
 
-    i = first_boot_module_index(bi, BOOTMOD_RAMDISK);
-    if ( i < bi->nr_modules )
-    {
-        initrd = &bi->mods[i];
-        initrd_len = initrd->size;
-    }
-
     d->max_pages = ~0U;
 
     if ( (rc = bzimage_parse(image_base, &image_start, &image_len)) != 0 )
@@ -1078,7 +1070,7 @@ out:
     return rc;
 }
 
-int __init dom0_construct_pv(struct boot_info *bi, struct domain *d)
+int __init dom0_construct_pv(const struct boot_domain *bd)
 {
     unsigned long cr4 = read_cr4();
     int rc;
@@ -1096,7 +1088,7 @@ int __init dom0_construct_pv(struct boot_info *bi, struct domain *d)
         write_cr4(cr4 & ~X86_CR4_SMAP);
     }
 
-    rc = dom0_construct(bi, d);
+    rc = dom0_construct(bd);
 
     if ( cr4 & X86_CR4_SMAP )
     {
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index d70abb7e0c..ddb10ea03d 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -992,16 +992,9 @@ static struct domain *__init create_dom0(struct boot_info *bi)
             .misc_flags = opt_dom0_msr_relaxed ? XEN_X86_MSR_RELAXED : 0,
         },
     };
+    struct boot_domain *bd = &bi->domains[0];
     struct domain *d;
     domid_t domid;
-    struct boot_module *image;
-    unsigned int idx;
-
-    idx = first_boot_module_index(bi, BOOTMOD_KERNEL);
-    if ( idx >= bi->nr_modules )
-        panic("Missing kernel boot module for building domain\n");
-
-    image = &bi->mods[idx];
 
     if ( opt_dom0_pvh )
     {
@@ -1028,11 +1021,11 @@ static struct domain *__init create_dom0(struct boot_info *bi)
         panic("Error creating d%uv0\n", domid);
 
     /* Grab the DOM0 command line. */
-    if ( image->cmdline_pa || bi->kextra )
+    if ( bd->kernel->cmdline_pa || bi->kextra )
     {
-        if ( image->cmdline_pa )
-            safe_strcpy(
-                cmdline, cmdline_cook(__va(image->cmdline_pa), bi->loader));
+        if ( bd->kernel->cmdline_pa )
+            safe_strcpy(cmdline,
+                        cmdline_cook(__va(bd->kernel->cmdline_pa), bi->loader));
 
         if ( bi->kextra )
             /* kextra always includes exactly one leading space. */
@@ -1054,10 +1047,11 @@ static struct domain *__init create_dom0(struct boot_info *bi)
             safe_strcat(cmdline, acpi_param);
         }
 
-        image->cmdline_pa = __pa(cmdline);
+        bd->kernel->cmdline_pa = __pa(cmdline);
     }
 
-    if ( construct_dom0(bi, d) != 0 )
+    bd->d = d;
+    if ( construct_dom0(bd) != 0 )
         panic("Could not construct domain 0\n");
 
     return d;
@@ -1263,6 +1257,7 @@ void asmlinkage __init noreturn __start_xen(void)
 
     /* Dom0 kernel is always first */
     bi->mods[0].type = BOOTMOD_KERNEL;
+    bi->domains[0].kernel = &bi->mods[0];
 
     if ( pvh_boot )
     {
@@ -2129,6 +2124,7 @@ void asmlinkage __init noreturn __start_xen(void)
     if ( initrdidx < MAX_NR_BOOTMODS )
     {
         bi->mods[initrdidx].type = BOOTMOD_RAMDISK;
+        bi->domains[0].module = &bi->mods[initrdidx];
         if ( first_boot_module_index(bi, BOOTMOD_UNKNOWN) < MAX_NR_BOOTMODS )
             printk(XENLOG_WARNING
                    "Multiple initrd candidates, picking module #%u\n",
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 09 13:45:04 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 09 Apr 2025 13:45:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.944158.1342706 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2Vjk-0003It-Qw; Wed, 09 Apr 2025 13:45:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 944158.1342706; Wed, 09 Apr 2025 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 1u2Vjk-0003Il-O9; Wed, 09 Apr 2025 13:45:04 +0000
Received: by outflank-mailman (input) for mailman id 944158;
 Wed, 09 Apr 2025 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 1u2Vji-0003IY-VL
 for xen-changelog@lists.xenproject.org; Wed, 09 Apr 2025 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 1u2Vji-004NXI-31
 for xen-changelog@lists.xenproject.org;
 Wed, 09 Apr 2025 13:45:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2Vji-00EYSA-2t
 for xen-changelog@lists.xenproject.org;
 Wed, 09 Apr 2025 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=HjPkLo2xNWIbTz8k5XlZ4PG3fh4lU7EdqwESl1KH85Q=; b=Tt+XvWLG3QW+RA/LlaXEszlJlN
	2vW/1PJiJGG7so/wiFGtpGuRPv0SioIgSf7H/PflQ+82z9jV1aVYX0EjfMK+1vzKrLG+MWrY9pBUq
	DkLE+2+kDMD0voi7RSb/C8bZiN3ftm/eesQ2OarNGxF+VKH1LleAqjREL3OdUyk07zhA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/boot: introduce domid field to struct boot_domain
Message-Id: <E1u2Vji-00EYSA-2t@xenbits.xenproject.org>
Date: Wed, 09 Apr 2025 13:45:02 +0000

commit fc46a36b1e39413d6e5bf6fccd87f425a42fa94b
Author:     Daniel P. Smith <dpsmith@apertussolutions.com>
AuthorDate: Wed Apr 9 15:32:26 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 9 15:32:26 2025 +0200

    x86/boot: introduce domid field to struct boot_domain
    
    boot_domain stores the domid until it is used to create (and allocate)
    struct domain. d->domain_id is not available early enough.
    
    boot_domain domids are initialized to DOMID_INVALID. If not overridden
    by device tree, domids of DOMID_INVALID are assigned a valid value. The
    domid will be optionally parsed from the device tree configuration.
    
    Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Signed-off-by: Alejandro Vallejo <agarciav@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/boot-domain.h |  4 ++++
 xen/arch/x86/setup.c                   | 10 +++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/include/asm/boot-domain.h b/xen/arch/x86/include/asm/boot-domain.h
index 5e1e1a0b61..fcbedda0f0 100644
--- a/xen/arch/x86/include/asm/boot-domain.h
+++ b/xen/arch/x86/include/asm/boot-domain.h
@@ -8,7 +8,11 @@
 #ifndef __XEN_X86_BOOTDOMAIN_H__
 #define __XEN_X86_BOOTDOMAIN_H__
 
+#include <public/xen.h>
+
 struct boot_domain {
+    domid_t domid;
+
     struct boot_module *kernel;
     struct boot_module *module;
 
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index ddb10ea03d..3c257f0bad 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -295,6 +295,7 @@ static const char *cmdline_cook(const char *p, const char *loader_name);
 struct boot_info __initdata xen_boot_info = {
     .loader = "unknown",
     .cmdline = "",
+    .domains = { [0 ... MAX_NR_BOOTDOMS - 1] = { .domid = DOMID_INVALID } },
 };
 
 static struct boot_info *__init multiboot_fill_boot_info(
@@ -994,7 +995,6 @@ static struct domain *__init create_dom0(struct boot_info *bi)
     };
     struct boot_domain *bd = &bi->domains[0];
     struct domain *d;
-    domid_t domid;
 
     if ( opt_dom0_pvh )
     {
@@ -1010,15 +1010,15 @@ static struct domain *__init create_dom0(struct boot_info *bi)
         dom0_cfg.flags |= XEN_DOMCTL_CDF_iommu;
 
     /* Create initial domain.  Not d0 for pvshim. */
-    domid = get_initial_domain_id();
-    d = domain_create(domid, &dom0_cfg, pv_shim ? 0 : CDF_privileged);
+    bd->domid = get_initial_domain_id();
+    d = domain_create(bd->domid, &dom0_cfg, pv_shim ? 0 : CDF_privileged);
     if ( IS_ERR(d) )
-        panic("Error creating d%u: %ld\n", domid, PTR_ERR(d));
+        panic("Error creating d%u: %ld\n", bd->domid, PTR_ERR(d));
 
     init_dom0_cpuid_policy(d);
 
     if ( alloc_dom0_vcpu0(d) == NULL )
-        panic("Error creating d%uv0\n", domid);
+        panic("Error creating %pdv0\n", d);
 
     /* Grab the DOM0 command line. */
     if ( bd->kernel->cmdline_pa || bi->kextra )
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 09 13:45:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 09 Apr 2025 13:45:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.944160.1342710 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2Vju-0003LN-SP; Wed, 09 Apr 2025 13:45:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 944160.1342710; Wed, 09 Apr 2025 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 1u2Vju-0003LF-PV; Wed, 09 Apr 2025 13:45:14 +0000
Received: by outflank-mailman (input) for mailman id 944160;
 Wed, 09 Apr 2025 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 1u2Vjt-0003L2-2B
 for xen-changelog@lists.xenproject.org; Wed, 09 Apr 2025 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 1u2Vjt-004NXO-07
 for xen-changelog@lists.xenproject.org;
 Wed, 09 Apr 2025 13:45:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2Vjs-00EYUL-3C
 for xen-changelog@lists.xenproject.org;
 Wed, 09 Apr 2025 13:45:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JjNk7UfKkfLe0i5x4tUjNRy3BpAwrhwlJayhsNNQOec=; b=WQp+uTiKfD7uCEhVeM9aPHSW84
	A4zx2AXLFnGJIUefmDH/tkgtfNzUpxlsnKPpaclmTyIrn+iCyd0ITKdrW0QfFe1W/3aaM6jAgYPZH
	Q8PY+HXPJzt/EYXUonbTLgOCAXwcjw5quh/BgWH1kHHA+8t+8D0Jrtcq1hYyszCrpPiw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/domain: revisit logging in arch_domain_create()
Message-Id: <E1u2Vjs-00EYUL-3C@xenbits.xenproject.org>
Date: Wed, 09 Apr 2025 13:45:12 +0000

commit b806f5fddc308e5ee4d48df8178dce968fb5dfcf
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Wed Apr 9 15:33:04 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 9 15:33:04 2025 +0200

    x86/domain: revisit logging in arch_domain_create()
    
    Use %pd in all logs issued from arch_domain_create() and reword some of the
    messages.
    
    Also, expand error message in arch_domain_create() under !emulation_flags_ok()
    case to help debugging.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domain.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index a42fa54805..f197dad4c0 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -798,13 +798,14 @@ int arch_domain_create(struct domain *d,
     {
         if ( !opt_allow_unsafe )
         {
-            printk(XENLOG_G_ERR "Xen does not allow DomU creation on this CPU"
-                   " for security reasons.\n");
+            printk(XENLOG_G_ERR
+                   "%pd: will not create domU on this CPU for security reasons\n",
+                   d);
             return -EPERM;
         }
         printk(XENLOG_G_WARNING
-               "Dom%d may compromise security on this CPU.\n",
-               d->domain_id);
+               "%pd: may compromise security on this CPU\n",
+               d);
     }
 
     emflags = config->arch.emulation_flags;
@@ -814,16 +815,20 @@ int arch_domain_create(struct domain *d,
 
     if ( emflags & ~XEN_X86_EMU_ALL )
     {
-        printk(XENLOG_G_ERR "d%d: Invalid emulation bitmap: %#x\n",
-               d->domain_id, emflags);
+        printk(XENLOG_G_ERR
+               "%pd: invalid emulation bitmap: %#x\n",
+               d, emflags);
         return -EINVAL;
     }
 
     if ( !emulation_flags_ok(d, emflags) )
     {
-        printk(XENLOG_G_ERR "d%d: Xen does not allow %s domain creation "
-               "with the current selection of emulators: %#x\n",
-               d->domain_id, is_hvm_domain(d) ? "HVM" : "PV", emflags);
+        printk(XENLOG_G_ERR
+               "%pd: will not create %s %sdomain with emulators: %#x\n",
+               d,
+               is_hvm_domain(d) ? "HVM" : "PV",
+               is_hardware_domain(d) ? "hardware " : "",
+               emflags);
         return -EOPNOTSUPP;
     }
     d->arch.emulation_flags = emflags;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 10 06:55:11 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Apr 2025 06:55:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.944914.1343204 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2loV-0004zH-Ko; Thu, 10 Apr 2025 06:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 944914.1343204; Thu, 10 Apr 2025 06: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 1u2loV-0004z7-Hu; Thu, 10 Apr 2025 06:55:03 +0000
Received: by outflank-mailman (input) for mailman id 944914;
 Thu, 10 Apr 2025 06: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 1u2loU-0004z1-EN
 for xen-changelog@lists.xenproject.org; Thu, 10 Apr 2025 06: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 1u2loU-006FF9-0m
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 06:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2loU-007T4w-0Z
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 06: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=cKDfUWzCYLjzcFg0OLONyMnzazgCFgdoRdCBXw1v3P0=; b=cF/DUfV77uAaosv6libYQwBhiD
	G3/SoXxHJtsKQzUT4cLfhJaidDpSxAj57hJy5foHkUbaAOmq9UtZDzIYPXWqzXDvJrE/TURUmBz+z
	bLVXFQ5UYWVMav4AGliqoZ0v+94b0bCTYki0+qu5maDF+Ujv+kl9+rAhaczxLktEVg/w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] libxc/PM: correct (not just) error handling in xc_get_cpufreq_para()
Message-Id: <E1u2loU-007T4w-0Z@xenbits.xenproject.org>
Date: Thu, 10 Apr 2025 06:55:02 +0000

commit cf1995fa8a24c7e51e781010680b042f49b38eda
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Apr 9 15:30:15 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 9 15:30:15 2025 +0200

    libxc/PM: correct (not just) error handling in xc_get_cpufreq_para()
    
    From their introduction all xc_hypercall_bounce_pre() uses, when they
    failed, would properly cause exit from the function including cleanup,
    yet without informing the caller of the failure. Purge the unlock_1
    label for being both pointless and mis-named.
    
    An earlier attempt to switch to the usual split between return value and
    errno wasn't quite complete.
    
    HWP work made the cleanup of the "available governors" array
    conditional, neglecting the fact that the condition used may not be the
    condition that was used to allocate the buffer (as the structure field
    is updated upon getting back EAGAIN). Since cleanup can be done even if
    no buffer was allocated, drop the conditional there again.
    
    Fixes: 4513025a8790 ("libxc: convert sysctl interfaces over to hypercall buffers")
    Amends: 73367cf3b4b4 ("libxc: Fix xc_pm API calls to return negative error and stash error in errno")
    Fixes: 31e264c672bc ("pmstat&xenpm: Re-arrage for cpufreq union")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/ctrl/xc_pm.c | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/tools/libs/ctrl/xc_pm.c b/tools/libs/ctrl/xc_pm.c
index b27b45c3dc..ff7b5ada05 100644
--- a/tools/libs/ctrl/xc_pm.c
+++ b/tools/libs/ctrl/xc_pm.c
@@ -212,10 +212,7 @@ int xc_get_cpufreq_para(xc_interface *xch, int cpuid,
     DECLARE_NAMED_HYPERCALL_BOUNCE(scaling_available_governors,
 			 user_para->scaling_available_governors,
 			 user_para->gov_num * CPUFREQ_NAME_LEN * sizeof(char), XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
-
-    bool has_num = user_para->cpu_num &&
-                     user_para->freq_num &&
-                     user_para->gov_num;
+    bool has_num = user_para->cpu_num && user_para->freq_num;
 
     if ( has_num )
     {
@@ -226,12 +223,15 @@ int xc_get_cpufreq_para(xc_interface *xch, int cpuid,
             errno = EINVAL;
             return -1;
         }
-        if ( xc_hypercall_bounce_pre(xch, affected_cpus) )
-            goto unlock_1;
-        if ( xc_hypercall_bounce_pre(xch, scaling_available_frequencies) )
+        ret = xc_hypercall_bounce_pre(xch, affected_cpus);
+        if ( ret )
+            return ret;
+        ret = xc_hypercall_bounce_pre(xch, scaling_available_frequencies);
+        if ( ret )
             goto unlock_2;
-        if ( user_para->gov_num &&
-             xc_hypercall_bounce_pre(xch, scaling_available_governors) )
+        if ( user_para->gov_num )
+            ret = xc_hypercall_bounce_pre(xch, scaling_available_governors);
+        if ( ret )
             goto unlock_3;
 
         set_xen_guest_handle(sys_para->affected_cpus, affected_cpus);
@@ -256,12 +256,11 @@ int xc_get_cpufreq_para(xc_interface *xch, int cpuid,
             user_para->cpu_num  = sys_para->cpu_num;
             user_para->freq_num = sys_para->freq_num;
             user_para->gov_num  = sys_para->gov_num;
-            ret = -errno;
         }
 
         if ( has_num )
             goto unlock_4;
-        goto unlock_1;
+        return ret;
     }
     else
     {
@@ -298,13 +297,12 @@ int xc_get_cpufreq_para(xc_interface *xch, int cpuid,
     }
 
 unlock_4:
-    if ( user_para->gov_num )
-        xc_hypercall_bounce_post(xch, scaling_available_governors);
+    xc_hypercall_bounce_post(xch, scaling_available_governors);
 unlock_3:
     xc_hypercall_bounce_post(xch, scaling_available_frequencies);
 unlock_2:
     xc_hypercall_bounce_post(xch, affected_cpus);
-unlock_1:
+
     return ret;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 10 06:55:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Apr 2025 06:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.944915.1343209 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2lof-00050s-MJ; Thu, 10 Apr 2025 06:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 944915.1343209; Thu, 10 Apr 2025 06: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 1u2lof-00050g-JO; Thu, 10 Apr 2025 06:55:13 +0000
Received: by outflank-mailman (input) for mailman id 944915;
 Thu, 10 Apr 2025 06: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 1u2loe-00050U-Dj
 for xen-changelog@lists.xenproject.org; Thu, 10 Apr 2025 06: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 1u2loe-006FFG-1G
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 06:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2loe-007TB0-0x
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 06: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=vDlJlklrvERwyC1eBC/OwEL5H1LuwZjk4jfy1dEk01E=; b=z8U6ttjkDq7UplGDPYoFnRigo3
	usHDWc62z8/5mVHEK2srlNvyvtE1oSv6JzMNfAARbfDyf8SZrGBOCPWiQ6WNaVodDVb4VDLpQlVG0
	3QqaQWIa7qWElXticdsKuTdnEMfe7VPD9Mhz6jdfyC5PRiZUJd5keeC9huPCPoYxSnBQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86emul/test: drop check for AVX512-4FMAPS
Message-Id: <E1u2loe-007TB0-0x@xenbits.xenproject.org>
Date: Thu, 10 Apr 2025 06:55:12 +0000

commit 4bb846f32c870b19decc926f4759eac3fecfc04c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Apr 9 15:30:51 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 9 15:30:51 2025 +0200

    x86emul/test: drop check for AVX512-4FMAPS
    
    Use of Xeon Phi features was dropped earlier on; this one was overlooked.
    
    Fixes: 85191cf32180 ("x86: drop Xeon Phi support")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/tests/x86_emulator/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/tests/x86_emulator/Makefile b/tools/tests/x86_emulator/Makefile
index 294d27ebaa..3f57ac6159 100644
--- a/tools/tests/x86_emulator/Makefile
+++ b/tools/tests/x86_emulator/Makefile
@@ -105,7 +105,7 @@ TARGET-$(shell echo 'int i;' | $(CC) -x c -c -o /dev/null -m$(1) - || echo y) :=
 endef
 
 ISA := bmi bmi2 tbm sse4.1 sse4.2 sse4a avx avx2 f16c
-ISA += $(addprefix avx512,f bw dq 4fmaps)
+ISA += $(addprefix avx512,f bw dq)
 $(foreach isa,$(ISA),$(eval $(call isa-check-cc,$(isa))))
 
 # Also explicitly check for {evex} pseudo-prefix support, which got introduced
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 10 06:55:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Apr 2025 06:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.944916.1343212 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2lop-00053s-NV; Thu, 10 Apr 2025 06:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 944916.1343212; Thu, 10 Apr 2025 06: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 1u2lop-00053k-Kp; Thu, 10 Apr 2025 06:55:23 +0000
Received: by outflank-mailman (input) for mailman id 944916;
 Thu, 10 Apr 2025 06: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 1u2loo-00053P-Hb
 for xen-changelog@lists.xenproject.org; Thu, 10 Apr 2025 06: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 1u2loo-006FFK-1b
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 06:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2loo-007TDE-1T
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 06: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=xUL2c3G9sMMVsxtFWkmUMBDV1xzW81NI+DzuY5m41Xk=; b=UC+cc5miuzNRp0aAi1NfYlzEwn
	h+iIuAaP2Qf/NUg4hoZg8fsSQ1j7bTQt05L5fQ89bdbiD9NosHzdtHf/LKX76lqcqoo1oDgo3z36u
	zKXo72aZe9a4tUl4D6AwdKC49KzJk2dswE3Q9wgAw44KuufFka22gDHeZZuW7EYw3JzQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/boot: introduce boot domain
Message-Id: <E1u2loo-007TDE-1T@xenbits.xenproject.org>
Date: Thu, 10 Apr 2025 06:55:22 +0000

commit 839b37f1633a9451cc7081135b0c4b3109b6d051
Author:     Daniel P. Smith <dpsmith@apertussolutions.com>
AuthorDate: Wed Apr 9 15:32:02 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 9 15:32:02 2025 +0200

    x86/boot: introduce boot domain
    
    To begin moving toward allowing the hypervisor to construct more than one
    domain at boot, a container is needed for a domain's build information.
    Introduce a new header, <xen/asm/bootdomain.h>, that contains the initial
    struct boot_domain that encapsulate the build information for a domain.
    
    Add a kernel and ramdisk boot module reference along with a struct domain
    reference to the new struct boot_domain. This allows a struct boot_domain
    reference to be the only parameter necessary to pass down through the domain
    construction call chain.
    
    Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Signed-off-by: Alejandro Vallejo <agarciav@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/dom0_build.c              |  8 +++++---
 xen/arch/x86/hvm/dom0_build.c          | 23 ++++++++---------------
 xen/arch/x86/include/asm/boot-domain.h | 28 ++++++++++++++++++++++++++++
 xen/arch/x86/include/asm/bootinfo.h    |  5 +++++
 xen/arch/x86/include/asm/dom0_build.h  |  6 +++---
 xen/arch/x86/include/asm/setup.h       |  4 ++--
 xen/arch/x86/pv/dom0_build.c           | 24 ++++++++----------------
 xen/arch/x86/setup.c                   | 24 ++++++++++--------------
 8 files changed, 69 insertions(+), 53 deletions(-)

diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index 8191d90a22..0b467fd4a4 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -13,6 +13,7 @@
 #include <xen/softirq.h>
 
 #include <asm/amd.h>
+#include <asm/bootinfo.h>
 #include <asm/dom0_build.h>
 #include <asm/guest.h>
 #include <asm/hpet.h>
@@ -614,9 +615,10 @@ int __init dom0_setup_permissions(struct domain *d)
     return rc;
 }
 
-int __init construct_dom0(struct boot_info *bi, struct domain *d)
+int __init construct_dom0(const struct boot_domain *bd)
 {
     int rc;
+    const struct domain *d = bd->d;
 
     /* Sanity! */
     BUG_ON(!pv_shim && d->domain_id != 0);
@@ -626,9 +628,9 @@ int __init construct_dom0(struct boot_info *bi, struct domain *d)
     process_pending_softirqs();
 
     if ( is_hvm_domain(d) )
-        rc = dom0_construct_pvh(bi, d);
+        rc = dom0_construct_pvh(bd);
     else if ( is_pv_domain(d) )
-        rc = dom0_construct_pv(bi, d);
+        rc = dom0_construct_pv(bd);
     else
         panic("Cannot construct Dom0. No guest interface available\n");
 
diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index 9fd68df7b9..2a094b3145 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -644,9 +644,11 @@ static bool __init check_and_adjust_load_address(
 }
 
 static int __init pvh_load_kernel(
-    struct domain *d, struct boot_module *image, struct boot_module *initrd,
-    paddr_t *entry, paddr_t *start_info_addr)
+    const struct boot_domain *bd, paddr_t *entry, paddr_t *start_info_addr)
 {
+    struct domain *d = bd->d;
+    struct boot_module *image = bd->kernel;
+    struct boot_module *initrd = bd->module;
     void *image_base = bootstrap_map_bm(image);
     void *image_start = image_base + image->headroom;
     unsigned long image_len = image->size;
@@ -1328,26 +1330,17 @@ static void __hwdom_init pvh_setup_mmcfg(struct domain *d)
     }
 }
 
-int __init dom0_construct_pvh(struct boot_info *bi, struct domain *d)
+int __init dom0_construct_pvh(const struct boot_domain *bd)
 {
     paddr_t entry, start_info;
-    struct boot_module *image;
-    struct boot_module *initrd = NULL;
-    unsigned int idx;
+    struct domain *d = bd->d;
     int rc;
 
     printk(XENLOG_INFO "*** Building a PVH Dom%d ***\n", d->domain_id);
 
-    idx = first_boot_module_index(bi, BOOTMOD_KERNEL);
-    if ( idx >= bi->nr_modules )
+    if ( bd->kernel == NULL )
         panic("Missing kernel boot module for %pd construction\n", d);
 
-    image = &bi->mods[idx];
-
-    idx = first_boot_module_index(bi, BOOTMOD_RAMDISK);
-    if ( idx < bi->nr_modules )
-        initrd = &bi->mods[idx];
-
     if ( is_hardware_domain(d) )
     {
         /*
@@ -1385,7 +1378,7 @@ int __init dom0_construct_pvh(struct boot_info *bi, struct domain *d)
         return rc;
     }
 
-    rc = pvh_load_kernel(d, image, initrd, &entry, &start_info);
+    rc = pvh_load_kernel(bd, &entry, &start_info);
     if ( rc )
     {
         printk("Failed to load Dom0 kernel\n");
diff --git a/xen/arch/x86/include/asm/boot-domain.h b/xen/arch/x86/include/asm/boot-domain.h
new file mode 100644
index 0000000000..5e1e1a0b61
--- /dev/null
+++ b/xen/arch/x86/include/asm/boot-domain.h
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (c) 2024 Apertus Solutions, LLC
+ * Author: Daniel P. Smith <dpsmith@apertussolutions.com>
+ * Copyright (c) 2024 Christopher Clark <christopher.w.clark@gmail.com>
+ */
+
+#ifndef __XEN_X86_BOOTDOMAIN_H__
+#define __XEN_X86_BOOTDOMAIN_H__
+
+struct boot_domain {
+    struct boot_module *kernel;
+    struct boot_module *module;
+
+    struct domain *d;
+};
+
+#endif
+
+/*
+ * 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/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
index f8b4229130..3afc214c17 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -11,10 +11,14 @@
 #include <xen/init.h>
 #include <xen/multiboot.h>
 #include <xen/types.h>
+#include <asm/boot-domain.h>
 
 /* Max number of boot modules a bootloader can provide in addition to Xen */
 #define MAX_NR_BOOTMODS 63
 
+/* Max number of boot domains that Xen can construct */
+#define MAX_NR_BOOTDOMS 1
+
 /* Boot module binary type / purpose */
 enum bootmod_type {
     BOOTMOD_UNKNOWN,
@@ -78,6 +82,7 @@ struct boot_info {
 
     unsigned int nr_modules;
     struct boot_module mods[MAX_NR_BOOTMODS + 1];
+    struct boot_domain domains[MAX_NR_BOOTDOMS];
 };
 
 /*
diff --git a/xen/arch/x86/include/asm/dom0_build.h b/xen/arch/x86/include/asm/dom0_build.h
index 2d67b17213..ff021c24af 100644
--- a/xen/arch/x86/include/asm/dom0_build.h
+++ b/xen/arch/x86/include/asm/dom0_build.h
@@ -13,9 +13,9 @@ unsigned long dom0_compute_nr_pages(struct domain *d,
                                     unsigned long initrd_len);
 int dom0_setup_permissions(struct domain *d);
 
-struct boot_info;
-int dom0_construct_pv(struct boot_info *bi, struct domain *d);
-int dom0_construct_pvh(struct boot_info *bi, struct domain *d);
+struct boot_domain;
+int dom0_construct_pv(const struct boot_domain *bd);
+int dom0_construct_pvh(const struct boot_domain *bd);
 
 unsigned long dom0_paging_pages(const struct domain *d,
                                 unsigned long nr_pages);
diff --git a/xen/arch/x86/include/asm/setup.h b/xen/arch/x86/include/asm/setup.h
index 5c2391a868..ac34c69855 100644
--- a/xen/arch/x86/include/asm/setup.h
+++ b/xen/arch/x86/include/asm/setup.h
@@ -26,8 +26,8 @@ void subarch_init_memory(void);
 
 void init_IRQ(void);
 
-struct boot_info;
-int construct_dom0(struct boot_info *bi, struct domain *d);
+struct boot_domain;
+int construct_dom0(const struct boot_domain *bd);
 
 void setup_io_bitmap(struct domain *d);
 
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index 96e28c7b6a..b485eea05f 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -355,7 +355,7 @@ static struct page_info * __init alloc_chunk(struct domain *d,
     return page;
 }
 
-static int __init dom0_construct(struct boot_info *bi, struct domain *d)
+static int __init dom0_construct(const struct boot_domain *bd)
 {
     unsigned int i;
     int rc, order, machine;
@@ -371,14 +371,15 @@ static int __init dom0_construct(struct boot_info *bi, struct domain *d)
     struct page_info *page = NULL;
     unsigned int flush_flags = 0;
     start_info_t *si;
+    struct domain *d = bd->d;
     struct vcpu *v = d->vcpu[0];
 
-    struct boot_module *image;
-    struct boot_module *initrd = NULL;
+    struct boot_module *image = bd->kernel;
+    struct boot_module *initrd = bd->module;
     void *image_base;
     unsigned long image_len;
     void *image_start;
-    unsigned long initrd_len = 0;
+    unsigned long initrd_len = initrd ? initrd->size : 0;
 
     l4_pgentry_t *l4tab = NULL, *l4start = NULL;
     l3_pgentry_t *l3tab = NULL, *l3start = NULL;
@@ -416,22 +417,13 @@ static int __init dom0_construct(struct boot_info *bi, struct domain *d)
 
     printk(XENLOG_INFO "*** Building a PV Dom%d ***\n", d->domain_id);
 
-    i = first_boot_module_index(bi, BOOTMOD_KERNEL);
-    if ( i >= bi->nr_modules )
+    if ( !image )
         panic("Missing kernel boot module for %pd construction\n", d);
 
-    image = &bi->mods[i];
     image_base = bootstrap_map_bm(image);
     image_len = image->size;
     image_start = image_base + image->headroom;
 
-    i = first_boot_module_index(bi, BOOTMOD_RAMDISK);
-    if ( i < bi->nr_modules )
-    {
-        initrd = &bi->mods[i];
-        initrd_len = initrd->size;
-    }
-
     d->max_pages = ~0U;
 
     if ( (rc = bzimage_parse(image_base, &image_start, &image_len)) != 0 )
@@ -1078,7 +1070,7 @@ out:
     return rc;
 }
 
-int __init dom0_construct_pv(struct boot_info *bi, struct domain *d)
+int __init dom0_construct_pv(const struct boot_domain *bd)
 {
     unsigned long cr4 = read_cr4();
     int rc;
@@ -1096,7 +1088,7 @@ int __init dom0_construct_pv(struct boot_info *bi, struct domain *d)
         write_cr4(cr4 & ~X86_CR4_SMAP);
     }
 
-    rc = dom0_construct(bi, d);
+    rc = dom0_construct(bd);
 
     if ( cr4 & X86_CR4_SMAP )
     {
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index d70abb7e0c..ddb10ea03d 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -992,16 +992,9 @@ static struct domain *__init create_dom0(struct boot_info *bi)
             .misc_flags = opt_dom0_msr_relaxed ? XEN_X86_MSR_RELAXED : 0,
         },
     };
+    struct boot_domain *bd = &bi->domains[0];
     struct domain *d;
     domid_t domid;
-    struct boot_module *image;
-    unsigned int idx;
-
-    idx = first_boot_module_index(bi, BOOTMOD_KERNEL);
-    if ( idx >= bi->nr_modules )
-        panic("Missing kernel boot module for building domain\n");
-
-    image = &bi->mods[idx];
 
     if ( opt_dom0_pvh )
     {
@@ -1028,11 +1021,11 @@ static struct domain *__init create_dom0(struct boot_info *bi)
         panic("Error creating d%uv0\n", domid);
 
     /* Grab the DOM0 command line. */
-    if ( image->cmdline_pa || bi->kextra )
+    if ( bd->kernel->cmdline_pa || bi->kextra )
     {
-        if ( image->cmdline_pa )
-            safe_strcpy(
-                cmdline, cmdline_cook(__va(image->cmdline_pa), bi->loader));
+        if ( bd->kernel->cmdline_pa )
+            safe_strcpy(cmdline,
+                        cmdline_cook(__va(bd->kernel->cmdline_pa), bi->loader));
 
         if ( bi->kextra )
             /* kextra always includes exactly one leading space. */
@@ -1054,10 +1047,11 @@ static struct domain *__init create_dom0(struct boot_info *bi)
             safe_strcat(cmdline, acpi_param);
         }
 
-        image->cmdline_pa = __pa(cmdline);
+        bd->kernel->cmdline_pa = __pa(cmdline);
     }
 
-    if ( construct_dom0(bi, d) != 0 )
+    bd->d = d;
+    if ( construct_dom0(bd) != 0 )
         panic("Could not construct domain 0\n");
 
     return d;
@@ -1263,6 +1257,7 @@ void asmlinkage __init noreturn __start_xen(void)
 
     /* Dom0 kernel is always first */
     bi->mods[0].type = BOOTMOD_KERNEL;
+    bi->domains[0].kernel = &bi->mods[0];
 
     if ( pvh_boot )
     {
@@ -2129,6 +2124,7 @@ void asmlinkage __init noreturn __start_xen(void)
     if ( initrdidx < MAX_NR_BOOTMODS )
     {
         bi->mods[initrdidx].type = BOOTMOD_RAMDISK;
+        bi->domains[0].module = &bi->mods[initrdidx];
         if ( first_boot_module_index(bi, BOOTMOD_UNKNOWN) < MAX_NR_BOOTMODS )
             printk(XENLOG_WARNING
                    "Multiple initrd candidates, picking module #%u\n",
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 10 06:55:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Apr 2025 06:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.944919.1343215 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2loz-00056v-QF; Thu, 10 Apr 2025 06:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 944919.1343215; Thu, 10 Apr 2025 06: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 1u2loz-00056n-Ni; Thu, 10 Apr 2025 06:55:33 +0000
Received: by outflank-mailman (input) for mailman id 944919;
 Thu, 10 Apr 2025 06: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 1u2loy-00056f-Ko
 for xen-changelog@lists.xenproject.org; Thu, 10 Apr 2025 06: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 1u2loy-006FFO-1u
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 06:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2loy-007TGi-1n
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 06: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=RDrP5LksuA8l3Ts5vrCQTcDsZmroshEnb4o+qeDOi0U=; b=GbpiSlOyj3YvcmVUuk5WTPRAiu
	VnDuWGW0beGoN7kDAPl1kAewDHH//Pzr/KXs9aFrCOqNIAqBOAvx00YXCuTUd9VW11kqfg2Bzy9jl
	lSTiUcPOxVLHX2tU1JAX/1Xlc/Xz0UbLJ/lNYGEEKpfoKpWlx8Ru8xW24/LRUYNrKXwk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/boot: introduce domid field to struct boot_domain
Message-Id: <E1u2loy-007TGi-1n@xenbits.xenproject.org>
Date: Thu, 10 Apr 2025 06:55:32 +0000

commit fc46a36b1e39413d6e5bf6fccd87f425a42fa94b
Author:     Daniel P. Smith <dpsmith@apertussolutions.com>
AuthorDate: Wed Apr 9 15:32:26 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 9 15:32:26 2025 +0200

    x86/boot: introduce domid field to struct boot_domain
    
    boot_domain stores the domid until it is used to create (and allocate)
    struct domain. d->domain_id is not available early enough.
    
    boot_domain domids are initialized to DOMID_INVALID. If not overridden
    by device tree, domids of DOMID_INVALID are assigned a valid value. The
    domid will be optionally parsed from the device tree configuration.
    
    Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Signed-off-by: Alejandro Vallejo <agarciav@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/boot-domain.h |  4 ++++
 xen/arch/x86/setup.c                   | 10 +++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/include/asm/boot-domain.h b/xen/arch/x86/include/asm/boot-domain.h
index 5e1e1a0b61..fcbedda0f0 100644
--- a/xen/arch/x86/include/asm/boot-domain.h
+++ b/xen/arch/x86/include/asm/boot-domain.h
@@ -8,7 +8,11 @@
 #ifndef __XEN_X86_BOOTDOMAIN_H__
 #define __XEN_X86_BOOTDOMAIN_H__
 
+#include <public/xen.h>
+
 struct boot_domain {
+    domid_t domid;
+
     struct boot_module *kernel;
     struct boot_module *module;
 
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index ddb10ea03d..3c257f0bad 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -295,6 +295,7 @@ static const char *cmdline_cook(const char *p, const char *loader_name);
 struct boot_info __initdata xen_boot_info = {
     .loader = "unknown",
     .cmdline = "",
+    .domains = { [0 ... MAX_NR_BOOTDOMS - 1] = { .domid = DOMID_INVALID } },
 };
 
 static struct boot_info *__init multiboot_fill_boot_info(
@@ -994,7 +995,6 @@ static struct domain *__init create_dom0(struct boot_info *bi)
     };
     struct boot_domain *bd = &bi->domains[0];
     struct domain *d;
-    domid_t domid;
 
     if ( opt_dom0_pvh )
     {
@@ -1010,15 +1010,15 @@ static struct domain *__init create_dom0(struct boot_info *bi)
         dom0_cfg.flags |= XEN_DOMCTL_CDF_iommu;
 
     /* Create initial domain.  Not d0 for pvshim. */
-    domid = get_initial_domain_id();
-    d = domain_create(domid, &dom0_cfg, pv_shim ? 0 : CDF_privileged);
+    bd->domid = get_initial_domain_id();
+    d = domain_create(bd->domid, &dom0_cfg, pv_shim ? 0 : CDF_privileged);
     if ( IS_ERR(d) )
-        panic("Error creating d%u: %ld\n", domid, PTR_ERR(d));
+        panic("Error creating d%u: %ld\n", bd->domid, PTR_ERR(d));
 
     init_dom0_cpuid_policy(d);
 
     if ( alloc_dom0_vcpu0(d) == NULL )
-        panic("Error creating d%uv0\n", domid);
+        panic("Error creating %pdv0\n", d);
 
     /* Grab the DOM0 command line. */
     if ( bd->kernel->cmdline_pa || bi->kextra )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 10 06:55:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Apr 2025 06:55:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.944921.1343219 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2lp9-00059w-S7; Thu, 10 Apr 2025 06:55:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 944921.1343219; Thu, 10 Apr 2025 06:55:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2lp9-00059o-PD; Thu, 10 Apr 2025 06:55:43 +0000
Received: by outflank-mailman (input) for mailman id 944921;
 Thu, 10 Apr 2025 06: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 1u2lp8-00059c-My
 for xen-changelog@lists.xenproject.org; Thu, 10 Apr 2025 06: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 1u2lp8-006FFU-2C
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 06:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2lp8-007TIp-25
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 06: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=3/x7JRV2ZEszchfGakrftKiBmnNyzbU06WB053JIcSQ=; b=PHUhLqKD/tTiISOUTI8gHR/gs6
	nHo2NsFv3QwBl0kTBfS+OcnyL0GsxxRPM4QndSt9+U4R3jPAxDKBWfjHAAy4LsZ4SRwwq77SVde1W
	Sd+XjRpzGTlfDCeorFYByLT0dMIXeEk85/xfkMNDAWfKLj0VOmKiZZgxWKZjt2Fych/A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/domain: revisit logging in arch_domain_create()
Message-Id: <E1u2lp8-007TIp-25@xenbits.xenproject.org>
Date: Thu, 10 Apr 2025 06:55:42 +0000

commit b806f5fddc308e5ee4d48df8178dce968fb5dfcf
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Wed Apr 9 15:33:04 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 9 15:33:04 2025 +0200

    x86/domain: revisit logging in arch_domain_create()
    
    Use %pd in all logs issued from arch_domain_create() and reword some of the
    messages.
    
    Also, expand error message in arch_domain_create() under !emulation_flags_ok()
    case to help debugging.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domain.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index a42fa54805..f197dad4c0 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -798,13 +798,14 @@ int arch_domain_create(struct domain *d,
     {
         if ( !opt_allow_unsafe )
         {
-            printk(XENLOG_G_ERR "Xen does not allow DomU creation on this CPU"
-                   " for security reasons.\n");
+            printk(XENLOG_G_ERR
+                   "%pd: will not create domU on this CPU for security reasons\n",
+                   d);
             return -EPERM;
         }
         printk(XENLOG_G_WARNING
-               "Dom%d may compromise security on this CPU.\n",
-               d->domain_id);
+               "%pd: may compromise security on this CPU\n",
+               d);
     }
 
     emflags = config->arch.emulation_flags;
@@ -814,16 +815,20 @@ int arch_domain_create(struct domain *d,
 
     if ( emflags & ~XEN_X86_EMU_ALL )
     {
-        printk(XENLOG_G_ERR "d%d: Invalid emulation bitmap: %#x\n",
-               d->domain_id, emflags);
+        printk(XENLOG_G_ERR
+               "%pd: invalid emulation bitmap: %#x\n",
+               d, emflags);
         return -EINVAL;
     }
 
     if ( !emulation_flags_ok(d, emflags) )
     {
-        printk(XENLOG_G_ERR "d%d: Xen does not allow %s domain creation "
-               "with the current selection of emulators: %#x\n",
-               d->domain_id, is_hvm_domain(d) ? "HVM" : "PV", emflags);
+        printk(XENLOG_G_ERR
+               "%pd: will not create %s %sdomain with emulators: %#x\n",
+               d,
+               is_hvm_domain(d) ? "HVM" : "PV",
+               is_hardware_domain(d) ? "hardware " : "",
+               emflags);
         return -EOPNOTSUPP;
     }
     d->arch.emulation_flags = emflags;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 10 09:11:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Apr 2025 09:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.945072.1343335 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2nw7-0004KO-Fd; Thu, 10 Apr 2025 09:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 945072.1343335; Thu, 10 Apr 2025 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 1u2nw7-0004KE-Cp; Thu, 10 Apr 2025 09:11:03 +0000
Received: by outflank-mailman (input) for mailman id 945072;
 Thu, 10 Apr 2025 09: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 1u2nw6-0004K2-Ea
 for xen-changelog@lists.xenproject.org; Thu, 10 Apr 2025 09: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 1u2nw6-006It3-11
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 09:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2nw6-0099QO-0r
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 09: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=HWPMH7QrByo5HNAtkXWdJAoHD7hWJj/fWchmnqooyIU=; b=DN0YKTADHTMn+bmrsVLLgQ+Hj4
	Z7FWItZ4nC9BtF2h4n5nyuNzENxjdDt9+0Y6SvQNTMMhHXjWyww4Yp1M6krwtxN6sy6a4OiQ48F1Q
	ehRSI6cLVhYOsn3mNMAqZ8V8WqOaPdNxoiK/rFl+XE2YRC1RHNSGIP57reZogHsqSovs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] include: sort $(wildcard ...) results
Message-Id: <E1u2nw6-0099QO-0r@xenbits.xenproject.org>
Date: Thu, 10 Apr 2025 09:11:02 +0000

commit ff835bbc8096a14ed1bffa235e25848c993f7240
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 10 10:56:29 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 10 10:56:29 2025 +0200

    include: sort $(wildcard ...) results
    
    The order of items is stored in .*.chk.cmd, and hence variations between
    how items are ordered would result in re-invocation of the checking rule
    during "make install-xen" despite that already having successfully run
    earlier on. The difference can become noticable when building (as non-
    root) and installing (as root) use different GNU make versions: In 3.82
    the sorting was deliberately undone, just for it to be restored in 4.3.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/include/Makefile b/xen/include/Makefile
index 058b0a566b..41b985f4d1 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -41,8 +41,8 @@ cppflags-$(CONFIG_X86)    += -m32
 
 endif
 
-public-$(CONFIG_X86) := $(wildcard $(srcdir)/public/arch-x86/*.h $(srcdir)/public/arch-x86/*/*.h)
-public-$(CONFIG_ARM) := $(wildcard $(srcdir)/public/arch-arm/*.h $(srcdir)/public/arch-arm/*/*.h)
+public-$(CONFIG_X86) := $(sort $(wildcard $(srcdir)/public/arch-x86/*.h $(srcdir)/public/arch-x86/*/*.h))
+public-$(CONFIG_ARM) := $(sort $(wildcard $(srcdir)/public/arch-arm/*.h $(srcdir)/public/arch-arm/*/*.h))
 
 .PHONY: all
 all: $(addprefix $(obj)/,$(headers-y) $(headers-n))
@@ -130,7 +130,7 @@ all: $(obj)/headers.chk $(obj)/headers99.chk $(obj)/headers++.chk
 
 public-hdrs-path := $(srcdir)/public
 
-public-list-headers = $(wildcard $1/*.h $1/*/*.h)
+public-list-headers = $(sort $(wildcard $1/*.h $1/*/*.h))
 public-filter-headers = $(filter-out $(addprefix $(public-hdrs-path)/, $($1-filter)), $($1))
 
 public-headers := $(call public-list-headers, $(public-hdrs-path)) $(public-y)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 10 09:11:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Apr 2025 09:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.945073.1343338 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2nwH-0004PA-Go; Thu, 10 Apr 2025 09:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 945073.1343338; Thu, 10 Apr 2025 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 1u2nwH-0004P2-E9; Thu, 10 Apr 2025 09:11:13 +0000
Received: by outflank-mailman (input) for mailman id 945073;
 Thu, 10 Apr 2025 09: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 1u2nwG-0004Oq-FL
 for xen-changelog@lists.xenproject.org; Thu, 10 Apr 2025 09: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 1u2nwG-006It9-1M
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 09:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2nwG-0099YL-1E
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 09: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=YeETC9vHDVPm10GUS99+MYgjHm1a4Ne54I2LiIoPURc=; b=O2SUE/hhbAOi1IaouJBTrevt08
	62wSb3lHZ4DN4Rf6BH1PTEImJCpzTBqTN+1DO6QJe6sa3RdLbMsJBOkGrso9c3JMjk/eKTrmcul2O
	bROdlceHM3g0p4TSuinmjs362Ih2RU8j5owSrNLzvam6v5q+sOL7UaqdF4QeO1AGik0w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/HVM: improve local variable use in hvm_hap_nested_page_fault()
Message-Id: <E1u2nwG-0099YL-1E@xenbits.xenproject.org>
Date: Thu, 10 Apr 2025 09:11:12 +0000

commit 8322753096da613e6649673f5f3c86725155559c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 10 10:56:49 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 10 10:56:49 2025 +0200

    x86/HVM: improve local variable use in hvm_hap_nested_page_fault()
    
    First, gfn can be set just once, rather than (conditionally) twice.
    
    And then gfn can be used in two function calls, rather than re-
    calculating the value there.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 5950f3160f..6f1174c512 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1794,7 +1794,7 @@ void hvm_inject_event(const struct x86_event *event)
 int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
                               struct npfec npfec)
 {
-    unsigned long gfn = gpa >> PAGE_SHIFT;
+    unsigned long gfn;
     p2m_type_t p2mt;
     p2m_access_t p2ma;
     mfn_t mfn;
@@ -1841,12 +1841,13 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
                 hvm_inject_hw_exception(X86_EXC_GP, 0);
             return 1;
         case NESTEDHVM_PAGEFAULT_L0_ERROR:
-            /* gpa is now translated to l1 guest address, update gfn. */
-            gfn = gpa >> PAGE_SHIFT;
+            /* gpa is now translated to l1 guest address. */
             break;
         }
     }
 
+    gfn = gpa >> PAGE_SHIFT;
+
     /*
      * No need to do the P2M lookup for internally handled MMIO, benefiting
      * - 32-bit WinXP (& older Windows) on AMD CPUs for LAPIC accesses,
@@ -1854,7 +1855,7 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
      */
     if ( !nestedhvm_vcpu_in_guestmode(curr) && hvm_mmio_internal(gpa) )
     {
-        if ( !handle_mmio_with_translation(gla, gpa >> PAGE_SHIFT, npfec) )
+        if ( !handle_mmio_with_translation(gla, gfn, npfec) )
             hvm_inject_hw_exception(X86_EXC_GP, 0);
         rc = 1;
         goto out;
@@ -1982,7 +1983,7 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
          (npfec.write_access &&
           (p2m_is_discard_write(p2mt) || (p2mt == p2m_ioreq_server))) )
     {
-        if ( !handle_mmio_with_translation(gla, gpa >> PAGE_SHIFT, npfec) )
+        if ( !handle_mmio_with_translation(gla, gfn, npfec) )
             hvm_inject_hw_exception(X86_EXC_GP, 0);
         rc = 1;
         goto out_put_gfn;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 10 11:33:08 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Apr 2025 11:33:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.945305.1343511 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2q9X-0000Wt-0T; Thu, 10 Apr 2025 11:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 945305.1343511; Thu, 10 Apr 2025 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 1u2q9W-0000Wl-UA; Thu, 10 Apr 2025 11:33:02 +0000
Received: by outflank-mailman (input) for mailman id 945305;
 Thu, 10 Apr 2025 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 1u2q9W-0000Wf-B4
 for xen-changelog@lists.xenproject.org; Thu, 10 Apr 2025 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 1u2q9W-006MBk-0M
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 11:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2q9W-00AzfH-07
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 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=wvH/sJqnKxDDlyWn9qfwNQ+IKRht/yedMDrRWSbHm0g=; b=UxpsgEv5OHnVPSqGzdPI/W6eos
	bSX0ZBTQwgO65CqJ+5hWh53rIZoI1OK4kYvfpghSZw5KlQQLvG3YCBZOaQveehbJ6s6zm3vxKkea0
	9iLqF/+ETnlaSBeWYJNn4JuUa/YNQhhdjzH1Jeg3C1jGG3q9V6crFNjbzj4bGm/w65vc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] include: sort $(wildcard ...) results
Message-Id: <E1u2q9W-00AzfH-07@xenbits.xenproject.org>
Date: Thu, 10 Apr 2025 11:33:02 +0000

commit ff835bbc8096a14ed1bffa235e25848c993f7240
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 10 10:56:29 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 10 10:56:29 2025 +0200

    include: sort $(wildcard ...) results
    
    The order of items is stored in .*.chk.cmd, and hence variations between
    how items are ordered would result in re-invocation of the checking rule
    during "make install-xen" despite that already having successfully run
    earlier on. The difference can become noticable when building (as non-
    root) and installing (as root) use different GNU make versions: In 3.82
    the sorting was deliberately undone, just for it to be restored in 4.3.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/include/Makefile b/xen/include/Makefile
index 058b0a566b..41b985f4d1 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -41,8 +41,8 @@ cppflags-$(CONFIG_X86)    += -m32
 
 endif
 
-public-$(CONFIG_X86) := $(wildcard $(srcdir)/public/arch-x86/*.h $(srcdir)/public/arch-x86/*/*.h)
-public-$(CONFIG_ARM) := $(wildcard $(srcdir)/public/arch-arm/*.h $(srcdir)/public/arch-arm/*/*.h)
+public-$(CONFIG_X86) := $(sort $(wildcard $(srcdir)/public/arch-x86/*.h $(srcdir)/public/arch-x86/*/*.h))
+public-$(CONFIG_ARM) := $(sort $(wildcard $(srcdir)/public/arch-arm/*.h $(srcdir)/public/arch-arm/*/*.h))
 
 .PHONY: all
 all: $(addprefix $(obj)/,$(headers-y) $(headers-n))
@@ -130,7 +130,7 @@ all: $(obj)/headers.chk $(obj)/headers99.chk $(obj)/headers++.chk
 
 public-hdrs-path := $(srcdir)/public
 
-public-list-headers = $(wildcard $1/*.h $1/*/*.h)
+public-list-headers = $(sort $(wildcard $1/*.h $1/*/*.h))
 public-filter-headers = $(filter-out $(addprefix $(public-hdrs-path)/, $($1-filter)), $($1))
 
 public-headers := $(call public-list-headers, $(public-hdrs-path)) $(public-y)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 10 11:33:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Apr 2025 11:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.945306.1343516 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2q9h-0000Yi-2G; Thu, 10 Apr 2025 11:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 945306.1343516; Thu, 10 Apr 2025 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 1u2q9g-0000Ya-Vd; Thu, 10 Apr 2025 11:33:12 +0000
Received: by outflank-mailman (input) for mailman id 945306;
 Thu, 10 Apr 2025 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 1u2q9g-0000YU-8A
 for xen-changelog@lists.xenproject.org; Thu, 10 Apr 2025 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 1u2q9g-006MC7-0i
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 11:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2q9g-00Azrb-0Y
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 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=rKjJw6vUxdAs8K+XUMf55uJT6DYF9cEUKOqu7I3Wr0k=; b=zqp5hdqFZssXWh0fXCR8iJ/ebk
	QlHXp5dQKy+rnaETSpx5GmhqVyglevC7ix7RHUN6naVpeivQYmitJgl//FlQKrw3UFDnymrru4Rtd
	7ls0L6bdJOF2pm6JeENy7gWVJoGtr58SiSYqG4RGuL7bnFmah+u8G7jjMw3Mt4zhxTJw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/HVM: improve local variable use in hvm_hap_nested_page_fault()
Message-Id: <E1u2q9g-00Azrb-0Y@xenbits.xenproject.org>
Date: Thu, 10 Apr 2025 11:33:12 +0000

commit 8322753096da613e6649673f5f3c86725155559c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 10 10:56:49 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 10 10:56:49 2025 +0200

    x86/HVM: improve local variable use in hvm_hap_nested_page_fault()
    
    First, gfn can be set just once, rather than (conditionally) twice.
    
    And then gfn can be used in two function calls, rather than re-
    calculating the value there.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 5950f3160f..6f1174c512 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1794,7 +1794,7 @@ void hvm_inject_event(const struct x86_event *event)
 int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
                               struct npfec npfec)
 {
-    unsigned long gfn = gpa >> PAGE_SHIFT;
+    unsigned long gfn;
     p2m_type_t p2mt;
     p2m_access_t p2ma;
     mfn_t mfn;
@@ -1841,12 +1841,13 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
                 hvm_inject_hw_exception(X86_EXC_GP, 0);
             return 1;
         case NESTEDHVM_PAGEFAULT_L0_ERROR:
-            /* gpa is now translated to l1 guest address, update gfn. */
-            gfn = gpa >> PAGE_SHIFT;
+            /* gpa is now translated to l1 guest address. */
             break;
         }
     }
 
+    gfn = gpa >> PAGE_SHIFT;
+
     /*
      * No need to do the P2M lookup for internally handled MMIO, benefiting
      * - 32-bit WinXP (& older Windows) on AMD CPUs for LAPIC accesses,
@@ -1854,7 +1855,7 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
      */
     if ( !nestedhvm_vcpu_in_guestmode(curr) && hvm_mmio_internal(gpa) )
     {
-        if ( !handle_mmio_with_translation(gla, gpa >> PAGE_SHIFT, npfec) )
+        if ( !handle_mmio_with_translation(gla, gfn, npfec) )
             hvm_inject_hw_exception(X86_EXC_GP, 0);
         rc = 1;
         goto out;
@@ -1982,7 +1983,7 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
          (npfec.write_access &&
           (p2m_is_discard_write(p2mt) || (p2mt == p2m_ioreq_server))) )
     {
-        if ( !handle_mmio_with_translation(gla, gpa >> PAGE_SHIFT, npfec) )
+        if ( !handle_mmio_with_translation(gla, gfn, npfec) )
             hvm_inject_hw_exception(X86_EXC_GP, 0);
         rc = 1;
         goto out_put_gfn;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 10 17:11:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Apr 2025 17:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.946122.1344120 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2vQd-0006n5-QP; Thu, 10 Apr 2025 17:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 946122.1344120; Thu, 10 Apr 2025 17: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 1u2vQd-0006mx-Nl; Thu, 10 Apr 2025 17:11:03 +0000
Received: by outflank-mailman (input) for mailman id 946122;
 Thu, 10 Apr 2025 17: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 1u2vQc-0006mj-7H
 for xen-changelog@lists.xenproject.org; Thu, 10 Apr 2025 17: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 1u2vQb-006UgB-32
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 17:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2vQb-00FoZp-2p
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 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=5p3gP5C4p8rO2t7/Zt4ZhQbUAANagoK/yPc5x3o38x4=; b=gHwZAlPuHioN6SyPS1MgvhhIuS
	3N441KLnCyjtxcTAsMJE1eYWfh1+GW5K2wWkzcxpB4sNNDIKJPqsBZEb0rHKa4wo/kb/1N2lB5DbT
	WjfzvUyFY4xKfgQ3OXrJ+rUNDZvktVGnRKCXj3yW56NmHdigsN3lcKHEqisPyv20G1QI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: Update x86 tests from Linux 6.1.19 to 6.6.56
Message-Id: <E1u2vQb-00FoZp-2p@xenbits.xenproject.org>
Date: Thu, 10 Apr 2025 17:11:01 +0000

commit f8588376648aa87f22cc709453f32473f45923c0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Apr 9 13:50:00 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Apr 10 18:01:57 2025 +0100

    CI: Update x86 tests from Linux 6.1.19 to 6.6.56
    
    Linux 6.6.56 was already added to test-artifacts for the argo testing, and
    this removes one moving part while cleaning things up.
    
    Drop the associated export job, and dockerfile.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 automation/gitlab-ci/build.yaml                    | 13 -------
 automation/gitlab-ci/test.yaml                     |  4 ++-
 .../tests-artifacts/kernel/6.1.19.dockerfile       | 41 ----------------------
 3 files changed, 3 insertions(+), 55 deletions(-)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 169bebe3c7..ab758243c1 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -308,19 +308,6 @@ qemu-system-aarch64-6.0.0-arm32-export:
   tags:
     - arm64
 
-# x86_64 test artifacts
-
-kernel-6.1.19-export:
-  extends: .test-jobs-artifact-common
-  image: registry.gitlab.com/xen-project/xen/tests-artifacts/kernel:6.1.19
-  script:
-    - mkdir binaries && cp /bzImage binaries/bzImage
-  artifacts:
-    paths:
-      - binaries/bzImage
-  tags:
-    - x86_64
-
 # Jobs below this line
 
 # Build jobs needed for tests
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index d05b9a98af..a23ff8a6e7 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -16,7 +16,9 @@
   - qemu-system-aarch64-6.0.0-arm32-export
 
 .x86-64-test-needs: &x86-64-test-needs
-  - kernel-6.1.19-export
+  - project: xen-project/hardware/test-artifacts
+    job: linux-6.6.56-x86_64
+    ref: master
   - project: xen-project/hardware/test-artifacts
     job: x86_64-rootfs-alpine-3.18
     ref: master
diff --git a/automation/tests-artifacts/kernel/6.1.19.dockerfile b/automation/tests-artifacts/kernel/6.1.19.dockerfile
deleted file mode 100644
index 073eaa0e11..0000000000
--- a/automation/tests-artifacts/kernel/6.1.19.dockerfile
+++ /dev/null
@@ -1,41 +0,0 @@
-# syntax=docker/dockerfile:1
-FROM --platform=linux/amd64 debian:bookworm
-LABEL maintainer.name="The Xen Project" \
-      maintainer.email="xen-devel@lists.xenproject.org"
-
-ENV DEBIAN_FRONTEND=noninteractive
-ENV LINUX_VERSION=6.1.19
-ENV USER root
-
-RUN mkdir /build
-WORKDIR /build
-
-# build depends
-RUN apt-get update && \
-    apt-get --quiet --yes install \
-        build-essential \
-        bc \
-        curl \
-        flex \
-        bison \
-        libelf-dev \
-        && \
-    apt-get autoremove -y && \
-    apt-get clean && \
-    rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/*
-
-# Build the kernel
-RUN curl -fsSLO https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-"$LINUX_VERSION".tar.xz && \
-    tar xvJf linux-"$LINUX_VERSION".tar.xz && \
-    cd linux-"$LINUX_VERSION" && \
-    make defconfig && \
-    make xen.config && \
-    scripts/config --enable BRIDGE && \
-    scripts/config --enable IGC && \
-    scripts/config --enable TUN && \
-    cp .config .config.orig && \
-    cat .config.orig | grep XEN | grep =m |sed 's/=m/=y/g' >> .config && \
-    make -j$(nproc) bzImage && \
-    cp arch/x86/boot/bzImage / && \
-    cd /build && \
-    rm -rf linux-"$LINUX_VERSION"*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 10 17:11:12 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Apr 2025 17:11:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.946123.1344124 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2vQm-0006oi-Rv; Thu, 10 Apr 2025 17:11:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 946123.1344124; Thu, 10 Apr 2025 17: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 1u2vQm-0006oa-P7; Thu, 10 Apr 2025 17:11:12 +0000
Received: by outflank-mailman (input) for mailman id 946123;
 Thu, 10 Apr 2025 17: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 1u2vQm-0006oS-2F
 for xen-changelog@lists.xenproject.org; Thu, 10 Apr 2025 17: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 1u2vQm-006UgY-06
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 17:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2vQl-00ForA-3D
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 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=Q5fhx3ntTSljn1rY3CVvEzHPcEnvDOkygMMJcNx7gBk=; b=yGTUcRFpWMiDimDb90BMthO3Qs
	z+3f0ebpJR8USiZ4C9eMFfb2rzZ5qFxtLmfHq5KX03WwYWchhGK614iBvajGGHlRuPlLsxNJ0Eec1
	YHMAju22q6xCHjV8tWEBqhc7V7ki61OrwjMD+KwtuheyxGzsHzvCzEau/WovMCA0cfQc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: Update ARM64 tests from Linux 6.6.74 to 6.6.86
Message-Id: <E1u2vQl-00ForA-3D@xenbits.xenproject.org>
Date: Thu, 10 Apr 2025 17:11:11 +0000

commit 8b22309c9bae2cb0717651b8b71feb86d8b203f8
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Apr 9 17:22:54 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Apr 10 18:01:57 2025 +0100

    CI: Update ARM64 tests from Linux 6.6.74 to 6.6.86
    
    Switch over to test-artifacts.
    
    Drop the associated export job, and dockerfile.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 automation/gitlab-ci/build.yaml                    | 11 -------
 automation/gitlab-ci/test.yaml                     |  4 ++-
 .../kernel/6.6.74-arm64v8.dockerfile               | 38 ----------------------
 3 files changed, 3 insertions(+), 50 deletions(-)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index ab758243c1..40dcd31f1b 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -275,17 +275,6 @@ alpine-3.18-arm64-rootfs-export:
   tags:
     - arm64
 
-kernel-6.6.74-arm64-export:
-  extends: .test-jobs-artifact-common
-  image: registry.gitlab.com/xen-project/xen/tests-artifacts/kernel:6.6.74-arm64v8
-  script:
-    - mkdir binaries && cp /Image binaries/Image
-  artifacts:
-    paths:
-      - binaries/Image
-  tags:
-    - arm64
-
 qemu-system-aarch64-6.0.0-arm64-export:
   extends: .test-jobs-artifact-common
   image: registry.gitlab.com/xen-project/xen/tests-artifacts/qemu-system-aarch64:6.0.0-arm64v8
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index a23ff8a6e7..59a2de28c8 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -8,8 +8,10 @@
   - when: on_success
 
 .arm64-test-needs: &arm64-test-needs
+  - project: xen-project/hardware/test-artifacts
+    job: linux-6.6.86-arm64
+    ref: master
   - alpine-3.18-arm64-rootfs-export
-  - kernel-6.6.74-arm64-export
   - qemu-system-aarch64-6.0.0-arm64-export
 
 .arm32-test-needs: &arm32-test-needs
diff --git a/automation/tests-artifacts/kernel/6.6.74-arm64v8.dockerfile b/automation/tests-artifacts/kernel/6.6.74-arm64v8.dockerfile
deleted file mode 100644
index 73e5145425..0000000000
--- a/automation/tests-artifacts/kernel/6.6.74-arm64v8.dockerfile
+++ /dev/null
@@ -1,38 +0,0 @@
-# syntax=docker/dockerfile:1
-FROM --platform=linux/arm64/v8 debian:bookworm
-LABEL maintainer.name="The Xen Project" \
-      maintainer.email="xen-devel@lists.xenproject.org"
-
-ENV DEBIAN_FRONTEND=noninteractive
-ENV LINUX_VERSION=6.6.74
-ENV USER root
-
-RUN mkdir /build
-WORKDIR /build
-
-# build depends
-RUN apt-get update && \
-    apt-get --quiet --yes install \
-        build-essential \
-        bc \
-        curl \
-        flex \
-        bison \
-        libssl-dev \
-        && \
-    \
-    # Build the kernel
-    curl -fsSLO https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-"$LINUX_VERSION".tar.xz && \
-    tar xvJf linux-"$LINUX_VERSION".tar.xz && \
-    cd linux-"$LINUX_VERSION" && \
-    make defconfig && \
-    sed -i 's/CONFIG_IPV6=m/CONFIG_IPV6=y/g' .config && \
-    sed -i 's/CONFIG_BRIDGE=m/CONFIG_BRIDGE=y/g' .config && \
-    sed -i 's/# CONFIG_XEN_NETDEV_BACKEND is not set/CONFIG_XEN_NETDEV_BACKEND=y/g' .config && \
-    make -j$(nproc) Image.gz && \
-    cp arch/arm64/boot/Image / && \
-    cd /build && \
-    rm -rf linux-"$LINUX_VERSION"* && \
-    apt-get autoremove -y && \
-    apt-get clean && \
-    rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 10 17:11:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Apr 2025 17:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.946125.1344128 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2vQx-0006rH-TK; Thu, 10 Apr 2025 17:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 946125.1344128; Thu, 10 Apr 2025 17: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 1u2vQx-0006r9-QW; Thu, 10 Apr 2025 17:11:23 +0000
Received: by outflank-mailman (input) for mailman id 946125;
 Thu, 10 Apr 2025 17: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 1u2vQw-0006qz-5I
 for xen-changelog@lists.xenproject.org; Thu, 10 Apr 2025 17: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 1u2vQw-006Ugc-0Q
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 17:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2vQw-00FozW-0G
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 17: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=ukIsMR813fiZa6fcQ2aaWMIgAabzSkPTnrnqjuJahF4=; b=3BGm/s6n1R05xznhtZYzy26Pwi
	vy5WGjFiwiF0MsikRb8SQIVDED9mG1XNJbVYRuDNSfs5D2eP6wvsvpZNlyvHqT11saDZenKbglojD
	OORhfGp3yv/s+p5k4GtSVmr7w4Yn/tBW3dlSFykrPts76WIasyMDEDCvY7mO3EhnSq40=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: Drop stale test-artifacts/alpine/3.18.dockerfile
Message-Id: <E1u2vQw-00FozW-0G@xenbits.xenproject.org>
Date: Thu, 10 Apr 2025 17:11:22 +0000

commit 424d20afae9a0d85c17e9dec3922af6448929b8c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Apr 7 18:15:32 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Apr 10 18:01:57 2025 +0100

    CI: Drop stale test-artifacts/alpine/3.18.dockerfile
    
    This should have been dropped too, as the authoritative copy lives in another
    repo now.
    
    Fixes: babe11b46c1a ("CI: Drop alpine-3.18-rootfs-export and use test-artefacts")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 automation/tests-artifacts/alpine/3.18.dockerfile | 67 -----------------------
 1 file changed, 67 deletions(-)

diff --git a/automation/tests-artifacts/alpine/3.18.dockerfile b/automation/tests-artifacts/alpine/3.18.dockerfile
deleted file mode 100644
index 311a92889b..0000000000
--- a/automation/tests-artifacts/alpine/3.18.dockerfile
+++ /dev/null
@@ -1,67 +0,0 @@
-# syntax=docker/dockerfile:1
-FROM --platform=linux/amd64 alpine:3.18
-LABEL maintainer.name="The Xen Project" \
-      maintainer.email="xen-devel@lists.xenproject.org"
-
-ENV USER root
-
-RUN mkdir /build
-WORKDIR /build
-
-RUN \
-  # apk
-  apk update && \
-  \
-  # xen runtime deps
-  apk add musl && \
-  apk add libgcc && \
-  apk add openrc && \
-  apk add busybox && \
-  apk add sudo && \
-  apk add dbus && \
-  apk add bash && \
-  apk add python3 && \
-  apk add zlib && \
-  apk add ncurses && \
-  apk add yajl && \
-  apk add libaio && \
-  apk add xz && \
-  apk add util-linux && \
-  apk add argp-standalone && \
-  apk add libfdt && \
-  apk add glib && \
-  apk add pixman && \
-  apk add curl && \
-  apk add udev && \
-  apk add pciutils && \
-  apk add libelf && \
-  \
-  # Xen
-  cd / && \
-  # Minimal ramdisk environment in case of cpio output
-  rc-update add udev && \
-  rc-update add udev-trigger && \
-  rc-update add udev-settle && \
-  rc-update add loopback sysinit && \
-  rc-update add bootmisc boot && \
-  rc-update add devfs sysinit && \
-  rc-update add dmesg sysinit && \
-  rc-update add hostname boot && \
-  rc-update add hwclock boot && \
-  rc-update add hwdrivers sysinit && \
-  rc-update add modules boot && \
-  rc-update add killprocs shutdown && \
-  rc-update add mount-ro shutdown && \
-  rc-update add savecache shutdown && \
-  rc-update add local default && \
-  cp -a /sbin/init /init && \
-  echo "ttyS0" >> /etc/securetty && \
-  echo "hvc0" >> /etc/securetty && \
-  echo "ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100" >> /etc/inittab && \
-  echo "hvc0::respawn:/sbin/getty -L hvc0 115200 vt100" >> /etc/inittab && \
-  echo > /etc/modules && \
-  passwd -d "root" root && \
-  \
-  # Create rootfs
-  cd / && \
-  tar cvzf /initrd.tar.gz bin dev etc home init lib mnt opt root sbin usr var
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 10 18:55:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Apr 2025 18:55:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.946190.1344163 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2x3G-000181-J1; Thu, 10 Apr 2025 18:55:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 946190.1344163; Thu, 10 Apr 2025 18: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 1u2x3G-00017t-Fp; Thu, 10 Apr 2025 18:55:02 +0000
Received: by outflank-mailman (input) for mailman id 946190;
 Thu, 10 Apr 2025 18:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u2x3G-00017n-2u
 for xen-changelog@lists.xenproject.org; Thu, 10 Apr 2025 18:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2x3F-006XFq-2V
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 18:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2x3F-00HCWl-2M
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 18: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=CRWlgsXYqBQxu8VS5qKiTJuvAypQwnNWmsZOrk+ZyLc=; b=hhBy2lKCrfpv4AUZCWoj152tNM
	tj54v8sZdjOq55H42F58r79iOCKkhls+NyiW+/hfKyu+38Bpc+JjXpCjgvSB4cg6GJc2p94AJN0gi
	kJ7gM3eu7nLGY+Ixmd+VWTZoY5Et3Xpr1gzOdMhEVNVTA4l5KcT3C9viNE1b2QjIpnbM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: Update x86 tests from Linux 6.1.19 to 6.6.56
Message-Id: <E1u2x3F-00HCWl-2M@xenbits.xenproject.org>
Date: Thu, 10 Apr 2025 18:55:01 +0000

commit f8588376648aa87f22cc709453f32473f45923c0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Apr 9 13:50:00 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Apr 10 18:01:57 2025 +0100

    CI: Update x86 tests from Linux 6.1.19 to 6.6.56
    
    Linux 6.6.56 was already added to test-artifacts for the argo testing, and
    this removes one moving part while cleaning things up.
    
    Drop the associated export job, and dockerfile.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 automation/gitlab-ci/build.yaml                    | 13 -------
 automation/gitlab-ci/test.yaml                     |  4 ++-
 .../tests-artifacts/kernel/6.1.19.dockerfile       | 41 ----------------------
 3 files changed, 3 insertions(+), 55 deletions(-)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 169bebe3c7..ab758243c1 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -308,19 +308,6 @@ qemu-system-aarch64-6.0.0-arm32-export:
   tags:
     - arm64
 
-# x86_64 test artifacts
-
-kernel-6.1.19-export:
-  extends: .test-jobs-artifact-common
-  image: registry.gitlab.com/xen-project/xen/tests-artifacts/kernel:6.1.19
-  script:
-    - mkdir binaries && cp /bzImage binaries/bzImage
-  artifacts:
-    paths:
-      - binaries/bzImage
-  tags:
-    - x86_64
-
 # Jobs below this line
 
 # Build jobs needed for tests
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index d05b9a98af..a23ff8a6e7 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -16,7 +16,9 @@
   - qemu-system-aarch64-6.0.0-arm32-export
 
 .x86-64-test-needs: &x86-64-test-needs
-  - kernel-6.1.19-export
+  - project: xen-project/hardware/test-artifacts
+    job: linux-6.6.56-x86_64
+    ref: master
   - project: xen-project/hardware/test-artifacts
     job: x86_64-rootfs-alpine-3.18
     ref: master
diff --git a/automation/tests-artifacts/kernel/6.1.19.dockerfile b/automation/tests-artifacts/kernel/6.1.19.dockerfile
deleted file mode 100644
index 073eaa0e11..0000000000
--- a/automation/tests-artifacts/kernel/6.1.19.dockerfile
+++ /dev/null
@@ -1,41 +0,0 @@
-# syntax=docker/dockerfile:1
-FROM --platform=linux/amd64 debian:bookworm
-LABEL maintainer.name="The Xen Project" \
-      maintainer.email="xen-devel@lists.xenproject.org"
-
-ENV DEBIAN_FRONTEND=noninteractive
-ENV LINUX_VERSION=6.1.19
-ENV USER root
-
-RUN mkdir /build
-WORKDIR /build
-
-# build depends
-RUN apt-get update && \
-    apt-get --quiet --yes install \
-        build-essential \
-        bc \
-        curl \
-        flex \
-        bison \
-        libelf-dev \
-        && \
-    apt-get autoremove -y && \
-    apt-get clean && \
-    rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/*
-
-# Build the kernel
-RUN curl -fsSLO https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-"$LINUX_VERSION".tar.xz && \
-    tar xvJf linux-"$LINUX_VERSION".tar.xz && \
-    cd linux-"$LINUX_VERSION" && \
-    make defconfig && \
-    make xen.config && \
-    scripts/config --enable BRIDGE && \
-    scripts/config --enable IGC && \
-    scripts/config --enable TUN && \
-    cp .config .config.orig && \
-    cat .config.orig | grep XEN | grep =m |sed 's/=m/=y/g' >> .config && \
-    make -j$(nproc) bzImage && \
-    cp arch/x86/boot/bzImage / && \
-    cd /build && \
-    rm -rf linux-"$LINUX_VERSION"*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 10 18:55:12 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Apr 2025 18:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.946191.1344166 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2x3Q-00019c-Jo; Thu, 10 Apr 2025 18:55:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 946191.1344166; Thu, 10 Apr 2025 18: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 1u2x3Q-00019U-HJ; Thu, 10 Apr 2025 18:55:12 +0000
Received: by outflank-mailman (input) for mailman id 946191;
 Thu, 10 Apr 2025 18: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 1u2x3P-00019O-TF
 for xen-changelog@lists.xenproject.org; Thu, 10 Apr 2025 18: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 1u2x3P-006XGF-2p
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 18:55:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2x3P-00HCYI-2h
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 18: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=AdODFXTLz8nmhPSWUHq4Ow1brnmIo/7R3ffU4gYD64A=; b=Ijw2+jdMn83EW7D1RaG1xwz85e
	NdZ3qGDaKDrIHooqknljiQ6SYc0aH/ue2mfV66WBkGrkhtRobDycJ2jrPHGezVDFO370OtvtXeIql
	jt3+C//NcDI+qd8d3778c2ywnmt+l4bJRgyiy8wJhDQp609X46gA9R+we/qYMfk69fkg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: Update ARM64 tests from Linux 6.6.74 to 6.6.86
Message-Id: <E1u2x3P-00HCYI-2h@xenbits.xenproject.org>
Date: Thu, 10 Apr 2025 18:55:11 +0000

commit 8b22309c9bae2cb0717651b8b71feb86d8b203f8
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Apr 9 17:22:54 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Apr 10 18:01:57 2025 +0100

    CI: Update ARM64 tests from Linux 6.6.74 to 6.6.86
    
    Switch over to test-artifacts.
    
    Drop the associated export job, and dockerfile.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 automation/gitlab-ci/build.yaml                    | 11 -------
 automation/gitlab-ci/test.yaml                     |  4 ++-
 .../kernel/6.6.74-arm64v8.dockerfile               | 38 ----------------------
 3 files changed, 3 insertions(+), 50 deletions(-)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index ab758243c1..40dcd31f1b 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -275,17 +275,6 @@ alpine-3.18-arm64-rootfs-export:
   tags:
     - arm64
 
-kernel-6.6.74-arm64-export:
-  extends: .test-jobs-artifact-common
-  image: registry.gitlab.com/xen-project/xen/tests-artifacts/kernel:6.6.74-arm64v8
-  script:
-    - mkdir binaries && cp /Image binaries/Image
-  artifacts:
-    paths:
-      - binaries/Image
-  tags:
-    - arm64
-
 qemu-system-aarch64-6.0.0-arm64-export:
   extends: .test-jobs-artifact-common
   image: registry.gitlab.com/xen-project/xen/tests-artifacts/qemu-system-aarch64:6.0.0-arm64v8
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index a23ff8a6e7..59a2de28c8 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -8,8 +8,10 @@
   - when: on_success
 
 .arm64-test-needs: &arm64-test-needs
+  - project: xen-project/hardware/test-artifacts
+    job: linux-6.6.86-arm64
+    ref: master
   - alpine-3.18-arm64-rootfs-export
-  - kernel-6.6.74-arm64-export
   - qemu-system-aarch64-6.0.0-arm64-export
 
 .arm32-test-needs: &arm32-test-needs
diff --git a/automation/tests-artifacts/kernel/6.6.74-arm64v8.dockerfile b/automation/tests-artifacts/kernel/6.6.74-arm64v8.dockerfile
deleted file mode 100644
index 73e5145425..0000000000
--- a/automation/tests-artifacts/kernel/6.6.74-arm64v8.dockerfile
+++ /dev/null
@@ -1,38 +0,0 @@
-# syntax=docker/dockerfile:1
-FROM --platform=linux/arm64/v8 debian:bookworm
-LABEL maintainer.name="The Xen Project" \
-      maintainer.email="xen-devel@lists.xenproject.org"
-
-ENV DEBIAN_FRONTEND=noninteractive
-ENV LINUX_VERSION=6.6.74
-ENV USER root
-
-RUN mkdir /build
-WORKDIR /build
-
-# build depends
-RUN apt-get update && \
-    apt-get --quiet --yes install \
-        build-essential \
-        bc \
-        curl \
-        flex \
-        bison \
-        libssl-dev \
-        && \
-    \
-    # Build the kernel
-    curl -fsSLO https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-"$LINUX_VERSION".tar.xz && \
-    tar xvJf linux-"$LINUX_VERSION".tar.xz && \
-    cd linux-"$LINUX_VERSION" && \
-    make defconfig && \
-    sed -i 's/CONFIG_IPV6=m/CONFIG_IPV6=y/g' .config && \
-    sed -i 's/CONFIG_BRIDGE=m/CONFIG_BRIDGE=y/g' .config && \
-    sed -i 's/# CONFIG_XEN_NETDEV_BACKEND is not set/CONFIG_XEN_NETDEV_BACKEND=y/g' .config && \
-    make -j$(nproc) Image.gz && \
-    cp arch/arm64/boot/Image / && \
-    cd /build && \
-    rm -rf linux-"$LINUX_VERSION"* && \
-    apt-get autoremove -y && \
-    apt-get clean && \
-    rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 10 18:55:22 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Apr 2025 18:55:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.946194.1344169 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u2x3a-0001CM-LI; Thu, 10 Apr 2025 18:55:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 946194.1344169; Thu, 10 Apr 2025 18: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 1u2x3a-0001CE-Ii; Thu, 10 Apr 2025 18:55:22 +0000
Received: by outflank-mailman (input) for mailman id 946194;
 Thu, 10 Apr 2025 18:55:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u2x3a-0001C8-0H
 for xen-changelog@lists.xenproject.org; Thu, 10 Apr 2025 18:55:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2x3Z-006XGJ-36
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 18:55:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u2x3Z-00HCZp-2z
 for xen-changelog@lists.xenproject.org;
 Thu, 10 Apr 2025 18: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=Iu75/fXTnRG4yJ5gSwqzbsSEopozI5UCHzucZlXSmX8=; b=IYokVteVK+CpuoDr328t0h1qrG
	nDorPelcauBPhWrjM+jPQmHDd2cJxfRsLQxSOjd/6izdqlHGtngc2xqZP2zj57Vzfiv9rMfNwUx2p
	yEPABENWHoOnZjUO2XcvY8gpW090WyTiq4MlWxcKpbrQlAyyufDsciwJO9+e4ziovQuM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: Drop stale test-artifacts/alpine/3.18.dockerfile
Message-Id: <E1u2x3Z-00HCZp-2z@xenbits.xenproject.org>
Date: Thu, 10 Apr 2025 18:55:21 +0000

commit 424d20afae9a0d85c17e9dec3922af6448929b8c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Apr 7 18:15:32 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Apr 10 18:01:57 2025 +0100

    CI: Drop stale test-artifacts/alpine/3.18.dockerfile
    
    This should have been dropped too, as the authoritative copy lives in another
    repo now.
    
    Fixes: babe11b46c1a ("CI: Drop alpine-3.18-rootfs-export and use test-artefacts")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 automation/tests-artifacts/alpine/3.18.dockerfile | 67 -----------------------
 1 file changed, 67 deletions(-)

diff --git a/automation/tests-artifacts/alpine/3.18.dockerfile b/automation/tests-artifacts/alpine/3.18.dockerfile
deleted file mode 100644
index 311a92889b..0000000000
--- a/automation/tests-artifacts/alpine/3.18.dockerfile
+++ /dev/null
@@ -1,67 +0,0 @@
-# syntax=docker/dockerfile:1
-FROM --platform=linux/amd64 alpine:3.18
-LABEL maintainer.name="The Xen Project" \
-      maintainer.email="xen-devel@lists.xenproject.org"
-
-ENV USER root
-
-RUN mkdir /build
-WORKDIR /build
-
-RUN \
-  # apk
-  apk update && \
-  \
-  # xen runtime deps
-  apk add musl && \
-  apk add libgcc && \
-  apk add openrc && \
-  apk add busybox && \
-  apk add sudo && \
-  apk add dbus && \
-  apk add bash && \
-  apk add python3 && \
-  apk add zlib && \
-  apk add ncurses && \
-  apk add yajl && \
-  apk add libaio && \
-  apk add xz && \
-  apk add util-linux && \
-  apk add argp-standalone && \
-  apk add libfdt && \
-  apk add glib && \
-  apk add pixman && \
-  apk add curl && \
-  apk add udev && \
-  apk add pciutils && \
-  apk add libelf && \
-  \
-  # Xen
-  cd / && \
-  # Minimal ramdisk environment in case of cpio output
-  rc-update add udev && \
-  rc-update add udev-trigger && \
-  rc-update add udev-settle && \
-  rc-update add loopback sysinit && \
-  rc-update add bootmisc boot && \
-  rc-update add devfs sysinit && \
-  rc-update add dmesg sysinit && \
-  rc-update add hostname boot && \
-  rc-update add hwclock boot && \
-  rc-update add hwdrivers sysinit && \
-  rc-update add modules boot && \
-  rc-update add killprocs shutdown && \
-  rc-update add mount-ro shutdown && \
-  rc-update add savecache shutdown && \
-  rc-update add local default && \
-  cp -a /sbin/init /init && \
-  echo "ttyS0" >> /etc/securetty && \
-  echo "hvc0" >> /etc/securetty && \
-  echo "ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100" >> /etc/inittab && \
-  echo "hvc0::respawn:/sbin/getty -L hvc0 115200 vt100" >> /etc/inittab && \
-  echo > /etc/modules && \
-  passwd -d "root" root && \
-  \
-  # Create rootfs
-  cd / && \
-  tar cvzf /initrd.tar.gz bin dev etc home init lib mnt opt root sbin usr var
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 10:11:08 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 10:11:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.946977.1344689 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3BLj-00080V-D3; Fri, 11 Apr 2025 10:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 946977.1344689; Fri, 11 Apr 2025 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 1u3BLj-00080N-A5; Fri, 11 Apr 2025 10:11:03 +0000
Received: by outflank-mailman (input) for mailman id 946977;
 Fri, 11 Apr 2025 10: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 1u3BLh-00080B-MY
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 10: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 1u3BLh-008M0N-1M
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 10:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3BLh-0099YZ-1B
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 10: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=rgCunfU+4IJBHpxKD3yLPtFLwuW6Yn6nK8M2/aFtD/8=; b=xUXFnCibWmtua9I6YD7WoQPUjM
	HXVMMnmeqeNKh1R/zLPbMtqoKOYBr+P+8ykAyXdgjmz2iMvN7Z/ErZtPV0srdB5fpFwbii3hiueSG
	ma4tbVSAT7hA7OfjtXzNR19RH9MFD+h6u4tZGK9p0Uh5JDSmEPk8zIUteLmd7YnM7CjU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] automation/eclair: Remove bespoke service B.UNEVALEFF
Message-Id: <E1u3BLh-0099YZ-1B@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 10:11:01 +0000

commit a43b0a770bdcf3933634c860049e4bd65854e472
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Thu Apr 10 21:32:14 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 11:01:05 2025 +0100

    automation/eclair: Remove bespoke service B.UNEVALEFF
    
    The Eclair runners in GitlabCI have been update.  This service is now
    included, and redefining results in an error.
    
    No functional change.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/eclair_analysis/ECLAIR/B.UNEVALEFF.ecl | 10 ----------
 automation/eclair_analysis/ECLAIR/analysis.ecl    |  1 -
 2 files changed, 11 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/B.UNEVALEFF.ecl b/automation/eclair_analysis/ECLAIR/B.UNEVALEFF.ecl
deleted file mode 100644
index fa249b8e36..0000000000
--- a/automation/eclair_analysis/ECLAIR/B.UNEVALEFF.ecl
+++ /dev/null
@@ -1,10 +0,0 @@
--clone_service=MC3A2.R13.6,B.UNEVALEFF
-
--config=B.UNEVALEFF,summary="The operand of the `alignof' and `typeof'  operators shall not contain any expression which has potential side effects"
--config=B.UNEVALEFF,stmt_child_matcher=
-{"stmt(node(utrait_expr)&&operator(alignof))", expr, 0, "stmt(any())", {}},
-{"stmt(node(utrait_type)&&operator(alignof))", type, 0, "stmt(any())", {}},
-{"stmt(node(utrait_expr)&&operator(preferred_alignof))", expr, 0, "stmt(any())", {}},
-{"stmt(node(utrait_type)&&operator(preferred_alignof))", type, 0, "stmt(any())", {}},
-{"type(node(typeof_expr))", expr, 0, "stmt(any())", {}},
-{"type(node(typeof_type))", type, 0, "stmt(any())", {}}
diff --git a/automation/eclair_analysis/ECLAIR/analysis.ecl b/automation/eclair_analysis/ECLAIR/analysis.ecl
index 29409a9af0..399099938f 100644
--- a/automation/eclair_analysis/ECLAIR/analysis.ecl
+++ b/automation/eclair_analysis/ECLAIR/analysis.ecl
@@ -50,7 +50,6 @@ their Standard Library equivalents."
 -eval_file=adopted.ecl
 -eval_file=out_of_scope.ecl
 
--eval_file=B.UNEVALEFF.ecl
 -eval_file=deviations.ecl
 -eval_file=call_properties.ecl
 -eval_file=tagging.ecl
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 10:22:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 10:22:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.946985.1344698 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3BWO-0004Xa-63; Fri, 11 Apr 2025 10:22:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 946985.1344698; Fri, 11 Apr 2025 10:22:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3BWO-0004XT-3U; Fri, 11 Apr 2025 10:22:04 +0000
Received: by outflank-mailman (input) for mailman id 946985;
 Fri, 11 Apr 2025 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 1u3BWM-0004XN-1K
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 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 1u3BWL-008MIA-2u
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 10:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3BWL-009P5j-2f
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 10:22:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8dj0kYuYzdWAGZ+Xcxoa39XDqdDgCg8gb+FjIkqgs2k=; b=T7hFmGVVPaXGL1wQ+7JSslLqLV
	DvVs38N1FDeXnKwmslPJVloONmXg2Ny+RpWXHrv785fZZM/FZKnSJaLm6h6OenSFYt6sVP/nh1MPo
	z4kiSc3YBJy0Mz1F5+vfF5fLN6qhD+8qm1VZwHHg71cIbl7m5+mjqtGp/XHuwM9Phe3M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] automation/eclair: Remove bespoke service B.UNEVALEFF
Message-Id: <E1u3BWL-009P5j-2f@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 10:22:01 +0000

commit c413eff3c5cb11f489d66612b6c7acf93754ae88
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Thu Apr 10 21:32:14 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 11:06:37 2025 +0100

    automation/eclair: Remove bespoke service B.UNEVALEFF
    
    The Eclair runners in GitlabCI have been update.  This service is now
    included, and redefining results in an error.
    
    No functional change.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit a43b0a770bdcf3933634c860049e4bd65854e472)
---
 automation/eclair_analysis/ECLAIR/B.UNEVALEFF.ecl | 10 ----------
 automation/eclair_analysis/ECLAIR/analysis.ecl    |  1 -
 2 files changed, 11 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/B.UNEVALEFF.ecl b/automation/eclair_analysis/ECLAIR/B.UNEVALEFF.ecl
deleted file mode 100644
index fa249b8e36..0000000000
--- a/automation/eclair_analysis/ECLAIR/B.UNEVALEFF.ecl
+++ /dev/null
@@ -1,10 +0,0 @@
--clone_service=MC3A2.R13.6,B.UNEVALEFF
-
--config=B.UNEVALEFF,summary="The operand of the `alignof' and `typeof'  operators shall not contain any expression which has potential side effects"
--config=B.UNEVALEFF,stmt_child_matcher=
-{"stmt(node(utrait_expr)&&operator(alignof))", expr, 0, "stmt(any())", {}},
-{"stmt(node(utrait_type)&&operator(alignof))", type, 0, "stmt(any())", {}},
-{"stmt(node(utrait_expr)&&operator(preferred_alignof))", expr, 0, "stmt(any())", {}},
-{"stmt(node(utrait_type)&&operator(preferred_alignof))", type, 0, "stmt(any())", {}},
-{"type(node(typeof_expr))", expr, 0, "stmt(any())", {}},
-{"type(node(typeof_type))", type, 0, "stmt(any())", {}}
diff --git a/automation/eclair_analysis/ECLAIR/analysis.ecl b/automation/eclair_analysis/ECLAIR/analysis.ecl
index 824283a989..8326156b38 100644
--- a/automation/eclair_analysis/ECLAIR/analysis.ecl
+++ b/automation/eclair_analysis/ECLAIR/analysis.ecl
@@ -52,7 +52,6 @@ their Standard Library equivalents."
 -eval_file=adopted.ecl
 -eval_file=out_of_scope.ecl
 
--eval_file=B.UNEVALEFF.ecl
 -eval_file=deviations.ecl
 -eval_file=call_properties.ecl
 -eval_file=tagging.ecl
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 10:22:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 10:22:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.946987.1344702 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3BWY-000524-7M; Fri, 11 Apr 2025 10:22:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 946987.1344702; Fri, 11 Apr 2025 10: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 1u3BWY-00051w-4s; Fri, 11 Apr 2025 10:22:14 +0000
Received: by outflank-mailman (input) for mailman id 946987;
 Fri, 11 Apr 2025 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 1u3BWW-00051h-6p
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 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 1u3BWW-008MIG-0a
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 10:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3BWW-009PMz-0R
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 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=8eSE2xexr+u3ZtkHopZ2ySuehwYTuYa6tgucPzYHvQM=; b=2yL3TiVXOkwvyGHS4X5piVTf6R
	rj89UpnhH0VCpkJhDhpYhJqIVeP9QdYRxVehLWFVcnulOTPH3fH+J6WFZOdHhc1tE0VtNg1OO6uup
	ahkrG62h2nsELUquFuKfPHA7+Pe8nsTFO+W3pCa8SujO7+uWFipd+sxZyJ9UNCkpTIU0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] automation/eclair: Remove bespoke service B.UNEVALEFF
Message-Id: <E1u3BWW-009PMz-0R@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 10:22:12 +0000

commit cfea30c0084e1b57e9a7fc90d32ef1eb40c7e186
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Thu Apr 10 21:32:14 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 11:07:07 2025 +0100

    automation/eclair: Remove bespoke service B.UNEVALEFF
    
    The Eclair runners in GitlabCI have been update.  This service is now
    included, and redefining results in an error.
    
    No functional change.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit a43b0a770bdcf3933634c860049e4bd65854e472)
---
 automation/eclair_analysis/ECLAIR/B.UNEVALEFF.ecl | 10 ----------
 automation/eclair_analysis/ECLAIR/analysis.ecl    |  1 -
 2 files changed, 11 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/B.UNEVALEFF.ecl b/automation/eclair_analysis/ECLAIR/B.UNEVALEFF.ecl
deleted file mode 100644
index fa249b8e36..0000000000
--- a/automation/eclair_analysis/ECLAIR/B.UNEVALEFF.ecl
+++ /dev/null
@@ -1,10 +0,0 @@
--clone_service=MC3A2.R13.6,B.UNEVALEFF
-
--config=B.UNEVALEFF,summary="The operand of the `alignof' and `typeof'  operators shall not contain any expression which has potential side effects"
--config=B.UNEVALEFF,stmt_child_matcher=
-{"stmt(node(utrait_expr)&&operator(alignof))", expr, 0, "stmt(any())", {}},
-{"stmt(node(utrait_type)&&operator(alignof))", type, 0, "stmt(any())", {}},
-{"stmt(node(utrait_expr)&&operator(preferred_alignof))", expr, 0, "stmt(any())", {}},
-{"stmt(node(utrait_type)&&operator(preferred_alignof))", type, 0, "stmt(any())", {}},
-{"type(node(typeof_expr))", expr, 0, "stmt(any())", {}},
-{"type(node(typeof_type))", type, 0, "stmt(any())", {}}
diff --git a/automation/eclair_analysis/ECLAIR/analysis.ecl b/automation/eclair_analysis/ECLAIR/analysis.ecl
index 824283a989..8326156b38 100644
--- a/automation/eclair_analysis/ECLAIR/analysis.ecl
+++ b/automation/eclair_analysis/ECLAIR/analysis.ecl
@@ -52,7 +52,6 @@ their Standard Library equivalents."
 -eval_file=adopted.ecl
 -eval_file=out_of_scope.ecl
 
--eval_file=B.UNEVALEFF.ecl
 -eval_file=deviations.ecl
 -eval_file=call_properties.ecl
 -eval_file=tagging.ecl
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 10:33:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 10:33:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.946989.1344705 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3Bh1-0008KR-0F; Fri, 11 Apr 2025 10:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 946989.1344705; Fri, 11 Apr 2025 10: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 1u3Bh0-0008KJ-Tr; Fri, 11 Apr 2025 10:33:02 +0000
Received: by outflank-mailman (input) for mailman id 946989;
 Fri, 11 Apr 2025 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 1u3Bh0-0008KD-0p
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 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 1u3Bgz-008MWK-2B
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 10:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3Bgz-009dWZ-1w
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 10: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=5zMXVhTpAlMgjRdmA7tVvcoIooR/a77sibH2g7w2Aek=; b=joqWHNVBfRuFNjG6u028ogC/D0
	pxAoD2EXC5DcGBRNySjw6N2Y9HERo+0Jg/2QIAH+aS7GrFEycC9pZeLhEnJPPJUjbPbSGjrtxOUnk
	QIcunXODtBDMD/3XJLM5B91T61T/YeoJMY/bE0z56q6a0pFw2aCH6Rclv1zczsTVTnwU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/rangeset: fix incorrect subtraction
Message-Id: <E1u3Bgz-009dWZ-1w@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 10:33:01 +0000

commit e118fc98e7ae652a188d227bd7ea22f132724150
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Apr 2 18:50:46 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Fri Apr 11 12:20:10 2025 +0200

    xen/rangeset: fix incorrect subtraction
    
    Given the following rangset operation:
    
    { [0, 1], [4, 5] } - { [3, 4] }
    
    The current rangeset logic will output a rangeset:
    
    { [0, 2], [5, 5] }
    
    This is incorrect, and also has the undesirable property of being bogus in
    a way that the resulting rangeset is expanded.
    
    Fix this by making sure the bounds are correctly checked before modifying
    the previous range.
    
    Fixes: 484a058c4828 ('Add auto-destructing per-domain rangeset data structure...')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/rangeset.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/common/rangeset.c b/xen/common/rangeset.c
index b75590f907..e758710390 100644
--- a/xen/common/rangeset.c
+++ b/xen/common/rangeset.c
@@ -227,7 +227,8 @@ int rangeset_remove_range(
 
         if ( x->s < s )
         {
-            x->e = s - 1;
+            if ( x->e >= s )
+                x->e = s - 1;
             x = next_range(r, x);
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 10:33:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 10:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.946990.1344710 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3BhB-0008MM-2X; Fri, 11 Apr 2025 10:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 946990.1344710; Fri, 11 Apr 2025 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 1u3BhA-0008ME-VQ; Fri, 11 Apr 2025 10:33:12 +0000
Received: by outflank-mailman (input) for mailman id 946990;
 Fri, 11 Apr 2025 10:33:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u3Bh9-0008Lx-Py
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 10:33:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3Bh9-008MWP-2U
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 10:33:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3Bh9-009dqS-2N
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 10:33:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=f48WLmXyhAVMf1gooW4AVYIguMZ/qDRdTyoEQAj3Mfw=; b=ys5wMzOHiATMvU7NKuSvEB3o60
	td9OH7PI77R85XBkSFZnSl+TUPdhXxZlsENd3DOMyP26TkI/6fLh2qczT/e30muWLZ/D70unAOeWe
	EBzRLxaVMCG95WrzNBCGRjLVbCDLKXasGWW9BjT7THsn1onqdOP0rUG4fAuHqbMDEF6M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tootls/tests: introduce unit tests for rangesets
Message-Id: <E1u3Bh9-009dqS-2N@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 10:33:11 +0000

commit 7bf777b42cade81d4f20f78cb85c4bc0f638de7b
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Apr 3 10:43:42 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Fri Apr 11 12:20:10 2025 +0200

    tootls/tests: introduce unit tests for rangesets
    
    Introduce some basic infrastructure for doing rangeset unit tests, and add
    a few tests that ensure correctness of rangeset subtraction.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 tools/tests/Makefile                 |   1 +
 tools/tests/rangeset/Makefile        |  46 +++++++
 tools/tests/rangeset/harness.h       |  71 +++++++++++
 tools/tests/rangeset/test-rangeset.c | 228 +++++++++++++++++++++++++++++++++++
 4 files changed, 346 insertions(+)

diff --git a/tools/tests/Makefile b/tools/tests/Makefile
index 1319c3a9d8..3e60ab6b26 100644
--- a/tools/tests/Makefile
+++ b/tools/tests/Makefile
@@ -10,6 +10,7 @@ SUBDIRS-$(CONFIG_X86) += x86_emulator
 endif
 SUBDIRS-y += xenstore
 SUBDIRS-y += depriv
+SUBDIRS-y += rangeset
 SUBDIRS-y += vpci
 SUBDIRS-y += paging-mempool
 
diff --git a/tools/tests/rangeset/Makefile b/tools/tests/rangeset/Makefile
new file mode 100644
index 0000000000..70076eff34
--- /dev/null
+++ b/tools/tests/rangeset/Makefile
@@ -0,0 +1,46 @@
+XEN_ROOT=$(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+TARGET := test-rangeset
+
+.PHONY: all
+all: $(TARGET)
+
+.PHONY: run
+run: $(TARGET)
+	./$<
+
+.PHONY: clean
+clean:
+	$(RM) -- *.o $(TARGET) $(DEPS_RM)
+
+.PHONY: distclean
+distclean: clean
+	$(RM) -- *~
+
+.PHONY: install
+install: all
+	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+	$(INSTALL_PROG) $(TARGET) $(DESTDIR)$(LIBEXEC_BIN)
+
+.PHONY: uninstall
+uninstall:
+	$(RM) -- $(addprefix $(DESTDIR)$(LIBEXEC_BIN)/,$(TARGET))
+
+list.h: $(XEN_ROOT)/xen/include/xen/list.h
+rangeset.h: $(XEN_ROOT)/xen/include/xen/rangeset.h
+list.h rangeset.h:
+	sed -e '/#include/d' <$< >$@
+
+rangeset.c: $(XEN_ROOT)/xen/common/rangeset.c list.h rangeset.h
+	# Remove includes and add the test harness header
+	sed -e '/#include/d' -e '1s/^/#include "harness.h"/' <$< >$@
+
+CFLAGS += -D__XEN_TOOLS__
+CFLAGS += $(APPEND_CFLAGS)
+CFLAGS += $(CFLAGS_xeninclude)
+
+LDFLAGS += $(APPEND_LDFLAGS)
+
+test-rangeset: rangeset.o test-rangeset.o
+	$(CC) $^ -o $@ $(LDFLAGS)
diff --git a/tools/tests/rangeset/harness.h b/tools/tests/rangeset/harness.h
new file mode 100644
index 0000000000..a60ebff72d
--- /dev/null
+++ b/tools/tests/rangeset/harness.h
@@ -0,0 +1,71 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Unit tests for rangesets.
+ *
+ * Copyright (C) 2025 Cloud Software Group
+ */
+
+#ifndef _TEST_HARNESS_
+#define _TEST_HARNESS_
+
+#include <assert.h>
+#include <errno.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <xen-tools/common-macros.h>
+
+#define smp_wmb()
+#define __must_check __attribute__((__warn_unused_result__))
+#define cf_check
+
+#define BUG_ON(x) assert(!(x))
+#define ASSERT(x) assert(x)
+
+#include "list.h"
+#include "rangeset.h"
+
+typedef bool rwlock_t;
+typedef bool spinlock_t;
+
+struct domain {
+    unsigned int     domain_id;
+    struct list_head rangesets;
+    spinlock_t       rangesets_lock;
+};
+
+/* For rangeset_domain_{initialize,printk}() */
+#define spin_lock_init(l) (*(l) = false)
+#define spin_lock(l)      (*(l) = true)
+#define spin_unlock(l)    (*(l) = false)
+
+/* For rangeset->lock */
+#define rwlock_init(l)    (*(l) = false)
+#define read_lock(l)      (*(l) = true)
+#define read_unlock(l)    (*(l) = false)
+#define write_lock(l)     (*(l) = true)
+#define write_unlock(l)   (*(l) = false)
+
+#define xmalloc(type) ((type *)malloc(sizeof(type)))
+#define xfree free
+
+#define unlikely
+
+#define safe_strcpy strcpy
+
+#define printk printf
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/tests/rangeset/test-rangeset.c b/tools/tests/rangeset/test-rangeset.c
new file mode 100644
index 0000000000..8b580e14eb
--- /dev/null
+++ b/tools/tests/rangeset/test-rangeset.c
@@ -0,0 +1,228 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Unit tests for rangesets.
+ *
+ * Copyright (C) 2025 Cloud Software Group
+ */
+
+#include "harness.h"
+
+struct range {
+    unsigned long start, end;
+};
+
+struct action {
+    enum {
+        ADD,
+        REMOVE,
+    } action;
+    struct range r;
+};
+
+#define DECLARE_ACTIONS(nr) static const struct action actions ## nr []
+#define DECLARE_RESULTS(nr) static const struct range results ## nr []
+
+/*
+ * Subtract range with tail overlap on existing range:
+ *
+ * { 0, 1, 4, 5 } - { 3, 4 } = { 0, 1, 5, 5 }
+ */
+DECLARE_ACTIONS(0) = {
+    { ADD,    { 0, 1 } },
+    { ADD,    { 4, 5 } },
+    { REMOVE, { 3, 4 } },
+};
+DECLARE_RESULTS(0) = {
+    { 0, 1 }, { 5, 5 },
+};
+
+/*
+ * Subtract range with complete and tail overlap on existing ranges:
+ *
+ * { 0, 1, 4, 5, 7, 8 } - { 3, 4, 5, 6, 7 } = { 0, 1, 8 }
+ */
+DECLARE_ACTIONS(1) = {
+    { ADD,    { 0, 1 } },
+    { ADD,    { 4, 5 } },
+    { ADD,    { 7, 8 } },
+    { REMOVE, { 3, 7 } },
+};
+DECLARE_RESULTS(1) = {
+    { 0, 1 }, { 8, 8 },
+};
+
+/*
+ * Subtract range with no overlap:
+ *
+ * { 0, 1, 4, 5 } - { 2, 3 } = { 0, 1, 4, 5 }
+ */
+DECLARE_ACTIONS(2) = {
+    { ADD,    { 0, 1 } },
+    { ADD,    { 4, 5 } },
+    { REMOVE, { 2, 3 } },
+};
+DECLARE_RESULTS(2) = {
+    { 0, 1 }, { 4, 5 },
+};
+
+/*
+ * Subtract range with partial overlap on two existing ranges:
+ *
+ * { 0, 1, 4, 5 } - { 1, 4 } = { 0, 5 }
+ */
+DECLARE_ACTIONS(3) = {
+    { ADD,    { 0, 1 } },
+    { ADD,    { 4, 5 } },
+    { REMOVE, { 1, 4 } },
+};
+DECLARE_RESULTS(3) = {
+    { 0, 0 }, { 5, 5 },
+};
+
+static const struct test {
+    unsigned int nr_actions, nr_results;
+    const struct action *actions;
+    const struct range *result;
+} tests[] = {
+#define DECLARE_TEST(nr)                                \
+    {                                                   \
+        .actions = actions ## nr,                       \
+        .nr_actions = ARRAY_SIZE(actions ## nr),        \
+        .result  = results ## nr,                       \
+        .nr_results = ARRAY_SIZE(results ## nr),        \
+    }
+
+    DECLARE_TEST(0),
+    DECLARE_TEST(1),
+    DECLARE_TEST(2),
+    DECLARE_TEST(3),
+
+#undef DECLARE_TEST
+};
+
+static int print_range(unsigned long s, unsigned long e, void *data)
+{
+    printf("[%ld, %ld]\n", s, e);
+
+    return 0;
+}
+
+static int count_ranges(unsigned long s, unsigned long e, void *data)
+{
+    unsigned int *nr = data;
+
+    ++*nr;
+    return 0;
+}
+
+static const struct range *expected;
+static int check_ranges(unsigned long s, unsigned long e, void *data)
+{
+    unsigned int *nr = data;
+    int rc = 0;
+
+    if ( s != expected[*nr].start || e != expected[*nr].end )
+        rc = -EINVAL;
+
+    ++*nr;
+    return rc;
+}
+
+static void print_both(struct rangeset *r, const struct range *expected,
+                       unsigned int nr_expected)
+{
+    unsigned int i;
+
+    printf("Result:\n");
+    rangeset_report_ranges(r, 0, ~0UL, print_range, NULL);
+    printf("Expected:\n");
+    for ( i = 0; i < nr_expected; i++ )
+        printf("[%ld, %ld]\n", expected[i].start, expected[i].end);
+}
+
+int main(int argc, char **argv)
+{
+    struct rangeset *r = rangeset_new(NULL, NULL, 0);
+    unsigned int i;
+    int ret_code = 0;
+
+    ASSERT(r);
+
+    for ( i = 0 ; i < ARRAY_SIZE(tests); i++ )
+    {
+        unsigned int j, nr = 0;
+        int rc = 0;
+
+        rangeset_purge(r);
+        for ( j = 0; j < tests[i].nr_actions; j++ )
+        {
+            const struct action *a = &tests[i].actions[j];
+
+            switch ( a->action )
+            {
+            case ADD:
+                rc = rangeset_add_range(r, a->r.start, a->r.end);
+                break;
+
+            case REMOVE:
+                rc = rangeset_remove_range(r, a->r.start, a->r.end);
+                break;
+            }
+
+            if ( rc )
+            {
+                printf("Test %u failed to %s range [%ld, %ld]\n",
+                       i, a->action == ADD ? "add" : "remove",
+                       a->r.start, a->r.end);
+                rangeset_report_ranges(r, 0, ~0UL, print_range, NULL);
+                break;
+            }
+        }
+
+        if ( rc )
+        {
+            /* Action failed, skip this test and set exit code to failure. */
+            ret_code = EXIT_FAILURE;
+            continue;
+        }
+
+        rc = rangeset_report_ranges(r, 0, ~0UL, count_ranges, &nr);
+        if ( rc )
+        {
+            printf("Test %u unable to count number of result ranges\n", i);
+            rangeset_report_ranges(r, 0, ~0UL, print_range, NULL);
+            ret_code = EXIT_FAILURE;
+            continue;
+        }
+        if ( nr != tests[i].nr_results )
+        {
+            printf("Test %u unexpected number of result ranges, expected: %u got: %u\n",
+                   i, tests[i].nr_results, nr);
+            print_both(r, tests[i].result, tests[i].nr_results);
+            ret_code = EXIT_FAILURE;
+            continue;
+        }
+
+        nr = 0;
+        expected = tests[i].result;
+        rc = rangeset_report_ranges(r, 0, ~0UL, check_ranges, &nr);
+        if ( rc )
+        {
+            printf("Test %u range checking failed\n", i);
+            print_both(r, tests[i].result, tests[i].nr_results);
+            ret_code = EXIT_FAILURE;
+            continue;
+        }
+    }
+
+    return 0;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 11:55:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 11:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947269.1344928 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3CyN-0005eD-74; Fri, 11 Apr 2025 11:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947269.1344928; Fri, 11 Apr 2025 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 1u3CyN-0005e5-4Q; Fri, 11 Apr 2025 11:55:03 +0000
Received: by outflank-mailman (input) for mailman id 947269;
 Fri, 11 Apr 2025 11: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 1u3CyL-0005dz-PA
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 11: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 1u3CyL-008OM1-17
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 11:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3CyL-00AovF-0t
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 11: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=OEPfDotqHqbhoCwjDFhEEyStGfYkE9GA48Dbz5GkK48=; b=wH+glHai9135OXB+P4uwdOnuxe
	6HSj0fZe+aiz8fHkdIREtFjWw/FuvflB+h+VVu9bZPjpharHuyfBco9xJzC5e+S/8X6HYKGyyyYKf
	Ie7pXyM8njj4yWaeCNIYYFzfOYSd/1hAqG0O33zcNAxSkBUJi2yK+ZZ6zpyygOa3UWYM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] automation/eclair: Remove bespoke service B.UNEVALEFF
Message-Id: <E1u3CyL-00AovF-0t@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 11:55:01 +0000

commit cfea30c0084e1b57e9a7fc90d32ef1eb40c7e186
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Thu Apr 10 21:32:14 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 11:07:07 2025 +0100

    automation/eclair: Remove bespoke service B.UNEVALEFF
    
    The Eclair runners in GitlabCI have been update.  This service is now
    included, and redefining results in an error.
    
    No functional change.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit a43b0a770bdcf3933634c860049e4bd65854e472)
---
 automation/eclair_analysis/ECLAIR/B.UNEVALEFF.ecl | 10 ----------
 automation/eclair_analysis/ECLAIR/analysis.ecl    |  1 -
 2 files changed, 11 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/B.UNEVALEFF.ecl b/automation/eclair_analysis/ECLAIR/B.UNEVALEFF.ecl
deleted file mode 100644
index fa249b8e36..0000000000
--- a/automation/eclair_analysis/ECLAIR/B.UNEVALEFF.ecl
+++ /dev/null
@@ -1,10 +0,0 @@
--clone_service=MC3A2.R13.6,B.UNEVALEFF
-
--config=B.UNEVALEFF,summary="The operand of the `alignof' and `typeof'  operators shall not contain any expression which has potential side effects"
--config=B.UNEVALEFF,stmt_child_matcher=
-{"stmt(node(utrait_expr)&&operator(alignof))", expr, 0, "stmt(any())", {}},
-{"stmt(node(utrait_type)&&operator(alignof))", type, 0, "stmt(any())", {}},
-{"stmt(node(utrait_expr)&&operator(preferred_alignof))", expr, 0, "stmt(any())", {}},
-{"stmt(node(utrait_type)&&operator(preferred_alignof))", type, 0, "stmt(any())", {}},
-{"type(node(typeof_expr))", expr, 0, "stmt(any())", {}},
-{"type(node(typeof_type))", type, 0, "stmt(any())", {}}
diff --git a/automation/eclair_analysis/ECLAIR/analysis.ecl b/automation/eclair_analysis/ECLAIR/analysis.ecl
index 824283a989..8326156b38 100644
--- a/automation/eclair_analysis/ECLAIR/analysis.ecl
+++ b/automation/eclair_analysis/ECLAIR/analysis.ecl
@@ -52,7 +52,6 @@ their Standard Library equivalents."
 -eval_file=adopted.ecl
 -eval_file=out_of_scope.ecl
 
--eval_file=B.UNEVALEFF.ecl
 -eval_file=deviations.ecl
 -eval_file=call_properties.ecl
 -eval_file=tagging.ecl
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 12:33:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 12:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947316.1344962 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3DZ8-0003PJ-ME; Fri, 11 Apr 2025 12:33:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947316.1344962; Fri, 11 Apr 2025 12: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 1u3DZ8-0003PB-Jc; Fri, 11 Apr 2025 12:33:02 +0000
Received: by outflank-mailman (input) for mailman id 947316;
 Fri, 11 Apr 2025 12: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 1u3DZ7-0003P5-L1
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 12: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 1u3DZ7-008PCE-1D
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 12:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3DZ7-00B2UY-13
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 12: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=6OkKzP8ofKhGLvzNcMqOz/fj+0vooG+ER5xn3z4wSKY=; b=yxaNTkDkmvKQ2qP2SSEorI21ZY
	+oKpNiK4aHnA5YfmBeGn441QzqysyUj7J8HqqYOpQHn25PEq7TMReCXOMe4bvrGQ0xwTRTyu9NXn7
	RbXJvJGKv1s354a7Gz3P6E3vkAJ1LNDWj3EqMlPmjhAxu7KS+As0/a19vALfCdHmPEeU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] automation/eclair: Remove bespoke service B.UNEVALEFF
Message-Id: <E1u3DZ7-00B2UY-13@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 12:33:01 +0000

commit c413eff3c5cb11f489d66612b6c7acf93754ae88
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Thu Apr 10 21:32:14 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 11:06:37 2025 +0100

    automation/eclair: Remove bespoke service B.UNEVALEFF
    
    The Eclair runners in GitlabCI have been update.  This service is now
    included, and redefining results in an error.
    
    No functional change.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit a43b0a770bdcf3933634c860049e4bd65854e472)
---
 automation/eclair_analysis/ECLAIR/B.UNEVALEFF.ecl | 10 ----------
 automation/eclair_analysis/ECLAIR/analysis.ecl    |  1 -
 2 files changed, 11 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/B.UNEVALEFF.ecl b/automation/eclair_analysis/ECLAIR/B.UNEVALEFF.ecl
deleted file mode 100644
index fa249b8e36..0000000000
--- a/automation/eclair_analysis/ECLAIR/B.UNEVALEFF.ecl
+++ /dev/null
@@ -1,10 +0,0 @@
--clone_service=MC3A2.R13.6,B.UNEVALEFF
-
--config=B.UNEVALEFF,summary="The operand of the `alignof' and `typeof'  operators shall not contain any expression which has potential side effects"
--config=B.UNEVALEFF,stmt_child_matcher=
-{"stmt(node(utrait_expr)&&operator(alignof))", expr, 0, "stmt(any())", {}},
-{"stmt(node(utrait_type)&&operator(alignof))", type, 0, "stmt(any())", {}},
-{"stmt(node(utrait_expr)&&operator(preferred_alignof))", expr, 0, "stmt(any())", {}},
-{"stmt(node(utrait_type)&&operator(preferred_alignof))", type, 0, "stmt(any())", {}},
-{"type(node(typeof_expr))", expr, 0, "stmt(any())", {}},
-{"type(node(typeof_type))", type, 0, "stmt(any())", {}}
diff --git a/automation/eclair_analysis/ECLAIR/analysis.ecl b/automation/eclair_analysis/ECLAIR/analysis.ecl
index 824283a989..8326156b38 100644
--- a/automation/eclair_analysis/ECLAIR/analysis.ecl
+++ b/automation/eclair_analysis/ECLAIR/analysis.ecl
@@ -52,7 +52,6 @@ their Standard Library equivalents."
 -eval_file=adopted.ecl
 -eval_file=out_of_scope.ecl
 
--eval_file=B.UNEVALEFF.ecl
 -eval_file=deviations.ecl
 -eval_file=call_properties.ecl
 -eval_file=tagging.ecl
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 13:11:11 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 13:11:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947400.1345017 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3E9v-0000UD-IC; Fri, 11 Apr 2025 13:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947400.1345017; Fri, 11 Apr 2025 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 1u3E9v-0000U5-FK; Fri, 11 Apr 2025 13:11:03 +0000
Received: by outflank-mailman (input) for mailman id 947400;
 Fri, 11 Apr 2025 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 1u3E9u-0000To-B4
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 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 1u3E9t-008Q50-3D
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 13:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3E9t-00BEJM-31
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 13: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=qnQEt1TJDcwPn8sbw1PfZ2NNvIad9KubsnmHDd2qxH8=; b=qDbbm518YqueiRu51M2BoAVBEN
	Id4JOKIOnrJGvyolRi2Jb0XgsiydJFRjo9rY+Z1+fwx0woPB7eF5niSm3ZvgajJqU7SOb4bkuUAaN
	2oa4kmMDZjF7sihibQ7cTGB6IepEAWvGY4Nh3H/FCv7zotHq8R00w3NsN+nA/lscj3L8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] tools/libxl: do not use `-c -E` compiler options together
Message-Id: <E1u3E9t-00BEJM-31@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 13:11:01 +0000

commit 95d726d28bc7b07709cbc09c324f66f5659e0429
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Apr 7 13:09:38 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 14:08:31 2025 +0100

    tools/libxl: do not use `-c -E` compiler options together
    
    It makes no sense to request for preprocessor only output and also request
    object file generation.  Fix the _libxl.api-for-check target to only use
    -E (preprocessor output).
    
    Also Clang 20.0 reports an error if both options are used.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Fixes: 2862bf5b6c81 ('libxl: enforce prohibitions of internal callers')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
    (cherry picked from commit a235f856e4bbd270b085590e1f5fc9599234dcdf)
---
 tools/libs/light/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
index 37e4d16709..b690d92159 100644
--- a/tools/libs/light/Makefile
+++ b/tools/libs/light/Makefile
@@ -195,7 +195,7 @@ libxl.api-ok: check-libxl-api-rules _libxl.api-for-check
 	touch $@
 
 _libxl.api-for-check: $(XEN_INCLUDE)/libxl.h
-	$(CC) $(CPPFLAGS) $(CFLAGS) -c -E $< $(APPEND_CFLAGS) \
+	$(CC) $(CPPFLAGS) $(CFLAGS) -E $< $(APPEND_CFLAGS) \
 		-DLIBXL_EXTERNAL_CALLERS_ONLY=LIBXL_EXTERNAL_CALLERS_ONLY \
 		>$@.new
 	mv -f $@.new $@
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 13:11:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 13:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947401.1345021 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3EA5-0000fI-JS; Fri, 11 Apr 2025 13:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947401.1345021; Fri, 11 Apr 2025 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 1u3EA5-0000ev-Gv; Fri, 11 Apr 2025 13:11:13 +0000
Received: by outflank-mailman (input) for mailman id 947401;
 Fri, 11 Apr 2025 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 1u3EA4-0000XX-3r
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 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 1u3EA4-008Q5B-0I
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 13:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3EA4-00BEMA-0A
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 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=Unavw9W6oSqY0pMl8VKh+iu74PO6bvwmZdhkurycOGw=; b=LLchAWl0QfUjDfnw7gDXD0k6hZ
	zdR92Gw2dQu/aM9nogDsPBacDlF8HbJUh0UIQz3eL741QPyWnzEd2WeAFMELI2GGpLwowY40WsUih
	qef/jaskY3cP6oRtCuMNeB+jA5y5X1pnKVS+7K03tX2iDT42H9/EAeqG7iNmxzW/kzaQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] xen/lib: Introduce SHA2-256
Message-Id: <E1u3EA4-00BEMA-0A@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 13:11:12 +0000

commit 41d65b31146bef22eef16a5ea6cdbe5041985f4f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Dec 13 14:34:00 2024 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 14:08:31 2025 +0100

    xen/lib: Introduce SHA2-256
    
    A future change will need to calculate SHA2-256 digests.  Introduce an
    implementation in lib/, derived from Trenchboot which itself is derived from
    Linux.
    
    In order to be useful to other architectures, it is careful with endianness
    and misaligned accesses as well as being more MISRA friendly, but is only
    wired up for x86 in the short term.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 372af524411f5a013bcb0b117073d8d07c026563)
    
    Xen: CI fix from XSN-2
    
     * Add U suffix to the K[] table to fix MISRA Rule 7.2 violations.
    
    Fixes: 372af524411f ("xen/lib: Introduce SHA2-256")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 15fe2eb5f1bac8a212c0ba3d6dfe60d1fdf851cf)
---
 xen/include/xen/sha2.h |  15 +++
 xen/lib/Makefile       |   1 +
 xen/lib/sha2-256.c     | 264 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 280 insertions(+)

diff --git a/xen/include/xen/sha2.h b/xen/include/xen/sha2.h
new file mode 100644
index 0000000000..47d97fbf01
--- /dev/null
+++ b/xen/include/xen/sha2.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * SHA2-256: https://csrc.nist.gov/pubs/fips/180-2/upd1/final
+ */
+#ifndef XEN_SHA2_H
+#define XEN_SHA2_H
+
+#include <xen/types.h>
+
+#define SHA2_256_DIGEST_SIZE 32
+
+void sha2_256_digest(uint8_t digest[SHA2_256_DIGEST_SIZE],
+                     const void *msg, size_t len);
+
+#endif /* XEN_SHA2_H */
diff --git a/xen/lib/Makefile b/xen/lib/Makefile
index 54440f628a..76dc86fab0 100644
--- a/xen/lib/Makefile
+++ b/xen/lib/Makefile
@@ -17,6 +17,7 @@ lib-y += memset.o
 lib-y += muldiv64.o
 lib-y += parse-size.o
 lib-y += rbtree.o
+lib-$(CONFIG_X86) += sha2-256.o
 lib-y += sort.o
 lib-y += strcasecmp.o
 lib-y += strchr.o
diff --git a/xen/lib/sha2-256.c b/xen/lib/sha2-256.c
new file mode 100644
index 0000000000..19e8252188
--- /dev/null
+++ b/xen/lib/sha2-256.c
@@ -0,0 +1,264 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * SHA2-256: https://csrc.nist.gov/pubs/fips/180-2/upd1/final
+ *
+ * Originally derived from Linux.  Modified substantially to optimise for size
+ * and Xen's expected usecases.
+ */
+#include <xen/bitops.h>
+#include <xen/sha2.h>
+#include <xen/string.h>
+#include <xen/unaligned.h>
+
+struct sha2_256_state {
+    uint32_t state[SHA2_256_DIGEST_SIZE / sizeof(uint32_t)];
+    uint8_t buf[64];
+    size_t count; /* Byte count. */
+};
+
+static uint32_t choose(uint32_t x, uint32_t y, uint32_t z)
+{
+    return z ^ (x & (y ^ z));
+}
+
+static uint32_t majority(uint32_t x, uint32_t y, uint32_t z)
+{
+    return (x & y) | (z & (x | y));
+}
+
+static uint32_t e0(uint32_t x)
+{
+    return ror32(x, 2) ^ ror32(x, 13) ^ ror32(x, 22);
+}
+
+static uint32_t e1(uint32_t x)
+{
+    return ror32(x, 6) ^ ror32(x, 11) ^ ror32(x, 25);
+}
+
+static uint32_t s0(uint32_t x)
+{
+    return ror32(x, 7) ^ ror32(x, 18) ^ (x >> 3);
+}
+
+static uint32_t s1(uint32_t x)
+{
+    return ror32(x, 17) ^ ror32(x, 19) ^ (x >> 10);
+}
+
+static uint32_t blend(uint32_t W[16], unsigned int i)
+{
+#define W(i) W[(i) & 15]
+
+    return W(i) += s1(W(i - 2)) + W(i - 7) + s0(W(i - 15));
+
+#undef W
+}
+
+static const uint32_t K[] = {
+    0x428a2f98U, 0x71374491U, 0xb5c0fbcfU, 0xe9b5dba5U,
+    0x3956c25bU, 0x59f111f1U, 0x923f82a4U, 0xab1c5ed5U,
+    0xd807aa98U, 0x12835b01U, 0x243185beU, 0x550c7dc3U,
+    0x72be5d74U, 0x80deb1feU, 0x9bdc06a7U, 0xc19bf174U,
+    0xe49b69c1U, 0xefbe4786U, 0x0fc19dc6U, 0x240ca1ccU,
+    0x2de92c6fU, 0x4a7484aaU, 0x5cb0a9dcU, 0x76f988daU,
+    0x983e5152U, 0xa831c66dU, 0xb00327c8U, 0xbf597fc7U,
+    0xc6e00bf3U, 0xd5a79147U, 0x06ca6351U, 0x14292967U,
+    0x27b70a85U, 0x2e1b2138U, 0x4d2c6dfcU, 0x53380d13U,
+    0x650a7354U, 0x766a0abbU, 0x81c2c92eU, 0x92722c85U,
+    0xa2bfe8a1U, 0xa81a664bU, 0xc24b8b70U, 0xc76c51a3U,
+    0xd192e819U, 0xd6990624U, 0xf40e3585U, 0x106aa070U,
+    0x19a4c116U, 0x1e376c08U, 0x2748774cU, 0x34b0bcb5U,
+    0x391c0cb3U, 0x4ed8aa4aU, 0x5b9cca4fU, 0x682e6ff3U,
+    0x748f82eeU, 0x78a5636fU, 0x84c87814U, 0x8cc70208U,
+    0x90befffaU, 0xa4506cebU, 0xbef9a3f7U, 0xc67178f2U,
+};
+
+static void sha2_256_transform(uint32_t *state, const void *_input)
+{
+    const uint32_t *input = _input;
+    uint32_t a, b, c, d, e, f, g, h, t1, t2;
+    uint32_t W[16];
+    unsigned int i;
+
+    for ( i = 0; i < 16; i++ )
+        W[i] = get_unaligned_be32(&input[i]);
+
+    a = state[0]; b = state[1]; c = state[2]; d = state[3];
+    e = state[4]; f = state[5]; g = state[6]; h = state[7];
+
+    for ( i = 0; i < 16; i += 8 )
+    {
+        t1 = h + e1(e) + choose(e, f, g) + K[i + 0] + W[i + 0];
+        t2 = e0(a) + majority(a, b, c);    d += t1;    h = t1 + t2;
+        t1 = g + e1(d) + choose(d, e, f) + K[i + 1] + W[i + 1];
+        t2 = e0(h) + majority(h, a, b);    c += t1;    g = t1 + t2;
+        t1 = f + e1(c) + choose(c, d, e) + K[i + 2] + W[i + 2];
+        t2 = e0(g) + majority(g, h, a);    b += t1;    f = t1 + t2;
+        t1 = e + e1(b) + choose(b, c, d) + K[i + 3] + W[i + 3];
+        t2 = e0(f) + majority(f, g, h);    a += t1;    e = t1 + t2;
+        t1 = d + e1(a) + choose(a, b, c) + K[i + 4] + W[i + 4];
+        t2 = e0(e) + majority(e, f, g);    h += t1;    d = t1 + t2;
+        t1 = c + e1(h) + choose(h, a, b) + K[i + 5] + W[i + 5];
+        t2 = e0(d) + majority(d, e, f);    g += t1;    c = t1 + t2;
+        t1 = b + e1(g) + choose(g, h, a) + K[i + 6] + W[i + 6];
+        t2 = e0(c) + majority(c, d, e);    f += t1;    b = t1 + t2;
+        t1 = a + e1(f) + choose(f, g, h) + K[i + 7] + W[i + 7];
+        t2 = e0(b) + majority(b, c, d);    e += t1;    a = t1 + t2;
+    }
+
+    for ( ; i < 64; i += 8 )
+    {
+        t1 = h + e1(e) + choose(e, f, g) + K[i + 0] + blend(W, i + 0);
+        t2 = e0(a) + majority(a, b, c);    d += t1;    h = t1 + t2;
+        t1 = g + e1(d) + choose(d, e, f) + K[i + 1] + blend(W, i + 1);
+        t2 = e0(h) + majority(h, a, b);    c += t1;    g = t1 + t2;
+        t1 = f + e1(c) + choose(c, d, e) + K[i + 2] + blend(W, i + 2);
+        t2 = e0(g) + majority(g, h, a);    b += t1;    f = t1 + t2;
+        t1 = e + e1(b) + choose(b, c, d) + K[i + 3] + blend(W, i + 3);
+        t2 = e0(f) + majority(f, g, h);    a += t1;    e = t1 + t2;
+        t1 = d + e1(a) + choose(a, b, c) + K[i + 4] + blend(W, i + 4);
+        t2 = e0(e) + majority(e, f, g);    h += t1;    d = t1 + t2;
+        t1 = c + e1(h) + choose(h, a, b) + K[i + 5] + blend(W, i + 5);
+        t2 = e0(d) + majority(d, e, f);    g += t1;    c = t1 + t2;
+        t1 = b + e1(g) + choose(g, h, a) + K[i + 6] + blend(W, i + 6);
+        t2 = e0(c) + majority(c, d, e);    f += t1;    b = t1 + t2;
+        t1 = a + e1(f) + choose(f, g, h) + K[i + 7] + blend(W, i + 7);
+        t2 = e0(b) + majority(b, c, d);    e += t1;    a = t1 + t2;
+    }
+
+    state[0] += a; state[1] += b; state[2] += c; state[3] += d;
+    state[4] += e; state[5] += f; state[6] += g; state[7] += h;
+}
+
+static void sha2_256_init(struct sha2_256_state *s)
+{
+    *s = (struct sha2_256_state){
+        .state = {
+            0x6a09e667UL,
+            0xbb67ae85UL,
+            0x3c6ef372UL,
+            0xa54ff53aUL,
+            0x510e527fUL,
+            0x9b05688cUL,
+            0x1f83d9abUL,
+            0x5be0cd19UL,
+        },
+    };
+}
+
+static void sha2_256_update(struct sha2_256_state *s, const void *msg,
+                            size_t len)
+{
+    unsigned int partial = s->count & 63;
+
+    s->count += len;
+
+    if ( (partial + len) >= 64 )
+    {
+        if ( partial )
+        {
+            unsigned int rem = 64 - partial;
+
+            /* Fill the partial block. */
+            memcpy(s->buf + partial, msg, rem);
+            msg += rem;
+            len -= rem;
+
+            sha2_256_transform(s->state, s->buf);
+            partial = 0;
+        }
+
+        for ( ; len >= 64; msg += 64, len -= 64 )
+            sha2_256_transform(s->state, msg);
+    }
+
+    /* Remaining data becomes partial. */
+    memcpy(s->buf + partial, msg, len);
+}
+
+static void sha2_256_final(struct sha2_256_state *s, void *_dst)
+{
+    uint32_t *dst = _dst;
+    unsigned int i, partial = s->count & 63;
+
+    /* Start padding */
+    s->buf[partial++] = 0x80;
+
+    if ( partial > 56 )
+    {
+        /* Need one extra block - pad to 64 */
+        memset(s->buf + partial, 0, 64 - partial);
+        sha2_256_transform(s->state, s->buf);
+        partial = 0;
+    }
+    /* Pad to 56 */
+    memset(s->buf + partial, 0, 56 - partial);
+
+    /* Append the bit count */
+    put_unaligned_be64((uint64_t)s->count << 3, &s->buf[56]);
+    sha2_256_transform(s->state, s->buf);
+
+    /* Store state in digest */
+    for ( i = 0; i < 8; i++ )
+        put_unaligned_be32(s->state[i], &dst[i]);
+}
+
+void sha2_256_digest(uint8_t digest[SHA2_256_DIGEST_SIZE],
+                     const void *msg, size_t len)
+{
+    struct sha2_256_state s;
+
+    sha2_256_init(&s);
+    sha2_256_update(&s, msg, len);
+    sha2_256_final(&s, digest);
+}
+
+#ifdef CONFIG_SELF_TESTS
+
+#include <xen/init.h>
+#include <xen/lib.h>
+
+static const struct test {
+    const char *msg;
+    uint8_t digest[SHA2_256_DIGEST_SIZE];
+} tests[] __initconst = {
+    {
+        .msg = "abc",
+        .digest = {
+            0xba, 0x78, 0x16, 0xbf, 0x8f, 0x01, 0xcf, 0xea,
+            0x41, 0x41, 0x40, 0xde, 0x5d, 0xae, 0x22, 0x23,
+            0xb0, 0x03, 0x61, 0xa3, 0x96, 0x17, 0x7a, 0x9c,
+            0xb4, 0x10, 0xff, 0x61, 0xf2, 0x00, 0x15, 0xad,
+        },
+    },
+    {
+        .msg = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
+        .digest = {
+            0x24, 0x8d, 0x6a, 0x61, 0xd2, 0x06, 0x38, 0xb8,
+            0xe5, 0xc0, 0x26, 0x93, 0x0c, 0x3e, 0x60, 0x39,
+            0xa3, 0x3c, 0xe4, 0x59, 0x64, 0xff, 0x21, 0x67,
+            0xf6, 0xec, 0xed, 0xd4, 0x19, 0xdb, 0x06, 0xc1,
+        },
+    },
+};
+
+static void __init __constructor test_sha2_256(void)
+{
+    for ( unsigned int i = 0; i < ARRAY_SIZE(tests); ++i )
+    {
+        const struct test *t = &tests[i];
+        uint8_t res[SHA2_256_DIGEST_SIZE] = {};
+
+        sha2_256_digest(res, t->msg, strlen(t->msg));
+
+        if ( memcmp(res, t->digest, sizeof(t->digest)) == 0 )
+            continue;
+
+        panic("%s() msg '%s' failed\n"
+              "  expected %" STR(SHA2_256_DIGEST_SIZE) "phN\n"
+              "       got %" STR(SHA2_256_DIGEST_SIZE) "phN\n",
+              __func__, t->msg, t->digest, res);
+    }
+}
+#endif /* CONFIG_SELF_TESTS */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 13:11:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 13:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947403.1345026 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3EAF-00011u-M9; Fri, 11 Apr 2025 13:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947403.1345026; Fri, 11 Apr 2025 13: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 1u3EAF-00011m-IU; Fri, 11 Apr 2025 13:11:23 +0000
Received: by outflank-mailman (input) for mailman id 947403;
 Fri, 11 Apr 2025 13:11:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u3EAE-00011g-86
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 13:11:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3EAE-008Q5H-0h
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 13:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3EAE-00BEP1-0U
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 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=38lf2C2UyK10UnBvG23UlObASLxar+HMgxM9xw1N/S4=; b=PI3xotT5yTMJ2a66twHGo8+D0j
	sx5BsU6FRcCX1cYw4hGz6DI/pjtzRTNFoPE01KGfqwaFXatiNau+ZiJERhf5QR4JhEqNqox7EVvnh
	VMKNvLJmuMEz5/E79Ih8dXMTtsWkk/ktP1daWUAdX95z6Bu9UfAUq66KV6QNFiVemBg4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode
Message-Id: <E1u3EAE-00BEP1-0U@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 13:11:22 +0000

commit ad569a4bd7477be1cd9e06f160a969053d8521e7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Dec 13 14:34:00 2024 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 14:08:31 2025 +0100

    x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode
    
    Collisions have been found in the microcode signing algorithm used by AMD
    Fam17h/19h CPUs, and now anyone can sign their own.
    
    For more details, see:
      https://bughunters.google.com/blog/5424842357473280/zen-and-the-art-of-microcode-hacking
      https://www.amd.com/en/resources/product-security/bulletin/amd-sb-7033.html
    
    As a stopgap mitigation, check the digest of patches against a table of blobs
    with known provenance.  These are all Fam17h and Fam19h blobs included in
    linux-firwmare at the time of writing, specifically:
    
      https://git.kernel.org/firmware/linux-firmware/c/48bb90cceb882cab8e9ab692bc5779d3bf3a13b8
    
    This checks can be opted out of by booting with ucode=no-digest-check, but
    doing so is not recommended.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 630e8875ab368b97cc7231aaf3809e3d7d5687e1)
    
    Xen: CI fix from XSN-2
    
     * Add cf_check annotation to cmp_patch_id() used by bsearch().
    
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 15fe2eb5f1bac8a212c0ba3d6dfe60d1fdf851cf)
---
 docs/misc/xen-command-line.pandoc              |  10 +-
 xen/arch/x86/cpu/microcode/amd-patch-digests.c | 226 +++++++++++++++++++++++++
 xen/arch/x86/cpu/microcode/amd.c               |  66 +++++++-
 xen/arch/x86/cpu/microcode/core.c              |   3 +
 xen/arch/x86/cpu/microcode/private.h           |   2 +
 5 files changed, 304 insertions(+), 3 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 83bb69cfb8..53ad3ffc3f 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2735,10 +2735,10 @@ performance.
    Alternatively, selecting `tsx=1` will re-enable TSX at the users own risk.
 
 ### ucode
-> `= List of [ <integer> | scan=<bool>, nmi=<bool> ]`
+> `= List of [ <integer> | scan=<bool>, nmi=<bool>, digest-check=<bool> ]`
 
     Applicability: x86
-    Default: `nmi`
+    Default: `nmi,digest-check`
 
 Controls for CPU microcode loading. For early loading, this parameter can
 specify how and where to find the microcode update blob. For late loading,
@@ -2767,6 +2767,12 @@ precedence over `scan`.
 stop_machine context. In NMI handler, even NMIs are blocked, which is
 considered safer. The default value is `true`.
 
+The `digest-check=` option is active by default and controls whether to
+perform additional authenticity checks.  Collisions in the signature algorithm
+used by AMD Fam17h/19h processors have been found.  Xen contains a table of
+digests of microcode patches with known-good provenance, and will block
+loading of patches that do not match.
+
 ### unrestricted_guest (Intel)
 > `= <boolean>`
 
diff --git a/xen/arch/x86/cpu/microcode/amd-patch-digests.c b/xen/arch/x86/cpu/microcode/amd-patch-digests.c
new file mode 100644
index 0000000000..d327612267
--- /dev/null
+++ b/xen/arch/x86/cpu/microcode/amd-patch-digests.c
@@ -0,0 +1,226 @@
+/* Generated from linux-firmware. */
+{
+    .patch_id = 0x0800126f,
+    .digest = {
+        0x2b, 0x5a, 0xf2, 0x9c, 0xdd, 0xd2, 0x7f, 0xec,
+        0xec, 0x96, 0x09, 0x57, 0xb0, 0x96, 0x29, 0x8b,
+        0x2e, 0x26, 0x91, 0xf0, 0x49, 0x33, 0x42, 0x18,
+        0xdd, 0x4b, 0x65, 0x5a, 0xd4, 0x15, 0x3d, 0x33,
+    },
+},
+{
+    .patch_id = 0x0800820d,
+    .digest = {
+        0x68, 0x98, 0x83, 0xcd, 0x22, 0x0d, 0xdd, 0x59,
+        0x73, 0x2c, 0x5b, 0x37, 0x1f, 0x84, 0x0e, 0x67,
+        0x96, 0x43, 0x83, 0x0c, 0x46, 0x44, 0xab, 0x7c,
+        0x7b, 0x65, 0x9e, 0x57, 0xb5, 0x90, 0x4b, 0x0e,
+    },
+},
+{
+    .patch_id = 0x0830107c,
+    .digest = {
+        0x21, 0x64, 0xde, 0xfb, 0x9f, 0x68, 0x96, 0x47,
+        0x70, 0x5c, 0xe2, 0x8f, 0x18, 0x52, 0x6a, 0xac,
+        0xa4, 0xd2, 0x2e, 0xe0, 0xde, 0x68, 0x66, 0xc3,
+        0xeb, 0x1e, 0xd3, 0x3f, 0xbc, 0x51, 0x1d, 0x38,
+    },
+},
+{
+    .patch_id = 0x0860010d,
+    .digest = {
+        0x86, 0xb6, 0x15, 0x83, 0xbc, 0x3b, 0x9c, 0xe0,
+        0xb3, 0xef, 0x1d, 0x99, 0x84, 0x35, 0x15, 0xf7,
+        0x7c, 0x2a, 0xc6, 0x42, 0xdb, 0x73, 0x07, 0x5c,
+        0x7d, 0xc3, 0x02, 0xb5, 0x43, 0x06, 0x5e, 0xf8,
+    },
+},
+{
+    .patch_id = 0x08608108,
+    .digest = {
+        0x14, 0xfe, 0x57, 0x86, 0x49, 0xc8, 0x68, 0xe2,
+        0x11, 0xa3, 0xcb, 0x6e, 0xff, 0x6e, 0xd5, 0x38,
+        0xfe, 0x89, 0x1a, 0xe0, 0x67, 0xbf, 0xc4, 0xcc,
+        0x1b, 0x9f, 0x84, 0x77, 0x2b, 0x9f, 0xaa, 0xbd,
+    },
+},
+{
+    .patch_id = 0x08701034,
+    .digest = {
+        0xc3, 0x14, 0x09, 0xa8, 0x9c, 0x3f, 0x8d, 0x83,
+        0x9b, 0x4c, 0xa5, 0xb7, 0x64, 0x8b, 0x91, 0x5d,
+        0x85, 0x6a, 0x39, 0x26, 0x1e, 0x14, 0x41, 0xa8,
+        0x75, 0xea, 0xa6, 0xf9, 0xc9, 0xd1, 0xea, 0x2b,
+    },
+},
+{
+    .patch_id = 0x08a0000a,
+    .digest = {
+        0x73, 0x31, 0x26, 0x22, 0xd4, 0xf9, 0xee, 0x3c,
+        0x07, 0x06, 0xe7, 0xb9, 0xad, 0xd8, 0x72, 0x44,
+        0x33, 0x31, 0xaa, 0x7d, 0xc3, 0x67, 0x0e, 0xdb,
+        0x47, 0xb5, 0xaa, 0xbc, 0xf5, 0xbb, 0xd9, 0x20,
+    },
+},
+{
+    .patch_id = 0x0a00107a,
+    .digest = {
+        0x5f, 0x92, 0xca, 0xff, 0xc3, 0x59, 0x22, 0x5f,
+        0x02, 0xa0, 0x91, 0x3b, 0x4a, 0x45, 0x10, 0xfd,
+        0x19, 0xe1, 0x8a, 0x6d, 0x9a, 0x92, 0xc1, 0x3f,
+        0x75, 0x78, 0xac, 0x78, 0x03, 0x1d, 0xdb, 0x18,
+    },
+},
+{
+    .patch_id = 0x0a0011d5,
+    .digest = {
+        0xed, 0x69, 0x89, 0xf4, 0xeb, 0x64, 0xc2, 0x13,
+        0xe0, 0x51, 0x1f, 0x03, 0x26, 0x52, 0x7d, 0xb7,
+        0x93, 0x5d, 0x65, 0xca, 0xb8, 0x12, 0x1d, 0x62,
+        0x0d, 0x5b, 0x65, 0x34, 0x69, 0xb2, 0x62, 0x21,
+    },
+},
+{
+    .patch_id = 0x0a001238,
+    .digest = {
+        0x72, 0xf7, 0x4b, 0x0c, 0x7d, 0x58, 0x65, 0xcc,
+        0x00, 0xcc, 0x57, 0x16, 0x68, 0x16, 0xf8, 0x2a,
+        0x1b, 0xb3, 0x8b, 0xe1, 0xb6, 0x83, 0x8c, 0x7e,
+        0xc0, 0xcd, 0x33, 0xf2, 0x8d, 0xf9, 0xef, 0x59,
+    },
+},
+{
+    .patch_id = 0x0a00820c,
+    .digest = {
+        0xa8, 0x0c, 0x81, 0xc0, 0xa6, 0x00, 0xe7, 0xf3,
+        0x5f, 0x65, 0xd3, 0xb9, 0x6f, 0xea, 0x93, 0x63,
+        0xf1, 0x8c, 0x88, 0x45, 0xd7, 0x82, 0x80, 0xd1,
+        0xe1, 0x3b, 0x8d, 0xb2, 0xf8, 0x22, 0x03, 0xe2,
+    },
+},
+{
+    .patch_id = 0x0a101148,
+    .digest = {
+        0x20, 0xd5, 0x6f, 0x40, 0x4a, 0xf6, 0x48, 0x90,
+        0xc2, 0x93, 0x9a, 0xc2, 0xfd, 0xac, 0xef, 0x4f,
+        0xfa, 0xc0, 0x3d, 0x92, 0x3c, 0x6d, 0x01, 0x08,
+        0xf1, 0x5e, 0xb0, 0xde, 0xb4, 0x98, 0xae, 0xc4,
+    },
+},
+{
+    .patch_id = 0x0a101248,
+    .digest = {
+        0xed, 0x3b, 0x95, 0xa6, 0x68, 0xa7, 0x77, 0x3e,
+        0xfc, 0x17, 0x26, 0xe2, 0x7b, 0xd5, 0x56, 0x22,
+        0x2c, 0x1d, 0xef, 0xeb, 0x56, 0xdd, 0xba, 0x6e,
+        0x1b, 0x7d, 0x64, 0x9d, 0x4b, 0x53, 0x13, 0x75,
+    },
+},
+{
+    .patch_id = 0x0a108108,
+    .digest = {
+        0xed, 0xc2, 0xec, 0xa1, 0x15, 0xc6, 0x65, 0xe9,
+        0xd0, 0xef, 0x39, 0xaa, 0x7f, 0x55, 0x06, 0xc6,
+        0xf5, 0xd4, 0x3f, 0x7b, 0x14, 0xd5, 0x60, 0x2c,
+        0x28, 0x1e, 0x9c, 0x59, 0x69, 0x99, 0x4d, 0x16,
+    },
+},
+{
+    .patch_id = 0x0a20102d,
+    .digest = {
+        0xf9, 0x6e, 0xf2, 0x32, 0xd3, 0x0f, 0x5f, 0x11,
+        0x59, 0xa1, 0xfe, 0xcc, 0xcd, 0x9b, 0x42, 0x89,
+        0x8b, 0x89, 0x2f, 0xb5, 0xbb, 0x82, 0xef, 0x23,
+        0x8c, 0xe9, 0x19, 0x3e, 0xcc, 0x3f, 0x7b, 0xb4,
+    },
+},
+{
+    .patch_id = 0x0a201210,
+    .digest = {
+        0xe8, 0x6d, 0x51, 0x6a, 0x8e, 0x72, 0xf3, 0xfe,
+        0x6e, 0x16, 0xbc, 0x62, 0x59, 0x40, 0x17, 0xe9,
+        0x6d, 0x3d, 0x0e, 0x6b, 0xa7, 0xac, 0xe3, 0x68,
+        0xf7, 0x55, 0xf0, 0x13, 0xbb, 0x22, 0xf6, 0x41,
+    },
+},
+{
+    .patch_id = 0x0a404107,
+    .digest = {
+        0xbb, 0x04, 0x4e, 0x47, 0xdd, 0x5e, 0x26, 0x45,
+        0x1a, 0xc9, 0x56, 0x24, 0xa4, 0x4c, 0x82, 0xb0,
+        0x8b, 0x0d, 0x9f, 0xf9, 0x3a, 0xdf, 0xc6, 0x81,
+        0x13, 0xbc, 0xc5, 0x25, 0xe4, 0xc5, 0xc3, 0x99,
+    },
+},
+{
+    .patch_id = 0x0a500011,
+    .digest = {
+        0x23, 0x3d, 0x70, 0x7d, 0x03, 0xc3, 0xc4, 0xf4,
+        0x2b, 0x82, 0xc6, 0x05, 0xda, 0x80, 0x0a, 0xf1,
+        0xd7, 0x5b, 0x65, 0x3a, 0x7d, 0xab, 0xdf, 0xa2,
+        0x11, 0x5e, 0x96, 0x7e, 0x71, 0xe9, 0xfc, 0x74,
+    },
+},
+{
+    .patch_id = 0x0a601209,
+    .digest = {
+        0x66, 0x48, 0xd4, 0x09, 0x05, 0xcb, 0x29, 0x32,
+        0x66, 0xb7, 0x9a, 0x76, 0xcd, 0x11, 0xf3, 0x30,
+        0x15, 0x86, 0xcc, 0x5d, 0x97, 0x0f, 0xc0, 0x46,
+        0xe8, 0x73, 0xe2, 0xd6, 0xdb, 0xd2, 0x77, 0x1d,
+    },
+},
+{
+    .patch_id = 0x0a704107,
+    .digest = {
+        0xf3, 0xc6, 0x58, 0x26, 0xee, 0xac, 0x3f, 0xd6,
+        0xce, 0xa1, 0x72, 0x47, 0x3b, 0xba, 0x2b, 0x93,
+        0x2a, 0xad, 0x8e, 0x6b, 0xea, 0x9b, 0xb7, 0xc2,
+        0x64, 0x39, 0x71, 0x8c, 0xce, 0xe7, 0x41, 0x39,
+    },
+},
+{
+    .patch_id = 0x0a705206,
+    .digest = {
+        0x8d, 0xc0, 0x76, 0xbd, 0x58, 0x9f, 0x8f, 0xa4,
+        0x12, 0x9d, 0x21, 0xfb, 0x48, 0x21, 0xbc, 0xe7,
+        0x67, 0x6f, 0x04, 0x18, 0xae, 0x20, 0x87, 0x4b,
+        0x03, 0x35, 0xe9, 0xbe, 0xfb, 0x06, 0xdf, 0xfc,
+    },
+},
+{
+    .patch_id = 0x0a708007,
+    .digest = {
+        0x6b, 0x76, 0xcc, 0x78, 0xc5, 0x8a, 0xa3, 0xe3,
+        0x32, 0x2d, 0x79, 0xe4, 0xc3, 0x80, 0xdb, 0xb2,
+        0x07, 0xaa, 0x3a, 0xe0, 0x57, 0x13, 0x72, 0x80,
+        0xdf, 0x92, 0x73, 0x84, 0x87, 0x3c, 0x73, 0x93,
+    },
+},
+{
+    .patch_id = 0x0a70c005,
+    .digest = {
+        0x88, 0x5d, 0xfb, 0x79, 0x64, 0xd8, 0x46, 0x3b,
+        0x4a, 0x83, 0x8e, 0x77, 0x7e, 0xcf, 0xb3, 0x0f,
+        0x1f, 0x1f, 0xf1, 0x97, 0xeb, 0xfe, 0x56, 0x55,
+        0xee, 0x49, 0xac, 0xe1, 0x8b, 0x13, 0xc5, 0x13,
+    },
+},
+{
+    .patch_id = 0x0aa00116,
+    .digest = {
+        0xe8, 0x4c, 0x2c, 0x88, 0xa1, 0xac, 0x24, 0x63,
+        0x65, 0xe5, 0xaa, 0x2d, 0x16, 0xa9, 0xc3, 0xf5,
+        0xfe, 0x1d, 0x5e, 0x65, 0xc7, 0xaa, 0x92, 0x4d,
+        0x91, 0xee, 0x76, 0xbb, 0x4c, 0x66, 0x78, 0xc9,
+    },
+},
+{
+    .patch_id = 0x0aa00215,
+    .digest = {
+        0x55, 0xd3, 0x28, 0xcb, 0x87, 0xa9, 0x32, 0xe9,
+        0x4e, 0x85, 0x4b, 0x7c, 0x6b, 0xd5, 0x7c, 0xd4,
+        0x1b, 0x51, 0x71, 0x3a, 0x0e, 0x0b, 0xdc, 0x9b,
+        0x68, 0x2f, 0x46, 0xee, 0xfe, 0xc6, 0x6d, 0xef,
+    },
+},
diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 210736f580..b2785ebd7d 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -16,7 +16,9 @@
 
 #include <xen/err.h>
 #include <xen/init.h>
+#include <xen/lib.h>
 #include <xen/mm.h> /* TODO: Fix asm/tlbflush.h breakage */
+#include <xen/sha2.h>
 
 #include <asm/msr.h>
 
@@ -91,6 +93,59 @@ static struct {
     uint16_t id;
 } equiv __read_mostly;
 
+static const struct patch_digest {
+    uint32_t patch_id;
+    uint8_t digest[SHA2_256_DIGEST_SIZE];
+} patch_digests[] = {
+#include "amd-patch-digests.c"
+};
+
+static int cf_check cmp_patch_id(const void *key, const void *elem)
+{
+    const struct patch_digest *pd = elem;
+    uint32_t patch_id = *(uint32_t *)key;
+
+    if ( patch_id == pd->patch_id )
+        return 0;
+    else if ( patch_id < pd->patch_id )
+        return -1;
+    return 1;
+}
+
+static bool check_digest(const struct container_microcode *mc)
+{
+    const struct microcode_patch *patch = mc->patch;
+    const struct patch_digest *pd;
+    uint8_t digest[SHA2_256_DIGEST_SIZE];
+
+    /* Only Fam17h/19h are known to need extra checks.  Skip other families. */
+    if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x19 ||
+         !opt_digest_check )
+        return true;
+
+    pd = bsearch(&patch->patch_id, patch_digests, ARRAY_SIZE(patch_digests),
+                 sizeof(struct patch_digest), cmp_patch_id);
+    if ( !pd )
+    {
+        printk(XENLOG_WARNING "No digest found for patch_id %08x\n",
+               patch->patch_id);
+        return false;
+    }
+
+    sha2_256_digest(digest, patch, mc->len);
+
+    if ( memcmp(digest, pd->digest, sizeof(digest)) )
+    {
+        printk(XENLOG_WARNING "Patch %08x SHA256 mismatch:\n"
+               "  expected %" STR(SHA2_256_DIGEST_SIZE) "phN\n"
+               "       got %" STR(SHA2_256_DIGEST_SIZE) "phN\n",
+               patch->patch_id, pd->digest, digest);
+        return false;
+    }
+
+    return true;
+}
+
 static void cf_check collect_cpu_info(void)
 {
     struct cpu_signature *csig = &this_cpu(cpu_sig);
@@ -398,7 +453,8 @@ static struct microcode_patch *cf_check cpu_request_microcode(
             if ( microcode_fits_cpu(mc->patch) &&
                  (!saved ||
                   compare_revisions(saved->patch_id,
-                                    mc->patch->patch_id) == NEW_UCODE) )
+                                    mc->patch->patch_id) == NEW_UCODE) &&
+                 check_digest(mc) )
             {
                 saved = mc->patch;
                 saved_size = mc->len;
@@ -457,6 +513,14 @@ static const struct microcode_ops __initconst_cf_clobber amd_ucode_ops = {
 
 void __init ucode_probe_amd(struct microcode_ops *ops)
 {
+    if ( !opt_digest_check &&
+         boot_cpu_data.x86 >= 0x17 && boot_cpu_data.x86 <= 0x19 )
+    {
+        printk(XENLOG_WARNING
+               "Microcode patch additional digest checks disabled");
+        add_taint(TAINT_CPU_OUT_OF_SPEC);
+    }
+
     if ( boot_cpu_data.x86 < 0x10 )
         return;
 
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 87283cff1d..82e2b3ab1e 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -101,6 +101,7 @@ static struct microcode_patch *microcode_cache;
  */
 static int __initdata opt_mod_idx;
 static bool __initdata opt_scan;
+bool __ro_after_init opt_digest_check = true;
 
 /*
  * Used by the EFI path only, when xen.cfg identifies an explicit microcode
@@ -130,6 +131,8 @@ static int __init cf_check parse_ucode(const char *s)
 
         if ( (val = parse_boolean("nmi", s, ss)) >= 0 )
             ucode_in_nmi = val;
+        else if ( (val = parse_boolean("digest-check", s, ss)) >= 0 )
+            opt_digest_check = val;
         else if ( !ucode_mod_forced ) /* Not forced by EFI */
         {
             if ( (val = parse_boolean("scan", s, ss)) >= 0 )
diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h
index 74bb2f0a65..f5e2bfee00 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -67,6 +67,8 @@ struct microcode_ops {
     const char *cpio_path;
 };
 
+extern bool opt_digest_check;
+
 /*
  * Microcode loading falls into one of 3 states.
  *   - No support at all
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 13:11:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 13:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947404.1345029 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3EAP-0001KY-OB; Fri, 11 Apr 2025 13:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947404.1345029; Fri, 11 Apr 2025 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 1u3EAP-0001KO-LX; Fri, 11 Apr 2025 13:11:33 +0000
Received: by outflank-mailman (input) for mailman id 947404;
 Fri, 11 Apr 2025 13:11:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u3EAO-0001KB-B6
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 13:11:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3EAO-008Q5j-0z
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 13:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3EAO-00BEPq-0s
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 13:11:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bNyoByxNamopvVPtH3f49D+kZCNhWMrDcjA+D387AMM=; b=B7Z2BuR68SHuHb+cGg2xoYZJAw
	SaumcEJhco8jRt3Wq1dQgGzn5lyzL7QvZMR/30HDfWfh6bk1Zyc8XkuePn57XNXbg1zdunGLscDny
	9Y8l5QJn5v/s80h6Dgw3hZLv0LVOx5OKzufHXIrZvQyb8aKdqxW49UV5wZK/4UhjqDaM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/ucode: Extend AMD digest checks to cover Zen5 CPUs
Message-Id: <E1u3EAO-00BEPq-0s@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 13:11:32 +0000

commit ad82c8c7b6e23f8daed72b7daf567eb70f4593d4
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 8 17:09:15 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 14:08:31 2025 +0100

    x86/ucode: Extend AMD digest checks to cover Zen5 CPUs
    
    AMD have updated the SB-7033 advisory to include Zen5 CPUs.  Extend the digest
    check to cover Zen5 too.
    
    In practice, cover everything until further notice.
    
    Observant readers may be wondering where the update to the digest list is.  At
    the time of writing, no Zen5 patches are available via a verifiable channel.
    
    Link: https://www.amd.com/en/resources/product-security/bulletin/amd-sb-7033.html
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit b63951467e964bcc927f823fc943e40069fac0c9)
    
    x86/ucode: Extend warning about disabling digest check too
    
    This was missed by accident.
    
    Fixes: b63951467e96 ("x86/ucode: Extend AMD digest checks to cover Zen5 CPUs")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 59bb316ea89e7f9461690fe00547d7d2af96321d)
---
 xen/arch/x86/cpu/microcode/amd.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index b2785ebd7d..a2860d8948 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -118,8 +118,12 @@ static bool check_digest(const struct container_microcode *mc)
     const struct patch_digest *pd;
     uint8_t digest[SHA2_256_DIGEST_SIZE];
 
-    /* Only Fam17h/19h are known to need extra checks.  Skip other families. */
-    if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x19 ||
+    /*
+     * Zen1 thru Zen5 CPUs are known to use a weak signature algorithm on
+     * microcode updates.  Mitigate by checking the digest of the patch
+     * against a list of known provenance.
+     */
+    if ( boot_cpu_data.x86 < 0x17 ||
          !opt_digest_check )
         return true;
 
@@ -513,8 +517,7 @@ static const struct microcode_ops __initconst_cf_clobber amd_ucode_ops = {
 
 void __init ucode_probe_amd(struct microcode_ops *ops)
 {
-    if ( !opt_digest_check &&
-         boot_cpu_data.x86 >= 0x17 && boot_cpu_data.x86 <= 0x19 )
+    if ( !opt_digest_check && boot_cpu_data.x86 >= 0x17 )
     {
         printk(XENLOG_WARNING
                "Microcode patch additional digest checks disabled");
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 13:22:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 13:22:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947406.1345033 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3EKZ-0004eD-GL; Fri, 11 Apr 2025 13:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947406.1345033; Fri, 11 Apr 2025 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 1u3EKZ-0004e3-Dc; Fri, 11 Apr 2025 13:22:03 +0000
Received: by outflank-mailman (input) for mailman id 947406;
 Fri, 11 Apr 2025 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 1u3EKY-0004dx-IW
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 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 1u3EKY-008QJX-10
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 13:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3EKY-00BHFV-0t
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 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=mXPMWmAvrdcwnfBdMmjsOhrA8UsbtrMvxojMfPFJivk=; b=vZsDA2veUSR2iGOwoxHYmJTCoD
	aA2gUw0dHFXFgRR/J29E9JsG+bzv/WREJeJxwFjIP/kCZbZawLDhLEWOvlAAyL0reKLigrTyOXZ4g
	g23quCV0FfL4+80aGsjOea1fmdSj8mzVeWo1GkSlVqsK69yy4gpNlEYpmyHO12+aGT3I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] tools/libxl: do not use `-c -E` compiler options together
Message-Id: <E1u3EKY-00BHFV-0t@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 13:22:02 +0000

commit 2389f0a3b2c36737e99e942cff3da2cf33050831
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Apr 7 13:09:38 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 14:12:25 2025 +0100

    tools/libxl: do not use `-c -E` compiler options together
    
    It makes no sense to request for preprocessor only output and also request
    object file generation.  Fix the _libxl.api-for-check target to only use
    -E (preprocessor output).
    
    Also Clang 20.0 reports an error if both options are used.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Fixes: 2862bf5b6c81 ('libxl: enforce prohibitions of internal callers')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
    (cherry picked from commit a235f856e4bbd270b085590e1f5fc9599234dcdf)
---
 tools/libs/light/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
index 37e4d16709..b690d92159 100644
--- a/tools/libs/light/Makefile
+++ b/tools/libs/light/Makefile
@@ -195,7 +195,7 @@ libxl.api-ok: check-libxl-api-rules _libxl.api-for-check
 	touch $@
 
 _libxl.api-for-check: $(XEN_INCLUDE)/libxl.h
-	$(CC) $(CPPFLAGS) $(CFLAGS) -c -E $< $(APPEND_CFLAGS) \
+	$(CC) $(CPPFLAGS) $(CFLAGS) -E $< $(APPEND_CFLAGS) \
 		-DLIBXL_EXTERNAL_CALLERS_ONLY=LIBXL_EXTERNAL_CALLERS_ONLY \
 		>$@.new
 	mv -f $@.new $@
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 13:22:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 13:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947407.1345036 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3EKj-0004g8-HT; Fri, 11 Apr 2025 13:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947407.1345036; Fri, 11 Apr 2025 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 1u3EKj-0004g1-F0; Fri, 11 Apr 2025 13:22:13 +0000
Received: by outflank-mailman (input) for mailman id 947407;
 Fri, 11 Apr 2025 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 1u3EKi-0004ft-F2
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 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 1u3EKi-008QJb-1O
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 13:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3EKi-00BHGq-1B
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 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=mNiwyxS795R6o2GIXSpEUy4i4VdkJbMndme2VOhEQbY=; b=P0+5u4ww7fbqfbK9DE6S/L4Pxr
	bw5cnnaWCIw7ePx4L/MrGr/5rqN8tLqjxUYULwErTsWL8/0G+VyUUuYBzsPpSenloC88dgWn50NqF
	EIZEgNK+uAA3W9Gh9wUX7746L+hkaV11y5dmis5dACiZciCE2XSwQo7b1lhfFCR2ZAnE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] xen/lib: Introduce SHA2-256
Message-Id: <E1u3EKi-00BHGq-1B@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 13:22:12 +0000

commit 3cc6a924d78f32b98790db274379ff5f9e946225
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Dec 13 14:34:00 2024 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 14:12:25 2025 +0100

    xen/lib: Introduce SHA2-256
    
    A future change will need to calculate SHA2-256 digests.  Introduce an
    implementation in lib/, derived from Trenchboot which itself is derived from
    Linux.
    
    In order to be useful to other architectures, it is careful with endianness
    and misaligned accesses as well as being more MISRA friendly, but is only
    wired up for x86 in the short term.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 372af524411f5a013bcb0b117073d8d07c026563)
    
    Xen: CI fix from XSN-2
    
     * Add U suffix to the K[] table to fix MISRA Rule 7.2 violations.
    
    Fixes: 372af524411f ("xen/lib: Introduce SHA2-256")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 15fe2eb5f1bac8a212c0ba3d6dfe60d1fdf851cf)
---
 xen/include/xen/sha2.h |  15 +++
 xen/lib/Makefile       |   1 +
 xen/lib/sha2-256.c     | 264 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 280 insertions(+)

diff --git a/xen/include/xen/sha2.h b/xen/include/xen/sha2.h
new file mode 100644
index 0000000000..47d97fbf01
--- /dev/null
+++ b/xen/include/xen/sha2.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * SHA2-256: https://csrc.nist.gov/pubs/fips/180-2/upd1/final
+ */
+#ifndef XEN_SHA2_H
+#define XEN_SHA2_H
+
+#include <xen/types.h>
+
+#define SHA2_256_DIGEST_SIZE 32
+
+void sha2_256_digest(uint8_t digest[SHA2_256_DIGEST_SIZE],
+                     const void *msg, size_t len);
+
+#endif /* XEN_SHA2_H */
diff --git a/xen/lib/Makefile b/xen/lib/Makefile
index a485415964..03e33baaa0 100644
--- a/xen/lib/Makefile
+++ b/xen/lib/Makefile
@@ -16,6 +16,7 @@ lib-y += memset.o
 lib-y += muldiv64.o
 lib-y += parse-size.o
 lib-y += rbtree.o
+lib-$(CONFIG_X86) += sha2-256.o
 lib-y += sort.o
 lib-y += strcasecmp.o
 lib-y += strchr.o
diff --git a/xen/lib/sha2-256.c b/xen/lib/sha2-256.c
new file mode 100644
index 0000000000..19e8252188
--- /dev/null
+++ b/xen/lib/sha2-256.c
@@ -0,0 +1,264 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * SHA2-256: https://csrc.nist.gov/pubs/fips/180-2/upd1/final
+ *
+ * Originally derived from Linux.  Modified substantially to optimise for size
+ * and Xen's expected usecases.
+ */
+#include <xen/bitops.h>
+#include <xen/sha2.h>
+#include <xen/string.h>
+#include <xen/unaligned.h>
+
+struct sha2_256_state {
+    uint32_t state[SHA2_256_DIGEST_SIZE / sizeof(uint32_t)];
+    uint8_t buf[64];
+    size_t count; /* Byte count. */
+};
+
+static uint32_t choose(uint32_t x, uint32_t y, uint32_t z)
+{
+    return z ^ (x & (y ^ z));
+}
+
+static uint32_t majority(uint32_t x, uint32_t y, uint32_t z)
+{
+    return (x & y) | (z & (x | y));
+}
+
+static uint32_t e0(uint32_t x)
+{
+    return ror32(x, 2) ^ ror32(x, 13) ^ ror32(x, 22);
+}
+
+static uint32_t e1(uint32_t x)
+{
+    return ror32(x, 6) ^ ror32(x, 11) ^ ror32(x, 25);
+}
+
+static uint32_t s0(uint32_t x)
+{
+    return ror32(x, 7) ^ ror32(x, 18) ^ (x >> 3);
+}
+
+static uint32_t s1(uint32_t x)
+{
+    return ror32(x, 17) ^ ror32(x, 19) ^ (x >> 10);
+}
+
+static uint32_t blend(uint32_t W[16], unsigned int i)
+{
+#define W(i) W[(i) & 15]
+
+    return W(i) += s1(W(i - 2)) + W(i - 7) + s0(W(i - 15));
+
+#undef W
+}
+
+static const uint32_t K[] = {
+    0x428a2f98U, 0x71374491U, 0xb5c0fbcfU, 0xe9b5dba5U,
+    0x3956c25bU, 0x59f111f1U, 0x923f82a4U, 0xab1c5ed5U,
+    0xd807aa98U, 0x12835b01U, 0x243185beU, 0x550c7dc3U,
+    0x72be5d74U, 0x80deb1feU, 0x9bdc06a7U, 0xc19bf174U,
+    0xe49b69c1U, 0xefbe4786U, 0x0fc19dc6U, 0x240ca1ccU,
+    0x2de92c6fU, 0x4a7484aaU, 0x5cb0a9dcU, 0x76f988daU,
+    0x983e5152U, 0xa831c66dU, 0xb00327c8U, 0xbf597fc7U,
+    0xc6e00bf3U, 0xd5a79147U, 0x06ca6351U, 0x14292967U,
+    0x27b70a85U, 0x2e1b2138U, 0x4d2c6dfcU, 0x53380d13U,
+    0x650a7354U, 0x766a0abbU, 0x81c2c92eU, 0x92722c85U,
+    0xa2bfe8a1U, 0xa81a664bU, 0xc24b8b70U, 0xc76c51a3U,
+    0xd192e819U, 0xd6990624U, 0xf40e3585U, 0x106aa070U,
+    0x19a4c116U, 0x1e376c08U, 0x2748774cU, 0x34b0bcb5U,
+    0x391c0cb3U, 0x4ed8aa4aU, 0x5b9cca4fU, 0x682e6ff3U,
+    0x748f82eeU, 0x78a5636fU, 0x84c87814U, 0x8cc70208U,
+    0x90befffaU, 0xa4506cebU, 0xbef9a3f7U, 0xc67178f2U,
+};
+
+static void sha2_256_transform(uint32_t *state, const void *_input)
+{
+    const uint32_t *input = _input;
+    uint32_t a, b, c, d, e, f, g, h, t1, t2;
+    uint32_t W[16];
+    unsigned int i;
+
+    for ( i = 0; i < 16; i++ )
+        W[i] = get_unaligned_be32(&input[i]);
+
+    a = state[0]; b = state[1]; c = state[2]; d = state[3];
+    e = state[4]; f = state[5]; g = state[6]; h = state[7];
+
+    for ( i = 0; i < 16; i += 8 )
+    {
+        t1 = h + e1(e) + choose(e, f, g) + K[i + 0] + W[i + 0];
+        t2 = e0(a) + majority(a, b, c);    d += t1;    h = t1 + t2;
+        t1 = g + e1(d) + choose(d, e, f) + K[i + 1] + W[i + 1];
+        t2 = e0(h) + majority(h, a, b);    c += t1;    g = t1 + t2;
+        t1 = f + e1(c) + choose(c, d, e) + K[i + 2] + W[i + 2];
+        t2 = e0(g) + majority(g, h, a);    b += t1;    f = t1 + t2;
+        t1 = e + e1(b) + choose(b, c, d) + K[i + 3] + W[i + 3];
+        t2 = e0(f) + majority(f, g, h);    a += t1;    e = t1 + t2;
+        t1 = d + e1(a) + choose(a, b, c) + K[i + 4] + W[i + 4];
+        t2 = e0(e) + majority(e, f, g);    h += t1;    d = t1 + t2;
+        t1 = c + e1(h) + choose(h, a, b) + K[i + 5] + W[i + 5];
+        t2 = e0(d) + majority(d, e, f);    g += t1;    c = t1 + t2;
+        t1 = b + e1(g) + choose(g, h, a) + K[i + 6] + W[i + 6];
+        t2 = e0(c) + majority(c, d, e);    f += t1;    b = t1 + t2;
+        t1 = a + e1(f) + choose(f, g, h) + K[i + 7] + W[i + 7];
+        t2 = e0(b) + majority(b, c, d);    e += t1;    a = t1 + t2;
+    }
+
+    for ( ; i < 64; i += 8 )
+    {
+        t1 = h + e1(e) + choose(e, f, g) + K[i + 0] + blend(W, i + 0);
+        t2 = e0(a) + majority(a, b, c);    d += t1;    h = t1 + t2;
+        t1 = g + e1(d) + choose(d, e, f) + K[i + 1] + blend(W, i + 1);
+        t2 = e0(h) + majority(h, a, b);    c += t1;    g = t1 + t2;
+        t1 = f + e1(c) + choose(c, d, e) + K[i + 2] + blend(W, i + 2);
+        t2 = e0(g) + majority(g, h, a);    b += t1;    f = t1 + t2;
+        t1 = e + e1(b) + choose(b, c, d) + K[i + 3] + blend(W, i + 3);
+        t2 = e0(f) + majority(f, g, h);    a += t1;    e = t1 + t2;
+        t1 = d + e1(a) + choose(a, b, c) + K[i + 4] + blend(W, i + 4);
+        t2 = e0(e) + majority(e, f, g);    h += t1;    d = t1 + t2;
+        t1 = c + e1(h) + choose(h, a, b) + K[i + 5] + blend(W, i + 5);
+        t2 = e0(d) + majority(d, e, f);    g += t1;    c = t1 + t2;
+        t1 = b + e1(g) + choose(g, h, a) + K[i + 6] + blend(W, i + 6);
+        t2 = e0(c) + majority(c, d, e);    f += t1;    b = t1 + t2;
+        t1 = a + e1(f) + choose(f, g, h) + K[i + 7] + blend(W, i + 7);
+        t2 = e0(b) + majority(b, c, d);    e += t1;    a = t1 + t2;
+    }
+
+    state[0] += a; state[1] += b; state[2] += c; state[3] += d;
+    state[4] += e; state[5] += f; state[6] += g; state[7] += h;
+}
+
+static void sha2_256_init(struct sha2_256_state *s)
+{
+    *s = (struct sha2_256_state){
+        .state = {
+            0x6a09e667UL,
+            0xbb67ae85UL,
+            0x3c6ef372UL,
+            0xa54ff53aUL,
+            0x510e527fUL,
+            0x9b05688cUL,
+            0x1f83d9abUL,
+            0x5be0cd19UL,
+        },
+    };
+}
+
+static void sha2_256_update(struct sha2_256_state *s, const void *msg,
+                            size_t len)
+{
+    unsigned int partial = s->count & 63;
+
+    s->count += len;
+
+    if ( (partial + len) >= 64 )
+    {
+        if ( partial )
+        {
+            unsigned int rem = 64 - partial;
+
+            /* Fill the partial block. */
+            memcpy(s->buf + partial, msg, rem);
+            msg += rem;
+            len -= rem;
+
+            sha2_256_transform(s->state, s->buf);
+            partial = 0;
+        }
+
+        for ( ; len >= 64; msg += 64, len -= 64 )
+            sha2_256_transform(s->state, msg);
+    }
+
+    /* Remaining data becomes partial. */
+    memcpy(s->buf + partial, msg, len);
+}
+
+static void sha2_256_final(struct sha2_256_state *s, void *_dst)
+{
+    uint32_t *dst = _dst;
+    unsigned int i, partial = s->count & 63;
+
+    /* Start padding */
+    s->buf[partial++] = 0x80;
+
+    if ( partial > 56 )
+    {
+        /* Need one extra block - pad to 64 */
+        memset(s->buf + partial, 0, 64 - partial);
+        sha2_256_transform(s->state, s->buf);
+        partial = 0;
+    }
+    /* Pad to 56 */
+    memset(s->buf + partial, 0, 56 - partial);
+
+    /* Append the bit count */
+    put_unaligned_be64((uint64_t)s->count << 3, &s->buf[56]);
+    sha2_256_transform(s->state, s->buf);
+
+    /* Store state in digest */
+    for ( i = 0; i < 8; i++ )
+        put_unaligned_be32(s->state[i], &dst[i]);
+}
+
+void sha2_256_digest(uint8_t digest[SHA2_256_DIGEST_SIZE],
+                     const void *msg, size_t len)
+{
+    struct sha2_256_state s;
+
+    sha2_256_init(&s);
+    sha2_256_update(&s, msg, len);
+    sha2_256_final(&s, digest);
+}
+
+#ifdef CONFIG_SELF_TESTS
+
+#include <xen/init.h>
+#include <xen/lib.h>
+
+static const struct test {
+    const char *msg;
+    uint8_t digest[SHA2_256_DIGEST_SIZE];
+} tests[] __initconst = {
+    {
+        .msg = "abc",
+        .digest = {
+            0xba, 0x78, 0x16, 0xbf, 0x8f, 0x01, 0xcf, 0xea,
+            0x41, 0x41, 0x40, 0xde, 0x5d, 0xae, 0x22, 0x23,
+            0xb0, 0x03, 0x61, 0xa3, 0x96, 0x17, 0x7a, 0x9c,
+            0xb4, 0x10, 0xff, 0x61, 0xf2, 0x00, 0x15, 0xad,
+        },
+    },
+    {
+        .msg = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
+        .digest = {
+            0x24, 0x8d, 0x6a, 0x61, 0xd2, 0x06, 0x38, 0xb8,
+            0xe5, 0xc0, 0x26, 0x93, 0x0c, 0x3e, 0x60, 0x39,
+            0xa3, 0x3c, 0xe4, 0x59, 0x64, 0xff, 0x21, 0x67,
+            0xf6, 0xec, 0xed, 0xd4, 0x19, 0xdb, 0x06, 0xc1,
+        },
+    },
+};
+
+static void __init __constructor test_sha2_256(void)
+{
+    for ( unsigned int i = 0; i < ARRAY_SIZE(tests); ++i )
+    {
+        const struct test *t = &tests[i];
+        uint8_t res[SHA2_256_DIGEST_SIZE] = {};
+
+        sha2_256_digest(res, t->msg, strlen(t->msg));
+
+        if ( memcmp(res, t->digest, sizeof(t->digest)) == 0 )
+            continue;
+
+        panic("%s() msg '%s' failed\n"
+              "  expected %" STR(SHA2_256_DIGEST_SIZE) "phN\n"
+              "       got %" STR(SHA2_256_DIGEST_SIZE) "phN\n",
+              __func__, t->msg, t->digest, res);
+    }
+}
+#endif /* CONFIG_SELF_TESTS */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 13:22:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 13:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947408.1345040 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3EKt-0004iU-JA; Fri, 11 Apr 2025 13:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947408.1345040; Fri, 11 Apr 2025 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 1u3EKt-0004iM-GP; Fri, 11 Apr 2025 13:22:23 +0000
Received: by outflank-mailman (input) for mailman id 947408;
 Fri, 11 Apr 2025 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 1u3EKs-0004iC-IR
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 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 1u3EKs-008QJj-1k
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 13:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3EKs-00BHJL-1c
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 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=6w5vGwv9sDhJYSGN99UHmK85wiKxwIct8M2PZsA3X60=; b=B2EnrzY2P/KiARmqdgAhQKyNeE
	zFlEI/A3NUlB2+g9JElqxPOiSmkV2lmvB/WHe6gkFE649htM3gMU/kiHbWGdJaFJu+X7d2/t38Ihg
	8un7P++A5A6eOFI9UI7qGumn5XAlf113wa37KIO0vF2W88tz9rbChkc+Lk+h+voNeDgM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode
Message-Id: <E1u3EKs-00BHJL-1c@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 13:22:22 +0000

commit 56d85952addb47f7341ad5d5d67aab002c7e7118
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Dec 13 14:34:00 2024 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 14:12:25 2025 +0100

    x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode
    
    Collisions have been found in the microcode signing algorithm used by AMD
    Fam17h/19h CPUs, and now anyone can sign their own.
    
    For more details, see:
      https://bughunters.google.com/blog/5424842357473280/zen-and-the-art-of-microcode-hacking
      https://www.amd.com/en/resources/product-security/bulletin/amd-sb-7033.html
    
    As a stopgap mitigation, check the digest of patches against a table of blobs
    with known provenance.  These are all Fam17h and Fam19h blobs included in
    linux-firwmare at the time of writing, specifically:
    
      https://git.kernel.org/firmware/linux-firmware/c/48bb90cceb882cab8e9ab692bc5779d3bf3a13b8
    
    This checks can be opted out of by booting with ucode=no-digest-check, but
    doing so is not recommended.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 630e8875ab368b97cc7231aaf3809e3d7d5687e1)
    
    Xen: CI fix from XSN-2
    
     * Add cf_check annotation to cmp_patch_id() used by bsearch().
    
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 15fe2eb5f1bac8a212c0ba3d6dfe60d1fdf851cf)
---
 docs/misc/xen-command-line.pandoc              |  10 +-
 xen/arch/x86/cpu/microcode/amd-patch-digests.c | 226 +++++++++++++++++++++++++
 xen/arch/x86/cpu/microcode/amd.c               |  66 +++++++-
 xen/arch/x86/cpu/microcode/core.c              |   3 +
 xen/arch/x86/cpu/microcode/private.h           |   2 +
 5 files changed, 304 insertions(+), 3 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index ff10ff9f65..559fb21c5b 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2671,10 +2671,10 @@ performance.
    Alternatively, selecting `tsx=1` will re-enable TSX at the users own risk.
 
 ### ucode
-> `= List of [ <integer> | scan=<bool>, nmi=<bool>, allow-same=<bool> ]`
+> `= List of [ <integer> | scan=<bool>, nmi=<bool>, allow-same=<bool>, digest-check=<bool> ]`
 
     Applicability: x86
-    Default: `nmi`
+    Default: `nmi,digest-check`
 
 Controls for CPU microcode loading. For early loading, this parameter can
 specify how and where to find the microcode update blob. For late loading,
@@ -2708,6 +2708,12 @@ trying to reload the same version.  Many CPUs will actually reload microcode
 of the same version, and this allows for easy testing of the late microcode
 loading path.
 
+The `digest-check=` option is active by default and controls whether to
+perform additional authenticity checks.  Collisions in the signature algorithm
+used by AMD Fam17h/19h processors have been found.  Xen contains a table of
+digests of microcode patches with known-good provenance, and will block
+loading of patches that do not match.
+
 ### unrestricted_guest (Intel)
 > `= <boolean>`
 
diff --git a/xen/arch/x86/cpu/microcode/amd-patch-digests.c b/xen/arch/x86/cpu/microcode/amd-patch-digests.c
new file mode 100644
index 0000000000..d327612267
--- /dev/null
+++ b/xen/arch/x86/cpu/microcode/amd-patch-digests.c
@@ -0,0 +1,226 @@
+/* Generated from linux-firmware. */
+{
+    .patch_id = 0x0800126f,
+    .digest = {
+        0x2b, 0x5a, 0xf2, 0x9c, 0xdd, 0xd2, 0x7f, 0xec,
+        0xec, 0x96, 0x09, 0x57, 0xb0, 0x96, 0x29, 0x8b,
+        0x2e, 0x26, 0x91, 0xf0, 0x49, 0x33, 0x42, 0x18,
+        0xdd, 0x4b, 0x65, 0x5a, 0xd4, 0x15, 0x3d, 0x33,
+    },
+},
+{
+    .patch_id = 0x0800820d,
+    .digest = {
+        0x68, 0x98, 0x83, 0xcd, 0x22, 0x0d, 0xdd, 0x59,
+        0x73, 0x2c, 0x5b, 0x37, 0x1f, 0x84, 0x0e, 0x67,
+        0x96, 0x43, 0x83, 0x0c, 0x46, 0x44, 0xab, 0x7c,
+        0x7b, 0x65, 0x9e, 0x57, 0xb5, 0x90, 0x4b, 0x0e,
+    },
+},
+{
+    .patch_id = 0x0830107c,
+    .digest = {
+        0x21, 0x64, 0xde, 0xfb, 0x9f, 0x68, 0x96, 0x47,
+        0x70, 0x5c, 0xe2, 0x8f, 0x18, 0x52, 0x6a, 0xac,
+        0xa4, 0xd2, 0x2e, 0xe0, 0xde, 0x68, 0x66, 0xc3,
+        0xeb, 0x1e, 0xd3, 0x3f, 0xbc, 0x51, 0x1d, 0x38,
+    },
+},
+{
+    .patch_id = 0x0860010d,
+    .digest = {
+        0x86, 0xb6, 0x15, 0x83, 0xbc, 0x3b, 0x9c, 0xe0,
+        0xb3, 0xef, 0x1d, 0x99, 0x84, 0x35, 0x15, 0xf7,
+        0x7c, 0x2a, 0xc6, 0x42, 0xdb, 0x73, 0x07, 0x5c,
+        0x7d, 0xc3, 0x02, 0xb5, 0x43, 0x06, 0x5e, 0xf8,
+    },
+},
+{
+    .patch_id = 0x08608108,
+    .digest = {
+        0x14, 0xfe, 0x57, 0x86, 0x49, 0xc8, 0x68, 0xe2,
+        0x11, 0xa3, 0xcb, 0x6e, 0xff, 0x6e, 0xd5, 0x38,
+        0xfe, 0x89, 0x1a, 0xe0, 0x67, 0xbf, 0xc4, 0xcc,
+        0x1b, 0x9f, 0x84, 0x77, 0x2b, 0x9f, 0xaa, 0xbd,
+    },
+},
+{
+    .patch_id = 0x08701034,
+    .digest = {
+        0xc3, 0x14, 0x09, 0xa8, 0x9c, 0x3f, 0x8d, 0x83,
+        0x9b, 0x4c, 0xa5, 0xb7, 0x64, 0x8b, 0x91, 0x5d,
+        0x85, 0x6a, 0x39, 0x26, 0x1e, 0x14, 0x41, 0xa8,
+        0x75, 0xea, 0xa6, 0xf9, 0xc9, 0xd1, 0xea, 0x2b,
+    },
+},
+{
+    .patch_id = 0x08a0000a,
+    .digest = {
+        0x73, 0x31, 0x26, 0x22, 0xd4, 0xf9, 0xee, 0x3c,
+        0x07, 0x06, 0xe7, 0xb9, 0xad, 0xd8, 0x72, 0x44,
+        0x33, 0x31, 0xaa, 0x7d, 0xc3, 0x67, 0x0e, 0xdb,
+        0x47, 0xb5, 0xaa, 0xbc, 0xf5, 0xbb, 0xd9, 0x20,
+    },
+},
+{
+    .patch_id = 0x0a00107a,
+    .digest = {
+        0x5f, 0x92, 0xca, 0xff, 0xc3, 0x59, 0x22, 0x5f,
+        0x02, 0xa0, 0x91, 0x3b, 0x4a, 0x45, 0x10, 0xfd,
+        0x19, 0xe1, 0x8a, 0x6d, 0x9a, 0x92, 0xc1, 0x3f,
+        0x75, 0x78, 0xac, 0x78, 0x03, 0x1d, 0xdb, 0x18,
+    },
+},
+{
+    .patch_id = 0x0a0011d5,
+    .digest = {
+        0xed, 0x69, 0x89, 0xf4, 0xeb, 0x64, 0xc2, 0x13,
+        0xe0, 0x51, 0x1f, 0x03, 0x26, 0x52, 0x7d, 0xb7,
+        0x93, 0x5d, 0x65, 0xca, 0xb8, 0x12, 0x1d, 0x62,
+        0x0d, 0x5b, 0x65, 0x34, 0x69, 0xb2, 0x62, 0x21,
+    },
+},
+{
+    .patch_id = 0x0a001238,
+    .digest = {
+        0x72, 0xf7, 0x4b, 0x0c, 0x7d, 0x58, 0x65, 0xcc,
+        0x00, 0xcc, 0x57, 0x16, 0x68, 0x16, 0xf8, 0x2a,
+        0x1b, 0xb3, 0x8b, 0xe1, 0xb6, 0x83, 0x8c, 0x7e,
+        0xc0, 0xcd, 0x33, 0xf2, 0x8d, 0xf9, 0xef, 0x59,
+    },
+},
+{
+    .patch_id = 0x0a00820c,
+    .digest = {
+        0xa8, 0x0c, 0x81, 0xc0, 0xa6, 0x00, 0xe7, 0xf3,
+        0x5f, 0x65, 0xd3, 0xb9, 0x6f, 0xea, 0x93, 0x63,
+        0xf1, 0x8c, 0x88, 0x45, 0xd7, 0x82, 0x80, 0xd1,
+        0xe1, 0x3b, 0x8d, 0xb2, 0xf8, 0x22, 0x03, 0xe2,
+    },
+},
+{
+    .patch_id = 0x0a101148,
+    .digest = {
+        0x20, 0xd5, 0x6f, 0x40, 0x4a, 0xf6, 0x48, 0x90,
+        0xc2, 0x93, 0x9a, 0xc2, 0xfd, 0xac, 0xef, 0x4f,
+        0xfa, 0xc0, 0x3d, 0x92, 0x3c, 0x6d, 0x01, 0x08,
+        0xf1, 0x5e, 0xb0, 0xde, 0xb4, 0x98, 0xae, 0xc4,
+    },
+},
+{
+    .patch_id = 0x0a101248,
+    .digest = {
+        0xed, 0x3b, 0x95, 0xa6, 0x68, 0xa7, 0x77, 0x3e,
+        0xfc, 0x17, 0x26, 0xe2, 0x7b, 0xd5, 0x56, 0x22,
+        0x2c, 0x1d, 0xef, 0xeb, 0x56, 0xdd, 0xba, 0x6e,
+        0x1b, 0x7d, 0x64, 0x9d, 0x4b, 0x53, 0x13, 0x75,
+    },
+},
+{
+    .patch_id = 0x0a108108,
+    .digest = {
+        0xed, 0xc2, 0xec, 0xa1, 0x15, 0xc6, 0x65, 0xe9,
+        0xd0, 0xef, 0x39, 0xaa, 0x7f, 0x55, 0x06, 0xc6,
+        0xf5, 0xd4, 0x3f, 0x7b, 0x14, 0xd5, 0x60, 0x2c,
+        0x28, 0x1e, 0x9c, 0x59, 0x69, 0x99, 0x4d, 0x16,
+    },
+},
+{
+    .patch_id = 0x0a20102d,
+    .digest = {
+        0xf9, 0x6e, 0xf2, 0x32, 0xd3, 0x0f, 0x5f, 0x11,
+        0x59, 0xa1, 0xfe, 0xcc, 0xcd, 0x9b, 0x42, 0x89,
+        0x8b, 0x89, 0x2f, 0xb5, 0xbb, 0x82, 0xef, 0x23,
+        0x8c, 0xe9, 0x19, 0x3e, 0xcc, 0x3f, 0x7b, 0xb4,
+    },
+},
+{
+    .patch_id = 0x0a201210,
+    .digest = {
+        0xe8, 0x6d, 0x51, 0x6a, 0x8e, 0x72, 0xf3, 0xfe,
+        0x6e, 0x16, 0xbc, 0x62, 0x59, 0x40, 0x17, 0xe9,
+        0x6d, 0x3d, 0x0e, 0x6b, 0xa7, 0xac, 0xe3, 0x68,
+        0xf7, 0x55, 0xf0, 0x13, 0xbb, 0x22, 0xf6, 0x41,
+    },
+},
+{
+    .patch_id = 0x0a404107,
+    .digest = {
+        0xbb, 0x04, 0x4e, 0x47, 0xdd, 0x5e, 0x26, 0x45,
+        0x1a, 0xc9, 0x56, 0x24, 0xa4, 0x4c, 0x82, 0xb0,
+        0x8b, 0x0d, 0x9f, 0xf9, 0x3a, 0xdf, 0xc6, 0x81,
+        0x13, 0xbc, 0xc5, 0x25, 0xe4, 0xc5, 0xc3, 0x99,
+    },
+},
+{
+    .patch_id = 0x0a500011,
+    .digest = {
+        0x23, 0x3d, 0x70, 0x7d, 0x03, 0xc3, 0xc4, 0xf4,
+        0x2b, 0x82, 0xc6, 0x05, 0xda, 0x80, 0x0a, 0xf1,
+        0xd7, 0x5b, 0x65, 0x3a, 0x7d, 0xab, 0xdf, 0xa2,
+        0x11, 0x5e, 0x96, 0x7e, 0x71, 0xe9, 0xfc, 0x74,
+    },
+},
+{
+    .patch_id = 0x0a601209,
+    .digest = {
+        0x66, 0x48, 0xd4, 0x09, 0x05, 0xcb, 0x29, 0x32,
+        0x66, 0xb7, 0x9a, 0x76, 0xcd, 0x11, 0xf3, 0x30,
+        0x15, 0x86, 0xcc, 0x5d, 0x97, 0x0f, 0xc0, 0x46,
+        0xe8, 0x73, 0xe2, 0xd6, 0xdb, 0xd2, 0x77, 0x1d,
+    },
+},
+{
+    .patch_id = 0x0a704107,
+    .digest = {
+        0xf3, 0xc6, 0x58, 0x26, 0xee, 0xac, 0x3f, 0xd6,
+        0xce, 0xa1, 0x72, 0x47, 0x3b, 0xba, 0x2b, 0x93,
+        0x2a, 0xad, 0x8e, 0x6b, 0xea, 0x9b, 0xb7, 0xc2,
+        0x64, 0x39, 0x71, 0x8c, 0xce, 0xe7, 0x41, 0x39,
+    },
+},
+{
+    .patch_id = 0x0a705206,
+    .digest = {
+        0x8d, 0xc0, 0x76, 0xbd, 0x58, 0x9f, 0x8f, 0xa4,
+        0x12, 0x9d, 0x21, 0xfb, 0x48, 0x21, 0xbc, 0xe7,
+        0x67, 0x6f, 0x04, 0x18, 0xae, 0x20, 0x87, 0x4b,
+        0x03, 0x35, 0xe9, 0xbe, 0xfb, 0x06, 0xdf, 0xfc,
+    },
+},
+{
+    .patch_id = 0x0a708007,
+    .digest = {
+        0x6b, 0x76, 0xcc, 0x78, 0xc5, 0x8a, 0xa3, 0xe3,
+        0x32, 0x2d, 0x79, 0xe4, 0xc3, 0x80, 0xdb, 0xb2,
+        0x07, 0xaa, 0x3a, 0xe0, 0x57, 0x13, 0x72, 0x80,
+        0xdf, 0x92, 0x73, 0x84, 0x87, 0x3c, 0x73, 0x93,
+    },
+},
+{
+    .patch_id = 0x0a70c005,
+    .digest = {
+        0x88, 0x5d, 0xfb, 0x79, 0x64, 0xd8, 0x46, 0x3b,
+        0x4a, 0x83, 0x8e, 0x77, 0x7e, 0xcf, 0xb3, 0x0f,
+        0x1f, 0x1f, 0xf1, 0x97, 0xeb, 0xfe, 0x56, 0x55,
+        0xee, 0x49, 0xac, 0xe1, 0x8b, 0x13, 0xc5, 0x13,
+    },
+},
+{
+    .patch_id = 0x0aa00116,
+    .digest = {
+        0xe8, 0x4c, 0x2c, 0x88, 0xa1, 0xac, 0x24, 0x63,
+        0x65, 0xe5, 0xaa, 0x2d, 0x16, 0xa9, 0xc3, 0xf5,
+        0xfe, 0x1d, 0x5e, 0x65, 0xc7, 0xaa, 0x92, 0x4d,
+        0x91, 0xee, 0x76, 0xbb, 0x4c, 0x66, 0x78, 0xc9,
+    },
+},
+{
+    .patch_id = 0x0aa00215,
+    .digest = {
+        0x55, 0xd3, 0x28, 0xcb, 0x87, 0xa9, 0x32, 0xe9,
+        0x4e, 0x85, 0x4b, 0x7c, 0x6b, 0xd5, 0x7c, 0xd4,
+        0x1b, 0x51, 0x71, 0x3a, 0x0e, 0x0b, 0xdc, 0x9b,
+        0x68, 0x2f, 0x46, 0xee, 0xfe, 0xc6, 0x6d, 0xef,
+    },
+},
diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 31fbd326e5..e17c60fe3b 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -16,7 +16,9 @@
 
 #include <xen/err.h>
 #include <xen/init.h>
+#include <xen/lib.h>
 #include <xen/mm.h> /* TODO: Fix asm/tlbflush.h breakage */
+#include <xen/sha2.h>
 
 #include <asm/msr.h>
 
@@ -91,6 +93,59 @@ static struct {
     uint16_t id;
 } equiv __read_mostly;
 
+static const struct patch_digest {
+    uint32_t patch_id;
+    uint8_t digest[SHA2_256_DIGEST_SIZE];
+} patch_digests[] = {
+#include "amd-patch-digests.c"
+};
+
+static int cf_check cmp_patch_id(const void *key, const void *elem)
+{
+    const struct patch_digest *pd = elem;
+    uint32_t patch_id = *(uint32_t *)key;
+
+    if ( patch_id == pd->patch_id )
+        return 0;
+    else if ( patch_id < pd->patch_id )
+        return -1;
+    return 1;
+}
+
+static bool check_digest(const struct container_microcode *mc)
+{
+    const struct microcode_patch *patch = mc->patch;
+    const struct patch_digest *pd;
+    uint8_t digest[SHA2_256_DIGEST_SIZE];
+
+    /* Only Fam17h/19h are known to need extra checks.  Skip other families. */
+    if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x19 ||
+         !opt_digest_check )
+        return true;
+
+    pd = bsearch(&patch->patch_id, patch_digests, ARRAY_SIZE(patch_digests),
+                 sizeof(struct patch_digest), cmp_patch_id);
+    if ( !pd )
+    {
+        printk(XENLOG_WARNING "No digest found for patch_id %08x\n",
+               patch->patch_id);
+        return false;
+    }
+
+    sha2_256_digest(digest, patch, mc->len);
+
+    if ( memcmp(digest, pd->digest, sizeof(digest)) )
+    {
+        printk(XENLOG_WARNING "Patch %08x SHA256 mismatch:\n"
+               "  expected %" STR(SHA2_256_DIGEST_SIZE) "phN\n"
+               "       got %" STR(SHA2_256_DIGEST_SIZE) "phN\n",
+               patch->patch_id, pd->digest, digest);
+        return false;
+    }
+
+    return true;
+}
+
 static void cf_check collect_cpu_info(void)
 {
     struct cpu_signature *csig = &this_cpu(cpu_sig);
@@ -394,7 +449,8 @@ static struct microcode_patch *cf_check cpu_request_microcode(
              * one with higher revision.
              */
             if ( (microcode_fits(mc->patch) != MIS_UCODE) &&
-                 (!saved || (compare_header(mc->patch, saved) == NEW_UCODE)) )
+                 (!saved || (compare_header(mc->patch, saved) == NEW_UCODE)) &&
+                 check_digest(mc) )
             {
                 saved = mc->patch;
                 saved_size = mc->len;
@@ -449,6 +505,14 @@ static const struct microcode_ops __initconst_cf_clobber amd_ucode_ops = {
 
 void __init ucode_probe_amd(struct microcode_ops *ops)
 {
+    if ( !opt_digest_check &&
+         boot_cpu_data.x86 >= 0x17 && boot_cpu_data.x86 <= 0x19 )
+    {
+        printk(XENLOG_WARNING
+               "Microcode patch additional digest checks disabled");
+        add_taint(TAINT_CPU_OUT_OF_SPEC);
+    }
+
     if ( boot_cpu_data.x86 < 0x10 )
         return;
 
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 655bc41e07..cae3d1ee3d 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -99,6 +99,7 @@ static bool __initdata ucode_scan;
 static bool ucode_in_nmi = true;
 
 bool __read_mostly opt_ucode_allow_same;
+bool __ro_after_init opt_digest_check = true;
 
 /* Protected by microcode_mutex */
 static struct microcode_patch *microcode_cache;
@@ -128,6 +129,8 @@ static int __init cf_check parse_ucode(const char *s)
             ucode_in_nmi = val;
         else if ( (val = parse_boolean("allow-same", s, ss)) >= 0 )
             opt_ucode_allow_same = val;
+        else if ( (val = parse_boolean("digest-check", s, ss)) >= 0 )
+            opt_digest_check = val;
         else if ( !ucode_mod_forced ) /* Not forced by EFI */
         {
             if ( (val = parse_boolean("scan", s, ss)) >= 0 )
diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h
index da556fe506..ef134724d8 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -60,6 +60,8 @@ struct microcode_ops {
         const struct microcode_patch *new, const struct microcode_patch *old);
 };
 
+extern bool opt_digest_check;
+
 /*
  * Microcode loading falls into one of 3 states.
  *   - No support at all
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 13:22:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 13:22:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947409.1345044 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3EL3-0004lW-Le; Fri, 11 Apr 2025 13:22:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947409.1345044; Fri, 11 Apr 2025 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 1u3EL3-0004lP-JB; Fri, 11 Apr 2025 13:22:33 +0000
Received: by outflank-mailman (input) for mailman id 947409;
 Fri, 11 Apr 2025 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 1u3EL2-0004lJ-M7
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 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 1u3EL2-008QK6-27
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 13:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3EL2-00BHOR-1v
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 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=wnYxOYsSrU2IRbpNB6GQV+F2QrbqLAUpQDAB/8sPb9U=; b=PuB1/BovhdWEIo3JFRYFy1fZHQ
	gKT4uumc5VA7GjLf02t+smEDEnpMm3gZvoRLoTnmQuRO/15nWJUPeXv/3E7yVVyHk/6ke0iLUar1I
	5fhpfdySiDsQVOTLSbMnyEB/Ubuuto7GxOnKEAogtfv/3VnGDzxBsZLcvCPOcESZcdJM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/ucode: Extend AMD digest checks to cover Zen5 CPUs
Message-Id: <E1u3EL2-00BHOR-1v@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 13:22:32 +0000

commit 465ccf84e382d367833924cc9fb44eb1580f2337
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 8 17:09:15 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 14:12:25 2025 +0100

    x86/ucode: Extend AMD digest checks to cover Zen5 CPUs
    
    AMD have updated the SB-7033 advisory to include Zen5 CPUs.  Extend the digest
    check to cover Zen5 too.
    
    In practice, cover everything until further notice.
    
    Observant readers may be wondering where the update to the digest list is.  At
    the time of writing, no Zen5 patches are available via a verifiable channel.
    
    Link: https://www.amd.com/en/resources/product-security/bulletin/amd-sb-7033.html
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit b63951467e964bcc927f823fc943e40069fac0c9)
    
    x86/ucode: Extend warning about disabling digest check too
    
    This was missed by accident.
    
    Fixes: b63951467e96 ("x86/ucode: Extend AMD digest checks to cover Zen5 CPUs")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 59bb316ea89e7f9461690fe00547d7d2af96321d)
---
 xen/arch/x86/cpu/microcode/amd.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index e17c60fe3b..4f236e4399 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -118,8 +118,12 @@ static bool check_digest(const struct container_microcode *mc)
     const struct patch_digest *pd;
     uint8_t digest[SHA2_256_DIGEST_SIZE];
 
-    /* Only Fam17h/19h are known to need extra checks.  Skip other families. */
-    if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x19 ||
+    /*
+     * Zen1 thru Zen5 CPUs are known to use a weak signature algorithm on
+     * microcode updates.  Mitigate by checking the digest of the patch
+     * against a list of known provenance.
+     */
+    if ( boot_cpu_data.x86 < 0x17 ||
          !opt_digest_check )
         return true;
 
@@ -505,8 +509,7 @@ static const struct microcode_ops __initconst_cf_clobber amd_ucode_ops = {
 
 void __init ucode_probe_amd(struct microcode_ops *ops)
 {
-    if ( !opt_digest_check &&
-         boot_cpu_data.x86 >= 0x17 && boot_cpu_data.x86 <= 0x19 )
+    if ( !opt_digest_check && boot_cpu_data.x86 >= 0x17 )
     {
         printk(XENLOG_WARNING
                "Microcode patch additional digest checks disabled");
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 14:11:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 14:11:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947437.1345069 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3F5y-00026h-IJ; Fri, 11 Apr 2025 14:11:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947437.1345069; Fri, 11 Apr 2025 14:11:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3F5y-00026Z-F3; Fri, 11 Apr 2025 14:11:02 +0000
Received: by outflank-mailman (input) for mailman id 947437;
 Fri, 11 Apr 2025 14:11:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u3F5x-0001vu-J8
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 14:11:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3F5x-008RTY-1U
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 14:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3F5x-00BQ0f-1H
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 14:11:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=D3fpKeRF+oAzlMg8rDSVQW4FmoGST5vm6dkaKl3pC/k=; b=6wq7g/N7M4e5SYzpqpI2qKoWdT
	RpEK47b4PoaRLdF0GDZTwL2UeBt0nr9uqfMv6QqUR36dozKRGH5yYmE6U00fHDdErvrz/G6PH+S6D
	KcDXecNwAPTrvsDK1MbCF9ChpLXhK/JAnpUtnmTAXBIc0VixGqjfHCtaq97QXintvELs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation/eclair: Remove bespoke service B.UNEVALEFF
Message-Id: <E1u3F5x-00BQ0f-1H@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 14:11:01 +0000

commit a43b0a770bdcf3933634c860049e4bd65854e472
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Thu Apr 10 21:32:14 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 11:01:05 2025 +0100

    automation/eclair: Remove bespoke service B.UNEVALEFF
    
    The Eclair runners in GitlabCI have been update.  This service is now
    included, and redefining results in an error.
    
    No functional change.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/eclair_analysis/ECLAIR/B.UNEVALEFF.ecl | 10 ----------
 automation/eclair_analysis/ECLAIR/analysis.ecl    |  1 -
 2 files changed, 11 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/B.UNEVALEFF.ecl b/automation/eclair_analysis/ECLAIR/B.UNEVALEFF.ecl
deleted file mode 100644
index fa249b8e36..0000000000
--- a/automation/eclair_analysis/ECLAIR/B.UNEVALEFF.ecl
+++ /dev/null
@@ -1,10 +0,0 @@
--clone_service=MC3A2.R13.6,B.UNEVALEFF
-
--config=B.UNEVALEFF,summary="The operand of the `alignof' and `typeof'  operators shall not contain any expression which has potential side effects"
--config=B.UNEVALEFF,stmt_child_matcher=
-{"stmt(node(utrait_expr)&&operator(alignof))", expr, 0, "stmt(any())", {}},
-{"stmt(node(utrait_type)&&operator(alignof))", type, 0, "stmt(any())", {}},
-{"stmt(node(utrait_expr)&&operator(preferred_alignof))", expr, 0, "stmt(any())", {}},
-{"stmt(node(utrait_type)&&operator(preferred_alignof))", type, 0, "stmt(any())", {}},
-{"type(node(typeof_expr))", expr, 0, "stmt(any())", {}},
-{"type(node(typeof_type))", type, 0, "stmt(any())", {}}
diff --git a/automation/eclair_analysis/ECLAIR/analysis.ecl b/automation/eclair_analysis/ECLAIR/analysis.ecl
index 29409a9af0..399099938f 100644
--- a/automation/eclair_analysis/ECLAIR/analysis.ecl
+++ b/automation/eclair_analysis/ECLAIR/analysis.ecl
@@ -50,7 +50,6 @@ their Standard Library equivalents."
 -eval_file=adopted.ecl
 -eval_file=out_of_scope.ecl
 
--eval_file=B.UNEVALEFF.ecl
 -eval_file=deviations.ecl
 -eval_file=call_properties.ecl
 -eval_file=tagging.ecl
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 14:55:08 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 14:55:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947470.1345083 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3FmZ-0006Ts-PN; Fri, 11 Apr 2025 14:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947470.1345083; Fri, 11 Apr 2025 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 1u3FmZ-0006Tk-Mo; Fri, 11 Apr 2025 14:55:03 +0000
Received: by outflank-mailman (input) for mailman id 947470;
 Fri, 11 Apr 2025 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 1u3FmY-0006Te-GD
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 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 1u3FmY-008SOO-0U
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 14:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3FmY-00BYsu-0K
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 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=EfH5pQO8i6GvUjbbtdFBKgGgbxBOgsY9oERPvPyfBMY=; b=sUTNGJWsv8lr7nYazIkVjzYwtt
	xpoDNcSBGtFl5opuhSRrjhOJee3foqis8TBOIdqgvtr/iKATtupT1a8vPvKX277oElUGc9w51i7/K
	JfTxicxEnrrbzWhgbWyMUw7xp0KIOcydUKp3b9pqlqJmh9TlP1B+1Cah63+nVSAbmg2I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] tools/libxl: do not use `-c -E` compiler options together
Message-Id: <E1u3FmY-00BYsu-0K@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 14:55:02 +0000

commit 95d726d28bc7b07709cbc09c324f66f5659e0429
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Apr 7 13:09:38 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 14:08:31 2025 +0100

    tools/libxl: do not use `-c -E` compiler options together
    
    It makes no sense to request for preprocessor only output and also request
    object file generation.  Fix the _libxl.api-for-check target to only use
    -E (preprocessor output).
    
    Also Clang 20.0 reports an error if both options are used.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Fixes: 2862bf5b6c81 ('libxl: enforce prohibitions of internal callers')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
    (cherry picked from commit a235f856e4bbd270b085590e1f5fc9599234dcdf)
---
 tools/libs/light/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
index 37e4d16709..b690d92159 100644
--- a/tools/libs/light/Makefile
+++ b/tools/libs/light/Makefile
@@ -195,7 +195,7 @@ libxl.api-ok: check-libxl-api-rules _libxl.api-for-check
 	touch $@
 
 _libxl.api-for-check: $(XEN_INCLUDE)/libxl.h
-	$(CC) $(CPPFLAGS) $(CFLAGS) -c -E $< $(APPEND_CFLAGS) \
+	$(CC) $(CPPFLAGS) $(CFLAGS) -E $< $(APPEND_CFLAGS) \
 		-DLIBXL_EXTERNAL_CALLERS_ONLY=LIBXL_EXTERNAL_CALLERS_ONLY \
 		>$@.new
 	mv -f $@.new $@
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 14:55:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 14:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947471.1345087 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3Fmj-0006Vd-Qz; Fri, 11 Apr 2025 14:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947471.1345087; Fri, 11 Apr 2025 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 1u3Fmj-0006VV-OI; Fri, 11 Apr 2025 14:55:13 +0000
Received: by outflank-mailman (input) for mailman id 947471;
 Fri, 11 Apr 2025 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 1u3Fmi-0006VG-9u
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 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 1u3Fmi-008SRv-0q
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 14:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3Fmi-00BZ0I-0h
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 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=lN49rr7X0lvWl/vMCFdfxVPNrMrs0qIlydEQLJKoqxA=; b=ShMIhZ1S5m1tJtZ3sklHtTdwrp
	bFr9Xed7AyP6OekJ+O+yz/Z6Y625qT4PvamQ67mqyj83rzZ3ZR7P8WkTenvJcVsKgmKb4GM3sIk5t
	iU+TJGLjClXvHi5lVi+mlSG8bX0VEL7xlAALE9e2z94p/IyJ1g+hfLd/ljaRJ0dXmfzI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] xen/lib: Introduce SHA2-256
Message-Id: <E1u3Fmi-00BZ0I-0h@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 14:55:12 +0000

commit 41d65b31146bef22eef16a5ea6cdbe5041985f4f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Dec 13 14:34:00 2024 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 14:08:31 2025 +0100

    xen/lib: Introduce SHA2-256
    
    A future change will need to calculate SHA2-256 digests.  Introduce an
    implementation in lib/, derived from Trenchboot which itself is derived from
    Linux.
    
    In order to be useful to other architectures, it is careful with endianness
    and misaligned accesses as well as being more MISRA friendly, but is only
    wired up for x86 in the short term.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 372af524411f5a013bcb0b117073d8d07c026563)
    
    Xen: CI fix from XSN-2
    
     * Add U suffix to the K[] table to fix MISRA Rule 7.2 violations.
    
    Fixes: 372af524411f ("xen/lib: Introduce SHA2-256")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 15fe2eb5f1bac8a212c0ba3d6dfe60d1fdf851cf)
---
 xen/include/xen/sha2.h |  15 +++
 xen/lib/Makefile       |   1 +
 xen/lib/sha2-256.c     | 264 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 280 insertions(+)

diff --git a/xen/include/xen/sha2.h b/xen/include/xen/sha2.h
new file mode 100644
index 0000000000..47d97fbf01
--- /dev/null
+++ b/xen/include/xen/sha2.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * SHA2-256: https://csrc.nist.gov/pubs/fips/180-2/upd1/final
+ */
+#ifndef XEN_SHA2_H
+#define XEN_SHA2_H
+
+#include <xen/types.h>
+
+#define SHA2_256_DIGEST_SIZE 32
+
+void sha2_256_digest(uint8_t digest[SHA2_256_DIGEST_SIZE],
+                     const void *msg, size_t len);
+
+#endif /* XEN_SHA2_H */
diff --git a/xen/lib/Makefile b/xen/lib/Makefile
index 54440f628a..76dc86fab0 100644
--- a/xen/lib/Makefile
+++ b/xen/lib/Makefile
@@ -17,6 +17,7 @@ lib-y += memset.o
 lib-y += muldiv64.o
 lib-y += parse-size.o
 lib-y += rbtree.o
+lib-$(CONFIG_X86) += sha2-256.o
 lib-y += sort.o
 lib-y += strcasecmp.o
 lib-y += strchr.o
diff --git a/xen/lib/sha2-256.c b/xen/lib/sha2-256.c
new file mode 100644
index 0000000000..19e8252188
--- /dev/null
+++ b/xen/lib/sha2-256.c
@@ -0,0 +1,264 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * SHA2-256: https://csrc.nist.gov/pubs/fips/180-2/upd1/final
+ *
+ * Originally derived from Linux.  Modified substantially to optimise for size
+ * and Xen's expected usecases.
+ */
+#include <xen/bitops.h>
+#include <xen/sha2.h>
+#include <xen/string.h>
+#include <xen/unaligned.h>
+
+struct sha2_256_state {
+    uint32_t state[SHA2_256_DIGEST_SIZE / sizeof(uint32_t)];
+    uint8_t buf[64];
+    size_t count; /* Byte count. */
+};
+
+static uint32_t choose(uint32_t x, uint32_t y, uint32_t z)
+{
+    return z ^ (x & (y ^ z));
+}
+
+static uint32_t majority(uint32_t x, uint32_t y, uint32_t z)
+{
+    return (x & y) | (z & (x | y));
+}
+
+static uint32_t e0(uint32_t x)
+{
+    return ror32(x, 2) ^ ror32(x, 13) ^ ror32(x, 22);
+}
+
+static uint32_t e1(uint32_t x)
+{
+    return ror32(x, 6) ^ ror32(x, 11) ^ ror32(x, 25);
+}
+
+static uint32_t s0(uint32_t x)
+{
+    return ror32(x, 7) ^ ror32(x, 18) ^ (x >> 3);
+}
+
+static uint32_t s1(uint32_t x)
+{
+    return ror32(x, 17) ^ ror32(x, 19) ^ (x >> 10);
+}
+
+static uint32_t blend(uint32_t W[16], unsigned int i)
+{
+#define W(i) W[(i) & 15]
+
+    return W(i) += s1(W(i - 2)) + W(i - 7) + s0(W(i - 15));
+
+#undef W
+}
+
+static const uint32_t K[] = {
+    0x428a2f98U, 0x71374491U, 0xb5c0fbcfU, 0xe9b5dba5U,
+    0x3956c25bU, 0x59f111f1U, 0x923f82a4U, 0xab1c5ed5U,
+    0xd807aa98U, 0x12835b01U, 0x243185beU, 0x550c7dc3U,
+    0x72be5d74U, 0x80deb1feU, 0x9bdc06a7U, 0xc19bf174U,
+    0xe49b69c1U, 0xefbe4786U, 0x0fc19dc6U, 0x240ca1ccU,
+    0x2de92c6fU, 0x4a7484aaU, 0x5cb0a9dcU, 0x76f988daU,
+    0x983e5152U, 0xa831c66dU, 0xb00327c8U, 0xbf597fc7U,
+    0xc6e00bf3U, 0xd5a79147U, 0x06ca6351U, 0x14292967U,
+    0x27b70a85U, 0x2e1b2138U, 0x4d2c6dfcU, 0x53380d13U,
+    0x650a7354U, 0x766a0abbU, 0x81c2c92eU, 0x92722c85U,
+    0xa2bfe8a1U, 0xa81a664bU, 0xc24b8b70U, 0xc76c51a3U,
+    0xd192e819U, 0xd6990624U, 0xf40e3585U, 0x106aa070U,
+    0x19a4c116U, 0x1e376c08U, 0x2748774cU, 0x34b0bcb5U,
+    0x391c0cb3U, 0x4ed8aa4aU, 0x5b9cca4fU, 0x682e6ff3U,
+    0x748f82eeU, 0x78a5636fU, 0x84c87814U, 0x8cc70208U,
+    0x90befffaU, 0xa4506cebU, 0xbef9a3f7U, 0xc67178f2U,
+};
+
+static void sha2_256_transform(uint32_t *state, const void *_input)
+{
+    const uint32_t *input = _input;
+    uint32_t a, b, c, d, e, f, g, h, t1, t2;
+    uint32_t W[16];
+    unsigned int i;
+
+    for ( i = 0; i < 16; i++ )
+        W[i] = get_unaligned_be32(&input[i]);
+
+    a = state[0]; b = state[1]; c = state[2]; d = state[3];
+    e = state[4]; f = state[5]; g = state[6]; h = state[7];
+
+    for ( i = 0; i < 16; i += 8 )
+    {
+        t1 = h + e1(e) + choose(e, f, g) + K[i + 0] + W[i + 0];
+        t2 = e0(a) + majority(a, b, c);    d += t1;    h = t1 + t2;
+        t1 = g + e1(d) + choose(d, e, f) + K[i + 1] + W[i + 1];
+        t2 = e0(h) + majority(h, a, b);    c += t1;    g = t1 + t2;
+        t1 = f + e1(c) + choose(c, d, e) + K[i + 2] + W[i + 2];
+        t2 = e0(g) + majority(g, h, a);    b += t1;    f = t1 + t2;
+        t1 = e + e1(b) + choose(b, c, d) + K[i + 3] + W[i + 3];
+        t2 = e0(f) + majority(f, g, h);    a += t1;    e = t1 + t2;
+        t1 = d + e1(a) + choose(a, b, c) + K[i + 4] + W[i + 4];
+        t2 = e0(e) + majority(e, f, g);    h += t1;    d = t1 + t2;
+        t1 = c + e1(h) + choose(h, a, b) + K[i + 5] + W[i + 5];
+        t2 = e0(d) + majority(d, e, f);    g += t1;    c = t1 + t2;
+        t1 = b + e1(g) + choose(g, h, a) + K[i + 6] + W[i + 6];
+        t2 = e0(c) + majority(c, d, e);    f += t1;    b = t1 + t2;
+        t1 = a + e1(f) + choose(f, g, h) + K[i + 7] + W[i + 7];
+        t2 = e0(b) + majority(b, c, d);    e += t1;    a = t1 + t2;
+    }
+
+    for ( ; i < 64; i += 8 )
+    {
+        t1 = h + e1(e) + choose(e, f, g) + K[i + 0] + blend(W, i + 0);
+        t2 = e0(a) + majority(a, b, c);    d += t1;    h = t1 + t2;
+        t1 = g + e1(d) + choose(d, e, f) + K[i + 1] + blend(W, i + 1);
+        t2 = e0(h) + majority(h, a, b);    c += t1;    g = t1 + t2;
+        t1 = f + e1(c) + choose(c, d, e) + K[i + 2] + blend(W, i + 2);
+        t2 = e0(g) + majority(g, h, a);    b += t1;    f = t1 + t2;
+        t1 = e + e1(b) + choose(b, c, d) + K[i + 3] + blend(W, i + 3);
+        t2 = e0(f) + majority(f, g, h);    a += t1;    e = t1 + t2;
+        t1 = d + e1(a) + choose(a, b, c) + K[i + 4] + blend(W, i + 4);
+        t2 = e0(e) + majority(e, f, g);    h += t1;    d = t1 + t2;
+        t1 = c + e1(h) + choose(h, a, b) + K[i + 5] + blend(W, i + 5);
+        t2 = e0(d) + majority(d, e, f);    g += t1;    c = t1 + t2;
+        t1 = b + e1(g) + choose(g, h, a) + K[i + 6] + blend(W, i + 6);
+        t2 = e0(c) + majority(c, d, e);    f += t1;    b = t1 + t2;
+        t1 = a + e1(f) + choose(f, g, h) + K[i + 7] + blend(W, i + 7);
+        t2 = e0(b) + majority(b, c, d);    e += t1;    a = t1 + t2;
+    }
+
+    state[0] += a; state[1] += b; state[2] += c; state[3] += d;
+    state[4] += e; state[5] += f; state[6] += g; state[7] += h;
+}
+
+static void sha2_256_init(struct sha2_256_state *s)
+{
+    *s = (struct sha2_256_state){
+        .state = {
+            0x6a09e667UL,
+            0xbb67ae85UL,
+            0x3c6ef372UL,
+            0xa54ff53aUL,
+            0x510e527fUL,
+            0x9b05688cUL,
+            0x1f83d9abUL,
+            0x5be0cd19UL,
+        },
+    };
+}
+
+static void sha2_256_update(struct sha2_256_state *s, const void *msg,
+                            size_t len)
+{
+    unsigned int partial = s->count & 63;
+
+    s->count += len;
+
+    if ( (partial + len) >= 64 )
+    {
+        if ( partial )
+        {
+            unsigned int rem = 64 - partial;
+
+            /* Fill the partial block. */
+            memcpy(s->buf + partial, msg, rem);
+            msg += rem;
+            len -= rem;
+
+            sha2_256_transform(s->state, s->buf);
+            partial = 0;
+        }
+
+        for ( ; len >= 64; msg += 64, len -= 64 )
+            sha2_256_transform(s->state, msg);
+    }
+
+    /* Remaining data becomes partial. */
+    memcpy(s->buf + partial, msg, len);
+}
+
+static void sha2_256_final(struct sha2_256_state *s, void *_dst)
+{
+    uint32_t *dst = _dst;
+    unsigned int i, partial = s->count & 63;
+
+    /* Start padding */
+    s->buf[partial++] = 0x80;
+
+    if ( partial > 56 )
+    {
+        /* Need one extra block - pad to 64 */
+        memset(s->buf + partial, 0, 64 - partial);
+        sha2_256_transform(s->state, s->buf);
+        partial = 0;
+    }
+    /* Pad to 56 */
+    memset(s->buf + partial, 0, 56 - partial);
+
+    /* Append the bit count */
+    put_unaligned_be64((uint64_t)s->count << 3, &s->buf[56]);
+    sha2_256_transform(s->state, s->buf);
+
+    /* Store state in digest */
+    for ( i = 0; i < 8; i++ )
+        put_unaligned_be32(s->state[i], &dst[i]);
+}
+
+void sha2_256_digest(uint8_t digest[SHA2_256_DIGEST_SIZE],
+                     const void *msg, size_t len)
+{
+    struct sha2_256_state s;
+
+    sha2_256_init(&s);
+    sha2_256_update(&s, msg, len);
+    sha2_256_final(&s, digest);
+}
+
+#ifdef CONFIG_SELF_TESTS
+
+#include <xen/init.h>
+#include <xen/lib.h>
+
+static const struct test {
+    const char *msg;
+    uint8_t digest[SHA2_256_DIGEST_SIZE];
+} tests[] __initconst = {
+    {
+        .msg = "abc",
+        .digest = {
+            0xba, 0x78, 0x16, 0xbf, 0x8f, 0x01, 0xcf, 0xea,
+            0x41, 0x41, 0x40, 0xde, 0x5d, 0xae, 0x22, 0x23,
+            0xb0, 0x03, 0x61, 0xa3, 0x96, 0x17, 0x7a, 0x9c,
+            0xb4, 0x10, 0xff, 0x61, 0xf2, 0x00, 0x15, 0xad,
+        },
+    },
+    {
+        .msg = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
+        .digest = {
+            0x24, 0x8d, 0x6a, 0x61, 0xd2, 0x06, 0x38, 0xb8,
+            0xe5, 0xc0, 0x26, 0x93, 0x0c, 0x3e, 0x60, 0x39,
+            0xa3, 0x3c, 0xe4, 0x59, 0x64, 0xff, 0x21, 0x67,
+            0xf6, 0xec, 0xed, 0xd4, 0x19, 0xdb, 0x06, 0xc1,
+        },
+    },
+};
+
+static void __init __constructor test_sha2_256(void)
+{
+    for ( unsigned int i = 0; i < ARRAY_SIZE(tests); ++i )
+    {
+        const struct test *t = &tests[i];
+        uint8_t res[SHA2_256_DIGEST_SIZE] = {};
+
+        sha2_256_digest(res, t->msg, strlen(t->msg));
+
+        if ( memcmp(res, t->digest, sizeof(t->digest)) == 0 )
+            continue;
+
+        panic("%s() msg '%s' failed\n"
+              "  expected %" STR(SHA2_256_DIGEST_SIZE) "phN\n"
+              "       got %" STR(SHA2_256_DIGEST_SIZE) "phN\n",
+              __func__, t->msg, t->digest, res);
+    }
+}
+#endif /* CONFIG_SELF_TESTS */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 14:55:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 14:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947472.1345091 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3Fmt-0006Y6-SO; Fri, 11 Apr 2025 14:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947472.1345091; Fri, 11 Apr 2025 14: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 1u3Fmt-0006Xy-Pn; Fri, 11 Apr 2025 14:55:23 +0000
Received: by outflank-mailman (input) for mailman id 947472;
 Fri, 11 Apr 2025 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 1u3Fms-0006Xh-Df
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 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 1u3Fms-008SRz-1E
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 14:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3Fms-00BZHj-13
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 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=fTziuxpscu3411f2DrYcKv4DRhtKownNVu6yieQlaMQ=; b=e1ov6N4Sj31L4LM6MUpd/SuCS6
	lNoHiAqa0gDBls4AlxLFdjHNg6wHCV1/WwcLxbbv6ouxWKvLFznDhfWLLLxSgW8Q3lfUirgASguDP
	BjtW0h3VDGRAlbbdIYRHyzKifmXIupC4x8xu4vGdnicnnLSlSzf5N09tl4tLwnfDp100=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode
Message-Id: <E1u3Fms-00BZHj-13@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 14:55:22 +0000

commit ad569a4bd7477be1cd9e06f160a969053d8521e7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Dec 13 14:34:00 2024 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 14:08:31 2025 +0100

    x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode
    
    Collisions have been found in the microcode signing algorithm used by AMD
    Fam17h/19h CPUs, and now anyone can sign their own.
    
    For more details, see:
      https://bughunters.google.com/blog/5424842357473280/zen-and-the-art-of-microcode-hacking
      https://www.amd.com/en/resources/product-security/bulletin/amd-sb-7033.html
    
    As a stopgap mitigation, check the digest of patches against a table of blobs
    with known provenance.  These are all Fam17h and Fam19h blobs included in
    linux-firwmare at the time of writing, specifically:
    
      https://git.kernel.org/firmware/linux-firmware/c/48bb90cceb882cab8e9ab692bc5779d3bf3a13b8
    
    This checks can be opted out of by booting with ucode=no-digest-check, but
    doing so is not recommended.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 630e8875ab368b97cc7231aaf3809e3d7d5687e1)
    
    Xen: CI fix from XSN-2
    
     * Add cf_check annotation to cmp_patch_id() used by bsearch().
    
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 15fe2eb5f1bac8a212c0ba3d6dfe60d1fdf851cf)
---
 docs/misc/xen-command-line.pandoc              |  10 +-
 xen/arch/x86/cpu/microcode/amd-patch-digests.c | 226 +++++++++++++++++++++++++
 xen/arch/x86/cpu/microcode/amd.c               |  66 +++++++-
 xen/arch/x86/cpu/microcode/core.c              |   3 +
 xen/arch/x86/cpu/microcode/private.h           |   2 +
 5 files changed, 304 insertions(+), 3 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 83bb69cfb8..53ad3ffc3f 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2735,10 +2735,10 @@ performance.
    Alternatively, selecting `tsx=1` will re-enable TSX at the users own risk.
 
 ### ucode
-> `= List of [ <integer> | scan=<bool>, nmi=<bool> ]`
+> `= List of [ <integer> | scan=<bool>, nmi=<bool>, digest-check=<bool> ]`
 
     Applicability: x86
-    Default: `nmi`
+    Default: `nmi,digest-check`
 
 Controls for CPU microcode loading. For early loading, this parameter can
 specify how and where to find the microcode update blob. For late loading,
@@ -2767,6 +2767,12 @@ precedence over `scan`.
 stop_machine context. In NMI handler, even NMIs are blocked, which is
 considered safer. The default value is `true`.
 
+The `digest-check=` option is active by default and controls whether to
+perform additional authenticity checks.  Collisions in the signature algorithm
+used by AMD Fam17h/19h processors have been found.  Xen contains a table of
+digests of microcode patches with known-good provenance, and will block
+loading of patches that do not match.
+
 ### unrestricted_guest (Intel)
 > `= <boolean>`
 
diff --git a/xen/arch/x86/cpu/microcode/amd-patch-digests.c b/xen/arch/x86/cpu/microcode/amd-patch-digests.c
new file mode 100644
index 0000000000..d327612267
--- /dev/null
+++ b/xen/arch/x86/cpu/microcode/amd-patch-digests.c
@@ -0,0 +1,226 @@
+/* Generated from linux-firmware. */
+{
+    .patch_id = 0x0800126f,
+    .digest = {
+        0x2b, 0x5a, 0xf2, 0x9c, 0xdd, 0xd2, 0x7f, 0xec,
+        0xec, 0x96, 0x09, 0x57, 0xb0, 0x96, 0x29, 0x8b,
+        0x2e, 0x26, 0x91, 0xf0, 0x49, 0x33, 0x42, 0x18,
+        0xdd, 0x4b, 0x65, 0x5a, 0xd4, 0x15, 0x3d, 0x33,
+    },
+},
+{
+    .patch_id = 0x0800820d,
+    .digest = {
+        0x68, 0x98, 0x83, 0xcd, 0x22, 0x0d, 0xdd, 0x59,
+        0x73, 0x2c, 0x5b, 0x37, 0x1f, 0x84, 0x0e, 0x67,
+        0x96, 0x43, 0x83, 0x0c, 0x46, 0x44, 0xab, 0x7c,
+        0x7b, 0x65, 0x9e, 0x57, 0xb5, 0x90, 0x4b, 0x0e,
+    },
+},
+{
+    .patch_id = 0x0830107c,
+    .digest = {
+        0x21, 0x64, 0xde, 0xfb, 0x9f, 0x68, 0x96, 0x47,
+        0x70, 0x5c, 0xe2, 0x8f, 0x18, 0x52, 0x6a, 0xac,
+        0xa4, 0xd2, 0x2e, 0xe0, 0xde, 0x68, 0x66, 0xc3,
+        0xeb, 0x1e, 0xd3, 0x3f, 0xbc, 0x51, 0x1d, 0x38,
+    },
+},
+{
+    .patch_id = 0x0860010d,
+    .digest = {
+        0x86, 0xb6, 0x15, 0x83, 0xbc, 0x3b, 0x9c, 0xe0,
+        0xb3, 0xef, 0x1d, 0x99, 0x84, 0x35, 0x15, 0xf7,
+        0x7c, 0x2a, 0xc6, 0x42, 0xdb, 0x73, 0x07, 0x5c,
+        0x7d, 0xc3, 0x02, 0xb5, 0x43, 0x06, 0x5e, 0xf8,
+    },
+},
+{
+    .patch_id = 0x08608108,
+    .digest = {
+        0x14, 0xfe, 0x57, 0x86, 0x49, 0xc8, 0x68, 0xe2,
+        0x11, 0xa3, 0xcb, 0x6e, 0xff, 0x6e, 0xd5, 0x38,
+        0xfe, 0x89, 0x1a, 0xe0, 0x67, 0xbf, 0xc4, 0xcc,
+        0x1b, 0x9f, 0x84, 0x77, 0x2b, 0x9f, 0xaa, 0xbd,
+    },
+},
+{
+    .patch_id = 0x08701034,
+    .digest = {
+        0xc3, 0x14, 0x09, 0xa8, 0x9c, 0x3f, 0x8d, 0x83,
+        0x9b, 0x4c, 0xa5, 0xb7, 0x64, 0x8b, 0x91, 0x5d,
+        0x85, 0x6a, 0x39, 0x26, 0x1e, 0x14, 0x41, 0xa8,
+        0x75, 0xea, 0xa6, 0xf9, 0xc9, 0xd1, 0xea, 0x2b,
+    },
+},
+{
+    .patch_id = 0x08a0000a,
+    .digest = {
+        0x73, 0x31, 0x26, 0x22, 0xd4, 0xf9, 0xee, 0x3c,
+        0x07, 0x06, 0xe7, 0xb9, 0xad, 0xd8, 0x72, 0x44,
+        0x33, 0x31, 0xaa, 0x7d, 0xc3, 0x67, 0x0e, 0xdb,
+        0x47, 0xb5, 0xaa, 0xbc, 0xf5, 0xbb, 0xd9, 0x20,
+    },
+},
+{
+    .patch_id = 0x0a00107a,
+    .digest = {
+        0x5f, 0x92, 0xca, 0xff, 0xc3, 0x59, 0x22, 0x5f,
+        0x02, 0xa0, 0x91, 0x3b, 0x4a, 0x45, 0x10, 0xfd,
+        0x19, 0xe1, 0x8a, 0x6d, 0x9a, 0x92, 0xc1, 0x3f,
+        0x75, 0x78, 0xac, 0x78, 0x03, 0x1d, 0xdb, 0x18,
+    },
+},
+{
+    .patch_id = 0x0a0011d5,
+    .digest = {
+        0xed, 0x69, 0x89, 0xf4, 0xeb, 0x64, 0xc2, 0x13,
+        0xe0, 0x51, 0x1f, 0x03, 0x26, 0x52, 0x7d, 0xb7,
+        0x93, 0x5d, 0x65, 0xca, 0xb8, 0x12, 0x1d, 0x62,
+        0x0d, 0x5b, 0x65, 0x34, 0x69, 0xb2, 0x62, 0x21,
+    },
+},
+{
+    .patch_id = 0x0a001238,
+    .digest = {
+        0x72, 0xf7, 0x4b, 0x0c, 0x7d, 0x58, 0x65, 0xcc,
+        0x00, 0xcc, 0x57, 0x16, 0x68, 0x16, 0xf8, 0x2a,
+        0x1b, 0xb3, 0x8b, 0xe1, 0xb6, 0x83, 0x8c, 0x7e,
+        0xc0, 0xcd, 0x33, 0xf2, 0x8d, 0xf9, 0xef, 0x59,
+    },
+},
+{
+    .patch_id = 0x0a00820c,
+    .digest = {
+        0xa8, 0x0c, 0x81, 0xc0, 0xa6, 0x00, 0xe7, 0xf3,
+        0x5f, 0x65, 0xd3, 0xb9, 0x6f, 0xea, 0x93, 0x63,
+        0xf1, 0x8c, 0x88, 0x45, 0xd7, 0x82, 0x80, 0xd1,
+        0xe1, 0x3b, 0x8d, 0xb2, 0xf8, 0x22, 0x03, 0xe2,
+    },
+},
+{
+    .patch_id = 0x0a101148,
+    .digest = {
+        0x20, 0xd5, 0x6f, 0x40, 0x4a, 0xf6, 0x48, 0x90,
+        0xc2, 0x93, 0x9a, 0xc2, 0xfd, 0xac, 0xef, 0x4f,
+        0xfa, 0xc0, 0x3d, 0x92, 0x3c, 0x6d, 0x01, 0x08,
+        0xf1, 0x5e, 0xb0, 0xde, 0xb4, 0x98, 0xae, 0xc4,
+    },
+},
+{
+    .patch_id = 0x0a101248,
+    .digest = {
+        0xed, 0x3b, 0x95, 0xa6, 0x68, 0xa7, 0x77, 0x3e,
+        0xfc, 0x17, 0x26, 0xe2, 0x7b, 0xd5, 0x56, 0x22,
+        0x2c, 0x1d, 0xef, 0xeb, 0x56, 0xdd, 0xba, 0x6e,
+        0x1b, 0x7d, 0x64, 0x9d, 0x4b, 0x53, 0x13, 0x75,
+    },
+},
+{
+    .patch_id = 0x0a108108,
+    .digest = {
+        0xed, 0xc2, 0xec, 0xa1, 0x15, 0xc6, 0x65, 0xe9,
+        0xd0, 0xef, 0x39, 0xaa, 0x7f, 0x55, 0x06, 0xc6,
+        0xf5, 0xd4, 0x3f, 0x7b, 0x14, 0xd5, 0x60, 0x2c,
+        0x28, 0x1e, 0x9c, 0x59, 0x69, 0x99, 0x4d, 0x16,
+    },
+},
+{
+    .patch_id = 0x0a20102d,
+    .digest = {
+        0xf9, 0x6e, 0xf2, 0x32, 0xd3, 0x0f, 0x5f, 0x11,
+        0x59, 0xa1, 0xfe, 0xcc, 0xcd, 0x9b, 0x42, 0x89,
+        0x8b, 0x89, 0x2f, 0xb5, 0xbb, 0x82, 0xef, 0x23,
+        0x8c, 0xe9, 0x19, 0x3e, 0xcc, 0x3f, 0x7b, 0xb4,
+    },
+},
+{
+    .patch_id = 0x0a201210,
+    .digest = {
+        0xe8, 0x6d, 0x51, 0x6a, 0x8e, 0x72, 0xf3, 0xfe,
+        0x6e, 0x16, 0xbc, 0x62, 0x59, 0x40, 0x17, 0xe9,
+        0x6d, 0x3d, 0x0e, 0x6b, 0xa7, 0xac, 0xe3, 0x68,
+        0xf7, 0x55, 0xf0, 0x13, 0xbb, 0x22, 0xf6, 0x41,
+    },
+},
+{
+    .patch_id = 0x0a404107,
+    .digest = {
+        0xbb, 0x04, 0x4e, 0x47, 0xdd, 0x5e, 0x26, 0x45,
+        0x1a, 0xc9, 0x56, 0x24, 0xa4, 0x4c, 0x82, 0xb0,
+        0x8b, 0x0d, 0x9f, 0xf9, 0x3a, 0xdf, 0xc6, 0x81,
+        0x13, 0xbc, 0xc5, 0x25, 0xe4, 0xc5, 0xc3, 0x99,
+    },
+},
+{
+    .patch_id = 0x0a500011,
+    .digest = {
+        0x23, 0x3d, 0x70, 0x7d, 0x03, 0xc3, 0xc4, 0xf4,
+        0x2b, 0x82, 0xc6, 0x05, 0xda, 0x80, 0x0a, 0xf1,
+        0xd7, 0x5b, 0x65, 0x3a, 0x7d, 0xab, 0xdf, 0xa2,
+        0x11, 0x5e, 0x96, 0x7e, 0x71, 0xe9, 0xfc, 0x74,
+    },
+},
+{
+    .patch_id = 0x0a601209,
+    .digest = {
+        0x66, 0x48, 0xd4, 0x09, 0x05, 0xcb, 0x29, 0x32,
+        0x66, 0xb7, 0x9a, 0x76, 0xcd, 0x11, 0xf3, 0x30,
+        0x15, 0x86, 0xcc, 0x5d, 0x97, 0x0f, 0xc0, 0x46,
+        0xe8, 0x73, 0xe2, 0xd6, 0xdb, 0xd2, 0x77, 0x1d,
+    },
+},
+{
+    .patch_id = 0x0a704107,
+    .digest = {
+        0xf3, 0xc6, 0x58, 0x26, 0xee, 0xac, 0x3f, 0xd6,
+        0xce, 0xa1, 0x72, 0x47, 0x3b, 0xba, 0x2b, 0x93,
+        0x2a, 0xad, 0x8e, 0x6b, 0xea, 0x9b, 0xb7, 0xc2,
+        0x64, 0x39, 0x71, 0x8c, 0xce, 0xe7, 0x41, 0x39,
+    },
+},
+{
+    .patch_id = 0x0a705206,
+    .digest = {
+        0x8d, 0xc0, 0x76, 0xbd, 0x58, 0x9f, 0x8f, 0xa4,
+        0x12, 0x9d, 0x21, 0xfb, 0x48, 0x21, 0xbc, 0xe7,
+        0x67, 0x6f, 0x04, 0x18, 0xae, 0x20, 0x87, 0x4b,
+        0x03, 0x35, 0xe9, 0xbe, 0xfb, 0x06, 0xdf, 0xfc,
+    },
+},
+{
+    .patch_id = 0x0a708007,
+    .digest = {
+        0x6b, 0x76, 0xcc, 0x78, 0xc5, 0x8a, 0xa3, 0xe3,
+        0x32, 0x2d, 0x79, 0xe4, 0xc3, 0x80, 0xdb, 0xb2,
+        0x07, 0xaa, 0x3a, 0xe0, 0x57, 0x13, 0x72, 0x80,
+        0xdf, 0x92, 0x73, 0x84, 0x87, 0x3c, 0x73, 0x93,
+    },
+},
+{
+    .patch_id = 0x0a70c005,
+    .digest = {
+        0x88, 0x5d, 0xfb, 0x79, 0x64, 0xd8, 0x46, 0x3b,
+        0x4a, 0x83, 0x8e, 0x77, 0x7e, 0xcf, 0xb3, 0x0f,
+        0x1f, 0x1f, 0xf1, 0x97, 0xeb, 0xfe, 0x56, 0x55,
+        0xee, 0x49, 0xac, 0xe1, 0x8b, 0x13, 0xc5, 0x13,
+    },
+},
+{
+    .patch_id = 0x0aa00116,
+    .digest = {
+        0xe8, 0x4c, 0x2c, 0x88, 0xa1, 0xac, 0x24, 0x63,
+        0x65, 0xe5, 0xaa, 0x2d, 0x16, 0xa9, 0xc3, 0xf5,
+        0xfe, 0x1d, 0x5e, 0x65, 0xc7, 0xaa, 0x92, 0x4d,
+        0x91, 0xee, 0x76, 0xbb, 0x4c, 0x66, 0x78, 0xc9,
+    },
+},
+{
+    .patch_id = 0x0aa00215,
+    .digest = {
+        0x55, 0xd3, 0x28, 0xcb, 0x87, 0xa9, 0x32, 0xe9,
+        0x4e, 0x85, 0x4b, 0x7c, 0x6b, 0xd5, 0x7c, 0xd4,
+        0x1b, 0x51, 0x71, 0x3a, 0x0e, 0x0b, 0xdc, 0x9b,
+        0x68, 0x2f, 0x46, 0xee, 0xfe, 0xc6, 0x6d, 0xef,
+    },
+},
diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 210736f580..b2785ebd7d 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -16,7 +16,9 @@
 
 #include <xen/err.h>
 #include <xen/init.h>
+#include <xen/lib.h>
 #include <xen/mm.h> /* TODO: Fix asm/tlbflush.h breakage */
+#include <xen/sha2.h>
 
 #include <asm/msr.h>
 
@@ -91,6 +93,59 @@ static struct {
     uint16_t id;
 } equiv __read_mostly;
 
+static const struct patch_digest {
+    uint32_t patch_id;
+    uint8_t digest[SHA2_256_DIGEST_SIZE];
+} patch_digests[] = {
+#include "amd-patch-digests.c"
+};
+
+static int cf_check cmp_patch_id(const void *key, const void *elem)
+{
+    const struct patch_digest *pd = elem;
+    uint32_t patch_id = *(uint32_t *)key;
+
+    if ( patch_id == pd->patch_id )
+        return 0;
+    else if ( patch_id < pd->patch_id )
+        return -1;
+    return 1;
+}
+
+static bool check_digest(const struct container_microcode *mc)
+{
+    const struct microcode_patch *patch = mc->patch;
+    const struct patch_digest *pd;
+    uint8_t digest[SHA2_256_DIGEST_SIZE];
+
+    /* Only Fam17h/19h are known to need extra checks.  Skip other families. */
+    if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x19 ||
+         !opt_digest_check )
+        return true;
+
+    pd = bsearch(&patch->patch_id, patch_digests, ARRAY_SIZE(patch_digests),
+                 sizeof(struct patch_digest), cmp_patch_id);
+    if ( !pd )
+    {
+        printk(XENLOG_WARNING "No digest found for patch_id %08x\n",
+               patch->patch_id);
+        return false;
+    }
+
+    sha2_256_digest(digest, patch, mc->len);
+
+    if ( memcmp(digest, pd->digest, sizeof(digest)) )
+    {
+        printk(XENLOG_WARNING "Patch %08x SHA256 mismatch:\n"
+               "  expected %" STR(SHA2_256_DIGEST_SIZE) "phN\n"
+               "       got %" STR(SHA2_256_DIGEST_SIZE) "phN\n",
+               patch->patch_id, pd->digest, digest);
+        return false;
+    }
+
+    return true;
+}
+
 static void cf_check collect_cpu_info(void)
 {
     struct cpu_signature *csig = &this_cpu(cpu_sig);
@@ -398,7 +453,8 @@ static struct microcode_patch *cf_check cpu_request_microcode(
             if ( microcode_fits_cpu(mc->patch) &&
                  (!saved ||
                   compare_revisions(saved->patch_id,
-                                    mc->patch->patch_id) == NEW_UCODE) )
+                                    mc->patch->patch_id) == NEW_UCODE) &&
+                 check_digest(mc) )
             {
                 saved = mc->patch;
                 saved_size = mc->len;
@@ -457,6 +513,14 @@ static const struct microcode_ops __initconst_cf_clobber amd_ucode_ops = {
 
 void __init ucode_probe_amd(struct microcode_ops *ops)
 {
+    if ( !opt_digest_check &&
+         boot_cpu_data.x86 >= 0x17 && boot_cpu_data.x86 <= 0x19 )
+    {
+        printk(XENLOG_WARNING
+               "Microcode patch additional digest checks disabled");
+        add_taint(TAINT_CPU_OUT_OF_SPEC);
+    }
+
     if ( boot_cpu_data.x86 < 0x10 )
         return;
 
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 87283cff1d..82e2b3ab1e 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -101,6 +101,7 @@ static struct microcode_patch *microcode_cache;
  */
 static int __initdata opt_mod_idx;
 static bool __initdata opt_scan;
+bool __ro_after_init opt_digest_check = true;
 
 /*
  * Used by the EFI path only, when xen.cfg identifies an explicit microcode
@@ -130,6 +131,8 @@ static int __init cf_check parse_ucode(const char *s)
 
         if ( (val = parse_boolean("nmi", s, ss)) >= 0 )
             ucode_in_nmi = val;
+        else if ( (val = parse_boolean("digest-check", s, ss)) >= 0 )
+            opt_digest_check = val;
         else if ( !ucode_mod_forced ) /* Not forced by EFI */
         {
             if ( (val = parse_boolean("scan", s, ss)) >= 0 )
diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h
index 74bb2f0a65..f5e2bfee00 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -67,6 +67,8 @@ struct microcode_ops {
     const char *cpio_path;
 };
 
+extern bool opt_digest_check;
+
 /*
  * Microcode loading falls into one of 3 states.
  *   - No support at all
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 14:55:34 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 14:55:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947473.1345094 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3Fn3-0006b4-VQ; Fri, 11 Apr 2025 14:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947473.1345094; Fri, 11 Apr 2025 14: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 1u3Fn3-0006ax-St; Fri, 11 Apr 2025 14:55:33 +0000
Received: by outflank-mailman (input) for mailman id 947473;
 Fri, 11 Apr 2025 14: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 1u3Fn2-0006an-GU
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 14: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 1u3Fn2-008SSM-1V
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 14:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3Fn2-00BZTy-1P
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 14: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=eKzEbOnFTu5rd1P9zG/sgllG3djGNI3f3JXRWMV3nIM=; b=vFTk0mDK+rcQ5swJSiyLR5khtq
	L5uwhuUzmX+C26q//DQzuZ0ScZsAUbCCkWAxCE889V2LwPrsPQryYw+Pa+Wr/VxTNLTvzPtud52zs
	SSJ/nhiEZUoGyqymmvbt0aZrGEQdsJqx3rdNze12fOfYxSXv/ZLOdHGhnGFDHJacYb0s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/ucode: Extend AMD digest checks to cover Zen5 CPUs
Message-Id: <E1u3Fn2-00BZTy-1P@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 14:55:32 +0000

commit ad82c8c7b6e23f8daed72b7daf567eb70f4593d4
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 8 17:09:15 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 14:08:31 2025 +0100

    x86/ucode: Extend AMD digest checks to cover Zen5 CPUs
    
    AMD have updated the SB-7033 advisory to include Zen5 CPUs.  Extend the digest
    check to cover Zen5 too.
    
    In practice, cover everything until further notice.
    
    Observant readers may be wondering where the update to the digest list is.  At
    the time of writing, no Zen5 patches are available via a verifiable channel.
    
    Link: https://www.amd.com/en/resources/product-security/bulletin/amd-sb-7033.html
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit b63951467e964bcc927f823fc943e40069fac0c9)
    
    x86/ucode: Extend warning about disabling digest check too
    
    This was missed by accident.
    
    Fixes: b63951467e96 ("x86/ucode: Extend AMD digest checks to cover Zen5 CPUs")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 59bb316ea89e7f9461690fe00547d7d2af96321d)
---
 xen/arch/x86/cpu/microcode/amd.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index b2785ebd7d..a2860d8948 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -118,8 +118,12 @@ static bool check_digest(const struct container_microcode *mc)
     const struct patch_digest *pd;
     uint8_t digest[SHA2_256_DIGEST_SIZE];
 
-    /* Only Fam17h/19h are known to need extra checks.  Skip other families. */
-    if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x19 ||
+    /*
+     * Zen1 thru Zen5 CPUs are known to use a weak signature algorithm on
+     * microcode updates.  Mitigate by checking the digest of the patch
+     * against a list of known provenance.
+     */
+    if ( boot_cpu_data.x86 < 0x17 ||
          !opt_digest_check )
         return true;
 
@@ -513,8 +517,7 @@ static const struct microcode_ops __initconst_cf_clobber amd_ucode_ops = {
 
 void __init ucode_probe_amd(struct microcode_ops *ops)
 {
-    if ( !opt_digest_check &&
-         boot_cpu_data.x86 >= 0x17 && boot_cpu_data.x86 <= 0x19 )
+    if ( !opt_digest_check && boot_cpu_data.x86 >= 0x17 )
     {
         printk(XENLOG_WARNING
                "Microcode patch additional digest checks disabled");
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 15:55:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 15:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947614.1345200 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3Gie-0002jk-0J; Fri, 11 Apr 2025 15:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947614.1345200; Fri, 11 Apr 2025 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 1u3Gid-0002jc-Sm; Fri, 11 Apr 2025 15:55:03 +0000
Received: by outflank-mailman (input) for mailman id 947614;
 Fri, 11 Apr 2025 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 1u3Gic-0002jW-Nw
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 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 1u3Gic-008TkV-1N
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 15:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3Gic-00Crbh-1A
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 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=HDc9QDu8tLHU95d0qkC2JlRvK6FMsjD9q3vWHp8l6xA=; b=aGCgs0w7hEanS3jYsPSfop1jJA
	eSGT2DdgnZ6DH5MVBI0UKnkavZJ3z8e8CQba9JpGfEMD87LRPxJsTVBi/I8SGcN3mYTxSqjD1z14W
	eFaz71pc8kbM/409VG5JgBAth3KE/fsZGmcbSBz1etNfPN7RPo7YGBB4qmR+87dzogyQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/rangeset: fix incorrect subtraction
Message-Id: <E1u3Gic-00Crbh-1A@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 15:55:02 +0000

commit e118fc98e7ae652a188d227bd7ea22f132724150
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Apr 2 18:50:46 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Fri Apr 11 12:20:10 2025 +0200

    xen/rangeset: fix incorrect subtraction
    
    Given the following rangset operation:
    
    { [0, 1], [4, 5] } - { [3, 4] }
    
    The current rangeset logic will output a rangeset:
    
    { [0, 2], [5, 5] }
    
    This is incorrect, and also has the undesirable property of being bogus in
    a way that the resulting rangeset is expanded.
    
    Fix this by making sure the bounds are correctly checked before modifying
    the previous range.
    
    Fixes: 484a058c4828 ('Add auto-destructing per-domain rangeset data structure...')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/rangeset.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/common/rangeset.c b/xen/common/rangeset.c
index b75590f907..e758710390 100644
--- a/xen/common/rangeset.c
+++ b/xen/common/rangeset.c
@@ -227,7 +227,8 @@ int rangeset_remove_range(
 
         if ( x->s < s )
         {
-            x->e = s - 1;
+            if ( x->e >= s )
+                x->e = s - 1;
             x = next_range(r, x);
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 15:55:16 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 15:55:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947615.1345203 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3Gio-0002lm-0x; Fri, 11 Apr 2025 15:55:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947615.1345203; Fri, 11 Apr 2025 15:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3Gin-0002lf-UG; Fri, 11 Apr 2025 15:55:13 +0000
Received: by outflank-mailman (input) for mailman id 947615;
 Fri, 11 Apr 2025 15: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 1u3Gim-0002lS-In
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 15: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 1u3Gim-008TkZ-1l
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 15:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3Gim-00Crk9-1Z
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 15: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=pTtDwcrIY+YapwKmprDArG3eYEBIKQHl4hsRExS+aXY=; b=HZyi4L4MAGBBSrYK6+KsRjd+S4
	JxJSjz3b76N99IKgbfoLXw/B2aZTGbpRWLbahIOCb97juuz3UNW4QR+c4I0A2tzNOALXBy7ysixln
	/0xJSOB5LIKJV+2VgQsxi/fHvE+kIzvcrvEkQSESMspNNkI/URmgLqQpFPKFeIgVHN/k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tootls/tests: introduce unit tests for rangesets
Message-Id: <E1u3Gim-00Crk9-1Z@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 15:55:12 +0000

commit 7bf777b42cade81d4f20f78cb85c4bc0f638de7b
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Apr 3 10:43:42 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Fri Apr 11 12:20:10 2025 +0200

    tootls/tests: introduce unit tests for rangesets
    
    Introduce some basic infrastructure for doing rangeset unit tests, and add
    a few tests that ensure correctness of rangeset subtraction.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 tools/tests/Makefile                 |   1 +
 tools/tests/rangeset/Makefile        |  46 +++++++
 tools/tests/rangeset/harness.h       |  71 +++++++++++
 tools/tests/rangeset/test-rangeset.c | 228 +++++++++++++++++++++++++++++++++++
 4 files changed, 346 insertions(+)

diff --git a/tools/tests/Makefile b/tools/tests/Makefile
index 1319c3a9d8..3e60ab6b26 100644
--- a/tools/tests/Makefile
+++ b/tools/tests/Makefile
@@ -10,6 +10,7 @@ SUBDIRS-$(CONFIG_X86) += x86_emulator
 endif
 SUBDIRS-y += xenstore
 SUBDIRS-y += depriv
+SUBDIRS-y += rangeset
 SUBDIRS-y += vpci
 SUBDIRS-y += paging-mempool
 
diff --git a/tools/tests/rangeset/Makefile b/tools/tests/rangeset/Makefile
new file mode 100644
index 0000000000..70076eff34
--- /dev/null
+++ b/tools/tests/rangeset/Makefile
@@ -0,0 +1,46 @@
+XEN_ROOT=$(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+TARGET := test-rangeset
+
+.PHONY: all
+all: $(TARGET)
+
+.PHONY: run
+run: $(TARGET)
+	./$<
+
+.PHONY: clean
+clean:
+	$(RM) -- *.o $(TARGET) $(DEPS_RM)
+
+.PHONY: distclean
+distclean: clean
+	$(RM) -- *~
+
+.PHONY: install
+install: all
+	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+	$(INSTALL_PROG) $(TARGET) $(DESTDIR)$(LIBEXEC_BIN)
+
+.PHONY: uninstall
+uninstall:
+	$(RM) -- $(addprefix $(DESTDIR)$(LIBEXEC_BIN)/,$(TARGET))
+
+list.h: $(XEN_ROOT)/xen/include/xen/list.h
+rangeset.h: $(XEN_ROOT)/xen/include/xen/rangeset.h
+list.h rangeset.h:
+	sed -e '/#include/d' <$< >$@
+
+rangeset.c: $(XEN_ROOT)/xen/common/rangeset.c list.h rangeset.h
+	# Remove includes and add the test harness header
+	sed -e '/#include/d' -e '1s/^/#include "harness.h"/' <$< >$@
+
+CFLAGS += -D__XEN_TOOLS__
+CFLAGS += $(APPEND_CFLAGS)
+CFLAGS += $(CFLAGS_xeninclude)
+
+LDFLAGS += $(APPEND_LDFLAGS)
+
+test-rangeset: rangeset.o test-rangeset.o
+	$(CC) $^ -o $@ $(LDFLAGS)
diff --git a/tools/tests/rangeset/harness.h b/tools/tests/rangeset/harness.h
new file mode 100644
index 0000000000..a60ebff72d
--- /dev/null
+++ b/tools/tests/rangeset/harness.h
@@ -0,0 +1,71 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Unit tests for rangesets.
+ *
+ * Copyright (C) 2025 Cloud Software Group
+ */
+
+#ifndef _TEST_HARNESS_
+#define _TEST_HARNESS_
+
+#include <assert.h>
+#include <errno.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <xen-tools/common-macros.h>
+
+#define smp_wmb()
+#define __must_check __attribute__((__warn_unused_result__))
+#define cf_check
+
+#define BUG_ON(x) assert(!(x))
+#define ASSERT(x) assert(x)
+
+#include "list.h"
+#include "rangeset.h"
+
+typedef bool rwlock_t;
+typedef bool spinlock_t;
+
+struct domain {
+    unsigned int     domain_id;
+    struct list_head rangesets;
+    spinlock_t       rangesets_lock;
+};
+
+/* For rangeset_domain_{initialize,printk}() */
+#define spin_lock_init(l) (*(l) = false)
+#define spin_lock(l)      (*(l) = true)
+#define spin_unlock(l)    (*(l) = false)
+
+/* For rangeset->lock */
+#define rwlock_init(l)    (*(l) = false)
+#define read_lock(l)      (*(l) = true)
+#define read_unlock(l)    (*(l) = false)
+#define write_lock(l)     (*(l) = true)
+#define write_unlock(l)   (*(l) = false)
+
+#define xmalloc(type) ((type *)malloc(sizeof(type)))
+#define xfree free
+
+#define unlikely
+
+#define safe_strcpy strcpy
+
+#define printk printf
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/tests/rangeset/test-rangeset.c b/tools/tests/rangeset/test-rangeset.c
new file mode 100644
index 0000000000..8b580e14eb
--- /dev/null
+++ b/tools/tests/rangeset/test-rangeset.c
@@ -0,0 +1,228 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Unit tests for rangesets.
+ *
+ * Copyright (C) 2025 Cloud Software Group
+ */
+
+#include "harness.h"
+
+struct range {
+    unsigned long start, end;
+};
+
+struct action {
+    enum {
+        ADD,
+        REMOVE,
+    } action;
+    struct range r;
+};
+
+#define DECLARE_ACTIONS(nr) static const struct action actions ## nr []
+#define DECLARE_RESULTS(nr) static const struct range results ## nr []
+
+/*
+ * Subtract range with tail overlap on existing range:
+ *
+ * { 0, 1, 4, 5 } - { 3, 4 } = { 0, 1, 5, 5 }
+ */
+DECLARE_ACTIONS(0) = {
+    { ADD,    { 0, 1 } },
+    { ADD,    { 4, 5 } },
+    { REMOVE, { 3, 4 } },
+};
+DECLARE_RESULTS(0) = {
+    { 0, 1 }, { 5, 5 },
+};
+
+/*
+ * Subtract range with complete and tail overlap on existing ranges:
+ *
+ * { 0, 1, 4, 5, 7, 8 } - { 3, 4, 5, 6, 7 } = { 0, 1, 8 }
+ */
+DECLARE_ACTIONS(1) = {
+    { ADD,    { 0, 1 } },
+    { ADD,    { 4, 5 } },
+    { ADD,    { 7, 8 } },
+    { REMOVE, { 3, 7 } },
+};
+DECLARE_RESULTS(1) = {
+    { 0, 1 }, { 8, 8 },
+};
+
+/*
+ * Subtract range with no overlap:
+ *
+ * { 0, 1, 4, 5 } - { 2, 3 } = { 0, 1, 4, 5 }
+ */
+DECLARE_ACTIONS(2) = {
+    { ADD,    { 0, 1 } },
+    { ADD,    { 4, 5 } },
+    { REMOVE, { 2, 3 } },
+};
+DECLARE_RESULTS(2) = {
+    { 0, 1 }, { 4, 5 },
+};
+
+/*
+ * Subtract range with partial overlap on two existing ranges:
+ *
+ * { 0, 1, 4, 5 } - { 1, 4 } = { 0, 5 }
+ */
+DECLARE_ACTIONS(3) = {
+    { ADD,    { 0, 1 } },
+    { ADD,    { 4, 5 } },
+    { REMOVE, { 1, 4 } },
+};
+DECLARE_RESULTS(3) = {
+    { 0, 0 }, { 5, 5 },
+};
+
+static const struct test {
+    unsigned int nr_actions, nr_results;
+    const struct action *actions;
+    const struct range *result;
+} tests[] = {
+#define DECLARE_TEST(nr)                                \
+    {                                                   \
+        .actions = actions ## nr,                       \
+        .nr_actions = ARRAY_SIZE(actions ## nr),        \
+        .result  = results ## nr,                       \
+        .nr_results = ARRAY_SIZE(results ## nr),        \
+    }
+
+    DECLARE_TEST(0),
+    DECLARE_TEST(1),
+    DECLARE_TEST(2),
+    DECLARE_TEST(3),
+
+#undef DECLARE_TEST
+};
+
+static int print_range(unsigned long s, unsigned long e, void *data)
+{
+    printf("[%ld, %ld]\n", s, e);
+
+    return 0;
+}
+
+static int count_ranges(unsigned long s, unsigned long e, void *data)
+{
+    unsigned int *nr = data;
+
+    ++*nr;
+    return 0;
+}
+
+static const struct range *expected;
+static int check_ranges(unsigned long s, unsigned long e, void *data)
+{
+    unsigned int *nr = data;
+    int rc = 0;
+
+    if ( s != expected[*nr].start || e != expected[*nr].end )
+        rc = -EINVAL;
+
+    ++*nr;
+    return rc;
+}
+
+static void print_both(struct rangeset *r, const struct range *expected,
+                       unsigned int nr_expected)
+{
+    unsigned int i;
+
+    printf("Result:\n");
+    rangeset_report_ranges(r, 0, ~0UL, print_range, NULL);
+    printf("Expected:\n");
+    for ( i = 0; i < nr_expected; i++ )
+        printf("[%ld, %ld]\n", expected[i].start, expected[i].end);
+}
+
+int main(int argc, char **argv)
+{
+    struct rangeset *r = rangeset_new(NULL, NULL, 0);
+    unsigned int i;
+    int ret_code = 0;
+
+    ASSERT(r);
+
+    for ( i = 0 ; i < ARRAY_SIZE(tests); i++ )
+    {
+        unsigned int j, nr = 0;
+        int rc = 0;
+
+        rangeset_purge(r);
+        for ( j = 0; j < tests[i].nr_actions; j++ )
+        {
+            const struct action *a = &tests[i].actions[j];
+
+            switch ( a->action )
+            {
+            case ADD:
+                rc = rangeset_add_range(r, a->r.start, a->r.end);
+                break;
+
+            case REMOVE:
+                rc = rangeset_remove_range(r, a->r.start, a->r.end);
+                break;
+            }
+
+            if ( rc )
+            {
+                printf("Test %u failed to %s range [%ld, %ld]\n",
+                       i, a->action == ADD ? "add" : "remove",
+                       a->r.start, a->r.end);
+                rangeset_report_ranges(r, 0, ~0UL, print_range, NULL);
+                break;
+            }
+        }
+
+        if ( rc )
+        {
+            /* Action failed, skip this test and set exit code to failure. */
+            ret_code = EXIT_FAILURE;
+            continue;
+        }
+
+        rc = rangeset_report_ranges(r, 0, ~0UL, count_ranges, &nr);
+        if ( rc )
+        {
+            printf("Test %u unable to count number of result ranges\n", i);
+            rangeset_report_ranges(r, 0, ~0UL, print_range, NULL);
+            ret_code = EXIT_FAILURE;
+            continue;
+        }
+        if ( nr != tests[i].nr_results )
+        {
+            printf("Test %u unexpected number of result ranges, expected: %u got: %u\n",
+                   i, tests[i].nr_results, nr);
+            print_both(r, tests[i].result, tests[i].nr_results);
+            ret_code = EXIT_FAILURE;
+            continue;
+        }
+
+        nr = 0;
+        expected = tests[i].result;
+        rc = rangeset_report_ranges(r, 0, ~0UL, check_ranges, &nr);
+        if ( rc )
+        {
+            printf("Test %u range checking failed\n", i);
+            print_both(r, tests[i].result, tests[i].nr_results);
+            ret_code = EXIT_FAILURE;
+            continue;
+        }
+    }
+
+    return 0;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 17:33:09 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 17:33:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947671.1345226 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3IFT-0005hT-6B; Fri, 11 Apr 2025 17:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947671.1345226; Fri, 11 Apr 2025 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 1u3IFT-0005hL-3Z; Fri, 11 Apr 2025 17:33:03 +0000
Received: by outflank-mailman (input) for mailman id 947671;
 Fri, 11 Apr 2025 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 1u3IFS-0005hF-Bw
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 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 1u3IFS-008WSk-0c
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3IFS-00ENIi-0R
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 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=388CsMuwMPwwhKhzyMM3H7TiiePLPVzdQc232eDIghU=; b=eWHYwpbu/b9KW2DdXc3xv5K/KT
	emYyTzGM2ohxSb65dh6c0WJY7G4dG9Dbg6+hvFA2z9I74Rf4lciTdRR2p2R/d60+LToQ0Uomm32Sv
	xh5AnGuaVYDR2bn6a0+lc9ot4OZqjxTy+xUpCLboCb2RkoE06GESog4V69tQJ4lYpZM4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] tools/libxl: do not use `-c -E` compiler options together
Message-Id: <E1u3IFS-00ENIi-0R@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 17:33:02 +0000

commit 2389f0a3b2c36737e99e942cff3da2cf33050831
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Apr 7 13:09:38 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 14:12:25 2025 +0100

    tools/libxl: do not use `-c -E` compiler options together
    
    It makes no sense to request for preprocessor only output and also request
    object file generation.  Fix the _libxl.api-for-check target to only use
    -E (preprocessor output).
    
    Also Clang 20.0 reports an error if both options are used.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Fixes: 2862bf5b6c81 ('libxl: enforce prohibitions of internal callers')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
    (cherry picked from commit a235f856e4bbd270b085590e1f5fc9599234dcdf)
---
 tools/libs/light/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
index 37e4d16709..b690d92159 100644
--- a/tools/libs/light/Makefile
+++ b/tools/libs/light/Makefile
@@ -195,7 +195,7 @@ libxl.api-ok: check-libxl-api-rules _libxl.api-for-check
 	touch $@
 
 _libxl.api-for-check: $(XEN_INCLUDE)/libxl.h
-	$(CC) $(CPPFLAGS) $(CFLAGS) -c -E $< $(APPEND_CFLAGS) \
+	$(CC) $(CPPFLAGS) $(CFLAGS) -E $< $(APPEND_CFLAGS) \
 		-DLIBXL_EXTERNAL_CALLERS_ONLY=LIBXL_EXTERNAL_CALLERS_ONLY \
 		>$@.new
 	mv -f $@.new $@
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 17:33:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 17:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947672.1345232 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3IFd-0005ix-8M; Fri, 11 Apr 2025 17:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947672.1345232; Fri, 11 Apr 2025 17: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 1u3IFd-0005ip-53; Fri, 11 Apr 2025 17:33:13 +0000
Received: by outflank-mailman (input) for mailman id 947672;
 Fri, 11 Apr 2025 17: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 1u3IFc-0005ih-B0
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 17: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 1u3IFc-008WSo-10
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3IFc-00ENUR-0n
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17: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=KaXnpmPUWY2PtRHREBIRA/pdZFX2rxsfDV0N9e39Wis=; b=6uzi8UIa+01Il5RSf3g9G7ho+0
	QAYC6+rG6RsUzkJA0l/t1SvDT29Xl2pXvdr42cG1Mz6ON8RgB0p8/b1nOlRjZH02SrAOXKc1a6Lrn
	enwr9avsijhtE40Ote3Lo51lKtN5uW33Fk9IljZpnXbfGx7zPgAo+nqfd67IbanOfWLU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] xen/lib: Introduce SHA2-256
Message-Id: <E1u3IFc-00ENUR-0n@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 17:33:12 +0000

commit 3cc6a924d78f32b98790db274379ff5f9e946225
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Dec 13 14:34:00 2024 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 14:12:25 2025 +0100

    xen/lib: Introduce SHA2-256
    
    A future change will need to calculate SHA2-256 digests.  Introduce an
    implementation in lib/, derived from Trenchboot which itself is derived from
    Linux.
    
    In order to be useful to other architectures, it is careful with endianness
    and misaligned accesses as well as being more MISRA friendly, but is only
    wired up for x86 in the short term.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 372af524411f5a013bcb0b117073d8d07c026563)
    
    Xen: CI fix from XSN-2
    
     * Add U suffix to the K[] table to fix MISRA Rule 7.2 violations.
    
    Fixes: 372af524411f ("xen/lib: Introduce SHA2-256")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 15fe2eb5f1bac8a212c0ba3d6dfe60d1fdf851cf)
---
 xen/include/xen/sha2.h |  15 +++
 xen/lib/Makefile       |   1 +
 xen/lib/sha2-256.c     | 264 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 280 insertions(+)

diff --git a/xen/include/xen/sha2.h b/xen/include/xen/sha2.h
new file mode 100644
index 0000000000..47d97fbf01
--- /dev/null
+++ b/xen/include/xen/sha2.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * SHA2-256: https://csrc.nist.gov/pubs/fips/180-2/upd1/final
+ */
+#ifndef XEN_SHA2_H
+#define XEN_SHA2_H
+
+#include <xen/types.h>
+
+#define SHA2_256_DIGEST_SIZE 32
+
+void sha2_256_digest(uint8_t digest[SHA2_256_DIGEST_SIZE],
+                     const void *msg, size_t len);
+
+#endif /* XEN_SHA2_H */
diff --git a/xen/lib/Makefile b/xen/lib/Makefile
index a485415964..03e33baaa0 100644
--- a/xen/lib/Makefile
+++ b/xen/lib/Makefile
@@ -16,6 +16,7 @@ lib-y += memset.o
 lib-y += muldiv64.o
 lib-y += parse-size.o
 lib-y += rbtree.o
+lib-$(CONFIG_X86) += sha2-256.o
 lib-y += sort.o
 lib-y += strcasecmp.o
 lib-y += strchr.o
diff --git a/xen/lib/sha2-256.c b/xen/lib/sha2-256.c
new file mode 100644
index 0000000000..19e8252188
--- /dev/null
+++ b/xen/lib/sha2-256.c
@@ -0,0 +1,264 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * SHA2-256: https://csrc.nist.gov/pubs/fips/180-2/upd1/final
+ *
+ * Originally derived from Linux.  Modified substantially to optimise for size
+ * and Xen's expected usecases.
+ */
+#include <xen/bitops.h>
+#include <xen/sha2.h>
+#include <xen/string.h>
+#include <xen/unaligned.h>
+
+struct sha2_256_state {
+    uint32_t state[SHA2_256_DIGEST_SIZE / sizeof(uint32_t)];
+    uint8_t buf[64];
+    size_t count; /* Byte count. */
+};
+
+static uint32_t choose(uint32_t x, uint32_t y, uint32_t z)
+{
+    return z ^ (x & (y ^ z));
+}
+
+static uint32_t majority(uint32_t x, uint32_t y, uint32_t z)
+{
+    return (x & y) | (z & (x | y));
+}
+
+static uint32_t e0(uint32_t x)
+{
+    return ror32(x, 2) ^ ror32(x, 13) ^ ror32(x, 22);
+}
+
+static uint32_t e1(uint32_t x)
+{
+    return ror32(x, 6) ^ ror32(x, 11) ^ ror32(x, 25);
+}
+
+static uint32_t s0(uint32_t x)
+{
+    return ror32(x, 7) ^ ror32(x, 18) ^ (x >> 3);
+}
+
+static uint32_t s1(uint32_t x)
+{
+    return ror32(x, 17) ^ ror32(x, 19) ^ (x >> 10);
+}
+
+static uint32_t blend(uint32_t W[16], unsigned int i)
+{
+#define W(i) W[(i) & 15]
+
+    return W(i) += s1(W(i - 2)) + W(i - 7) + s0(W(i - 15));
+
+#undef W
+}
+
+static const uint32_t K[] = {
+    0x428a2f98U, 0x71374491U, 0xb5c0fbcfU, 0xe9b5dba5U,
+    0x3956c25bU, 0x59f111f1U, 0x923f82a4U, 0xab1c5ed5U,
+    0xd807aa98U, 0x12835b01U, 0x243185beU, 0x550c7dc3U,
+    0x72be5d74U, 0x80deb1feU, 0x9bdc06a7U, 0xc19bf174U,
+    0xe49b69c1U, 0xefbe4786U, 0x0fc19dc6U, 0x240ca1ccU,
+    0x2de92c6fU, 0x4a7484aaU, 0x5cb0a9dcU, 0x76f988daU,
+    0x983e5152U, 0xa831c66dU, 0xb00327c8U, 0xbf597fc7U,
+    0xc6e00bf3U, 0xd5a79147U, 0x06ca6351U, 0x14292967U,
+    0x27b70a85U, 0x2e1b2138U, 0x4d2c6dfcU, 0x53380d13U,
+    0x650a7354U, 0x766a0abbU, 0x81c2c92eU, 0x92722c85U,
+    0xa2bfe8a1U, 0xa81a664bU, 0xc24b8b70U, 0xc76c51a3U,
+    0xd192e819U, 0xd6990624U, 0xf40e3585U, 0x106aa070U,
+    0x19a4c116U, 0x1e376c08U, 0x2748774cU, 0x34b0bcb5U,
+    0x391c0cb3U, 0x4ed8aa4aU, 0x5b9cca4fU, 0x682e6ff3U,
+    0x748f82eeU, 0x78a5636fU, 0x84c87814U, 0x8cc70208U,
+    0x90befffaU, 0xa4506cebU, 0xbef9a3f7U, 0xc67178f2U,
+};
+
+static void sha2_256_transform(uint32_t *state, const void *_input)
+{
+    const uint32_t *input = _input;
+    uint32_t a, b, c, d, e, f, g, h, t1, t2;
+    uint32_t W[16];
+    unsigned int i;
+
+    for ( i = 0; i < 16; i++ )
+        W[i] = get_unaligned_be32(&input[i]);
+
+    a = state[0]; b = state[1]; c = state[2]; d = state[3];
+    e = state[4]; f = state[5]; g = state[6]; h = state[7];
+
+    for ( i = 0; i < 16; i += 8 )
+    {
+        t1 = h + e1(e) + choose(e, f, g) + K[i + 0] + W[i + 0];
+        t2 = e0(a) + majority(a, b, c);    d += t1;    h = t1 + t2;
+        t1 = g + e1(d) + choose(d, e, f) + K[i + 1] + W[i + 1];
+        t2 = e0(h) + majority(h, a, b);    c += t1;    g = t1 + t2;
+        t1 = f + e1(c) + choose(c, d, e) + K[i + 2] + W[i + 2];
+        t2 = e0(g) + majority(g, h, a);    b += t1;    f = t1 + t2;
+        t1 = e + e1(b) + choose(b, c, d) + K[i + 3] + W[i + 3];
+        t2 = e0(f) + majority(f, g, h);    a += t1;    e = t1 + t2;
+        t1 = d + e1(a) + choose(a, b, c) + K[i + 4] + W[i + 4];
+        t2 = e0(e) + majority(e, f, g);    h += t1;    d = t1 + t2;
+        t1 = c + e1(h) + choose(h, a, b) + K[i + 5] + W[i + 5];
+        t2 = e0(d) + majority(d, e, f);    g += t1;    c = t1 + t2;
+        t1 = b + e1(g) + choose(g, h, a) + K[i + 6] + W[i + 6];
+        t2 = e0(c) + majority(c, d, e);    f += t1;    b = t1 + t2;
+        t1 = a + e1(f) + choose(f, g, h) + K[i + 7] + W[i + 7];
+        t2 = e0(b) + majority(b, c, d);    e += t1;    a = t1 + t2;
+    }
+
+    for ( ; i < 64; i += 8 )
+    {
+        t1 = h + e1(e) + choose(e, f, g) + K[i + 0] + blend(W, i + 0);
+        t2 = e0(a) + majority(a, b, c);    d += t1;    h = t1 + t2;
+        t1 = g + e1(d) + choose(d, e, f) + K[i + 1] + blend(W, i + 1);
+        t2 = e0(h) + majority(h, a, b);    c += t1;    g = t1 + t2;
+        t1 = f + e1(c) + choose(c, d, e) + K[i + 2] + blend(W, i + 2);
+        t2 = e0(g) + majority(g, h, a);    b += t1;    f = t1 + t2;
+        t1 = e + e1(b) + choose(b, c, d) + K[i + 3] + blend(W, i + 3);
+        t2 = e0(f) + majority(f, g, h);    a += t1;    e = t1 + t2;
+        t1 = d + e1(a) + choose(a, b, c) + K[i + 4] + blend(W, i + 4);
+        t2 = e0(e) + majority(e, f, g);    h += t1;    d = t1 + t2;
+        t1 = c + e1(h) + choose(h, a, b) + K[i + 5] + blend(W, i + 5);
+        t2 = e0(d) + majority(d, e, f);    g += t1;    c = t1 + t2;
+        t1 = b + e1(g) + choose(g, h, a) + K[i + 6] + blend(W, i + 6);
+        t2 = e0(c) + majority(c, d, e);    f += t1;    b = t1 + t2;
+        t1 = a + e1(f) + choose(f, g, h) + K[i + 7] + blend(W, i + 7);
+        t2 = e0(b) + majority(b, c, d);    e += t1;    a = t1 + t2;
+    }
+
+    state[0] += a; state[1] += b; state[2] += c; state[3] += d;
+    state[4] += e; state[5] += f; state[6] += g; state[7] += h;
+}
+
+static void sha2_256_init(struct sha2_256_state *s)
+{
+    *s = (struct sha2_256_state){
+        .state = {
+            0x6a09e667UL,
+            0xbb67ae85UL,
+            0x3c6ef372UL,
+            0xa54ff53aUL,
+            0x510e527fUL,
+            0x9b05688cUL,
+            0x1f83d9abUL,
+            0x5be0cd19UL,
+        },
+    };
+}
+
+static void sha2_256_update(struct sha2_256_state *s, const void *msg,
+                            size_t len)
+{
+    unsigned int partial = s->count & 63;
+
+    s->count += len;
+
+    if ( (partial + len) >= 64 )
+    {
+        if ( partial )
+        {
+            unsigned int rem = 64 - partial;
+
+            /* Fill the partial block. */
+            memcpy(s->buf + partial, msg, rem);
+            msg += rem;
+            len -= rem;
+
+            sha2_256_transform(s->state, s->buf);
+            partial = 0;
+        }
+
+        for ( ; len >= 64; msg += 64, len -= 64 )
+            sha2_256_transform(s->state, msg);
+    }
+
+    /* Remaining data becomes partial. */
+    memcpy(s->buf + partial, msg, len);
+}
+
+static void sha2_256_final(struct sha2_256_state *s, void *_dst)
+{
+    uint32_t *dst = _dst;
+    unsigned int i, partial = s->count & 63;
+
+    /* Start padding */
+    s->buf[partial++] = 0x80;
+
+    if ( partial > 56 )
+    {
+        /* Need one extra block - pad to 64 */
+        memset(s->buf + partial, 0, 64 - partial);
+        sha2_256_transform(s->state, s->buf);
+        partial = 0;
+    }
+    /* Pad to 56 */
+    memset(s->buf + partial, 0, 56 - partial);
+
+    /* Append the bit count */
+    put_unaligned_be64((uint64_t)s->count << 3, &s->buf[56]);
+    sha2_256_transform(s->state, s->buf);
+
+    /* Store state in digest */
+    for ( i = 0; i < 8; i++ )
+        put_unaligned_be32(s->state[i], &dst[i]);
+}
+
+void sha2_256_digest(uint8_t digest[SHA2_256_DIGEST_SIZE],
+                     const void *msg, size_t len)
+{
+    struct sha2_256_state s;
+
+    sha2_256_init(&s);
+    sha2_256_update(&s, msg, len);
+    sha2_256_final(&s, digest);
+}
+
+#ifdef CONFIG_SELF_TESTS
+
+#include <xen/init.h>
+#include <xen/lib.h>
+
+static const struct test {
+    const char *msg;
+    uint8_t digest[SHA2_256_DIGEST_SIZE];
+} tests[] __initconst = {
+    {
+        .msg = "abc",
+        .digest = {
+            0xba, 0x78, 0x16, 0xbf, 0x8f, 0x01, 0xcf, 0xea,
+            0x41, 0x41, 0x40, 0xde, 0x5d, 0xae, 0x22, 0x23,
+            0xb0, 0x03, 0x61, 0xa3, 0x96, 0x17, 0x7a, 0x9c,
+            0xb4, 0x10, 0xff, 0x61, 0xf2, 0x00, 0x15, 0xad,
+        },
+    },
+    {
+        .msg = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
+        .digest = {
+            0x24, 0x8d, 0x6a, 0x61, 0xd2, 0x06, 0x38, 0xb8,
+            0xe5, 0xc0, 0x26, 0x93, 0x0c, 0x3e, 0x60, 0x39,
+            0xa3, 0x3c, 0xe4, 0x59, 0x64, 0xff, 0x21, 0x67,
+            0xf6, 0xec, 0xed, 0xd4, 0x19, 0xdb, 0x06, 0xc1,
+        },
+    },
+};
+
+static void __init __constructor test_sha2_256(void)
+{
+    for ( unsigned int i = 0; i < ARRAY_SIZE(tests); ++i )
+    {
+        const struct test *t = &tests[i];
+        uint8_t res[SHA2_256_DIGEST_SIZE] = {};
+
+        sha2_256_digest(res, t->msg, strlen(t->msg));
+
+        if ( memcmp(res, t->digest, sizeof(t->digest)) == 0 )
+            continue;
+
+        panic("%s() msg '%s' failed\n"
+              "  expected %" STR(SHA2_256_DIGEST_SIZE) "phN\n"
+              "       got %" STR(SHA2_256_DIGEST_SIZE) "phN\n",
+              __func__, t->msg, t->digest, res);
+    }
+}
+#endif /* CONFIG_SELF_TESTS */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 17:33:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 17:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947673.1345234 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3IFn-0005lz-AO; Fri, 11 Apr 2025 17:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947673.1345234; Fri, 11 Apr 2025 17: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 1u3IFn-0005ls-7t; Fri, 11 Apr 2025 17:33:23 +0000
Received: by outflank-mailman (input) for mailman id 947673;
 Fri, 11 Apr 2025 17: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 1u3IFm-0005lm-EA
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 17: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 1u3IFm-008WSs-1K
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3IFm-00ENeY-1D
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17: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=ozwrylDCZCdEIjrrza/PgzQtecWK2gwXjo0LBLQGv70=; b=f9Us9VceQkaDyN77EFmyoyzi8M
	UtZCRf0ppvcTghh9HLlDIe00sleRtmtldMr3kGjDE4JA9r7BsrXEtpVG1nIyQauPM2GkPELbtH2Rq
	gbd74kQvU9LYW4U9QvoJYOefDcHPhShKuLJ1yTKW+vpWSZ/TKCPgqghWJZ1Rh07jLZGw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode
Message-Id: <E1u3IFm-00ENeY-1D@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 17:33:22 +0000

commit 56d85952addb47f7341ad5d5d67aab002c7e7118
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Dec 13 14:34:00 2024 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 14:12:25 2025 +0100

    x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode
    
    Collisions have been found in the microcode signing algorithm used by AMD
    Fam17h/19h CPUs, and now anyone can sign their own.
    
    For more details, see:
      https://bughunters.google.com/blog/5424842357473280/zen-and-the-art-of-microcode-hacking
      https://www.amd.com/en/resources/product-security/bulletin/amd-sb-7033.html
    
    As a stopgap mitigation, check the digest of patches against a table of blobs
    with known provenance.  These are all Fam17h and Fam19h blobs included in
    linux-firwmare at the time of writing, specifically:
    
      https://git.kernel.org/firmware/linux-firmware/c/48bb90cceb882cab8e9ab692bc5779d3bf3a13b8
    
    This checks can be opted out of by booting with ucode=no-digest-check, but
    doing so is not recommended.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 630e8875ab368b97cc7231aaf3809e3d7d5687e1)
    
    Xen: CI fix from XSN-2
    
     * Add cf_check annotation to cmp_patch_id() used by bsearch().
    
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 15fe2eb5f1bac8a212c0ba3d6dfe60d1fdf851cf)
---
 docs/misc/xen-command-line.pandoc              |  10 +-
 xen/arch/x86/cpu/microcode/amd-patch-digests.c | 226 +++++++++++++++++++++++++
 xen/arch/x86/cpu/microcode/amd.c               |  66 +++++++-
 xen/arch/x86/cpu/microcode/core.c              |   3 +
 xen/arch/x86/cpu/microcode/private.h           |   2 +
 5 files changed, 304 insertions(+), 3 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index ff10ff9f65..559fb21c5b 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2671,10 +2671,10 @@ performance.
    Alternatively, selecting `tsx=1` will re-enable TSX at the users own risk.
 
 ### ucode
-> `= List of [ <integer> | scan=<bool>, nmi=<bool>, allow-same=<bool> ]`
+> `= List of [ <integer> | scan=<bool>, nmi=<bool>, allow-same=<bool>, digest-check=<bool> ]`
 
     Applicability: x86
-    Default: `nmi`
+    Default: `nmi,digest-check`
 
 Controls for CPU microcode loading. For early loading, this parameter can
 specify how and where to find the microcode update blob. For late loading,
@@ -2708,6 +2708,12 @@ trying to reload the same version.  Many CPUs will actually reload microcode
 of the same version, and this allows for easy testing of the late microcode
 loading path.
 
+The `digest-check=` option is active by default and controls whether to
+perform additional authenticity checks.  Collisions in the signature algorithm
+used by AMD Fam17h/19h processors have been found.  Xen contains a table of
+digests of microcode patches with known-good provenance, and will block
+loading of patches that do not match.
+
 ### unrestricted_guest (Intel)
 > `= <boolean>`
 
diff --git a/xen/arch/x86/cpu/microcode/amd-patch-digests.c b/xen/arch/x86/cpu/microcode/amd-patch-digests.c
new file mode 100644
index 0000000000..d327612267
--- /dev/null
+++ b/xen/arch/x86/cpu/microcode/amd-patch-digests.c
@@ -0,0 +1,226 @@
+/* Generated from linux-firmware. */
+{
+    .patch_id = 0x0800126f,
+    .digest = {
+        0x2b, 0x5a, 0xf2, 0x9c, 0xdd, 0xd2, 0x7f, 0xec,
+        0xec, 0x96, 0x09, 0x57, 0xb0, 0x96, 0x29, 0x8b,
+        0x2e, 0x26, 0x91, 0xf0, 0x49, 0x33, 0x42, 0x18,
+        0xdd, 0x4b, 0x65, 0x5a, 0xd4, 0x15, 0x3d, 0x33,
+    },
+},
+{
+    .patch_id = 0x0800820d,
+    .digest = {
+        0x68, 0x98, 0x83, 0xcd, 0x22, 0x0d, 0xdd, 0x59,
+        0x73, 0x2c, 0x5b, 0x37, 0x1f, 0x84, 0x0e, 0x67,
+        0x96, 0x43, 0x83, 0x0c, 0x46, 0x44, 0xab, 0x7c,
+        0x7b, 0x65, 0x9e, 0x57, 0xb5, 0x90, 0x4b, 0x0e,
+    },
+},
+{
+    .patch_id = 0x0830107c,
+    .digest = {
+        0x21, 0x64, 0xde, 0xfb, 0x9f, 0x68, 0x96, 0x47,
+        0x70, 0x5c, 0xe2, 0x8f, 0x18, 0x52, 0x6a, 0xac,
+        0xa4, 0xd2, 0x2e, 0xe0, 0xde, 0x68, 0x66, 0xc3,
+        0xeb, 0x1e, 0xd3, 0x3f, 0xbc, 0x51, 0x1d, 0x38,
+    },
+},
+{
+    .patch_id = 0x0860010d,
+    .digest = {
+        0x86, 0xb6, 0x15, 0x83, 0xbc, 0x3b, 0x9c, 0xe0,
+        0xb3, 0xef, 0x1d, 0x99, 0x84, 0x35, 0x15, 0xf7,
+        0x7c, 0x2a, 0xc6, 0x42, 0xdb, 0x73, 0x07, 0x5c,
+        0x7d, 0xc3, 0x02, 0xb5, 0x43, 0x06, 0x5e, 0xf8,
+    },
+},
+{
+    .patch_id = 0x08608108,
+    .digest = {
+        0x14, 0xfe, 0x57, 0x86, 0x49, 0xc8, 0x68, 0xe2,
+        0x11, 0xa3, 0xcb, 0x6e, 0xff, 0x6e, 0xd5, 0x38,
+        0xfe, 0x89, 0x1a, 0xe0, 0x67, 0xbf, 0xc4, 0xcc,
+        0x1b, 0x9f, 0x84, 0x77, 0x2b, 0x9f, 0xaa, 0xbd,
+    },
+},
+{
+    .patch_id = 0x08701034,
+    .digest = {
+        0xc3, 0x14, 0x09, 0xa8, 0x9c, 0x3f, 0x8d, 0x83,
+        0x9b, 0x4c, 0xa5, 0xb7, 0x64, 0x8b, 0x91, 0x5d,
+        0x85, 0x6a, 0x39, 0x26, 0x1e, 0x14, 0x41, 0xa8,
+        0x75, 0xea, 0xa6, 0xf9, 0xc9, 0xd1, 0xea, 0x2b,
+    },
+},
+{
+    .patch_id = 0x08a0000a,
+    .digest = {
+        0x73, 0x31, 0x26, 0x22, 0xd4, 0xf9, 0xee, 0x3c,
+        0x07, 0x06, 0xe7, 0xb9, 0xad, 0xd8, 0x72, 0x44,
+        0x33, 0x31, 0xaa, 0x7d, 0xc3, 0x67, 0x0e, 0xdb,
+        0x47, 0xb5, 0xaa, 0xbc, 0xf5, 0xbb, 0xd9, 0x20,
+    },
+},
+{
+    .patch_id = 0x0a00107a,
+    .digest = {
+        0x5f, 0x92, 0xca, 0xff, 0xc3, 0x59, 0x22, 0x5f,
+        0x02, 0xa0, 0x91, 0x3b, 0x4a, 0x45, 0x10, 0xfd,
+        0x19, 0xe1, 0x8a, 0x6d, 0x9a, 0x92, 0xc1, 0x3f,
+        0x75, 0x78, 0xac, 0x78, 0x03, 0x1d, 0xdb, 0x18,
+    },
+},
+{
+    .patch_id = 0x0a0011d5,
+    .digest = {
+        0xed, 0x69, 0x89, 0xf4, 0xeb, 0x64, 0xc2, 0x13,
+        0xe0, 0x51, 0x1f, 0x03, 0x26, 0x52, 0x7d, 0xb7,
+        0x93, 0x5d, 0x65, 0xca, 0xb8, 0x12, 0x1d, 0x62,
+        0x0d, 0x5b, 0x65, 0x34, 0x69, 0xb2, 0x62, 0x21,
+    },
+},
+{
+    .patch_id = 0x0a001238,
+    .digest = {
+        0x72, 0xf7, 0x4b, 0x0c, 0x7d, 0x58, 0x65, 0xcc,
+        0x00, 0xcc, 0x57, 0x16, 0x68, 0x16, 0xf8, 0x2a,
+        0x1b, 0xb3, 0x8b, 0xe1, 0xb6, 0x83, 0x8c, 0x7e,
+        0xc0, 0xcd, 0x33, 0xf2, 0x8d, 0xf9, 0xef, 0x59,
+    },
+},
+{
+    .patch_id = 0x0a00820c,
+    .digest = {
+        0xa8, 0x0c, 0x81, 0xc0, 0xa6, 0x00, 0xe7, 0xf3,
+        0x5f, 0x65, 0xd3, 0xb9, 0x6f, 0xea, 0x93, 0x63,
+        0xf1, 0x8c, 0x88, 0x45, 0xd7, 0x82, 0x80, 0xd1,
+        0xe1, 0x3b, 0x8d, 0xb2, 0xf8, 0x22, 0x03, 0xe2,
+    },
+},
+{
+    .patch_id = 0x0a101148,
+    .digest = {
+        0x20, 0xd5, 0x6f, 0x40, 0x4a, 0xf6, 0x48, 0x90,
+        0xc2, 0x93, 0x9a, 0xc2, 0xfd, 0xac, 0xef, 0x4f,
+        0xfa, 0xc0, 0x3d, 0x92, 0x3c, 0x6d, 0x01, 0x08,
+        0xf1, 0x5e, 0xb0, 0xde, 0xb4, 0x98, 0xae, 0xc4,
+    },
+},
+{
+    .patch_id = 0x0a101248,
+    .digest = {
+        0xed, 0x3b, 0x95, 0xa6, 0x68, 0xa7, 0x77, 0x3e,
+        0xfc, 0x17, 0x26, 0xe2, 0x7b, 0xd5, 0x56, 0x22,
+        0x2c, 0x1d, 0xef, 0xeb, 0x56, 0xdd, 0xba, 0x6e,
+        0x1b, 0x7d, 0x64, 0x9d, 0x4b, 0x53, 0x13, 0x75,
+    },
+},
+{
+    .patch_id = 0x0a108108,
+    .digest = {
+        0xed, 0xc2, 0xec, 0xa1, 0x15, 0xc6, 0x65, 0xe9,
+        0xd0, 0xef, 0x39, 0xaa, 0x7f, 0x55, 0x06, 0xc6,
+        0xf5, 0xd4, 0x3f, 0x7b, 0x14, 0xd5, 0x60, 0x2c,
+        0x28, 0x1e, 0x9c, 0x59, 0x69, 0x99, 0x4d, 0x16,
+    },
+},
+{
+    .patch_id = 0x0a20102d,
+    .digest = {
+        0xf9, 0x6e, 0xf2, 0x32, 0xd3, 0x0f, 0x5f, 0x11,
+        0x59, 0xa1, 0xfe, 0xcc, 0xcd, 0x9b, 0x42, 0x89,
+        0x8b, 0x89, 0x2f, 0xb5, 0xbb, 0x82, 0xef, 0x23,
+        0x8c, 0xe9, 0x19, 0x3e, 0xcc, 0x3f, 0x7b, 0xb4,
+    },
+},
+{
+    .patch_id = 0x0a201210,
+    .digest = {
+        0xe8, 0x6d, 0x51, 0x6a, 0x8e, 0x72, 0xf3, 0xfe,
+        0x6e, 0x16, 0xbc, 0x62, 0x59, 0x40, 0x17, 0xe9,
+        0x6d, 0x3d, 0x0e, 0x6b, 0xa7, 0xac, 0xe3, 0x68,
+        0xf7, 0x55, 0xf0, 0x13, 0xbb, 0x22, 0xf6, 0x41,
+    },
+},
+{
+    .patch_id = 0x0a404107,
+    .digest = {
+        0xbb, 0x04, 0x4e, 0x47, 0xdd, 0x5e, 0x26, 0x45,
+        0x1a, 0xc9, 0x56, 0x24, 0xa4, 0x4c, 0x82, 0xb0,
+        0x8b, 0x0d, 0x9f, 0xf9, 0x3a, 0xdf, 0xc6, 0x81,
+        0x13, 0xbc, 0xc5, 0x25, 0xe4, 0xc5, 0xc3, 0x99,
+    },
+},
+{
+    .patch_id = 0x0a500011,
+    .digest = {
+        0x23, 0x3d, 0x70, 0x7d, 0x03, 0xc3, 0xc4, 0xf4,
+        0x2b, 0x82, 0xc6, 0x05, 0xda, 0x80, 0x0a, 0xf1,
+        0xd7, 0x5b, 0x65, 0x3a, 0x7d, 0xab, 0xdf, 0xa2,
+        0x11, 0x5e, 0x96, 0x7e, 0x71, 0xe9, 0xfc, 0x74,
+    },
+},
+{
+    .patch_id = 0x0a601209,
+    .digest = {
+        0x66, 0x48, 0xd4, 0x09, 0x05, 0xcb, 0x29, 0x32,
+        0x66, 0xb7, 0x9a, 0x76, 0xcd, 0x11, 0xf3, 0x30,
+        0x15, 0x86, 0xcc, 0x5d, 0x97, 0x0f, 0xc0, 0x46,
+        0xe8, 0x73, 0xe2, 0xd6, 0xdb, 0xd2, 0x77, 0x1d,
+    },
+},
+{
+    .patch_id = 0x0a704107,
+    .digest = {
+        0xf3, 0xc6, 0x58, 0x26, 0xee, 0xac, 0x3f, 0xd6,
+        0xce, 0xa1, 0x72, 0x47, 0x3b, 0xba, 0x2b, 0x93,
+        0x2a, 0xad, 0x8e, 0x6b, 0xea, 0x9b, 0xb7, 0xc2,
+        0x64, 0x39, 0x71, 0x8c, 0xce, 0xe7, 0x41, 0x39,
+    },
+},
+{
+    .patch_id = 0x0a705206,
+    .digest = {
+        0x8d, 0xc0, 0x76, 0xbd, 0x58, 0x9f, 0x8f, 0xa4,
+        0x12, 0x9d, 0x21, 0xfb, 0x48, 0x21, 0xbc, 0xe7,
+        0x67, 0x6f, 0x04, 0x18, 0xae, 0x20, 0x87, 0x4b,
+        0x03, 0x35, 0xe9, 0xbe, 0xfb, 0x06, 0xdf, 0xfc,
+    },
+},
+{
+    .patch_id = 0x0a708007,
+    .digest = {
+        0x6b, 0x76, 0xcc, 0x78, 0xc5, 0x8a, 0xa3, 0xe3,
+        0x32, 0x2d, 0x79, 0xe4, 0xc3, 0x80, 0xdb, 0xb2,
+        0x07, 0xaa, 0x3a, 0xe0, 0x57, 0x13, 0x72, 0x80,
+        0xdf, 0x92, 0x73, 0x84, 0x87, 0x3c, 0x73, 0x93,
+    },
+},
+{
+    .patch_id = 0x0a70c005,
+    .digest = {
+        0x88, 0x5d, 0xfb, 0x79, 0x64, 0xd8, 0x46, 0x3b,
+        0x4a, 0x83, 0x8e, 0x77, 0x7e, 0xcf, 0xb3, 0x0f,
+        0x1f, 0x1f, 0xf1, 0x97, 0xeb, 0xfe, 0x56, 0x55,
+        0xee, 0x49, 0xac, 0xe1, 0x8b, 0x13, 0xc5, 0x13,
+    },
+},
+{
+    .patch_id = 0x0aa00116,
+    .digest = {
+        0xe8, 0x4c, 0x2c, 0x88, 0xa1, 0xac, 0x24, 0x63,
+        0x65, 0xe5, 0xaa, 0x2d, 0x16, 0xa9, 0xc3, 0xf5,
+        0xfe, 0x1d, 0x5e, 0x65, 0xc7, 0xaa, 0x92, 0x4d,
+        0x91, 0xee, 0x76, 0xbb, 0x4c, 0x66, 0x78, 0xc9,
+    },
+},
+{
+    .patch_id = 0x0aa00215,
+    .digest = {
+        0x55, 0xd3, 0x28, 0xcb, 0x87, 0xa9, 0x32, 0xe9,
+        0x4e, 0x85, 0x4b, 0x7c, 0x6b, 0xd5, 0x7c, 0xd4,
+        0x1b, 0x51, 0x71, 0x3a, 0x0e, 0x0b, 0xdc, 0x9b,
+        0x68, 0x2f, 0x46, 0xee, 0xfe, 0xc6, 0x6d, 0xef,
+    },
+},
diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 31fbd326e5..e17c60fe3b 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -16,7 +16,9 @@
 
 #include <xen/err.h>
 #include <xen/init.h>
+#include <xen/lib.h>
 #include <xen/mm.h> /* TODO: Fix asm/tlbflush.h breakage */
+#include <xen/sha2.h>
 
 #include <asm/msr.h>
 
@@ -91,6 +93,59 @@ static struct {
     uint16_t id;
 } equiv __read_mostly;
 
+static const struct patch_digest {
+    uint32_t patch_id;
+    uint8_t digest[SHA2_256_DIGEST_SIZE];
+} patch_digests[] = {
+#include "amd-patch-digests.c"
+};
+
+static int cf_check cmp_patch_id(const void *key, const void *elem)
+{
+    const struct patch_digest *pd = elem;
+    uint32_t patch_id = *(uint32_t *)key;
+
+    if ( patch_id == pd->patch_id )
+        return 0;
+    else if ( patch_id < pd->patch_id )
+        return -1;
+    return 1;
+}
+
+static bool check_digest(const struct container_microcode *mc)
+{
+    const struct microcode_patch *patch = mc->patch;
+    const struct patch_digest *pd;
+    uint8_t digest[SHA2_256_DIGEST_SIZE];
+
+    /* Only Fam17h/19h are known to need extra checks.  Skip other families. */
+    if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x19 ||
+         !opt_digest_check )
+        return true;
+
+    pd = bsearch(&patch->patch_id, patch_digests, ARRAY_SIZE(patch_digests),
+                 sizeof(struct patch_digest), cmp_patch_id);
+    if ( !pd )
+    {
+        printk(XENLOG_WARNING "No digest found for patch_id %08x\n",
+               patch->patch_id);
+        return false;
+    }
+
+    sha2_256_digest(digest, patch, mc->len);
+
+    if ( memcmp(digest, pd->digest, sizeof(digest)) )
+    {
+        printk(XENLOG_WARNING "Patch %08x SHA256 mismatch:\n"
+               "  expected %" STR(SHA2_256_DIGEST_SIZE) "phN\n"
+               "       got %" STR(SHA2_256_DIGEST_SIZE) "phN\n",
+               patch->patch_id, pd->digest, digest);
+        return false;
+    }
+
+    return true;
+}
+
 static void cf_check collect_cpu_info(void)
 {
     struct cpu_signature *csig = &this_cpu(cpu_sig);
@@ -394,7 +449,8 @@ static struct microcode_patch *cf_check cpu_request_microcode(
              * one with higher revision.
              */
             if ( (microcode_fits(mc->patch) != MIS_UCODE) &&
-                 (!saved || (compare_header(mc->patch, saved) == NEW_UCODE)) )
+                 (!saved || (compare_header(mc->patch, saved) == NEW_UCODE)) &&
+                 check_digest(mc) )
             {
                 saved = mc->patch;
                 saved_size = mc->len;
@@ -449,6 +505,14 @@ static const struct microcode_ops __initconst_cf_clobber amd_ucode_ops = {
 
 void __init ucode_probe_amd(struct microcode_ops *ops)
 {
+    if ( !opt_digest_check &&
+         boot_cpu_data.x86 >= 0x17 && boot_cpu_data.x86 <= 0x19 )
+    {
+        printk(XENLOG_WARNING
+               "Microcode patch additional digest checks disabled");
+        add_taint(TAINT_CPU_OUT_OF_SPEC);
+    }
+
     if ( boot_cpu_data.x86 < 0x10 )
         return;
 
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 655bc41e07..cae3d1ee3d 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -99,6 +99,7 @@ static bool __initdata ucode_scan;
 static bool ucode_in_nmi = true;
 
 bool __read_mostly opt_ucode_allow_same;
+bool __ro_after_init opt_digest_check = true;
 
 /* Protected by microcode_mutex */
 static struct microcode_patch *microcode_cache;
@@ -128,6 +129,8 @@ static int __init cf_check parse_ucode(const char *s)
             ucode_in_nmi = val;
         else if ( (val = parse_boolean("allow-same", s, ss)) >= 0 )
             opt_ucode_allow_same = val;
+        else if ( (val = parse_boolean("digest-check", s, ss)) >= 0 )
+            opt_digest_check = val;
         else if ( !ucode_mod_forced ) /* Not forced by EFI */
         {
             if ( (val = parse_boolean("scan", s, ss)) >= 0 )
diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h
index da556fe506..ef134724d8 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -60,6 +60,8 @@ struct microcode_ops {
         const struct microcode_patch *new, const struct microcode_patch *old);
 };
 
+extern bool opt_digest_check;
+
 /*
  * Microcode loading falls into one of 3 states.
  *   - No support at all
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 17:33:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 17:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947674.1345239 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3IFx-0005nr-Bx; Fri, 11 Apr 2025 17:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947674.1345239; Fri, 11 Apr 2025 17: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 1u3IFx-0005nk-9T; Fri, 11 Apr 2025 17:33:33 +0000
Received: by outflank-mailman (input) for mailman id 947674;
 Fri, 11 Apr 2025 17: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 1u3IFw-0005nc-Jk
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 17: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 1u3IFw-008WTG-1s
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3IFw-00ENm3-1V
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17: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=s23+OrgtWGFukGWWjcAOzj8BBEeVAwsVz4eo1Xa9crQ=; b=W9RFJIBu5lTHXGPvFV4xQymvMb
	telo0qZiqiFHB+8V9GQ1oKUbq8u5SnCX74olpVY5aiheihT6NmIr2Zwa1Gi/06D4RpUJwaHjopGZS
	VD5dynIleL2ynTC9paSSJJw9LSIfauRoixgRbYMU57b11bmGJw6L/0HG8abB7r70QCAU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/ucode: Extend AMD digest checks to cover Zen5 CPUs
Message-Id: <E1u3IFw-00ENm3-1V@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 17:33:32 +0000

commit 465ccf84e382d367833924cc9fb44eb1580f2337
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 8 17:09:15 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 14:12:25 2025 +0100

    x86/ucode: Extend AMD digest checks to cover Zen5 CPUs
    
    AMD have updated the SB-7033 advisory to include Zen5 CPUs.  Extend the digest
    check to cover Zen5 too.
    
    In practice, cover everything until further notice.
    
    Observant readers may be wondering where the update to the digest list is.  At
    the time of writing, no Zen5 patches are available via a verifiable channel.
    
    Link: https://www.amd.com/en/resources/product-security/bulletin/amd-sb-7033.html
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit b63951467e964bcc927f823fc943e40069fac0c9)
    
    x86/ucode: Extend warning about disabling digest check too
    
    This was missed by accident.
    
    Fixes: b63951467e96 ("x86/ucode: Extend AMD digest checks to cover Zen5 CPUs")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 59bb316ea89e7f9461690fe00547d7d2af96321d)
---
 xen/arch/x86/cpu/microcode/amd.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index e17c60fe3b..4f236e4399 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -118,8 +118,12 @@ static bool check_digest(const struct container_microcode *mc)
     const struct patch_digest *pd;
     uint8_t digest[SHA2_256_DIGEST_SIZE];
 
-    /* Only Fam17h/19h are known to need extra checks.  Skip other families. */
-    if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x19 ||
+    /*
+     * Zen1 thru Zen5 CPUs are known to use a weak signature algorithm on
+     * microcode updates.  Mitigate by checking the digest of the patch
+     * against a list of known provenance.
+     */
+    if ( boot_cpu_data.x86 < 0x17 ||
          !opt_digest_check )
         return true;
 
@@ -505,8 +509,7 @@ static const struct microcode_ops __initconst_cf_clobber amd_ucode_ops = {
 
 void __init ucode_probe_amd(struct microcode_ops *ops)
 {
-    if ( !opt_digest_check &&
-         boot_cpu_data.x86 >= 0x17 && boot_cpu_data.x86 <= 0x19 )
+    if ( !opt_digest_check && boot_cpu_data.x86 >= 0x17 )
     {
         printk(XENLOG_WARNING
                "Microcode patch additional digest checks disabled");
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 17:55:04 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 17:55:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947689.1345254 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3Ial-0003FR-15; Fri, 11 Apr 2025 17:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947689.1345254; Fri, 11 Apr 2025 17: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 1u3Iak-0003FJ-TQ; Fri, 11 Apr 2025 17:55:02 +0000
Received: by outflank-mailman (input) for mailman id 947689;
 Fri, 11 Apr 2025 17:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u3Iak-0003FD-3V
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 17:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3Iaj-008WvL-2y
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3Iaj-00EqGH-2q
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17:55:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=iRlH3NrS0v1znJLhh2NbUtCBadylzQDQ9AJTr+EKUzw=; b=Slfp9B32GCXkqEBUD0dXvWQbJJ
	ByfacwmqZk1njfRCEgWr6ayZGgILL41uF0dsp68LyKMPc3vr/Zsa2KpNCf4PtuSRFpru07FJJgLk6
	BxKkbhpofwRj4C4+1IQz3fS9Pgbk/qIyL40sl7kRHkHZvJ0pDbFejfqkJ7mZ2oEMbylE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] tools/libxl: do not use `-c -E` compiler options together
Message-Id: <E1u3Iaj-00EqGH-2q@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 17:55:01 +0000

commit 668e175d43b0b3109ba887789728b77d02750ffa
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Apr 7 13:09:38 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 17:27:59 2025 +0100

    tools/libxl: do not use `-c -E` compiler options together
    
    It makes no sense to request for preprocessor only output and also request
    object file generation.  Fix the _libxl.api-for-check target to only use
    -E (preprocessor output).
    
    Also Clang 20.0 reports an error if both options are used.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Fixes: 2862bf5b6c81 ('libxl: enforce prohibitions of internal callers')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
    (cherry picked from commit a235f856e4bbd270b085590e1f5fc9599234dcdf)
---
 tools/libs/light/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
index 37e4d16709..b690d92159 100644
--- a/tools/libs/light/Makefile
+++ b/tools/libs/light/Makefile
@@ -195,7 +195,7 @@ libxl.api-ok: check-libxl-api-rules _libxl.api-for-check
 	touch $@
 
 _libxl.api-for-check: $(XEN_INCLUDE)/libxl.h
-	$(CC) $(CPPFLAGS) $(CFLAGS) -c -E $< $(APPEND_CFLAGS) \
+	$(CC) $(CPPFLAGS) $(CFLAGS) -E $< $(APPEND_CFLAGS) \
 		-DLIBXL_EXTERNAL_CALLERS_ONLY=LIBXL_EXTERNAL_CALLERS_ONLY \
 		>$@.new
 	mv -f $@.new $@
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 17:55:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 17:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947690.1345257 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3Iav-0003HK-1G; Fri, 11 Apr 2025 17:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947690.1345257; Fri, 11 Apr 2025 17: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 1u3Iau-0003HC-Ur; Fri, 11 Apr 2025 17:55:12 +0000
Received: by outflank-mailman (input) for mailman id 947690;
 Fri, 11 Apr 2025 17: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 1u3Iau-0003H6-1s
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 17: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 1u3Iau-008WvP-04
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3Iat-00EqUj-39
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17: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=C0seuEDWExh/Fw3PLMB8ErxvUgstEtjsCPGDrvNqv6M=; b=qmLvQeR2DRB1kRDPvXnON5kO1q
	SoGiX8qKp8TbRDyP/AMgP72eSnazIkn8UMaDMchdyAfD/vXgzr8ooPCdjs/FPqdbBqeavFwFe/Hdv
	BGktE+62KLm2A0K+8PRRPxy3jLpYHWavwdSxS144GivSz4ft24O7InkTy62RWZvyTd4o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] tools/libxl: remove usage of VLA arrays
Message-Id: <E1u3Iat-00EqUj-39@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 17:55:11 +0000

commit af98d03997d78aba243666cc144fa5137b3bf2f0
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Oct 28 12:48:31 2024 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 17:27:59 2025 +0100

    tools/libxl: remove usage of VLA arrays
    
    Clang 19 complains with the following error when building libxl:
    
    libxl_utils.c:48:15: error: variable length array folded to constant array as an extension [-Werror,-Wgnu-folding-constant]
       48 |     char path[strlen("/local/domain") + 12];
          |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    Replace the usage of strlen() with sizeof, which allows the literal
    string length to be known at build time.  Note sizeof accounts for the
    NUL terminator while strlen() didn't, hence subtract 1 from the total
    size calculation.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Frediano Ziglio <frediano.ziglio@cloud.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
    (cherry picked from commit a7c7c3f6424504c4004bbb3437be319aa41ad580)
---
 tools/libs/light/libxl_utils.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libs/light/libxl_utils.c b/tools/libs/light/libxl_utils.c
index 65ef196935..7fd9b177b3 100644
--- a/tools/libs/light/libxl_utils.c
+++ b/tools/libs/light/libxl_utils.c
@@ -45,7 +45,7 @@ unsigned long libxl_get_required_shadow_memory(unsigned long maxmem_kb, unsigned
 char *libxl_domid_to_name(libxl_ctx *ctx, uint32_t domid)
 {
     unsigned int len;
-    char path[strlen("/local/domain") + 12];
+    char path[sizeof("/local/domain") + 11];
     char *s;
 
     snprintf(path, sizeof(path), "/local/domain/%d/name", domid);
@@ -141,7 +141,7 @@ int libxl_cpupool_qualifier_to_cpupoolid(libxl_ctx *ctx, const char *p,
 char *libxl_cpupoolid_to_name(libxl_ctx *ctx, uint32_t poolid)
 {
     unsigned int len;
-    char path[strlen("/local/pool") + 12];
+    char path[sizeof("/local/pool") + 11];
     char *s;
 
     snprintf(path, sizeof(path), "/local/pool/%d/name", poolid);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 17:55:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 17:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947691.1345261 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3Ib5-0003Jx-2k; Fri, 11 Apr 2025 17:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947691.1345261; Fri, 11 Apr 2025 17: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 1u3Ib5-0003Jp-05; Fri, 11 Apr 2025 17:55:23 +0000
Received: by outflank-mailman (input) for mailman id 947691;
 Fri, 11 Apr 2025 17: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 1u3Ib4-0003JZ-54
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 17: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 1u3Ib4-008WvT-0P
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3Ib4-00Equc-0J
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17: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=05nsvr/KSFN5legJEbDq0FPBIhqcFkOhzmcjD6G5K0s=; b=f6a4vTOCP4UHW5GBzJjlt0xrj0
	8GwEZewhqkWLaLO+O1U0dsWv3CSsfm9MwTxT45IPpL9YfruX5rX12W5/vfOgsZn1zFDctnvZ0EsDY
	pZwqSL8wTfUjUszL0aJT+vHEEH89WOcXhAn+DCRI2rl4+SOQb3XmP12L8M0kh0Xr6aC8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] automation: update xilinx test scripts (tty)
Message-Id: <E1u3Ib4-00Equc-0J@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 17:55:22 +0000

commit 3e1a31e7d3ed9fc9719ab6f6381daa4f25609b72
Author:     Victor Lira <victorm.lira@amd.com>
AuthorDate: Fri Aug 23 15:29:04 2024 -0700
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 17:27:59 2025 +0100

    automation: update xilinx test scripts (tty)
    
    Update serial device names from ttyUSB* to test board specific names.
    
    Update xilinx-smoke-dom0-x86_64 with new Xen command line console options,
    which are now set as Gitlab CI/CD variables. Abstract the directory where
    binaries are stored. Increase the timeout to match new setup.
    
    Signed-off-by: Victor Lira <victorm.lira@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 95764a0817a51741b7ffb1f78cba2a19b08ab2d1)
    [Stripped down to xilinx-smoke-dom0less-arm64.sh only]
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/scripts/xilinx-smoke-dom0less-arm64.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/automation/scripts/xilinx-smoke-dom0less-arm64.sh b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
index 075305241c..d4bf19855a 100755
--- a/automation/scripts/xilinx-smoke-dom0less-arm64.sh
+++ b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
@@ -134,9 +134,10 @@ sleep 5
 cd $START
 
 # connect to serial
+SERIAL_DEV="/dev/serial/zynq"
 set +e
-stty -F /dev/ttyUSB0 115200
-timeout -k 1 120 nohup sh -c "cat /dev/ttyUSB0 | tee smoke.serial"
+stty -F ${SERIAL_DEV} 115200
+timeout -k 1 120 nohup sh -c "cat ${SERIAL_DEV} | tee smoke.serial"
 
 # stop the board
 cd /scratch/gitlab-runner
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 17:55:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 17:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947692.1345266 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3IbF-0003Ml-5X; Fri, 11 Apr 2025 17:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947692.1345266; Fri, 11 Apr 2025 17: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 1u3IbF-0003Md-2l; Fri, 11 Apr 2025 17:55:33 +0000
Received: by outflank-mailman (input) for mailman id 947692;
 Fri, 11 Apr 2025 17: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 1u3IbE-0003MV-8a
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 17: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 1u3IbE-008Wvq-0k
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3IbE-00ErCO-0a
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17: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=Jct+tkG8haIIdsSFNJ5G6LreIwZ82NUcsseAT3XHSuA=; b=u346wGKoUwfibq2KxR/gG/Vtcy
	A+DjwVq2NaNnEU7zqHJtfes38c1Cn77qXZyctymfMCBYoJgOhQmvy343kAMODxzwFzJbXbMlvMzAG
	tvFdqf5f3WLotCieBguL8jqf9oT/ccaZ914cOluLYJqlszdQFtzOZWYAzMZncOx7dEyQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] CI: Resync .cirrus.yml for FreeBSD testing
Message-Id: <E1u3IbE-00ErCO-0a@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 17:55:32 +0000

commit 09c0f1aabb32d978a2c6ad6ae1e764db58064229
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Apr 11 16:56:35 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 17:27:59 2025 +0100

    CI: Resync .cirrus.yml for FreeBSD testing
    
    Includes:
      commit 5395cd7b892d ("automation/cirrus-ci: update FreeBSD to 13.5")
      commit 850a263b7863 ("automation/cirrus-ci: update FreeBSD to 13.4")
      commit 0cc8845fb9fd ("CI: Update to FreeBSD 14.2")
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 .cirrus.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 0ec9586e2c..eb46227892 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -17,11 +17,11 @@ freebsd_template: &FREEBSD_TEMPLATE
 task:
   name: 'FreeBSD 13'
   freebsd_instance:
-    image_family: freebsd-13-3
+    image_family: freebsd-13-5
   << : *FREEBSD_TEMPLATE
 
 task:
   name: 'FreeBSD 14'
   freebsd_instance:
-    image_family: freebsd-14-1
+    image_family: freebsd-14-2
   << : *FREEBSD_TEMPLATE
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 17:55:43 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 17:55:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947693.1345268 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3IbP-0003PB-6d; Fri, 11 Apr 2025 17:55:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947693.1345268; Fri, 11 Apr 2025 17:55:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3IbP-0003P4-46; Fri, 11 Apr 2025 17:55:43 +0000
Received: by outflank-mailman (input) for mailman id 947693;
 Fri, 11 Apr 2025 17: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 1u3IbO-0003Or-BZ
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 17: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 1u3IbO-008Wvu-14
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3IbO-00ErQR-0v
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17: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=rdFOg/EpF+E7qbz1NGsckCOEwdMhuXFK2uzEYw/KZ5Y=; b=Ado+emyZBBDlJhL9Hj5LygycWu
	IDn/vsp4SheFlT3dWn3pajjrNiRc/NdeE73/Ay/j6KQmaAQMRONji2ZdZjzVfeF3qfi5M0GT+ACpM
	rmddDtKT5Z0SrBnbRrM4iiWRMw3gyvCqCaO9boYdRDdDtk8aARUUS2xyu4m7FM3e8UJ4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] xen/lib: Introduce SHA2-256
Message-Id: <E1u3IbO-00ErQR-0v@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 17:55:42 +0000

commit ea0110cb3c49f351bdb39f8800fe421a22fc04ce
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Dec 13 14:34:00 2024 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 17:27:59 2025 +0100

    xen/lib: Introduce SHA2-256
    
    A future change will need to calculate SHA2-256 digests.  Introduce an
    implementation in lib/, derived from Trenchboot which itself is derived from
    Linux.
    
    In order to be useful to other architectures, it is careful with endianness
    and misaligned accesses as well as being more MISRA friendly, but is only
    wired up for x86 in the short term.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 372af524411f5a013bcb0b117073d8d07c026563)
    
    Xen: CI fix from XSN-2
    
     * Add U suffix to the K[] table to fix MISRA Rule 7.2 violations.
    
    Fixes: 372af524411f ("xen/lib: Introduce SHA2-256")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 15fe2eb5f1bac8a212c0ba3d6dfe60d1fdf851cf)
---
 xen/include/xen/sha2.h |  15 ++++
 xen/lib/Makefile       |   1 +
 xen/lib/sha2-256.c     | 216 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 232 insertions(+)

diff --git a/xen/include/xen/sha2.h b/xen/include/xen/sha2.h
new file mode 100644
index 0000000000..47d97fbf01
--- /dev/null
+++ b/xen/include/xen/sha2.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * SHA2-256: https://csrc.nist.gov/pubs/fips/180-2/upd1/final
+ */
+#ifndef XEN_SHA2_H
+#define XEN_SHA2_H
+
+#include <xen/types.h>
+
+#define SHA2_256_DIGEST_SIZE 32
+
+void sha2_256_digest(uint8_t digest[SHA2_256_DIGEST_SIZE],
+                     const void *msg, size_t len);
+
+#endif /* XEN_SHA2_H */
diff --git a/xen/lib/Makefile b/xen/lib/Makefile
index 2d9ebb945f..90766e37ce 100644
--- a/xen/lib/Makefile
+++ b/xen/lib/Makefile
@@ -13,6 +13,7 @@ lib-y += memset.o
 lib-y += muldiv64.o
 lib-y += parse-size.o
 lib-y += rbtree.o
+lib-$(CONFIG_X86) += sha2-256.o
 lib-y += sort.o
 lib-y += strcasecmp.o
 lib-y += strchr.o
diff --git a/xen/lib/sha2-256.c b/xen/lib/sha2-256.c
new file mode 100644
index 0000000000..cb02ec1857
--- /dev/null
+++ b/xen/lib/sha2-256.c
@@ -0,0 +1,216 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * SHA2-256: https://csrc.nist.gov/pubs/fips/180-2/upd1/final
+ *
+ * Originally derived from Linux.  Modified substantially to optimise for size
+ * and Xen's expected usecases.
+ */
+#include <xen/bitops.h>
+#include <xen/sha2.h>
+#include <xen/string.h>
+
+#include <asm/unaligned.h>
+
+struct sha2_256_state {
+    uint32_t state[SHA2_256_DIGEST_SIZE / sizeof(uint32_t)];
+    uint8_t buf[64];
+    size_t count; /* Byte count. */
+};
+
+static uint32_t choose(uint32_t x, uint32_t y, uint32_t z)
+{
+    return z ^ (x & (y ^ z));
+}
+
+static uint32_t majority(uint32_t x, uint32_t y, uint32_t z)
+{
+    return (x & y) | (z & (x | y));
+}
+
+static uint32_t e0(uint32_t x)
+{
+    return ror32(x, 2) ^ ror32(x, 13) ^ ror32(x, 22);
+}
+
+static uint32_t e1(uint32_t x)
+{
+    return ror32(x, 6) ^ ror32(x, 11) ^ ror32(x, 25);
+}
+
+static uint32_t s0(uint32_t x)
+{
+    return ror32(x, 7) ^ ror32(x, 18) ^ (x >> 3);
+}
+
+static uint32_t s1(uint32_t x)
+{
+    return ror32(x, 17) ^ ror32(x, 19) ^ (x >> 10);
+}
+
+static uint32_t blend(uint32_t W[16], unsigned int i)
+{
+#define W(i) W[(i) & 15]
+
+    return W(i) += s1(W(i - 2)) + W(i - 7) + s0(W(i - 15));
+
+#undef W
+}
+
+static const uint32_t K[] = {
+    0x428a2f98U, 0x71374491U, 0xb5c0fbcfU, 0xe9b5dba5U,
+    0x3956c25bU, 0x59f111f1U, 0x923f82a4U, 0xab1c5ed5U,
+    0xd807aa98U, 0x12835b01U, 0x243185beU, 0x550c7dc3U,
+    0x72be5d74U, 0x80deb1feU, 0x9bdc06a7U, 0xc19bf174U,
+    0xe49b69c1U, 0xefbe4786U, 0x0fc19dc6U, 0x240ca1ccU,
+    0x2de92c6fU, 0x4a7484aaU, 0x5cb0a9dcU, 0x76f988daU,
+    0x983e5152U, 0xa831c66dU, 0xb00327c8U, 0xbf597fc7U,
+    0xc6e00bf3U, 0xd5a79147U, 0x06ca6351U, 0x14292967U,
+    0x27b70a85U, 0x2e1b2138U, 0x4d2c6dfcU, 0x53380d13U,
+    0x650a7354U, 0x766a0abbU, 0x81c2c92eU, 0x92722c85U,
+    0xa2bfe8a1U, 0xa81a664bU, 0xc24b8b70U, 0xc76c51a3U,
+    0xd192e819U, 0xd6990624U, 0xf40e3585U, 0x106aa070U,
+    0x19a4c116U, 0x1e376c08U, 0x2748774cU, 0x34b0bcb5U,
+    0x391c0cb3U, 0x4ed8aa4aU, 0x5b9cca4fU, 0x682e6ff3U,
+    0x748f82eeU, 0x78a5636fU, 0x84c87814U, 0x8cc70208U,
+    0x90befffaU, 0xa4506cebU, 0xbef9a3f7U, 0xc67178f2U,
+};
+
+static void sha2_256_transform(uint32_t *state, const void *_input)
+{
+    const uint32_t *input = _input;
+    uint32_t a, b, c, d, e, f, g, h, t1, t2;
+    uint32_t W[16];
+    unsigned int i;
+
+    for ( i = 0; i < 16; i++ )
+        W[i] = get_unaligned_be32(&input[i]);
+
+    a = state[0]; b = state[1]; c = state[2]; d = state[3];
+    e = state[4]; f = state[5]; g = state[6]; h = state[7];
+
+    for ( i = 0; i < 16; i += 8 )
+    {
+        t1 = h + e1(e) + choose(e, f, g) + K[i + 0] + W[i + 0];
+        t2 = e0(a) + majority(a, b, c);    d += t1;    h = t1 + t2;
+        t1 = g + e1(d) + choose(d, e, f) + K[i + 1] + W[i + 1];
+        t2 = e0(h) + majority(h, a, b);    c += t1;    g = t1 + t2;
+        t1 = f + e1(c) + choose(c, d, e) + K[i + 2] + W[i + 2];
+        t2 = e0(g) + majority(g, h, a);    b += t1;    f = t1 + t2;
+        t1 = e + e1(b) + choose(b, c, d) + K[i + 3] + W[i + 3];
+        t2 = e0(f) + majority(f, g, h);    a += t1;    e = t1 + t2;
+        t1 = d + e1(a) + choose(a, b, c) + K[i + 4] + W[i + 4];
+        t2 = e0(e) + majority(e, f, g);    h += t1;    d = t1 + t2;
+        t1 = c + e1(h) + choose(h, a, b) + K[i + 5] + W[i + 5];
+        t2 = e0(d) + majority(d, e, f);    g += t1;    c = t1 + t2;
+        t1 = b + e1(g) + choose(g, h, a) + K[i + 6] + W[i + 6];
+        t2 = e0(c) + majority(c, d, e);    f += t1;    b = t1 + t2;
+        t1 = a + e1(f) + choose(f, g, h) + K[i + 7] + W[i + 7];
+        t2 = e0(b) + majority(b, c, d);    e += t1;    a = t1 + t2;
+    }
+
+    for ( ; i < 64; i += 8 )
+    {
+        t1 = h + e1(e) + choose(e, f, g) + K[i + 0] + blend(W, i + 0);
+        t2 = e0(a) + majority(a, b, c);    d += t1;    h = t1 + t2;
+        t1 = g + e1(d) + choose(d, e, f) + K[i + 1] + blend(W, i + 1);
+        t2 = e0(h) + majority(h, a, b);    c += t1;    g = t1 + t2;
+        t1 = f + e1(c) + choose(c, d, e) + K[i + 2] + blend(W, i + 2);
+        t2 = e0(g) + majority(g, h, a);    b += t1;    f = t1 + t2;
+        t1 = e + e1(b) + choose(b, c, d) + K[i + 3] + blend(W, i + 3);
+        t2 = e0(f) + majority(f, g, h);    a += t1;    e = t1 + t2;
+        t1 = d + e1(a) + choose(a, b, c) + K[i + 4] + blend(W, i + 4);
+        t2 = e0(e) + majority(e, f, g);    h += t1;    d = t1 + t2;
+        t1 = c + e1(h) + choose(h, a, b) + K[i + 5] + blend(W, i + 5);
+        t2 = e0(d) + majority(d, e, f);    g += t1;    c = t1 + t2;
+        t1 = b + e1(g) + choose(g, h, a) + K[i + 6] + blend(W, i + 6);
+        t2 = e0(c) + majority(c, d, e);    f += t1;    b = t1 + t2;
+        t1 = a + e1(f) + choose(f, g, h) + K[i + 7] + blend(W, i + 7);
+        t2 = e0(b) + majority(b, c, d);    e += t1;    a = t1 + t2;
+    }
+
+    state[0] += a; state[1] += b; state[2] += c; state[3] += d;
+    state[4] += e; state[5] += f; state[6] += g; state[7] += h;
+}
+
+static void sha2_256_init(struct sha2_256_state *s)
+{
+    *s = (struct sha2_256_state){
+        .state = {
+            0x6a09e667UL,
+            0xbb67ae85UL,
+            0x3c6ef372UL,
+            0xa54ff53aUL,
+            0x510e527fUL,
+            0x9b05688cUL,
+            0x1f83d9abUL,
+            0x5be0cd19UL,
+        },
+    };
+}
+
+static void sha2_256_update(struct sha2_256_state *s, const void *msg,
+                            size_t len)
+{
+    unsigned int partial = s->count & 63;
+
+    s->count += len;
+
+    if ( (partial + len) >= 64 )
+    {
+        if ( partial )
+        {
+            unsigned int rem = 64 - partial;
+
+            /* Fill the partial block. */
+            memcpy(s->buf + partial, msg, rem);
+            msg += rem;
+            len -= rem;
+
+            sha2_256_transform(s->state, s->buf);
+            partial = 0;
+        }
+
+        for ( ; len >= 64; msg += 64, len -= 64 )
+            sha2_256_transform(s->state, msg);
+    }
+
+    /* Remaining data becomes partial. */
+    memcpy(s->buf + partial, msg, len);
+}
+
+static void sha2_256_final(struct sha2_256_state *s, void *_dst)
+{
+    uint32_t *dst = _dst;
+    unsigned int i, partial = s->count & 63;
+
+    /* Start padding */
+    s->buf[partial++] = 0x80;
+
+    if ( partial > 56 )
+    {
+        /* Need one extra block - pad to 64 */
+        memset(s->buf + partial, 0, 64 - partial);
+        sha2_256_transform(s->state, s->buf);
+        partial = 0;
+    }
+    /* Pad to 56 */
+    memset(s->buf + partial, 0, 56 - partial);
+
+    /* Append the bit count */
+    put_unaligned_be64((uint64_t)s->count << 3, &s->buf[56]);
+    sha2_256_transform(s->state, s->buf);
+
+    /* Store state in digest */
+    for ( i = 0; i < 8; i++ )
+        put_unaligned_be32(s->state[i], &dst[i]);
+}
+
+void sha2_256_digest(uint8_t digest[SHA2_256_DIGEST_SIZE],
+                     const void *msg, size_t len)
+{
+    struct sha2_256_state s;
+
+    sha2_256_init(&s);
+    sha2_256_update(&s, msg, len);
+    sha2_256_final(&s, digest);
+}
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 17:55:53 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 17:55:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947694.1345272 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3IbZ-0003RP-8H; Fri, 11 Apr 2025 17:55:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947694.1345272; Fri, 11 Apr 2025 17:55:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3IbZ-0003RG-5a; Fri, 11 Apr 2025 17:55:53 +0000
Received: by outflank-mailman (input) for mailman id 947694;
 Fri, 11 Apr 2025 17: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 1u3IbY-0003RA-Fe
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 17: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 1u3IbY-008Wvy-1S
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17:55:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3IbY-00Erkc-1H
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17: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=x2sz+rYRTJvSX8XYZ5mZwuI7gjTO/Y2gOudU7pOrnE8=; b=MOGqsHAQ6kms65V0QLJvkJp0/e
	YJpltBjGbV8iA9n4Um10BA2491ccfJGG5NUO1LIHlPujjgl9s8AZe2QyReIvcvH7UzGmylGaGKem9
	HOoWuaHQqJvExtnUyg+v394B/Lyv/D0N55+MZwMTuYoPJyqtAvBN6KDxaVT1cPbIb5SE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode
Message-Id: <E1u3IbY-00Erkc-1H@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 17:55:52 +0000

commit b2b0b4bce10445a0338ecb596cfb3c05838b483b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Dec 13 14:34:00 2024 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 17:27:59 2025 +0100

    x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode
    
    Collisions have been found in the microcode signing algorithm used by AMD
    Fam17h/19h CPUs, and now anyone can sign their own.
    
    For more details, see:
      https://bughunters.google.com/blog/5424842357473280/zen-and-the-art-of-microcode-hacking
      https://www.amd.com/en/resources/product-security/bulletin/amd-sb-7033.html
    
    As a stopgap mitigation, check the digest of patches against a table of blobs
    with known provenance.  These are all Fam17h and Fam19h blobs included in
    linux-firwmare at the time of writing, specifically:
    
      https://git.kernel.org/firmware/linux-firmware/c/48bb90cceb882cab8e9ab692bc5779d3bf3a13b8
    
    This checks can be opted out of by booting with ucode=no-digest-check, but
    doing so is not recommended.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 630e8875ab368b97cc7231aaf3809e3d7d5687e1)
    
    Xen: CI fix from XSN-2
    
     * Add cf_check annotation to cmp_patch_id() used by bsearch().
    
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 15fe2eb5f1bac8a212c0ba3d6dfe60d1fdf851cf)
---
 docs/misc/xen-command-line.pandoc              |  10 +-
 xen/arch/x86/cpu/microcode/amd-patch-digests.c | 226 +++++++++++++++++++++++++
 xen/arch/x86/cpu/microcode/amd.c               |  58 ++++++-
 xen/arch/x86/cpu/microcode/core.c              |  11 ++
 xen/arch/x86/cpu/microcode/private.h           |   2 +
 5 files changed, 304 insertions(+), 3 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 03346aeba5..14c0d0a058 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2641,10 +2641,10 @@ performance.
    Alternatively, selecting `tsx=1` will re-enable TSX at the users own risk.
 
 ### ucode
-> `= List of [ <integer> | scan=<bool>, nmi=<bool>, allow-same=<bool> ]`
+> `= List of [ <integer> | scan=<bool>, nmi=<bool>, allow-same=<bool>, digest-check=<bool> ]`
 
     Applicability: x86
-    Default: `nmi`
+    Default: `nmi,digest-check`
 
 Controls for CPU microcode loading. For early loading, this parameter can
 specify how and where to find the microcode update blob. For late loading,
@@ -2678,6 +2678,12 @@ trying to reload the same version.  Many CPUs will actually reload microcode
 of the same version, and this allows for easy testing of the late microcode
 loading path.
 
+The `digest-check=` option is active by default and controls whether to
+perform additional authenticity checks.  Collisions in the signature algorithm
+used by AMD Fam17h/19h processors have been found.  Xen contains a table of
+digests of microcode patches with known-good provenance, and will block
+loading of patches that do not match.
+
 ### unrestricted_guest (Intel)
 > `= <boolean>`
 
diff --git a/xen/arch/x86/cpu/microcode/amd-patch-digests.c b/xen/arch/x86/cpu/microcode/amd-patch-digests.c
new file mode 100644
index 0000000000..d327612267
--- /dev/null
+++ b/xen/arch/x86/cpu/microcode/amd-patch-digests.c
@@ -0,0 +1,226 @@
+/* Generated from linux-firmware. */
+{
+    .patch_id = 0x0800126f,
+    .digest = {
+        0x2b, 0x5a, 0xf2, 0x9c, 0xdd, 0xd2, 0x7f, 0xec,
+        0xec, 0x96, 0x09, 0x57, 0xb0, 0x96, 0x29, 0x8b,
+        0x2e, 0x26, 0x91, 0xf0, 0x49, 0x33, 0x42, 0x18,
+        0xdd, 0x4b, 0x65, 0x5a, 0xd4, 0x15, 0x3d, 0x33,
+    },
+},
+{
+    .patch_id = 0x0800820d,
+    .digest = {
+        0x68, 0x98, 0x83, 0xcd, 0x22, 0x0d, 0xdd, 0x59,
+        0x73, 0x2c, 0x5b, 0x37, 0x1f, 0x84, 0x0e, 0x67,
+        0x96, 0x43, 0x83, 0x0c, 0x46, 0x44, 0xab, 0x7c,
+        0x7b, 0x65, 0x9e, 0x57, 0xb5, 0x90, 0x4b, 0x0e,
+    },
+},
+{
+    .patch_id = 0x0830107c,
+    .digest = {
+        0x21, 0x64, 0xde, 0xfb, 0x9f, 0x68, 0x96, 0x47,
+        0x70, 0x5c, 0xe2, 0x8f, 0x18, 0x52, 0x6a, 0xac,
+        0xa4, 0xd2, 0x2e, 0xe0, 0xde, 0x68, 0x66, 0xc3,
+        0xeb, 0x1e, 0xd3, 0x3f, 0xbc, 0x51, 0x1d, 0x38,
+    },
+},
+{
+    .patch_id = 0x0860010d,
+    .digest = {
+        0x86, 0xb6, 0x15, 0x83, 0xbc, 0x3b, 0x9c, 0xe0,
+        0xb3, 0xef, 0x1d, 0x99, 0x84, 0x35, 0x15, 0xf7,
+        0x7c, 0x2a, 0xc6, 0x42, 0xdb, 0x73, 0x07, 0x5c,
+        0x7d, 0xc3, 0x02, 0xb5, 0x43, 0x06, 0x5e, 0xf8,
+    },
+},
+{
+    .patch_id = 0x08608108,
+    .digest = {
+        0x14, 0xfe, 0x57, 0x86, 0x49, 0xc8, 0x68, 0xe2,
+        0x11, 0xa3, 0xcb, 0x6e, 0xff, 0x6e, 0xd5, 0x38,
+        0xfe, 0x89, 0x1a, 0xe0, 0x67, 0xbf, 0xc4, 0xcc,
+        0x1b, 0x9f, 0x84, 0x77, 0x2b, 0x9f, 0xaa, 0xbd,
+    },
+},
+{
+    .patch_id = 0x08701034,
+    .digest = {
+        0xc3, 0x14, 0x09, 0xa8, 0x9c, 0x3f, 0x8d, 0x83,
+        0x9b, 0x4c, 0xa5, 0xb7, 0x64, 0x8b, 0x91, 0x5d,
+        0x85, 0x6a, 0x39, 0x26, 0x1e, 0x14, 0x41, 0xa8,
+        0x75, 0xea, 0xa6, 0xf9, 0xc9, 0xd1, 0xea, 0x2b,
+    },
+},
+{
+    .patch_id = 0x08a0000a,
+    .digest = {
+        0x73, 0x31, 0x26, 0x22, 0xd4, 0xf9, 0xee, 0x3c,
+        0x07, 0x06, 0xe7, 0xb9, 0xad, 0xd8, 0x72, 0x44,
+        0x33, 0x31, 0xaa, 0x7d, 0xc3, 0x67, 0x0e, 0xdb,
+        0x47, 0xb5, 0xaa, 0xbc, 0xf5, 0xbb, 0xd9, 0x20,
+    },
+},
+{
+    .patch_id = 0x0a00107a,
+    .digest = {
+        0x5f, 0x92, 0xca, 0xff, 0xc3, 0x59, 0x22, 0x5f,
+        0x02, 0xa0, 0x91, 0x3b, 0x4a, 0x45, 0x10, 0xfd,
+        0x19, 0xe1, 0x8a, 0x6d, 0x9a, 0x92, 0xc1, 0x3f,
+        0x75, 0x78, 0xac, 0x78, 0x03, 0x1d, 0xdb, 0x18,
+    },
+},
+{
+    .patch_id = 0x0a0011d5,
+    .digest = {
+        0xed, 0x69, 0x89, 0xf4, 0xeb, 0x64, 0xc2, 0x13,
+        0xe0, 0x51, 0x1f, 0x03, 0x26, 0x52, 0x7d, 0xb7,
+        0x93, 0x5d, 0x65, 0xca, 0xb8, 0x12, 0x1d, 0x62,
+        0x0d, 0x5b, 0x65, 0x34, 0x69, 0xb2, 0x62, 0x21,
+    },
+},
+{
+    .patch_id = 0x0a001238,
+    .digest = {
+        0x72, 0xf7, 0x4b, 0x0c, 0x7d, 0x58, 0x65, 0xcc,
+        0x00, 0xcc, 0x57, 0x16, 0x68, 0x16, 0xf8, 0x2a,
+        0x1b, 0xb3, 0x8b, 0xe1, 0xb6, 0x83, 0x8c, 0x7e,
+        0xc0, 0xcd, 0x33, 0xf2, 0x8d, 0xf9, 0xef, 0x59,
+    },
+},
+{
+    .patch_id = 0x0a00820c,
+    .digest = {
+        0xa8, 0x0c, 0x81, 0xc0, 0xa6, 0x00, 0xe7, 0xf3,
+        0x5f, 0x65, 0xd3, 0xb9, 0x6f, 0xea, 0x93, 0x63,
+        0xf1, 0x8c, 0x88, 0x45, 0xd7, 0x82, 0x80, 0xd1,
+        0xe1, 0x3b, 0x8d, 0xb2, 0xf8, 0x22, 0x03, 0xe2,
+    },
+},
+{
+    .patch_id = 0x0a101148,
+    .digest = {
+        0x20, 0xd5, 0x6f, 0x40, 0x4a, 0xf6, 0x48, 0x90,
+        0xc2, 0x93, 0x9a, 0xc2, 0xfd, 0xac, 0xef, 0x4f,
+        0xfa, 0xc0, 0x3d, 0x92, 0x3c, 0x6d, 0x01, 0x08,
+        0xf1, 0x5e, 0xb0, 0xde, 0xb4, 0x98, 0xae, 0xc4,
+    },
+},
+{
+    .patch_id = 0x0a101248,
+    .digest = {
+        0xed, 0x3b, 0x95, 0xa6, 0x68, 0xa7, 0x77, 0x3e,
+        0xfc, 0x17, 0x26, 0xe2, 0x7b, 0xd5, 0x56, 0x22,
+        0x2c, 0x1d, 0xef, 0xeb, 0x56, 0xdd, 0xba, 0x6e,
+        0x1b, 0x7d, 0x64, 0x9d, 0x4b, 0x53, 0x13, 0x75,
+    },
+},
+{
+    .patch_id = 0x0a108108,
+    .digest = {
+        0xed, 0xc2, 0xec, 0xa1, 0x15, 0xc6, 0x65, 0xe9,
+        0xd0, 0xef, 0x39, 0xaa, 0x7f, 0x55, 0x06, 0xc6,
+        0xf5, 0xd4, 0x3f, 0x7b, 0x14, 0xd5, 0x60, 0x2c,
+        0x28, 0x1e, 0x9c, 0x59, 0x69, 0x99, 0x4d, 0x16,
+    },
+},
+{
+    .patch_id = 0x0a20102d,
+    .digest = {
+        0xf9, 0x6e, 0xf2, 0x32, 0xd3, 0x0f, 0x5f, 0x11,
+        0x59, 0xa1, 0xfe, 0xcc, 0xcd, 0x9b, 0x42, 0x89,
+        0x8b, 0x89, 0x2f, 0xb5, 0xbb, 0x82, 0xef, 0x23,
+        0x8c, 0xe9, 0x19, 0x3e, 0xcc, 0x3f, 0x7b, 0xb4,
+    },
+},
+{
+    .patch_id = 0x0a201210,
+    .digest = {
+        0xe8, 0x6d, 0x51, 0x6a, 0x8e, 0x72, 0xf3, 0xfe,
+        0x6e, 0x16, 0xbc, 0x62, 0x59, 0x40, 0x17, 0xe9,
+        0x6d, 0x3d, 0x0e, 0x6b, 0xa7, 0xac, 0xe3, 0x68,
+        0xf7, 0x55, 0xf0, 0x13, 0xbb, 0x22, 0xf6, 0x41,
+    },
+},
+{
+    .patch_id = 0x0a404107,
+    .digest = {
+        0xbb, 0x04, 0x4e, 0x47, 0xdd, 0x5e, 0x26, 0x45,
+        0x1a, 0xc9, 0x56, 0x24, 0xa4, 0x4c, 0x82, 0xb0,
+        0x8b, 0x0d, 0x9f, 0xf9, 0x3a, 0xdf, 0xc6, 0x81,
+        0x13, 0xbc, 0xc5, 0x25, 0xe4, 0xc5, 0xc3, 0x99,
+    },
+},
+{
+    .patch_id = 0x0a500011,
+    .digest = {
+        0x23, 0x3d, 0x70, 0x7d, 0x03, 0xc3, 0xc4, 0xf4,
+        0x2b, 0x82, 0xc6, 0x05, 0xda, 0x80, 0x0a, 0xf1,
+        0xd7, 0x5b, 0x65, 0x3a, 0x7d, 0xab, 0xdf, 0xa2,
+        0x11, 0x5e, 0x96, 0x7e, 0x71, 0xe9, 0xfc, 0x74,
+    },
+},
+{
+    .patch_id = 0x0a601209,
+    .digest = {
+        0x66, 0x48, 0xd4, 0x09, 0x05, 0xcb, 0x29, 0x32,
+        0x66, 0xb7, 0x9a, 0x76, 0xcd, 0x11, 0xf3, 0x30,
+        0x15, 0x86, 0xcc, 0x5d, 0x97, 0x0f, 0xc0, 0x46,
+        0xe8, 0x73, 0xe2, 0xd6, 0xdb, 0xd2, 0x77, 0x1d,
+    },
+},
+{
+    .patch_id = 0x0a704107,
+    .digest = {
+        0xf3, 0xc6, 0x58, 0x26, 0xee, 0xac, 0x3f, 0xd6,
+        0xce, 0xa1, 0x72, 0x47, 0x3b, 0xba, 0x2b, 0x93,
+        0x2a, 0xad, 0x8e, 0x6b, 0xea, 0x9b, 0xb7, 0xc2,
+        0x64, 0x39, 0x71, 0x8c, 0xce, 0xe7, 0x41, 0x39,
+    },
+},
+{
+    .patch_id = 0x0a705206,
+    .digest = {
+        0x8d, 0xc0, 0x76, 0xbd, 0x58, 0x9f, 0x8f, 0xa4,
+        0x12, 0x9d, 0x21, 0xfb, 0x48, 0x21, 0xbc, 0xe7,
+        0x67, 0x6f, 0x04, 0x18, 0xae, 0x20, 0x87, 0x4b,
+        0x03, 0x35, 0xe9, 0xbe, 0xfb, 0x06, 0xdf, 0xfc,
+    },
+},
+{
+    .patch_id = 0x0a708007,
+    .digest = {
+        0x6b, 0x76, 0xcc, 0x78, 0xc5, 0x8a, 0xa3, 0xe3,
+        0x32, 0x2d, 0x79, 0xe4, 0xc3, 0x80, 0xdb, 0xb2,
+        0x07, 0xaa, 0x3a, 0xe0, 0x57, 0x13, 0x72, 0x80,
+        0xdf, 0x92, 0x73, 0x84, 0x87, 0x3c, 0x73, 0x93,
+    },
+},
+{
+    .patch_id = 0x0a70c005,
+    .digest = {
+        0x88, 0x5d, 0xfb, 0x79, 0x64, 0xd8, 0x46, 0x3b,
+        0x4a, 0x83, 0x8e, 0x77, 0x7e, 0xcf, 0xb3, 0x0f,
+        0x1f, 0x1f, 0xf1, 0x97, 0xeb, 0xfe, 0x56, 0x55,
+        0xee, 0x49, 0xac, 0xe1, 0x8b, 0x13, 0xc5, 0x13,
+    },
+},
+{
+    .patch_id = 0x0aa00116,
+    .digest = {
+        0xe8, 0x4c, 0x2c, 0x88, 0xa1, 0xac, 0x24, 0x63,
+        0x65, 0xe5, 0xaa, 0x2d, 0x16, 0xa9, 0xc3, 0xf5,
+        0xfe, 0x1d, 0x5e, 0x65, 0xc7, 0xaa, 0x92, 0x4d,
+        0x91, 0xee, 0x76, 0xbb, 0x4c, 0x66, 0x78, 0xc9,
+    },
+},
+{
+    .patch_id = 0x0aa00215,
+    .digest = {
+        0x55, 0xd3, 0x28, 0xcb, 0x87, 0xa9, 0x32, 0xe9,
+        0x4e, 0x85, 0x4b, 0x7c, 0x6b, 0xd5, 0x7c, 0xd4,
+        0x1b, 0x51, 0x71, 0x3a, 0x0e, 0x0b, 0xdc, 0x9b,
+        0x68, 0x2f, 0x46, 0xee, 0xfe, 0xc6, 0x6d, 0xef,
+    },
+},
diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 7c459b86c6..b5c2a55b26 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -16,7 +16,9 @@
 
 #include <xen/err.h>
 #include <xen/init.h>
+#include <xen/lib.h>
 #include <xen/mm.h> /* TODO: Fix asm/tlbflush.h breakage */
+#include <xen/sha2.h>
 
 #include <asm/msr.h>
 
@@ -91,6 +93,59 @@ static struct {
     uint16_t id;
 } equiv __read_mostly;
 
+static const struct patch_digest {
+    uint32_t patch_id;
+    uint8_t digest[SHA2_256_DIGEST_SIZE];
+} patch_digests[] = {
+#include "amd-patch-digests.c"
+};
+
+static int cf_check cmp_patch_id(const void *key, const void *elem)
+{
+    const struct patch_digest *pd = elem;
+    uint32_t patch_id = *(uint32_t *)key;
+
+    if ( patch_id == pd->patch_id )
+        return 0;
+    else if ( patch_id < pd->patch_id )
+        return -1;
+    return 1;
+}
+
+static bool check_digest(const struct container_microcode *mc)
+{
+    const struct microcode_patch *patch = mc->patch;
+    const struct patch_digest *pd;
+    uint8_t digest[SHA2_256_DIGEST_SIZE];
+
+    /* Only Fam17h/19h are known to need extra checks.  Skip other families. */
+    if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x19 ||
+         !opt_digest_check )
+        return true;
+
+    pd = bsearch(&patch->patch_id, patch_digests, ARRAY_SIZE(patch_digests),
+                 sizeof(struct patch_digest), cmp_patch_id);
+    if ( !pd )
+    {
+        printk(XENLOG_WARNING "No digest found for patch_id %08x\n",
+               patch->patch_id);
+        return false;
+    }
+
+    sha2_256_digest(digest, patch, mc->len);
+
+    if ( memcmp(digest, pd->digest, sizeof(digest)) )
+    {
+        printk(XENLOG_WARNING "Patch %08x SHA256 mismatch:\n"
+               "  expected %" STR(SHA2_256_DIGEST_SIZE) "phN\n"
+               "       got %" STR(SHA2_256_DIGEST_SIZE) "phN\n",
+               patch->patch_id, pd->digest, digest);
+        return false;
+    }
+
+    return true;
+}
+
 static void cf_check collect_cpu_info(void)
 {
     struct cpu_signature *csig = &this_cpu(cpu_sig);
@@ -394,7 +449,8 @@ static struct microcode_patch *cf_check cpu_request_microcode(
              * one with higher revision.
              */
             if ( (microcode_fits(mc->patch) != MIS_UCODE) &&
-                 (!saved || (compare_header(mc->patch, saved) == NEW_UCODE)) )
+                 (!saved || (compare_header(mc->patch, saved) == NEW_UCODE)) &&
+                 check_digest(mc) )
             {
                 saved = mc->patch;
                 saved_size = mc->len;
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 2ee0db5b21..fa92355a7e 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -99,6 +99,7 @@ static bool_t __initdata ucode_scan;
 static bool ucode_in_nmi = true;
 
 bool __read_mostly opt_ucode_allow_same;
+bool __ro_after_init opt_digest_check = true;
 
 /* Protected by microcode_mutex */
 static struct microcode_patch *microcode_cache;
@@ -128,6 +129,8 @@ static int __init cf_check parse_ucode(const char *s)
             ucode_in_nmi = val;
         else if ( (val = parse_boolean("allow-same", s, ss)) >= 0 )
             opt_ucode_allow_same = val;
+        else if ( (val = parse_boolean("digest-check", s, ss)) >= 0 )
+            opt_digest_check = val;
         else if ( !ucode_mod_forced ) /* Not forced by EFI */
         {
             if ( (val = parse_boolean("scan", s, ss)) >= 0 )
@@ -867,6 +870,14 @@ int __init early_microcode_init(unsigned long *module_map,
     switch ( c->x86_vendor )
     {
     case X86_VENDOR_AMD:
+        if ( !opt_digest_check &&
+             boot_cpu_data.x86 >= 0x17 && boot_cpu_data.x86 <= 0x19 )
+        {
+            printk(XENLOG_WARNING
+                   "Microcode patch additional digest checks disabled");
+            add_taint(TAINT_CPU_OUT_OF_SPEC);
+        }
+
         if ( c->x86 >= 0x10 )
         {
             ucode_ops = amd_ucode_ops;
diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h
index d80787205a..158cbda9cc 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -60,6 +60,8 @@ struct microcode_ops {
         const struct microcode_patch *new, const struct microcode_patch *old);
 };
 
+extern bool opt_digest_check;
+
 /**
  * Checks whether we can perform microcode updates on this Intel system
  *
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 17:56:03 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 17:56:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947695.1345276 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3Ibj-0003Uq-B1; Fri, 11 Apr 2025 17:56:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947695.1345276; Fri, 11 Apr 2025 17:56: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 1u3Ibj-0003Uk-8R; Fri, 11 Apr 2025 17:56:03 +0000
Received: by outflank-mailman (input) for mailman id 947695;
 Fri, 11 Apr 2025 17: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 1u3Ibi-0003US-IZ
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 17: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 1u3Ibi-008WwF-1k
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17:56:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3Ibi-00Es05-1e
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17: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=EWYawTjclLl5UeVNwrbDuGW96U1LEzcxpL8QCnWhSFA=; b=sf9KYETKkwptmz82NzBJMabyR4
	DD3y2uWOCrg9FuHFAF6ghEKTm2/l5hZNCTAAhDs5NRocE2GPyDUv4yN2fMp7giFGUz2nReYkZi7d4
	uhQ0CY7wAh3Oa6hCJcoswq3h98vJFA+HITgPyMhkkX18pnUqh16hzH9I8AJkTAlJHiM8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] x86/ucode: Extend AMD digest checks to cover Zen5 CPUs
Message-Id: <E1u3Ibi-00Es05-1e@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 17:56:02 +0000

commit 0b999cf7e7b5e857e20aee977cfd147925c34066
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 8 17:09:15 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 17:27:59 2025 +0100

    x86/ucode: Extend AMD digest checks to cover Zen5 CPUs
    
    AMD have updated the SB-7033 advisory to include Zen5 CPUs.  Extend the digest
    check to cover Zen5 too.
    
    In practice, cover everything until further notice.
    
    Observant readers may be wondering where the update to the digest list is.  At
    the time of writing, no Zen5 patches are available via a verifiable channel.
    
    Link: https://www.amd.com/en/resources/product-security/bulletin/amd-sb-7033.html
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit b63951467e964bcc927f823fc943e40069fac0c9)
    
    x86/ucode: Extend warning about disabling digest check too
    
    This was missed by accident.
    
    Fixes: b63951467e96 ("x86/ucode: Extend AMD digest checks to cover Zen5 CPUs")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 59bb316ea89e7f9461690fe00547d7d2af96321d)
---
 xen/arch/x86/cpu/microcode/amd.c  | 8 ++++++--
 xen/arch/x86/cpu/microcode/core.c | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index b5c2a55b26..48466403ba 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -118,8 +118,12 @@ static bool check_digest(const struct container_microcode *mc)
     const struct patch_digest *pd;
     uint8_t digest[SHA2_256_DIGEST_SIZE];
 
-    /* Only Fam17h/19h are known to need extra checks.  Skip other families. */
-    if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x19 ||
+    /*
+     * Zen1 thru Zen5 CPUs are known to use a weak signature algorithm on
+     * microcode updates.  Mitigate by checking the digest of the patch
+     * against a list of known provenance.
+     */
+    if ( boot_cpu_data.x86 < 0x17 ||
          !opt_digest_check )
         return true;
 
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index fa92355a7e..fce38404d5 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -871,7 +871,7 @@ int __init early_microcode_init(unsigned long *module_map,
     {
     case X86_VENDOR_AMD:
         if ( !opt_digest_check &&
-             boot_cpu_data.x86 >= 0x17 && boot_cpu_data.x86 <= 0x19 )
+             boot_cpu_data.x86 >= 0x17 )
         {
             printk(XENLOG_WARNING
                    "Microcode patch additional digest checks disabled");
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 17:56:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 17:56:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947696.1345281 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3Ibu-0003XL-Cs; Fri, 11 Apr 2025 17:56:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947696.1345281; Fri, 11 Apr 2025 17: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 1u3Ibu-0003XD-9r; Fri, 11 Apr 2025 17:56:14 +0000
Received: by outflank-mailman (input) for mailman id 947696;
 Fri, 11 Apr 2025 17:56:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u3Ibt-0003X4-0w
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 17:56:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3Ibs-008WwJ-3D
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17:56:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3Ibs-00EsId-38
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17: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=AcTbilaLL30T5fNEh6kFJCGEd6kmm37zd5Td/PFEdPw=; b=FStYY0eoDmC6bfpF/PslPiDQl1
	iEiZ2VXx+hYaP2BH1dx3K8wOQOWhx49iA3ln/8PclIn7x6c/FHgHb0rht9X/a3cJSumE9SPvvCQ8t
	MWoMJD/bKdGIplKqnCHWbzWilW1jQ3QGIGH+bRd/IYejrh7lobsLgrC92SSY1cVQZ2OY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.17] tools/libxl: remove usage of VLA arrays
Message-Id: <E1u3Ibs-00EsId-38@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 17:56:12 +0000

commit 2f5d4a0685766e91bdb38e2d0f76809d2c7ded4e
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Oct 28 12:48:31 2024 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 17:34:28 2025 +0100

    tools/libxl: remove usage of VLA arrays
    
    Clang 19 complains with the following error when building libxl:
    
    libxl_utils.c:48:15: error: variable length array folded to constant array as an extension [-Werror,-Wgnu-folding-constant]
       48 |     char path[strlen("/local/domain") + 12];
          |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    Replace the usage of strlen() with sizeof, which allows the literal
    string length to be known at build time.  Note sizeof accounts for the
    NUL terminator while strlen() didn't, hence subtract 1 from the total
    size calculation.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Frediano Ziglio <frediano.ziglio@cloud.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
    (cherry picked from commit a7c7c3f6424504c4004bbb3437be319aa41ad580)
---
 tools/libs/light/libxl_utils.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libs/light/libxl_utils.c b/tools/libs/light/libxl_utils.c
index e403bd9bcf..01eb3a3670 100644
--- a/tools/libs/light/libxl_utils.c
+++ b/tools/libs/light/libxl_utils.c
@@ -45,7 +45,7 @@ unsigned long libxl_get_required_shadow_memory(unsigned long maxmem_kb, unsigned
 char *libxl_domid_to_name(libxl_ctx *ctx, uint32_t domid)
 {
     unsigned int len;
-    char path[strlen("/local/domain") + 12];
+    char path[sizeof("/local/domain") + 11];
     char *s;
 
     snprintf(path, sizeof(path), "/local/domain/%d/name", domid);
@@ -141,7 +141,7 @@ int libxl_cpupool_qualifier_to_cpupoolid(libxl_ctx *ctx, const char *p,
 char *libxl_cpupoolid_to_name(libxl_ctx *ctx, uint32_t poolid)
 {
     unsigned int len;
-    char path[strlen("/local/pool") + 12];
+    char path[sizeof("/local/pool") + 11];
     char *s;
 
     snprintf(path, sizeof(path), "/local/pool/%d/name", poolid);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.17


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 17:56:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 17:56:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947697.1345284 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3Ic4-0003Zb-EE; Fri, 11 Apr 2025 17:56:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947697.1345284; Fri, 11 Apr 2025 17: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 1u3Ic4-0003ZQ-BD; Fri, 11 Apr 2025 17:56:24 +0000
Received: by outflank-mailman (input) for mailman id 947697;
 Fri, 11 Apr 2025 17: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 1u3Ic3-0003ZI-6h
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 17:56:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3Ic3-008WwP-0Z
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17:56:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3Ic3-00EsTL-0A
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17:56:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jlq5Z83dTVtSRWloC4olIjHUiblGZWmu4AD0kQq5vB0=; b=nf4W+slW5H04xLGm2Dbd1GkQH4
	hg2HPjpx/HpzgybJTbu7GOA017WKYaCC+DVmZMRnyp5gtQ8lqx2Xn72wS8R51xt0oczf/N14T4dTC
	LnqYPvbELvHM1Y7njFm8ymTGjgevQx71cXbO4zbm2nmgGstFojl5z7X7TnttP/BPy7P4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.17] CI: Resync .cirrus.yml for FreeBSD testing
Message-Id: <E1u3Ic3-00EsTL-0A@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 17:56:23 +0000

commit f370d37cfa110d6d08c17c42188ba37cb1f52dde
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Apr 11 16:56:35 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 17:34:28 2025 +0100

    CI: Resync .cirrus.yml for FreeBSD testing
    
    Includes:
      commit 5395cd7b892d ("automation/cirrus-ci: update FreeBSD to 13.5")
      commit 850a263b7863 ("automation/cirrus-ci: update FreeBSD to 13.4")
      commit 0cc8845fb9fd ("CI: Update to FreeBSD 14.2")
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 .cirrus.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 0ec9586e2c..eb46227892 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -17,11 +17,11 @@ freebsd_template: &FREEBSD_TEMPLATE
 task:
   name: 'FreeBSD 13'
   freebsd_instance:
-    image_family: freebsd-13-3
+    image_family: freebsd-13-5
   << : *FREEBSD_TEMPLATE
 
 task:
   name: 'FreeBSD 14'
   freebsd_instance:
-    image_family: freebsd-14-1
+    image_family: freebsd-14-2
   << : *FREEBSD_TEMPLATE
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.17


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 17:56:34 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 17:56:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947698.1345289 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3IcE-0003c4-FK; Fri, 11 Apr 2025 17:56:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947698.1345289; Fri, 11 Apr 2025 17:56:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3IcE-0003bw-Cf; Fri, 11 Apr 2025 17:56:34 +0000
Received: by outflank-mailman (input) for mailman id 947698;
 Fri, 11 Apr 2025 17: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 1u3IcD-0003bn-AG
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 17: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 1u3IcD-008Wwo-0w
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17:56:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3IcD-00EshU-0l
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17:56:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=t6lpSeoUYF4lhn4U3++HysvflI35AvAMJQDJdaVxGbM=; b=xK0aL1EFXEVpMNuHqYOF8e7ZRP
	SoCfeFH3zu7d7A+POgT1HYc3fN2Uwu6ij4PLClo2rTJRrIGQd9wl+k2L2cvoZwqBQx9GjgFt8/7wz
	CamLV/pF2iWaqbZU9JolySqFR/grSm6XiYHC9Hc/mULMb9UWFF5AlEsRrJWc2F3Ao5E0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.17] xen/lib: Introduce SHA2-256
Message-Id: <E1u3IcD-00EshU-0l@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 17:56:33 +0000

commit b6eb7932a1c67c8e3bc3caf6c98ca4e584c557fb
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Dec 13 14:34:00 2024 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 17:34:28 2025 +0100

    xen/lib: Introduce SHA2-256
    
    A future change will need to calculate SHA2-256 digests.  Introduce an
    implementation in lib/, derived from Trenchboot which itself is derived from
    Linux.
    
    In order to be useful to other architectures, it is careful with endianness
    and misaligned accesses as well as being more MISRA friendly, but is only
    wired up for x86 in the short term.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 372af524411f5a013bcb0b117073d8d07c026563)
    
    Xen: CI fix from XSN-2
    
     * Add U suffix to the K[] table to fix MISRA Rule 7.2 violations.
    
    Fixes: 372af524411f ("xen/lib: Introduce SHA2-256")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 15fe2eb5f1bac8a212c0ba3d6dfe60d1fdf851cf)
---
 xen/include/xen/sha2.h |  15 ++++
 xen/lib/Makefile       |   1 +
 xen/lib/sha2-256.c     | 216 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 232 insertions(+)

diff --git a/xen/include/xen/sha2.h b/xen/include/xen/sha2.h
new file mode 100644
index 0000000000..47d97fbf01
--- /dev/null
+++ b/xen/include/xen/sha2.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * SHA2-256: https://csrc.nist.gov/pubs/fips/180-2/upd1/final
+ */
+#ifndef XEN_SHA2_H
+#define XEN_SHA2_H
+
+#include <xen/types.h>
+
+#define SHA2_256_DIGEST_SIZE 32
+
+void sha2_256_digest(uint8_t digest[SHA2_256_DIGEST_SIZE],
+                     const void *msg, size_t len);
+
+#endif /* XEN_SHA2_H */
diff --git a/xen/lib/Makefile b/xen/lib/Makefile
index b311ea739c..4a104ce835 100644
--- a/xen/lib/Makefile
+++ b/xen/lib/Makefile
@@ -13,6 +13,7 @@ lib-y += memset.o
 lib-y += muldiv64.o
 lib-y += parse-size.o
 lib-y += rbtree.o
+lib-$(CONFIG_X86) += sha2-256.o
 lib-y += sort.o
 lib-y += strcasecmp.o
 lib-y += strchr.o
diff --git a/xen/lib/sha2-256.c b/xen/lib/sha2-256.c
new file mode 100644
index 0000000000..cb02ec1857
--- /dev/null
+++ b/xen/lib/sha2-256.c
@@ -0,0 +1,216 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * SHA2-256: https://csrc.nist.gov/pubs/fips/180-2/upd1/final
+ *
+ * Originally derived from Linux.  Modified substantially to optimise for size
+ * and Xen's expected usecases.
+ */
+#include <xen/bitops.h>
+#include <xen/sha2.h>
+#include <xen/string.h>
+
+#include <asm/unaligned.h>
+
+struct sha2_256_state {
+    uint32_t state[SHA2_256_DIGEST_SIZE / sizeof(uint32_t)];
+    uint8_t buf[64];
+    size_t count; /* Byte count. */
+};
+
+static uint32_t choose(uint32_t x, uint32_t y, uint32_t z)
+{
+    return z ^ (x & (y ^ z));
+}
+
+static uint32_t majority(uint32_t x, uint32_t y, uint32_t z)
+{
+    return (x & y) | (z & (x | y));
+}
+
+static uint32_t e0(uint32_t x)
+{
+    return ror32(x, 2) ^ ror32(x, 13) ^ ror32(x, 22);
+}
+
+static uint32_t e1(uint32_t x)
+{
+    return ror32(x, 6) ^ ror32(x, 11) ^ ror32(x, 25);
+}
+
+static uint32_t s0(uint32_t x)
+{
+    return ror32(x, 7) ^ ror32(x, 18) ^ (x >> 3);
+}
+
+static uint32_t s1(uint32_t x)
+{
+    return ror32(x, 17) ^ ror32(x, 19) ^ (x >> 10);
+}
+
+static uint32_t blend(uint32_t W[16], unsigned int i)
+{
+#define W(i) W[(i) & 15]
+
+    return W(i) += s1(W(i - 2)) + W(i - 7) + s0(W(i - 15));
+
+#undef W
+}
+
+static const uint32_t K[] = {
+    0x428a2f98U, 0x71374491U, 0xb5c0fbcfU, 0xe9b5dba5U,
+    0x3956c25bU, 0x59f111f1U, 0x923f82a4U, 0xab1c5ed5U,
+    0xd807aa98U, 0x12835b01U, 0x243185beU, 0x550c7dc3U,
+    0x72be5d74U, 0x80deb1feU, 0x9bdc06a7U, 0xc19bf174U,
+    0xe49b69c1U, 0xefbe4786U, 0x0fc19dc6U, 0x240ca1ccU,
+    0x2de92c6fU, 0x4a7484aaU, 0x5cb0a9dcU, 0x76f988daU,
+    0x983e5152U, 0xa831c66dU, 0xb00327c8U, 0xbf597fc7U,
+    0xc6e00bf3U, 0xd5a79147U, 0x06ca6351U, 0x14292967U,
+    0x27b70a85U, 0x2e1b2138U, 0x4d2c6dfcU, 0x53380d13U,
+    0x650a7354U, 0x766a0abbU, 0x81c2c92eU, 0x92722c85U,
+    0xa2bfe8a1U, 0xa81a664bU, 0xc24b8b70U, 0xc76c51a3U,
+    0xd192e819U, 0xd6990624U, 0xf40e3585U, 0x106aa070U,
+    0x19a4c116U, 0x1e376c08U, 0x2748774cU, 0x34b0bcb5U,
+    0x391c0cb3U, 0x4ed8aa4aU, 0x5b9cca4fU, 0x682e6ff3U,
+    0x748f82eeU, 0x78a5636fU, 0x84c87814U, 0x8cc70208U,
+    0x90befffaU, 0xa4506cebU, 0xbef9a3f7U, 0xc67178f2U,
+};
+
+static void sha2_256_transform(uint32_t *state, const void *_input)
+{
+    const uint32_t *input = _input;
+    uint32_t a, b, c, d, e, f, g, h, t1, t2;
+    uint32_t W[16];
+    unsigned int i;
+
+    for ( i = 0; i < 16; i++ )
+        W[i] = get_unaligned_be32(&input[i]);
+
+    a = state[0]; b = state[1]; c = state[2]; d = state[3];
+    e = state[4]; f = state[5]; g = state[6]; h = state[7];
+
+    for ( i = 0; i < 16; i += 8 )
+    {
+        t1 = h + e1(e) + choose(e, f, g) + K[i + 0] + W[i + 0];
+        t2 = e0(a) + majority(a, b, c);    d += t1;    h = t1 + t2;
+        t1 = g + e1(d) + choose(d, e, f) + K[i + 1] + W[i + 1];
+        t2 = e0(h) + majority(h, a, b);    c += t1;    g = t1 + t2;
+        t1 = f + e1(c) + choose(c, d, e) + K[i + 2] + W[i + 2];
+        t2 = e0(g) + majority(g, h, a);    b += t1;    f = t1 + t2;
+        t1 = e + e1(b) + choose(b, c, d) + K[i + 3] + W[i + 3];
+        t2 = e0(f) + majority(f, g, h);    a += t1;    e = t1 + t2;
+        t1 = d + e1(a) + choose(a, b, c) + K[i + 4] + W[i + 4];
+        t2 = e0(e) + majority(e, f, g);    h += t1;    d = t1 + t2;
+        t1 = c + e1(h) + choose(h, a, b) + K[i + 5] + W[i + 5];
+        t2 = e0(d) + majority(d, e, f);    g += t1;    c = t1 + t2;
+        t1 = b + e1(g) + choose(g, h, a) + K[i + 6] + W[i + 6];
+        t2 = e0(c) + majority(c, d, e);    f += t1;    b = t1 + t2;
+        t1 = a + e1(f) + choose(f, g, h) + K[i + 7] + W[i + 7];
+        t2 = e0(b) + majority(b, c, d);    e += t1;    a = t1 + t2;
+    }
+
+    for ( ; i < 64; i += 8 )
+    {
+        t1 = h + e1(e) + choose(e, f, g) + K[i + 0] + blend(W, i + 0);
+        t2 = e0(a) + majority(a, b, c);    d += t1;    h = t1 + t2;
+        t1 = g + e1(d) + choose(d, e, f) + K[i + 1] + blend(W, i + 1);
+        t2 = e0(h) + majority(h, a, b);    c += t1;    g = t1 + t2;
+        t1 = f + e1(c) + choose(c, d, e) + K[i + 2] + blend(W, i + 2);
+        t2 = e0(g) + majority(g, h, a);    b += t1;    f = t1 + t2;
+        t1 = e + e1(b) + choose(b, c, d) + K[i + 3] + blend(W, i + 3);
+        t2 = e0(f) + majority(f, g, h);    a += t1;    e = t1 + t2;
+        t1 = d + e1(a) + choose(a, b, c) + K[i + 4] + blend(W, i + 4);
+        t2 = e0(e) + majority(e, f, g);    h += t1;    d = t1 + t2;
+        t1 = c + e1(h) + choose(h, a, b) + K[i + 5] + blend(W, i + 5);
+        t2 = e0(d) + majority(d, e, f);    g += t1;    c = t1 + t2;
+        t1 = b + e1(g) + choose(g, h, a) + K[i + 6] + blend(W, i + 6);
+        t2 = e0(c) + majority(c, d, e);    f += t1;    b = t1 + t2;
+        t1 = a + e1(f) + choose(f, g, h) + K[i + 7] + blend(W, i + 7);
+        t2 = e0(b) + majority(b, c, d);    e += t1;    a = t1 + t2;
+    }
+
+    state[0] += a; state[1] += b; state[2] += c; state[3] += d;
+    state[4] += e; state[5] += f; state[6] += g; state[7] += h;
+}
+
+static void sha2_256_init(struct sha2_256_state *s)
+{
+    *s = (struct sha2_256_state){
+        .state = {
+            0x6a09e667UL,
+            0xbb67ae85UL,
+            0x3c6ef372UL,
+            0xa54ff53aUL,
+            0x510e527fUL,
+            0x9b05688cUL,
+            0x1f83d9abUL,
+            0x5be0cd19UL,
+        },
+    };
+}
+
+static void sha2_256_update(struct sha2_256_state *s, const void *msg,
+                            size_t len)
+{
+    unsigned int partial = s->count & 63;
+
+    s->count += len;
+
+    if ( (partial + len) >= 64 )
+    {
+        if ( partial )
+        {
+            unsigned int rem = 64 - partial;
+
+            /* Fill the partial block. */
+            memcpy(s->buf + partial, msg, rem);
+            msg += rem;
+            len -= rem;
+
+            sha2_256_transform(s->state, s->buf);
+            partial = 0;
+        }
+
+        for ( ; len >= 64; msg += 64, len -= 64 )
+            sha2_256_transform(s->state, msg);
+    }
+
+    /* Remaining data becomes partial. */
+    memcpy(s->buf + partial, msg, len);
+}
+
+static void sha2_256_final(struct sha2_256_state *s, void *_dst)
+{
+    uint32_t *dst = _dst;
+    unsigned int i, partial = s->count & 63;
+
+    /* Start padding */
+    s->buf[partial++] = 0x80;
+
+    if ( partial > 56 )
+    {
+        /* Need one extra block - pad to 64 */
+        memset(s->buf + partial, 0, 64 - partial);
+        sha2_256_transform(s->state, s->buf);
+        partial = 0;
+    }
+    /* Pad to 56 */
+    memset(s->buf + partial, 0, 56 - partial);
+
+    /* Append the bit count */
+    put_unaligned_be64((uint64_t)s->count << 3, &s->buf[56]);
+    sha2_256_transform(s->state, s->buf);
+
+    /* Store state in digest */
+    for ( i = 0; i < 8; i++ )
+        put_unaligned_be32(s->state[i], &dst[i]);
+}
+
+void sha2_256_digest(uint8_t digest[SHA2_256_DIGEST_SIZE],
+                     const void *msg, size_t len)
+{
+    struct sha2_256_state s;
+
+    sha2_256_init(&s);
+    sha2_256_update(&s, msg, len);
+    sha2_256_final(&s, digest);
+}
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.17


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 17:56:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 17:56:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947699.1345292 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3IcO-0003eG-Ga; Fri, 11 Apr 2025 17:56:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947699.1345292; Fri, 11 Apr 2025 17:56:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3IcO-0003e9-E7; Fri, 11 Apr 2025 17:56:44 +0000
Received: by outflank-mailman (input) for mailman id 947699;
 Fri, 11 Apr 2025 17:56:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u3IcN-0003dy-Dv
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 17:56:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3IcN-008Wws-1I
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17:56:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3IcN-00Esov-1B
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17:56:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=VXXx7XUimyCNrNVPuzyKtIABGYCb5JTDW7QAyPdeEb8=; b=2BtaSKvX5opTh6Ak8awL6HAQAR
	vMCx6pP5GP31s8ytkWO8kPvtyqYxHWK62k/cgTKPhnUknfmGnlMGgcHsmEbUp0vly4Q+Pdle7lGTP
	tXh9kZc0hyPB4lKQsqPxxq6DsAgxl0WTNkUWWvEJZ3u1NFKVEWzZnla5AZEBC6ZArsNw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.17] x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode
Message-Id: <E1u3IcN-00Esov-1B@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 17:56:43 +0000

commit d6654c63e76fea383e8466b88ed0475490da3b2f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Dec 13 14:34:00 2024 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 17:34:28 2025 +0100

    x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode
    
    Collisions have been found in the microcode signing algorithm used by AMD
    Fam17h/19h CPUs, and now anyone can sign their own.
    
    For more details, see:
      https://bughunters.google.com/blog/5424842357473280/zen-and-the-art-of-microcode-hacking
      https://www.amd.com/en/resources/product-security/bulletin/amd-sb-7033.html
    
    As a stopgap mitigation, check the digest of patches against a table of blobs
    with known provenance.  These are all Fam17h and Fam19h blobs included in
    linux-firwmare at the time of writing, specifically:
    
      https://git.kernel.org/firmware/linux-firmware/c/48bb90cceb882cab8e9ab692bc5779d3bf3a13b8
    
    This checks can be opted out of by booting with ucode=no-digest-check, but
    doing so is not recommended.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 630e8875ab368b97cc7231aaf3809e3d7d5687e1)
    
    Xen: CI fix from XSN-2
    
     * Add cf_check annotation to cmp_patch_id() used by bsearch().
    
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 15fe2eb5f1bac8a212c0ba3d6dfe60d1fdf851cf)
---
 docs/misc/xen-command-line.pandoc              |  10 +-
 xen/arch/x86/cpu/microcode/amd-patch-digests.c | 226 +++++++++++++++++++++++++
 xen/arch/x86/cpu/microcode/amd.c               |  58 ++++++-
 xen/arch/x86/cpu/microcode/core.c              |  11 ++
 xen/arch/x86/cpu/microcode/private.h           |   2 +
 5 files changed, 304 insertions(+), 3 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index ccb185a4f3..d7310cbb46 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2588,10 +2588,10 @@ performance.
    Alternatively, selecting `tsx=1` will re-enable TSX at the users own risk.
 
 ### ucode
-> `= List of [ <integer> | scan=<bool>, nmi=<bool>, allow-same=<bool> ]`
+> `= List of [ <integer> | scan=<bool>, nmi=<bool>, allow-same=<bool>, digest-check=<bool> ]`
 
     Applicability: x86
-    Default: `nmi`
+    Default: `nmi,digest-check`
 
 Controls for CPU microcode loading. For early loading, this parameter can
 specify how and where to find the microcode update blob. For late loading,
@@ -2625,6 +2625,12 @@ trying to reload the same version.  Many CPUs will actually reload microcode
 of the same version, and this allows for easy testing of the late microcode
 loading path.
 
+The `digest-check=` option is active by default and controls whether to
+perform additional authenticity checks.  Collisions in the signature algorithm
+used by AMD Fam17h/19h processors have been found.  Xen contains a table of
+digests of microcode patches with known-good provenance, and will block
+loading of patches that do not match.
+
 ### unrestricted_guest (Intel)
 > `= <boolean>`
 
diff --git a/xen/arch/x86/cpu/microcode/amd-patch-digests.c b/xen/arch/x86/cpu/microcode/amd-patch-digests.c
new file mode 100644
index 0000000000..d327612267
--- /dev/null
+++ b/xen/arch/x86/cpu/microcode/amd-patch-digests.c
@@ -0,0 +1,226 @@
+/* Generated from linux-firmware. */
+{
+    .patch_id = 0x0800126f,
+    .digest = {
+        0x2b, 0x5a, 0xf2, 0x9c, 0xdd, 0xd2, 0x7f, 0xec,
+        0xec, 0x96, 0x09, 0x57, 0xb0, 0x96, 0x29, 0x8b,
+        0x2e, 0x26, 0x91, 0xf0, 0x49, 0x33, 0x42, 0x18,
+        0xdd, 0x4b, 0x65, 0x5a, 0xd4, 0x15, 0x3d, 0x33,
+    },
+},
+{
+    .patch_id = 0x0800820d,
+    .digest = {
+        0x68, 0x98, 0x83, 0xcd, 0x22, 0x0d, 0xdd, 0x59,
+        0x73, 0x2c, 0x5b, 0x37, 0x1f, 0x84, 0x0e, 0x67,
+        0x96, 0x43, 0x83, 0x0c, 0x46, 0x44, 0xab, 0x7c,
+        0x7b, 0x65, 0x9e, 0x57, 0xb5, 0x90, 0x4b, 0x0e,
+    },
+},
+{
+    .patch_id = 0x0830107c,
+    .digest = {
+        0x21, 0x64, 0xde, 0xfb, 0x9f, 0x68, 0x96, 0x47,
+        0x70, 0x5c, 0xe2, 0x8f, 0x18, 0x52, 0x6a, 0xac,
+        0xa4, 0xd2, 0x2e, 0xe0, 0xde, 0x68, 0x66, 0xc3,
+        0xeb, 0x1e, 0xd3, 0x3f, 0xbc, 0x51, 0x1d, 0x38,
+    },
+},
+{
+    .patch_id = 0x0860010d,
+    .digest = {
+        0x86, 0xb6, 0x15, 0x83, 0xbc, 0x3b, 0x9c, 0xe0,
+        0xb3, 0xef, 0x1d, 0x99, 0x84, 0x35, 0x15, 0xf7,
+        0x7c, 0x2a, 0xc6, 0x42, 0xdb, 0x73, 0x07, 0x5c,
+        0x7d, 0xc3, 0x02, 0xb5, 0x43, 0x06, 0x5e, 0xf8,
+    },
+},
+{
+    .patch_id = 0x08608108,
+    .digest = {
+        0x14, 0xfe, 0x57, 0x86, 0x49, 0xc8, 0x68, 0xe2,
+        0x11, 0xa3, 0xcb, 0x6e, 0xff, 0x6e, 0xd5, 0x38,
+        0xfe, 0x89, 0x1a, 0xe0, 0x67, 0xbf, 0xc4, 0xcc,
+        0x1b, 0x9f, 0x84, 0x77, 0x2b, 0x9f, 0xaa, 0xbd,
+    },
+},
+{
+    .patch_id = 0x08701034,
+    .digest = {
+        0xc3, 0x14, 0x09, 0xa8, 0x9c, 0x3f, 0x8d, 0x83,
+        0x9b, 0x4c, 0xa5, 0xb7, 0x64, 0x8b, 0x91, 0x5d,
+        0x85, 0x6a, 0x39, 0x26, 0x1e, 0x14, 0x41, 0xa8,
+        0x75, 0xea, 0xa6, 0xf9, 0xc9, 0xd1, 0xea, 0x2b,
+    },
+},
+{
+    .patch_id = 0x08a0000a,
+    .digest = {
+        0x73, 0x31, 0x26, 0x22, 0xd4, 0xf9, 0xee, 0x3c,
+        0x07, 0x06, 0xe7, 0xb9, 0xad, 0xd8, 0x72, 0x44,
+        0x33, 0x31, 0xaa, 0x7d, 0xc3, 0x67, 0x0e, 0xdb,
+        0x47, 0xb5, 0xaa, 0xbc, 0xf5, 0xbb, 0xd9, 0x20,
+    },
+},
+{
+    .patch_id = 0x0a00107a,
+    .digest = {
+        0x5f, 0x92, 0xca, 0xff, 0xc3, 0x59, 0x22, 0x5f,
+        0x02, 0xa0, 0x91, 0x3b, 0x4a, 0x45, 0x10, 0xfd,
+        0x19, 0xe1, 0x8a, 0x6d, 0x9a, 0x92, 0xc1, 0x3f,
+        0x75, 0x78, 0xac, 0x78, 0x03, 0x1d, 0xdb, 0x18,
+    },
+},
+{
+    .patch_id = 0x0a0011d5,
+    .digest = {
+        0xed, 0x69, 0x89, 0xf4, 0xeb, 0x64, 0xc2, 0x13,
+        0xe0, 0x51, 0x1f, 0x03, 0x26, 0x52, 0x7d, 0xb7,
+        0x93, 0x5d, 0x65, 0xca, 0xb8, 0x12, 0x1d, 0x62,
+        0x0d, 0x5b, 0x65, 0x34, 0x69, 0xb2, 0x62, 0x21,
+    },
+},
+{
+    .patch_id = 0x0a001238,
+    .digest = {
+        0x72, 0xf7, 0x4b, 0x0c, 0x7d, 0x58, 0x65, 0xcc,
+        0x00, 0xcc, 0x57, 0x16, 0x68, 0x16, 0xf8, 0x2a,
+        0x1b, 0xb3, 0x8b, 0xe1, 0xb6, 0x83, 0x8c, 0x7e,
+        0xc0, 0xcd, 0x33, 0xf2, 0x8d, 0xf9, 0xef, 0x59,
+    },
+},
+{
+    .patch_id = 0x0a00820c,
+    .digest = {
+        0xa8, 0x0c, 0x81, 0xc0, 0xa6, 0x00, 0xe7, 0xf3,
+        0x5f, 0x65, 0xd3, 0xb9, 0x6f, 0xea, 0x93, 0x63,
+        0xf1, 0x8c, 0x88, 0x45, 0xd7, 0x82, 0x80, 0xd1,
+        0xe1, 0x3b, 0x8d, 0xb2, 0xf8, 0x22, 0x03, 0xe2,
+    },
+},
+{
+    .patch_id = 0x0a101148,
+    .digest = {
+        0x20, 0xd5, 0x6f, 0x40, 0x4a, 0xf6, 0x48, 0x90,
+        0xc2, 0x93, 0x9a, 0xc2, 0xfd, 0xac, 0xef, 0x4f,
+        0xfa, 0xc0, 0x3d, 0x92, 0x3c, 0x6d, 0x01, 0x08,
+        0xf1, 0x5e, 0xb0, 0xde, 0xb4, 0x98, 0xae, 0xc4,
+    },
+},
+{
+    .patch_id = 0x0a101248,
+    .digest = {
+        0xed, 0x3b, 0x95, 0xa6, 0x68, 0xa7, 0x77, 0x3e,
+        0xfc, 0x17, 0x26, 0xe2, 0x7b, 0xd5, 0x56, 0x22,
+        0x2c, 0x1d, 0xef, 0xeb, 0x56, 0xdd, 0xba, 0x6e,
+        0x1b, 0x7d, 0x64, 0x9d, 0x4b, 0x53, 0x13, 0x75,
+    },
+},
+{
+    .patch_id = 0x0a108108,
+    .digest = {
+        0xed, 0xc2, 0xec, 0xa1, 0x15, 0xc6, 0x65, 0xe9,
+        0xd0, 0xef, 0x39, 0xaa, 0x7f, 0x55, 0x06, 0xc6,
+        0xf5, 0xd4, 0x3f, 0x7b, 0x14, 0xd5, 0x60, 0x2c,
+        0x28, 0x1e, 0x9c, 0x59, 0x69, 0x99, 0x4d, 0x16,
+    },
+},
+{
+    .patch_id = 0x0a20102d,
+    .digest = {
+        0xf9, 0x6e, 0xf2, 0x32, 0xd3, 0x0f, 0x5f, 0x11,
+        0x59, 0xa1, 0xfe, 0xcc, 0xcd, 0x9b, 0x42, 0x89,
+        0x8b, 0x89, 0x2f, 0xb5, 0xbb, 0x82, 0xef, 0x23,
+        0x8c, 0xe9, 0x19, 0x3e, 0xcc, 0x3f, 0x7b, 0xb4,
+    },
+},
+{
+    .patch_id = 0x0a201210,
+    .digest = {
+        0xe8, 0x6d, 0x51, 0x6a, 0x8e, 0x72, 0xf3, 0xfe,
+        0x6e, 0x16, 0xbc, 0x62, 0x59, 0x40, 0x17, 0xe9,
+        0x6d, 0x3d, 0x0e, 0x6b, 0xa7, 0xac, 0xe3, 0x68,
+        0xf7, 0x55, 0xf0, 0x13, 0xbb, 0x22, 0xf6, 0x41,
+    },
+},
+{
+    .patch_id = 0x0a404107,
+    .digest = {
+        0xbb, 0x04, 0x4e, 0x47, 0xdd, 0x5e, 0x26, 0x45,
+        0x1a, 0xc9, 0x56, 0x24, 0xa4, 0x4c, 0x82, 0xb0,
+        0x8b, 0x0d, 0x9f, 0xf9, 0x3a, 0xdf, 0xc6, 0x81,
+        0x13, 0xbc, 0xc5, 0x25, 0xe4, 0xc5, 0xc3, 0x99,
+    },
+},
+{
+    .patch_id = 0x0a500011,
+    .digest = {
+        0x23, 0x3d, 0x70, 0x7d, 0x03, 0xc3, 0xc4, 0xf4,
+        0x2b, 0x82, 0xc6, 0x05, 0xda, 0x80, 0x0a, 0xf1,
+        0xd7, 0x5b, 0x65, 0x3a, 0x7d, 0xab, 0xdf, 0xa2,
+        0x11, 0x5e, 0x96, 0x7e, 0x71, 0xe9, 0xfc, 0x74,
+    },
+},
+{
+    .patch_id = 0x0a601209,
+    .digest = {
+        0x66, 0x48, 0xd4, 0x09, 0x05, 0xcb, 0x29, 0x32,
+        0x66, 0xb7, 0x9a, 0x76, 0xcd, 0x11, 0xf3, 0x30,
+        0x15, 0x86, 0xcc, 0x5d, 0x97, 0x0f, 0xc0, 0x46,
+        0xe8, 0x73, 0xe2, 0xd6, 0xdb, 0xd2, 0x77, 0x1d,
+    },
+},
+{
+    .patch_id = 0x0a704107,
+    .digest = {
+        0xf3, 0xc6, 0x58, 0x26, 0xee, 0xac, 0x3f, 0xd6,
+        0xce, 0xa1, 0x72, 0x47, 0x3b, 0xba, 0x2b, 0x93,
+        0x2a, 0xad, 0x8e, 0x6b, 0xea, 0x9b, 0xb7, 0xc2,
+        0x64, 0x39, 0x71, 0x8c, 0xce, 0xe7, 0x41, 0x39,
+    },
+},
+{
+    .patch_id = 0x0a705206,
+    .digest = {
+        0x8d, 0xc0, 0x76, 0xbd, 0x58, 0x9f, 0x8f, 0xa4,
+        0x12, 0x9d, 0x21, 0xfb, 0x48, 0x21, 0xbc, 0xe7,
+        0x67, 0x6f, 0x04, 0x18, 0xae, 0x20, 0x87, 0x4b,
+        0x03, 0x35, 0xe9, 0xbe, 0xfb, 0x06, 0xdf, 0xfc,
+    },
+},
+{
+    .patch_id = 0x0a708007,
+    .digest = {
+        0x6b, 0x76, 0xcc, 0x78, 0xc5, 0x8a, 0xa3, 0xe3,
+        0x32, 0x2d, 0x79, 0xe4, 0xc3, 0x80, 0xdb, 0xb2,
+        0x07, 0xaa, 0x3a, 0xe0, 0x57, 0x13, 0x72, 0x80,
+        0xdf, 0x92, 0x73, 0x84, 0x87, 0x3c, 0x73, 0x93,
+    },
+},
+{
+    .patch_id = 0x0a70c005,
+    .digest = {
+        0x88, 0x5d, 0xfb, 0x79, 0x64, 0xd8, 0x46, 0x3b,
+        0x4a, 0x83, 0x8e, 0x77, 0x7e, 0xcf, 0xb3, 0x0f,
+        0x1f, 0x1f, 0xf1, 0x97, 0xeb, 0xfe, 0x56, 0x55,
+        0xee, 0x49, 0xac, 0xe1, 0x8b, 0x13, 0xc5, 0x13,
+    },
+},
+{
+    .patch_id = 0x0aa00116,
+    .digest = {
+        0xe8, 0x4c, 0x2c, 0x88, 0xa1, 0xac, 0x24, 0x63,
+        0x65, 0xe5, 0xaa, 0x2d, 0x16, 0xa9, 0xc3, 0xf5,
+        0xfe, 0x1d, 0x5e, 0x65, 0xc7, 0xaa, 0x92, 0x4d,
+        0x91, 0xee, 0x76, 0xbb, 0x4c, 0x66, 0x78, 0xc9,
+    },
+},
+{
+    .patch_id = 0x0aa00215,
+    .digest = {
+        0x55, 0xd3, 0x28, 0xcb, 0x87, 0xa9, 0x32, 0xe9,
+        0x4e, 0x85, 0x4b, 0x7c, 0x6b, 0xd5, 0x7c, 0xd4,
+        0x1b, 0x51, 0x71, 0x3a, 0x0e, 0x0b, 0xdc, 0x9b,
+        0x68, 0x2f, 0x46, 0xee, 0xfe, 0xc6, 0x6d, 0xef,
+    },
+},
diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index b28171f2d4..2238818f80 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -16,7 +16,9 @@
 
 #include <xen/err.h>
 #include <xen/init.h>
+#include <xen/lib.h>
 #include <xen/mm.h> /* TODO: Fix asm/tlbflush.h breakage */
+#include <xen/sha2.h>
 
 #include <asm/msr.h>
 
@@ -91,6 +93,59 @@ static struct {
     uint16_t id;
 } equiv __read_mostly;
 
+static const struct patch_digest {
+    uint32_t patch_id;
+    uint8_t digest[SHA2_256_DIGEST_SIZE];
+} patch_digests[] = {
+#include "amd-patch-digests.c"
+};
+
+static int cf_check cmp_patch_id(const void *key, const void *elem)
+{
+    const struct patch_digest *pd = elem;
+    uint32_t patch_id = *(uint32_t *)key;
+
+    if ( patch_id == pd->patch_id )
+        return 0;
+    else if ( patch_id < pd->patch_id )
+        return -1;
+    return 1;
+}
+
+static bool check_digest(const struct container_microcode *mc)
+{
+    const struct microcode_patch *patch = mc->patch;
+    const struct patch_digest *pd;
+    uint8_t digest[SHA2_256_DIGEST_SIZE];
+
+    /* Only Fam17h/19h are known to need extra checks.  Skip other families. */
+    if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x19 ||
+         !opt_digest_check )
+        return true;
+
+    pd = bsearch(&patch->patch_id, patch_digests, ARRAY_SIZE(patch_digests),
+                 sizeof(struct patch_digest), cmp_patch_id);
+    if ( !pd )
+    {
+        printk(XENLOG_WARNING "No digest found for patch_id %08x\n",
+               patch->patch_id);
+        return false;
+    }
+
+    sha2_256_digest(digest, patch, mc->len);
+
+    if ( memcmp(digest, pd->digest, sizeof(digest)) )
+    {
+        printk(XENLOG_WARNING "Patch %08x SHA256 mismatch:\n"
+               "  expected %" STR(SHA2_256_DIGEST_SIZE) "phN\n"
+               "       got %" STR(SHA2_256_DIGEST_SIZE) "phN\n",
+               patch->patch_id, pd->digest, digest);
+        return false;
+    }
+
+    return true;
+}
+
 static void cf_check collect_cpu_info(void)
 {
     struct cpu_signature *csig = &this_cpu(cpu_sig);
@@ -391,7 +446,8 @@ static struct microcode_patch *cf_check cpu_request_microcode(
              * one with higher revision.
              */
             if ( (microcode_fits(mc->patch) != MIS_UCODE) &&
-                 (!saved || (compare_header(mc->patch, saved) == NEW_UCODE)) )
+                 (!saved || (compare_header(mc->patch, saved) == NEW_UCODE)) &&
+                 check_digest(mc) )
             {
                 saved = mc->patch;
                 saved_size = mc->len;
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 3150395478..e102aa2b56 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -97,6 +97,7 @@ static bool_t __initdata ucode_scan;
 static bool ucode_in_nmi = true;
 
 bool __read_mostly opt_ucode_allow_same;
+bool __ro_after_init opt_digest_check = true;
 
 /* Protected by microcode_mutex */
 static struct microcode_patch *microcode_cache;
@@ -126,6 +127,8 @@ static int __init cf_check parse_ucode(const char *s)
             ucode_in_nmi = val;
         else if ( (val = parse_boolean("allow-same", s, ss)) >= 0 )
             opt_ucode_allow_same = val;
+        else if ( (val = parse_boolean("digest-check", s, ss)) >= 0 )
+            opt_digest_check = val;
         else if ( !ucode_mod_forced ) /* Not forced by EFI */
         {
             if ( (val = parse_boolean("scan", s, ss)) >= 0 )
@@ -801,6 +804,14 @@ int __init early_microcode_init(void)
     switch ( c->x86_vendor )
     {
     case X86_VENDOR_AMD:
+        if ( !opt_digest_check &&
+             boot_cpu_data.x86 >= 0x17 && boot_cpu_data.x86 <= 0x19 )
+        {
+            printk(XENLOG_WARNING
+                   "Microcode patch additional digest checks disabled");
+            add_taint(TAINT_CPU_OUT_OF_SPEC);
+        }
+
         if ( c->x86 >= 0x10 )
             ucode_ops = amd_ucode_ops;
         break;
diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h
index feafab0677..79d7e37cc6 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -54,6 +54,8 @@ struct microcode_ops {
         const struct microcode_patch *new, const struct microcode_patch *old);
 };
 
+extern bool opt_digest_check;
+
 extern const struct microcode_ops amd_ucode_ops, intel_ucode_ops;
 
 #endif /* ASM_X86_MICROCODE_PRIVATE_H */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.17


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 17:56:54 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 17:56:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947700.1345297 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3IcY-0003hL-JO; Fri, 11 Apr 2025 17:56:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947700.1345297; Fri, 11 Apr 2025 17:56: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 1u3IcY-0003hD-Gw; Fri, 11 Apr 2025 17:56:54 +0000
Received: by outflank-mailman (input) for mailman id 947700;
 Fri, 11 Apr 2025 17:56: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 1u3IcX-0003gy-GQ
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 17:56: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 1u3IcX-008Www-1Y
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17:56:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3IcX-00Esxj-1T
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 17:56: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=tFDRr1hrlixpiDzKXae48+lA6hymNDxMQxErStCVCs0=; b=ahrB+NbSbhQk2AynnHPIIHjj4m
	ZdD9Cq9HqAqWve9bU0zXrKI/xRIDbPP+T0A3q3oNv3Y4scdBYlWAovXoz7T8fSf8c1vgTsE+0waiA
	xievmuMVWBX6thfpBYMLuC8/o1c88z2km5rCqX6nciNIM+i5pHCcdlWM1bT6Uqm/KabU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.17] x86/ucode: Extend AMD digest checks to cover Zen5 CPUs
Message-Id: <E1u3IcX-00Esxj-1T@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 17:56:53 +0000

commit d109962a2a05d195a3cef3f27845da70536d52f1
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 8 17:09:15 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 17:34:28 2025 +0100

    x86/ucode: Extend AMD digest checks to cover Zen5 CPUs
    
    AMD have updated the SB-7033 advisory to include Zen5 CPUs.  Extend the digest
    check to cover Zen5 too.
    
    In practice, cover everything until further notice.
    
    Observant readers may be wondering where the update to the digest list is.  At
    the time of writing, no Zen5 patches are available via a verifiable channel.
    
    Link: https://www.amd.com/en/resources/product-security/bulletin/amd-sb-7033.html
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit b63951467e964bcc927f823fc943e40069fac0c9)
    
    x86/ucode: Extend warning about disabling digest check too
    
    This was missed by accident.
    
    Fixes: b63951467e96 ("x86/ucode: Extend AMD digest checks to cover Zen5 CPUs")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 59bb316ea89e7f9461690fe00547d7d2af96321d)
---
 xen/arch/x86/cpu/microcode/amd.c  | 8 ++++++--
 xen/arch/x86/cpu/microcode/core.c | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 2238818f80..13ca27d544 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -118,8 +118,12 @@ static bool check_digest(const struct container_microcode *mc)
     const struct patch_digest *pd;
     uint8_t digest[SHA2_256_DIGEST_SIZE];
 
-    /* Only Fam17h/19h are known to need extra checks.  Skip other families. */
-    if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x19 ||
+    /*
+     * Zen1 thru Zen5 CPUs are known to use a weak signature algorithm on
+     * microcode updates.  Mitigate by checking the digest of the patch
+     * against a list of known provenance.
+     */
+    if ( boot_cpu_data.x86 < 0x17 ||
          !opt_digest_check )
         return true;
 
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index e102aa2b56..e2975afa54 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -805,7 +805,7 @@ int __init early_microcode_init(void)
     {
     case X86_VENDOR_AMD:
         if ( !opt_digest_check &&
-             boot_cpu_data.x86 >= 0x17 && boot_cpu_data.x86 <= 0x19 )
+             boot_cpu_data.x86 >= 0x17 )
         {
             printk(XENLOG_WARNING
                    "Microcode patch additional digest checks disabled");
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.17


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 18:22:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 18:22:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947707.1345300 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3J0u-0003Km-BZ; Fri, 11 Apr 2025 18:22:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947707.1345300; Fri, 11 Apr 2025 18:22:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3J0u-0003Kf-97; Fri, 11 Apr 2025 18:22:04 +0000
Received: by outflank-mailman (input) for mailman id 947707;
 Fri, 11 Apr 2025 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 1u3J0s-0003KZ-NH
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 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 1u3J0s-008Xac-1A
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 18:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3J0s-00FR0l-0z
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 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=lGRI32keKhvR1Zy+K+iE2v4OMymR7CKTEBstUI9TzNg=; b=TeBWBqv72hjRb4XOYgIcTFNM4B
	V1aiQ0d5nkWB2FuJP/gdEqv679PYxM1cXEt7PEj4PNBprvIY2xeK/RFYGsJZdwsQi9r/OzMyxhN8f
	v9r1wVpVYXXxEABUY7ObpRJ6tOYXt1bdQIRxyqfb4RFpbkosFrzoNiCczFZbOIUJmy9s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] tools/libxl: remove usage of VLA arrays
Message-Id: <E1u3J0s-00FR0l-0z@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 18:22:02 +0000

commit 2f5d4a0685766e91bdb38e2d0f76809d2c7ded4e
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Oct 28 12:48:31 2024 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 17:34:28 2025 +0100

    tools/libxl: remove usage of VLA arrays
    
    Clang 19 complains with the following error when building libxl:
    
    libxl_utils.c:48:15: error: variable length array folded to constant array as an extension [-Werror,-Wgnu-folding-constant]
       48 |     char path[strlen("/local/domain") + 12];
          |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    Replace the usage of strlen() with sizeof, which allows the literal
    string length to be known at build time.  Note sizeof accounts for the
    NUL terminator while strlen() didn't, hence subtract 1 from the total
    size calculation.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Frediano Ziglio <frediano.ziglio@cloud.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
    (cherry picked from commit a7c7c3f6424504c4004bbb3437be319aa41ad580)
---
 tools/libs/light/libxl_utils.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libs/light/libxl_utils.c b/tools/libs/light/libxl_utils.c
index e403bd9bcf..01eb3a3670 100644
--- a/tools/libs/light/libxl_utils.c
+++ b/tools/libs/light/libxl_utils.c
@@ -45,7 +45,7 @@ unsigned long libxl_get_required_shadow_memory(unsigned long maxmem_kb, unsigned
 char *libxl_domid_to_name(libxl_ctx *ctx, uint32_t domid)
 {
     unsigned int len;
-    char path[strlen("/local/domain") + 12];
+    char path[sizeof("/local/domain") + 11];
     char *s;
 
     snprintf(path, sizeof(path), "/local/domain/%d/name", domid);
@@ -141,7 +141,7 @@ int libxl_cpupool_qualifier_to_cpupoolid(libxl_ctx *ctx, const char *p,
 char *libxl_cpupoolid_to_name(libxl_ctx *ctx, uint32_t poolid)
 {
     unsigned int len;
-    char path[strlen("/local/pool") + 12];
+    char path[sizeof("/local/pool") + 11];
     char *s;
 
     snprintf(path, sizeof(path), "/local/pool/%d/name", poolid);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 18:22:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 18:22:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947708.1345304 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3J14-0003MY-DT; Fri, 11 Apr 2025 18:22:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947708.1345304; Fri, 11 Apr 2025 18: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 1u3J14-0003MQ-Aa; Fri, 11 Apr 2025 18:22:14 +0000
Received: by outflank-mailman (input) for mailman id 947708;
 Fri, 11 Apr 2025 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 1u3J12-0003MA-Gi
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 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 1u3J12-008Xag-1U
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 18:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3J12-00FRJd-1K
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 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=KNDzgQqrDMvvrPwI6NlgyArupMLF+KmL/1QUaq3IGrs=; b=yHNm0JMmAg2Dq0iCYzEY8S/fLJ
	B1ZOKK5PJI6vFI8svwJZp1B5OZscVdLZ8SBQ3mfXvnzeslyNwE6xu5h4oWhB7ft1BiA3vLW0vha2t
	PqF4YKYnPP0Z0xaYWOwWzb6b3WmgH+y0o65MpQoSWTSx73UgVgq2GWH2WXKba1HnW6c0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] CI: Resync .cirrus.yml for FreeBSD testing
Message-Id: <E1u3J12-00FRJd-1K@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 18:22:12 +0000

commit f370d37cfa110d6d08c17c42188ba37cb1f52dde
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Apr 11 16:56:35 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 17:34:28 2025 +0100

    CI: Resync .cirrus.yml for FreeBSD testing
    
    Includes:
      commit 5395cd7b892d ("automation/cirrus-ci: update FreeBSD to 13.5")
      commit 850a263b7863 ("automation/cirrus-ci: update FreeBSD to 13.4")
      commit 0cc8845fb9fd ("CI: Update to FreeBSD 14.2")
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 .cirrus.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 0ec9586e2c..eb46227892 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -17,11 +17,11 @@ freebsd_template: &FREEBSD_TEMPLATE
 task:
   name: 'FreeBSD 13'
   freebsd_instance:
-    image_family: freebsd-13-3
+    image_family: freebsd-13-5
   << : *FREEBSD_TEMPLATE
 
 task:
   name: 'FreeBSD 14'
   freebsd_instance:
-    image_family: freebsd-14-1
+    image_family: freebsd-14-2
   << : *FREEBSD_TEMPLATE
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 18:22:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 18:22:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947709.1345309 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3J1E-0003Ow-EX; Fri, 11 Apr 2025 18:22:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947709.1345309; Fri, 11 Apr 2025 18: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 1u3J1E-0003Oo-C1; Fri, 11 Apr 2025 18:22:24 +0000
Received: by outflank-mailman (input) for mailman id 947709;
 Fri, 11 Apr 2025 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 1u3J1C-0003Oe-JM
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 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 1u3J1C-008Xap-1p
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 18:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3J1C-00FRUj-1g
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 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=H26fAE05CO5GTOF3Tr3Dal/gBAhq3Oc27/kwfj0Lwpc=; b=mtEJqAVoCQ0esADNYZNmMjn8zE
	paKWnRok64q9lzDE9ww/pc16UfGmZG5d0tmCZ/9PWW3Q8DYW5NSNM6tRvODxWtZg3EILaeRcXQ9cV
	DHnyEj8A3sLQ9tbcmGW6/owg18c39Izv5duESoCdUbHdh93gdMs3KjCF1ObjZcvTAi1Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] xen/lib: Introduce SHA2-256
Message-Id: <E1u3J1C-00FRUj-1g@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 18:22:22 +0000

commit b6eb7932a1c67c8e3bc3caf6c98ca4e584c557fb
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Dec 13 14:34:00 2024 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 17:34:28 2025 +0100

    xen/lib: Introduce SHA2-256
    
    A future change will need to calculate SHA2-256 digests.  Introduce an
    implementation in lib/, derived from Trenchboot which itself is derived from
    Linux.
    
    In order to be useful to other architectures, it is careful with endianness
    and misaligned accesses as well as being more MISRA friendly, but is only
    wired up for x86 in the short term.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 372af524411f5a013bcb0b117073d8d07c026563)
    
    Xen: CI fix from XSN-2
    
     * Add U suffix to the K[] table to fix MISRA Rule 7.2 violations.
    
    Fixes: 372af524411f ("xen/lib: Introduce SHA2-256")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 15fe2eb5f1bac8a212c0ba3d6dfe60d1fdf851cf)
---
 xen/include/xen/sha2.h |  15 ++++
 xen/lib/Makefile       |   1 +
 xen/lib/sha2-256.c     | 216 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 232 insertions(+)

diff --git a/xen/include/xen/sha2.h b/xen/include/xen/sha2.h
new file mode 100644
index 0000000000..47d97fbf01
--- /dev/null
+++ b/xen/include/xen/sha2.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * SHA2-256: https://csrc.nist.gov/pubs/fips/180-2/upd1/final
+ */
+#ifndef XEN_SHA2_H
+#define XEN_SHA2_H
+
+#include <xen/types.h>
+
+#define SHA2_256_DIGEST_SIZE 32
+
+void sha2_256_digest(uint8_t digest[SHA2_256_DIGEST_SIZE],
+                     const void *msg, size_t len);
+
+#endif /* XEN_SHA2_H */
diff --git a/xen/lib/Makefile b/xen/lib/Makefile
index b311ea739c..4a104ce835 100644
--- a/xen/lib/Makefile
+++ b/xen/lib/Makefile
@@ -13,6 +13,7 @@ lib-y += memset.o
 lib-y += muldiv64.o
 lib-y += parse-size.o
 lib-y += rbtree.o
+lib-$(CONFIG_X86) += sha2-256.o
 lib-y += sort.o
 lib-y += strcasecmp.o
 lib-y += strchr.o
diff --git a/xen/lib/sha2-256.c b/xen/lib/sha2-256.c
new file mode 100644
index 0000000000..cb02ec1857
--- /dev/null
+++ b/xen/lib/sha2-256.c
@@ -0,0 +1,216 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * SHA2-256: https://csrc.nist.gov/pubs/fips/180-2/upd1/final
+ *
+ * Originally derived from Linux.  Modified substantially to optimise for size
+ * and Xen's expected usecases.
+ */
+#include <xen/bitops.h>
+#include <xen/sha2.h>
+#include <xen/string.h>
+
+#include <asm/unaligned.h>
+
+struct sha2_256_state {
+    uint32_t state[SHA2_256_DIGEST_SIZE / sizeof(uint32_t)];
+    uint8_t buf[64];
+    size_t count; /* Byte count. */
+};
+
+static uint32_t choose(uint32_t x, uint32_t y, uint32_t z)
+{
+    return z ^ (x & (y ^ z));
+}
+
+static uint32_t majority(uint32_t x, uint32_t y, uint32_t z)
+{
+    return (x & y) | (z & (x | y));
+}
+
+static uint32_t e0(uint32_t x)
+{
+    return ror32(x, 2) ^ ror32(x, 13) ^ ror32(x, 22);
+}
+
+static uint32_t e1(uint32_t x)
+{
+    return ror32(x, 6) ^ ror32(x, 11) ^ ror32(x, 25);
+}
+
+static uint32_t s0(uint32_t x)
+{
+    return ror32(x, 7) ^ ror32(x, 18) ^ (x >> 3);
+}
+
+static uint32_t s1(uint32_t x)
+{
+    return ror32(x, 17) ^ ror32(x, 19) ^ (x >> 10);
+}
+
+static uint32_t blend(uint32_t W[16], unsigned int i)
+{
+#define W(i) W[(i) & 15]
+
+    return W(i) += s1(W(i - 2)) + W(i - 7) + s0(W(i - 15));
+
+#undef W
+}
+
+static const uint32_t K[] = {
+    0x428a2f98U, 0x71374491U, 0xb5c0fbcfU, 0xe9b5dba5U,
+    0x3956c25bU, 0x59f111f1U, 0x923f82a4U, 0xab1c5ed5U,
+    0xd807aa98U, 0x12835b01U, 0x243185beU, 0x550c7dc3U,
+    0x72be5d74U, 0x80deb1feU, 0x9bdc06a7U, 0xc19bf174U,
+    0xe49b69c1U, 0xefbe4786U, 0x0fc19dc6U, 0x240ca1ccU,
+    0x2de92c6fU, 0x4a7484aaU, 0x5cb0a9dcU, 0x76f988daU,
+    0x983e5152U, 0xa831c66dU, 0xb00327c8U, 0xbf597fc7U,
+    0xc6e00bf3U, 0xd5a79147U, 0x06ca6351U, 0x14292967U,
+    0x27b70a85U, 0x2e1b2138U, 0x4d2c6dfcU, 0x53380d13U,
+    0x650a7354U, 0x766a0abbU, 0x81c2c92eU, 0x92722c85U,
+    0xa2bfe8a1U, 0xa81a664bU, 0xc24b8b70U, 0xc76c51a3U,
+    0xd192e819U, 0xd6990624U, 0xf40e3585U, 0x106aa070U,
+    0x19a4c116U, 0x1e376c08U, 0x2748774cU, 0x34b0bcb5U,
+    0x391c0cb3U, 0x4ed8aa4aU, 0x5b9cca4fU, 0x682e6ff3U,
+    0x748f82eeU, 0x78a5636fU, 0x84c87814U, 0x8cc70208U,
+    0x90befffaU, 0xa4506cebU, 0xbef9a3f7U, 0xc67178f2U,
+};
+
+static void sha2_256_transform(uint32_t *state, const void *_input)
+{
+    const uint32_t *input = _input;
+    uint32_t a, b, c, d, e, f, g, h, t1, t2;
+    uint32_t W[16];
+    unsigned int i;
+
+    for ( i = 0; i < 16; i++ )
+        W[i] = get_unaligned_be32(&input[i]);
+
+    a = state[0]; b = state[1]; c = state[2]; d = state[3];
+    e = state[4]; f = state[5]; g = state[6]; h = state[7];
+
+    for ( i = 0; i < 16; i += 8 )
+    {
+        t1 = h + e1(e) + choose(e, f, g) + K[i + 0] + W[i + 0];
+        t2 = e0(a) + majority(a, b, c);    d += t1;    h = t1 + t2;
+        t1 = g + e1(d) + choose(d, e, f) + K[i + 1] + W[i + 1];
+        t2 = e0(h) + majority(h, a, b);    c += t1;    g = t1 + t2;
+        t1 = f + e1(c) + choose(c, d, e) + K[i + 2] + W[i + 2];
+        t2 = e0(g) + majority(g, h, a);    b += t1;    f = t1 + t2;
+        t1 = e + e1(b) + choose(b, c, d) + K[i + 3] + W[i + 3];
+        t2 = e0(f) + majority(f, g, h);    a += t1;    e = t1 + t2;
+        t1 = d + e1(a) + choose(a, b, c) + K[i + 4] + W[i + 4];
+        t2 = e0(e) + majority(e, f, g);    h += t1;    d = t1 + t2;
+        t1 = c + e1(h) + choose(h, a, b) + K[i + 5] + W[i + 5];
+        t2 = e0(d) + majority(d, e, f);    g += t1;    c = t1 + t2;
+        t1 = b + e1(g) + choose(g, h, a) + K[i + 6] + W[i + 6];
+        t2 = e0(c) + majority(c, d, e);    f += t1;    b = t1 + t2;
+        t1 = a + e1(f) + choose(f, g, h) + K[i + 7] + W[i + 7];
+        t2 = e0(b) + majority(b, c, d);    e += t1;    a = t1 + t2;
+    }
+
+    for ( ; i < 64; i += 8 )
+    {
+        t1 = h + e1(e) + choose(e, f, g) + K[i + 0] + blend(W, i + 0);
+        t2 = e0(a) + majority(a, b, c);    d += t1;    h = t1 + t2;
+        t1 = g + e1(d) + choose(d, e, f) + K[i + 1] + blend(W, i + 1);
+        t2 = e0(h) + majority(h, a, b);    c += t1;    g = t1 + t2;
+        t1 = f + e1(c) + choose(c, d, e) + K[i + 2] + blend(W, i + 2);
+        t2 = e0(g) + majority(g, h, a);    b += t1;    f = t1 + t2;
+        t1 = e + e1(b) + choose(b, c, d) + K[i + 3] + blend(W, i + 3);
+        t2 = e0(f) + majority(f, g, h);    a += t1;    e = t1 + t2;
+        t1 = d + e1(a) + choose(a, b, c) + K[i + 4] + blend(W, i + 4);
+        t2 = e0(e) + majority(e, f, g);    h += t1;    d = t1 + t2;
+        t1 = c + e1(h) + choose(h, a, b) + K[i + 5] + blend(W, i + 5);
+        t2 = e0(d) + majority(d, e, f);    g += t1;    c = t1 + t2;
+        t1 = b + e1(g) + choose(g, h, a) + K[i + 6] + blend(W, i + 6);
+        t2 = e0(c) + majority(c, d, e);    f += t1;    b = t1 + t2;
+        t1 = a + e1(f) + choose(f, g, h) + K[i + 7] + blend(W, i + 7);
+        t2 = e0(b) + majority(b, c, d);    e += t1;    a = t1 + t2;
+    }
+
+    state[0] += a; state[1] += b; state[2] += c; state[3] += d;
+    state[4] += e; state[5] += f; state[6] += g; state[7] += h;
+}
+
+static void sha2_256_init(struct sha2_256_state *s)
+{
+    *s = (struct sha2_256_state){
+        .state = {
+            0x6a09e667UL,
+            0xbb67ae85UL,
+            0x3c6ef372UL,
+            0xa54ff53aUL,
+            0x510e527fUL,
+            0x9b05688cUL,
+            0x1f83d9abUL,
+            0x5be0cd19UL,
+        },
+    };
+}
+
+static void sha2_256_update(struct sha2_256_state *s, const void *msg,
+                            size_t len)
+{
+    unsigned int partial = s->count & 63;
+
+    s->count += len;
+
+    if ( (partial + len) >= 64 )
+    {
+        if ( partial )
+        {
+            unsigned int rem = 64 - partial;
+
+            /* Fill the partial block. */
+            memcpy(s->buf + partial, msg, rem);
+            msg += rem;
+            len -= rem;
+
+            sha2_256_transform(s->state, s->buf);
+            partial = 0;
+        }
+
+        for ( ; len >= 64; msg += 64, len -= 64 )
+            sha2_256_transform(s->state, msg);
+    }
+
+    /* Remaining data becomes partial. */
+    memcpy(s->buf + partial, msg, len);
+}
+
+static void sha2_256_final(struct sha2_256_state *s, void *_dst)
+{
+    uint32_t *dst = _dst;
+    unsigned int i, partial = s->count & 63;
+
+    /* Start padding */
+    s->buf[partial++] = 0x80;
+
+    if ( partial > 56 )
+    {
+        /* Need one extra block - pad to 64 */
+        memset(s->buf + partial, 0, 64 - partial);
+        sha2_256_transform(s->state, s->buf);
+        partial = 0;
+    }
+    /* Pad to 56 */
+    memset(s->buf + partial, 0, 56 - partial);
+
+    /* Append the bit count */
+    put_unaligned_be64((uint64_t)s->count << 3, &s->buf[56]);
+    sha2_256_transform(s->state, s->buf);
+
+    /* Store state in digest */
+    for ( i = 0; i < 8; i++ )
+        put_unaligned_be32(s->state[i], &dst[i]);
+}
+
+void sha2_256_digest(uint8_t digest[SHA2_256_DIGEST_SIZE],
+                     const void *msg, size_t len)
+{
+    struct sha2_256_state s;
+
+    sha2_256_init(&s);
+    sha2_256_update(&s, msg, len);
+    sha2_256_final(&s, digest);
+}
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 18:22:34 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 18:22:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947710.1345312 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3J1O-0003Ri-GX; Fri, 11 Apr 2025 18:22:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947710.1345312; Fri, 11 Apr 2025 18: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 1u3J1O-0003Ra-DT; Fri, 11 Apr 2025 18:22:34 +0000
Received: by outflank-mailman (input) for mailman id 947710;
 Fri, 11 Apr 2025 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 1u3J1M-0003RJ-MM
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 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 1u3J1M-008XbC-28
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 18:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3J1M-00FRir-21
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 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=JwKesekBeP1lF3AYb01MK4Udj6f/HPiX8ZUytCUVAA0=; b=MZvh4lz3RKOv/cCb1s3rHgiO2m
	0zvszFGYCsjskbOjtECykyX12p8OID6EIEC7SgAzP+h47DrTs+9wus3988i2MTgMJN8rae//j7YnQ
	T1d+ITOOjJDNiJw7C/NPz+i+VlMepsWU6zhiIa+dv3ZDUtDSt1QIonGCSg6oVQM3VLmU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode
Message-Id: <E1u3J1M-00FRir-21@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 18:22:32 +0000

commit d6654c63e76fea383e8466b88ed0475490da3b2f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Dec 13 14:34:00 2024 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 17:34:28 2025 +0100

    x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode
    
    Collisions have been found in the microcode signing algorithm used by AMD
    Fam17h/19h CPUs, and now anyone can sign their own.
    
    For more details, see:
      https://bughunters.google.com/blog/5424842357473280/zen-and-the-art-of-microcode-hacking
      https://www.amd.com/en/resources/product-security/bulletin/amd-sb-7033.html
    
    As a stopgap mitigation, check the digest of patches against a table of blobs
    with known provenance.  These are all Fam17h and Fam19h blobs included in
    linux-firwmare at the time of writing, specifically:
    
      https://git.kernel.org/firmware/linux-firmware/c/48bb90cceb882cab8e9ab692bc5779d3bf3a13b8
    
    This checks can be opted out of by booting with ucode=no-digest-check, but
    doing so is not recommended.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 630e8875ab368b97cc7231aaf3809e3d7d5687e1)
    
    Xen: CI fix from XSN-2
    
     * Add cf_check annotation to cmp_patch_id() used by bsearch().
    
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 15fe2eb5f1bac8a212c0ba3d6dfe60d1fdf851cf)
---
 docs/misc/xen-command-line.pandoc              |  10 +-
 xen/arch/x86/cpu/microcode/amd-patch-digests.c | 226 +++++++++++++++++++++++++
 xen/arch/x86/cpu/microcode/amd.c               |  58 ++++++-
 xen/arch/x86/cpu/microcode/core.c              |  11 ++
 xen/arch/x86/cpu/microcode/private.h           |   2 +
 5 files changed, 304 insertions(+), 3 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index ccb185a4f3..d7310cbb46 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2588,10 +2588,10 @@ performance.
    Alternatively, selecting `tsx=1` will re-enable TSX at the users own risk.
 
 ### ucode
-> `= List of [ <integer> | scan=<bool>, nmi=<bool>, allow-same=<bool> ]`
+> `= List of [ <integer> | scan=<bool>, nmi=<bool>, allow-same=<bool>, digest-check=<bool> ]`
 
     Applicability: x86
-    Default: `nmi`
+    Default: `nmi,digest-check`
 
 Controls for CPU microcode loading. For early loading, this parameter can
 specify how and where to find the microcode update blob. For late loading,
@@ -2625,6 +2625,12 @@ trying to reload the same version.  Many CPUs will actually reload microcode
 of the same version, and this allows for easy testing of the late microcode
 loading path.
 
+The `digest-check=` option is active by default and controls whether to
+perform additional authenticity checks.  Collisions in the signature algorithm
+used by AMD Fam17h/19h processors have been found.  Xen contains a table of
+digests of microcode patches with known-good provenance, and will block
+loading of patches that do not match.
+
 ### unrestricted_guest (Intel)
 > `= <boolean>`
 
diff --git a/xen/arch/x86/cpu/microcode/amd-patch-digests.c b/xen/arch/x86/cpu/microcode/amd-patch-digests.c
new file mode 100644
index 0000000000..d327612267
--- /dev/null
+++ b/xen/arch/x86/cpu/microcode/amd-patch-digests.c
@@ -0,0 +1,226 @@
+/* Generated from linux-firmware. */
+{
+    .patch_id = 0x0800126f,
+    .digest = {
+        0x2b, 0x5a, 0xf2, 0x9c, 0xdd, 0xd2, 0x7f, 0xec,
+        0xec, 0x96, 0x09, 0x57, 0xb0, 0x96, 0x29, 0x8b,
+        0x2e, 0x26, 0x91, 0xf0, 0x49, 0x33, 0x42, 0x18,
+        0xdd, 0x4b, 0x65, 0x5a, 0xd4, 0x15, 0x3d, 0x33,
+    },
+},
+{
+    .patch_id = 0x0800820d,
+    .digest = {
+        0x68, 0x98, 0x83, 0xcd, 0x22, 0x0d, 0xdd, 0x59,
+        0x73, 0x2c, 0x5b, 0x37, 0x1f, 0x84, 0x0e, 0x67,
+        0x96, 0x43, 0x83, 0x0c, 0x46, 0x44, 0xab, 0x7c,
+        0x7b, 0x65, 0x9e, 0x57, 0xb5, 0x90, 0x4b, 0x0e,
+    },
+},
+{
+    .patch_id = 0x0830107c,
+    .digest = {
+        0x21, 0x64, 0xde, 0xfb, 0x9f, 0x68, 0x96, 0x47,
+        0x70, 0x5c, 0xe2, 0x8f, 0x18, 0x52, 0x6a, 0xac,
+        0xa4, 0xd2, 0x2e, 0xe0, 0xde, 0x68, 0x66, 0xc3,
+        0xeb, 0x1e, 0xd3, 0x3f, 0xbc, 0x51, 0x1d, 0x38,
+    },
+},
+{
+    .patch_id = 0x0860010d,
+    .digest = {
+        0x86, 0xb6, 0x15, 0x83, 0xbc, 0x3b, 0x9c, 0xe0,
+        0xb3, 0xef, 0x1d, 0x99, 0x84, 0x35, 0x15, 0xf7,
+        0x7c, 0x2a, 0xc6, 0x42, 0xdb, 0x73, 0x07, 0x5c,
+        0x7d, 0xc3, 0x02, 0xb5, 0x43, 0x06, 0x5e, 0xf8,
+    },
+},
+{
+    .patch_id = 0x08608108,
+    .digest = {
+        0x14, 0xfe, 0x57, 0x86, 0x49, 0xc8, 0x68, 0xe2,
+        0x11, 0xa3, 0xcb, 0x6e, 0xff, 0x6e, 0xd5, 0x38,
+        0xfe, 0x89, 0x1a, 0xe0, 0x67, 0xbf, 0xc4, 0xcc,
+        0x1b, 0x9f, 0x84, 0x77, 0x2b, 0x9f, 0xaa, 0xbd,
+    },
+},
+{
+    .patch_id = 0x08701034,
+    .digest = {
+        0xc3, 0x14, 0x09, 0xa8, 0x9c, 0x3f, 0x8d, 0x83,
+        0x9b, 0x4c, 0xa5, 0xb7, 0x64, 0x8b, 0x91, 0x5d,
+        0x85, 0x6a, 0x39, 0x26, 0x1e, 0x14, 0x41, 0xa8,
+        0x75, 0xea, 0xa6, 0xf9, 0xc9, 0xd1, 0xea, 0x2b,
+    },
+},
+{
+    .patch_id = 0x08a0000a,
+    .digest = {
+        0x73, 0x31, 0x26, 0x22, 0xd4, 0xf9, 0xee, 0x3c,
+        0x07, 0x06, 0xe7, 0xb9, 0xad, 0xd8, 0x72, 0x44,
+        0x33, 0x31, 0xaa, 0x7d, 0xc3, 0x67, 0x0e, 0xdb,
+        0x47, 0xb5, 0xaa, 0xbc, 0xf5, 0xbb, 0xd9, 0x20,
+    },
+},
+{
+    .patch_id = 0x0a00107a,
+    .digest = {
+        0x5f, 0x92, 0xca, 0xff, 0xc3, 0x59, 0x22, 0x5f,
+        0x02, 0xa0, 0x91, 0x3b, 0x4a, 0x45, 0x10, 0xfd,
+        0x19, 0xe1, 0x8a, 0x6d, 0x9a, 0x92, 0xc1, 0x3f,
+        0x75, 0x78, 0xac, 0x78, 0x03, 0x1d, 0xdb, 0x18,
+    },
+},
+{
+    .patch_id = 0x0a0011d5,
+    .digest = {
+        0xed, 0x69, 0x89, 0xf4, 0xeb, 0x64, 0xc2, 0x13,
+        0xe0, 0x51, 0x1f, 0x03, 0x26, 0x52, 0x7d, 0xb7,
+        0x93, 0x5d, 0x65, 0xca, 0xb8, 0x12, 0x1d, 0x62,
+        0x0d, 0x5b, 0x65, 0x34, 0x69, 0xb2, 0x62, 0x21,
+    },
+},
+{
+    .patch_id = 0x0a001238,
+    .digest = {
+        0x72, 0xf7, 0x4b, 0x0c, 0x7d, 0x58, 0x65, 0xcc,
+        0x00, 0xcc, 0x57, 0x16, 0x68, 0x16, 0xf8, 0x2a,
+        0x1b, 0xb3, 0x8b, 0xe1, 0xb6, 0x83, 0x8c, 0x7e,
+        0xc0, 0xcd, 0x33, 0xf2, 0x8d, 0xf9, 0xef, 0x59,
+    },
+},
+{
+    .patch_id = 0x0a00820c,
+    .digest = {
+        0xa8, 0x0c, 0x81, 0xc0, 0xa6, 0x00, 0xe7, 0xf3,
+        0x5f, 0x65, 0xd3, 0xb9, 0x6f, 0xea, 0x93, 0x63,
+        0xf1, 0x8c, 0x88, 0x45, 0xd7, 0x82, 0x80, 0xd1,
+        0xe1, 0x3b, 0x8d, 0xb2, 0xf8, 0x22, 0x03, 0xe2,
+    },
+},
+{
+    .patch_id = 0x0a101148,
+    .digest = {
+        0x20, 0xd5, 0x6f, 0x40, 0x4a, 0xf6, 0x48, 0x90,
+        0xc2, 0x93, 0x9a, 0xc2, 0xfd, 0xac, 0xef, 0x4f,
+        0xfa, 0xc0, 0x3d, 0x92, 0x3c, 0x6d, 0x01, 0x08,
+        0xf1, 0x5e, 0xb0, 0xde, 0xb4, 0x98, 0xae, 0xc4,
+    },
+},
+{
+    .patch_id = 0x0a101248,
+    .digest = {
+        0xed, 0x3b, 0x95, 0xa6, 0x68, 0xa7, 0x77, 0x3e,
+        0xfc, 0x17, 0x26, 0xe2, 0x7b, 0xd5, 0x56, 0x22,
+        0x2c, 0x1d, 0xef, 0xeb, 0x56, 0xdd, 0xba, 0x6e,
+        0x1b, 0x7d, 0x64, 0x9d, 0x4b, 0x53, 0x13, 0x75,
+    },
+},
+{
+    .patch_id = 0x0a108108,
+    .digest = {
+        0xed, 0xc2, 0xec, 0xa1, 0x15, 0xc6, 0x65, 0xe9,
+        0xd0, 0xef, 0x39, 0xaa, 0x7f, 0x55, 0x06, 0xc6,
+        0xf5, 0xd4, 0x3f, 0x7b, 0x14, 0xd5, 0x60, 0x2c,
+        0x28, 0x1e, 0x9c, 0x59, 0x69, 0x99, 0x4d, 0x16,
+    },
+},
+{
+    .patch_id = 0x0a20102d,
+    .digest = {
+        0xf9, 0x6e, 0xf2, 0x32, 0xd3, 0x0f, 0x5f, 0x11,
+        0x59, 0xa1, 0xfe, 0xcc, 0xcd, 0x9b, 0x42, 0x89,
+        0x8b, 0x89, 0x2f, 0xb5, 0xbb, 0x82, 0xef, 0x23,
+        0x8c, 0xe9, 0x19, 0x3e, 0xcc, 0x3f, 0x7b, 0xb4,
+    },
+},
+{
+    .patch_id = 0x0a201210,
+    .digest = {
+        0xe8, 0x6d, 0x51, 0x6a, 0x8e, 0x72, 0xf3, 0xfe,
+        0x6e, 0x16, 0xbc, 0x62, 0x59, 0x40, 0x17, 0xe9,
+        0x6d, 0x3d, 0x0e, 0x6b, 0xa7, 0xac, 0xe3, 0x68,
+        0xf7, 0x55, 0xf0, 0x13, 0xbb, 0x22, 0xf6, 0x41,
+    },
+},
+{
+    .patch_id = 0x0a404107,
+    .digest = {
+        0xbb, 0x04, 0x4e, 0x47, 0xdd, 0x5e, 0x26, 0x45,
+        0x1a, 0xc9, 0x56, 0x24, 0xa4, 0x4c, 0x82, 0xb0,
+        0x8b, 0x0d, 0x9f, 0xf9, 0x3a, 0xdf, 0xc6, 0x81,
+        0x13, 0xbc, 0xc5, 0x25, 0xe4, 0xc5, 0xc3, 0x99,
+    },
+},
+{
+    .patch_id = 0x0a500011,
+    .digest = {
+        0x23, 0x3d, 0x70, 0x7d, 0x03, 0xc3, 0xc4, 0xf4,
+        0x2b, 0x82, 0xc6, 0x05, 0xda, 0x80, 0x0a, 0xf1,
+        0xd7, 0x5b, 0x65, 0x3a, 0x7d, 0xab, 0xdf, 0xa2,
+        0x11, 0x5e, 0x96, 0x7e, 0x71, 0xe9, 0xfc, 0x74,
+    },
+},
+{
+    .patch_id = 0x0a601209,
+    .digest = {
+        0x66, 0x48, 0xd4, 0x09, 0x05, 0xcb, 0x29, 0x32,
+        0x66, 0xb7, 0x9a, 0x76, 0xcd, 0x11, 0xf3, 0x30,
+        0x15, 0x86, 0xcc, 0x5d, 0x97, 0x0f, 0xc0, 0x46,
+        0xe8, 0x73, 0xe2, 0xd6, 0xdb, 0xd2, 0x77, 0x1d,
+    },
+},
+{
+    .patch_id = 0x0a704107,
+    .digest = {
+        0xf3, 0xc6, 0x58, 0x26, 0xee, 0xac, 0x3f, 0xd6,
+        0xce, 0xa1, 0x72, 0x47, 0x3b, 0xba, 0x2b, 0x93,
+        0x2a, 0xad, 0x8e, 0x6b, 0xea, 0x9b, 0xb7, 0xc2,
+        0x64, 0x39, 0x71, 0x8c, 0xce, 0xe7, 0x41, 0x39,
+    },
+},
+{
+    .patch_id = 0x0a705206,
+    .digest = {
+        0x8d, 0xc0, 0x76, 0xbd, 0x58, 0x9f, 0x8f, 0xa4,
+        0x12, 0x9d, 0x21, 0xfb, 0x48, 0x21, 0xbc, 0xe7,
+        0x67, 0x6f, 0x04, 0x18, 0xae, 0x20, 0x87, 0x4b,
+        0x03, 0x35, 0xe9, 0xbe, 0xfb, 0x06, 0xdf, 0xfc,
+    },
+},
+{
+    .patch_id = 0x0a708007,
+    .digest = {
+        0x6b, 0x76, 0xcc, 0x78, 0xc5, 0x8a, 0xa3, 0xe3,
+        0x32, 0x2d, 0x79, 0xe4, 0xc3, 0x80, 0xdb, 0xb2,
+        0x07, 0xaa, 0x3a, 0xe0, 0x57, 0x13, 0x72, 0x80,
+        0xdf, 0x92, 0x73, 0x84, 0x87, 0x3c, 0x73, 0x93,
+    },
+},
+{
+    .patch_id = 0x0a70c005,
+    .digest = {
+        0x88, 0x5d, 0xfb, 0x79, 0x64, 0xd8, 0x46, 0x3b,
+        0x4a, 0x83, 0x8e, 0x77, 0x7e, 0xcf, 0xb3, 0x0f,
+        0x1f, 0x1f, 0xf1, 0x97, 0xeb, 0xfe, 0x56, 0x55,
+        0xee, 0x49, 0xac, 0xe1, 0x8b, 0x13, 0xc5, 0x13,
+    },
+},
+{
+    .patch_id = 0x0aa00116,
+    .digest = {
+        0xe8, 0x4c, 0x2c, 0x88, 0xa1, 0xac, 0x24, 0x63,
+        0x65, 0xe5, 0xaa, 0x2d, 0x16, 0xa9, 0xc3, 0xf5,
+        0xfe, 0x1d, 0x5e, 0x65, 0xc7, 0xaa, 0x92, 0x4d,
+        0x91, 0xee, 0x76, 0xbb, 0x4c, 0x66, 0x78, 0xc9,
+    },
+},
+{
+    .patch_id = 0x0aa00215,
+    .digest = {
+        0x55, 0xd3, 0x28, 0xcb, 0x87, 0xa9, 0x32, 0xe9,
+        0x4e, 0x85, 0x4b, 0x7c, 0x6b, 0xd5, 0x7c, 0xd4,
+        0x1b, 0x51, 0x71, 0x3a, 0x0e, 0x0b, 0xdc, 0x9b,
+        0x68, 0x2f, 0x46, 0xee, 0xfe, 0xc6, 0x6d, 0xef,
+    },
+},
diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index b28171f2d4..2238818f80 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -16,7 +16,9 @@
 
 #include <xen/err.h>
 #include <xen/init.h>
+#include <xen/lib.h>
 #include <xen/mm.h> /* TODO: Fix asm/tlbflush.h breakage */
+#include <xen/sha2.h>
 
 #include <asm/msr.h>
 
@@ -91,6 +93,59 @@ static struct {
     uint16_t id;
 } equiv __read_mostly;
 
+static const struct patch_digest {
+    uint32_t patch_id;
+    uint8_t digest[SHA2_256_DIGEST_SIZE];
+} patch_digests[] = {
+#include "amd-patch-digests.c"
+};
+
+static int cf_check cmp_patch_id(const void *key, const void *elem)
+{
+    const struct patch_digest *pd = elem;
+    uint32_t patch_id = *(uint32_t *)key;
+
+    if ( patch_id == pd->patch_id )
+        return 0;
+    else if ( patch_id < pd->patch_id )
+        return -1;
+    return 1;
+}
+
+static bool check_digest(const struct container_microcode *mc)
+{
+    const struct microcode_patch *patch = mc->patch;
+    const struct patch_digest *pd;
+    uint8_t digest[SHA2_256_DIGEST_SIZE];
+
+    /* Only Fam17h/19h are known to need extra checks.  Skip other families. */
+    if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x19 ||
+         !opt_digest_check )
+        return true;
+
+    pd = bsearch(&patch->patch_id, patch_digests, ARRAY_SIZE(patch_digests),
+                 sizeof(struct patch_digest), cmp_patch_id);
+    if ( !pd )
+    {
+        printk(XENLOG_WARNING "No digest found for patch_id %08x\n",
+               patch->patch_id);
+        return false;
+    }
+
+    sha2_256_digest(digest, patch, mc->len);
+
+    if ( memcmp(digest, pd->digest, sizeof(digest)) )
+    {
+        printk(XENLOG_WARNING "Patch %08x SHA256 mismatch:\n"
+               "  expected %" STR(SHA2_256_DIGEST_SIZE) "phN\n"
+               "       got %" STR(SHA2_256_DIGEST_SIZE) "phN\n",
+               patch->patch_id, pd->digest, digest);
+        return false;
+    }
+
+    return true;
+}
+
 static void cf_check collect_cpu_info(void)
 {
     struct cpu_signature *csig = &this_cpu(cpu_sig);
@@ -391,7 +446,8 @@ static struct microcode_patch *cf_check cpu_request_microcode(
              * one with higher revision.
              */
             if ( (microcode_fits(mc->patch) != MIS_UCODE) &&
-                 (!saved || (compare_header(mc->patch, saved) == NEW_UCODE)) )
+                 (!saved || (compare_header(mc->patch, saved) == NEW_UCODE)) &&
+                 check_digest(mc) )
             {
                 saved = mc->patch;
                 saved_size = mc->len;
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 3150395478..e102aa2b56 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -97,6 +97,7 @@ static bool_t __initdata ucode_scan;
 static bool ucode_in_nmi = true;
 
 bool __read_mostly opt_ucode_allow_same;
+bool __ro_after_init opt_digest_check = true;
 
 /* Protected by microcode_mutex */
 static struct microcode_patch *microcode_cache;
@@ -126,6 +127,8 @@ static int __init cf_check parse_ucode(const char *s)
             ucode_in_nmi = val;
         else if ( (val = parse_boolean("allow-same", s, ss)) >= 0 )
             opt_ucode_allow_same = val;
+        else if ( (val = parse_boolean("digest-check", s, ss)) >= 0 )
+            opt_digest_check = val;
         else if ( !ucode_mod_forced ) /* Not forced by EFI */
         {
             if ( (val = parse_boolean("scan", s, ss)) >= 0 )
@@ -801,6 +804,14 @@ int __init early_microcode_init(void)
     switch ( c->x86_vendor )
     {
     case X86_VENDOR_AMD:
+        if ( !opt_digest_check &&
+             boot_cpu_data.x86 >= 0x17 && boot_cpu_data.x86 <= 0x19 )
+        {
+            printk(XENLOG_WARNING
+                   "Microcode patch additional digest checks disabled");
+            add_taint(TAINT_CPU_OUT_OF_SPEC);
+        }
+
         if ( c->x86 >= 0x10 )
             ucode_ops = amd_ucode_ops;
         break;
diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h
index feafab0677..79d7e37cc6 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -54,6 +54,8 @@ struct microcode_ops {
         const struct microcode_patch *new, const struct microcode_patch *old);
 };
 
+extern bool opt_digest_check;
+
 extern const struct microcode_ops amd_ucode_ops, intel_ucode_ops;
 
 #endif /* ASM_X86_MICROCODE_PRIVATE_H */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 18:22:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 18:22:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947711.1345316 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3J1Y-0003UW-Jl; Fri, 11 Apr 2025 18:22:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947711.1345316; Fri, 11 Apr 2025 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 1u3J1Y-0003UO-Gx; Fri, 11 Apr 2025 18:22:44 +0000
Received: by outflank-mailman (input) for mailman id 947711;
 Fri, 11 Apr 2025 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 1u3J1W-0003UB-PF
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 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 1u3J1W-008Xel-2Q
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 18:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3J1W-00FS2Y-2J
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 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=/uCcilIeBYMSBgFHnr2/inxRsKz9NR4FsbzxsL81Ppw=; b=SVdytTVYkzJLwA7u3BTSOtckuy
	4PfkcBM/IIifyDDLO/jqQv/1GkvXi6VVOkFOvHSHpIt2S0hFz0yquum9hGr00koZsbtC1LrnbVHwt
	e511+4xbAk1Z7jmJ702bZSJuIUnjWxOL2lB6Iu3mw2QrzLRc7OHnt6AZxwjHfC9sNlWs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] x86/ucode: Extend AMD digest checks to cover Zen5 CPUs
Message-Id: <E1u3J1W-00FS2Y-2J@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 18:22:42 +0000

commit d109962a2a05d195a3cef3f27845da70536d52f1
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 8 17:09:15 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 17:34:28 2025 +0100

    x86/ucode: Extend AMD digest checks to cover Zen5 CPUs
    
    AMD have updated the SB-7033 advisory to include Zen5 CPUs.  Extend the digest
    check to cover Zen5 too.
    
    In practice, cover everything until further notice.
    
    Observant readers may be wondering where the update to the digest list is.  At
    the time of writing, no Zen5 patches are available via a verifiable channel.
    
    Link: https://www.amd.com/en/resources/product-security/bulletin/amd-sb-7033.html
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit b63951467e964bcc927f823fc943e40069fac0c9)
    
    x86/ucode: Extend warning about disabling digest check too
    
    This was missed by accident.
    
    Fixes: b63951467e96 ("x86/ucode: Extend AMD digest checks to cover Zen5 CPUs")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 59bb316ea89e7f9461690fe00547d7d2af96321d)
---
 xen/arch/x86/cpu/microcode/amd.c  | 8 ++++++--
 xen/arch/x86/cpu/microcode/core.c | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 2238818f80..13ca27d544 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -118,8 +118,12 @@ static bool check_digest(const struct container_microcode *mc)
     const struct patch_digest *pd;
     uint8_t digest[SHA2_256_DIGEST_SIZE];
 
-    /* Only Fam17h/19h are known to need extra checks.  Skip other families. */
-    if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x19 ||
+    /*
+     * Zen1 thru Zen5 CPUs are known to use a weak signature algorithm on
+     * microcode updates.  Mitigate by checking the digest of the patch
+     * against a list of known provenance.
+     */
+    if ( boot_cpu_data.x86 < 0x17 ||
          !opt_digest_check )
         return true;
 
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index e102aa2b56..e2975afa54 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -805,7 +805,7 @@ int __init early_microcode_init(void)
     {
     case X86_VENDOR_AMD:
         if ( !opt_digest_check &&
-             boot_cpu_data.x86 >= 0x17 && boot_cpu_data.x86 <= 0x19 )
+             boot_cpu_data.x86 >= 0x17 )
         {
             printk(XENLOG_WARNING
                    "Microcode patch additional digest checks disabled");
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 19:11:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 19:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947787.1345361 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3JmJ-00025C-O8; Fri, 11 Apr 2025 19:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947787.1345361; Fri, 11 Apr 2025 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 1u3JmJ-000254-LR; Fri, 11 Apr 2025 19:11:03 +0000
Received: by outflank-mailman (input) for mailman id 947787;
 Fri, 11 Apr 2025 19: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 1u3JmH-00024r-QG
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 19: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 1u3JmH-008YjQ-1y
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 19:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3JmH-00G9GD-1l
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 19: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=26E2AMYABVj4jwbvRuRFPcNwIDSpQ5NrRF6b8YDh2wg=; b=c/2uZh233+EGH4tUHxb1cM7KEw
	uWYDDRMtGoGpv9Kx+4MEkWcFjaJcnPoQlBUew7H9DByQepstCKDqFghSRFhwzJLjrzkSgwdSpaGOb
	KX/XcpduRdD2hGbXxDU1NCdwevyM7JF0F/wkgrsV2c2EyGyS2dq1+lOox0SkBhw2KdCI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] tools/libxl: do not use `-c -E` compiler options together
Message-Id: <E1u3JmH-00G9GD-1l@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 19:11:01 +0000

commit 668e175d43b0b3109ba887789728b77d02750ffa
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Apr 7 13:09:38 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 17:27:59 2025 +0100

    tools/libxl: do not use `-c -E` compiler options together
    
    It makes no sense to request for preprocessor only output and also request
    object file generation.  Fix the _libxl.api-for-check target to only use
    -E (preprocessor output).
    
    Also Clang 20.0 reports an error if both options are used.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Fixes: 2862bf5b6c81 ('libxl: enforce prohibitions of internal callers')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
    (cherry picked from commit a235f856e4bbd270b085590e1f5fc9599234dcdf)
---
 tools/libs/light/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
index 37e4d16709..b690d92159 100644
--- a/tools/libs/light/Makefile
+++ b/tools/libs/light/Makefile
@@ -195,7 +195,7 @@ libxl.api-ok: check-libxl-api-rules _libxl.api-for-check
 	touch $@
 
 _libxl.api-for-check: $(XEN_INCLUDE)/libxl.h
-	$(CC) $(CPPFLAGS) $(CFLAGS) -c -E $< $(APPEND_CFLAGS) \
+	$(CC) $(CPPFLAGS) $(CFLAGS) -E $< $(APPEND_CFLAGS) \
 		-DLIBXL_EXTERNAL_CALLERS_ONLY=LIBXL_EXTERNAL_CALLERS_ONLY \
 		>$@.new
 	mv -f $@.new $@
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 19:11:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 19:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947788.1345367 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3JmT-00026s-QN; Fri, 11 Apr 2025 19:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947788.1345367; Fri, 11 Apr 2025 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 1u3JmT-00026k-Mr; Fri, 11 Apr 2025 19:11:13 +0000
Received: by outflank-mailman (input) for mailman id 947788;
 Fri, 11 Apr 2025 19: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 1u3JmR-00026U-OP
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 19: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 1u3JmR-008YjV-2L
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 19:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3JmR-00G9Kt-29
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 19: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=hhaU+++dYXeTp36xLIJyZf1J9gihOIkYJuJ6yMMFSr0=; b=Ji7XxhHTrjBn+CUL0EylCpe2VI
	KiXuya5H1myZSVfgbEc9lUPn6Fyvlp/BGH2kv4NWMZqDOIWWDcA4qhUXmam1654I2jk6bjD0bnGEw
	K0igRhsuBFGgqV5Zf7ubiV6jjrOLTliImsp2meUfHSN633zX/azaKxOePIhxoU6GUoIQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] tools/libxl: remove usage of VLA arrays
Message-Id: <E1u3JmR-00G9Kt-29@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 19:11:11 +0000

commit af98d03997d78aba243666cc144fa5137b3bf2f0
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Oct 28 12:48:31 2024 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 17:27:59 2025 +0100

    tools/libxl: remove usage of VLA arrays
    
    Clang 19 complains with the following error when building libxl:
    
    libxl_utils.c:48:15: error: variable length array folded to constant array as an extension [-Werror,-Wgnu-folding-constant]
       48 |     char path[strlen("/local/domain") + 12];
          |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    Replace the usage of strlen() with sizeof, which allows the literal
    string length to be known at build time.  Note sizeof accounts for the
    NUL terminator while strlen() didn't, hence subtract 1 from the total
    size calculation.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Frediano Ziglio <frediano.ziglio@cloud.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
    (cherry picked from commit a7c7c3f6424504c4004bbb3437be319aa41ad580)
---
 tools/libs/light/libxl_utils.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libs/light/libxl_utils.c b/tools/libs/light/libxl_utils.c
index 65ef196935..7fd9b177b3 100644
--- a/tools/libs/light/libxl_utils.c
+++ b/tools/libs/light/libxl_utils.c
@@ -45,7 +45,7 @@ unsigned long libxl_get_required_shadow_memory(unsigned long maxmem_kb, unsigned
 char *libxl_domid_to_name(libxl_ctx *ctx, uint32_t domid)
 {
     unsigned int len;
-    char path[strlen("/local/domain") + 12];
+    char path[sizeof("/local/domain") + 11];
     char *s;
 
     snprintf(path, sizeof(path), "/local/domain/%d/name", domid);
@@ -141,7 +141,7 @@ int libxl_cpupool_qualifier_to_cpupoolid(libxl_ctx *ctx, const char *p,
 char *libxl_cpupoolid_to_name(libxl_ctx *ctx, uint32_t poolid)
 {
     unsigned int len;
-    char path[strlen("/local/pool") + 12];
+    char path[sizeof("/local/pool") + 11];
     char *s;
 
     snprintf(path, sizeof(path), "/local/pool/%d/name", poolid);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 19:11:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 19:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947789.1345370 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3Jmd-00029N-RH; Fri, 11 Apr 2025 19:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947789.1345370; Fri, 11 Apr 2025 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 1u3Jmd-00029D-OE; Fri, 11 Apr 2025 19:11:23 +0000
Received: by outflank-mailman (input) for mailman id 947789;
 Fri, 11 Apr 2025 19:11:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u3Jmb-00028t-Re
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 19:11:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3Jmb-008Yje-2e
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 19:11:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3Jmb-00G9Nu-2V
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 19: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=Yz1sMtH4L04ACvPvvQl0oiDAa9uCeF/TZ4EeeJavrA8=; b=F/whOE1oPKP5jDg2MFbBlvIg0a
	EW7D3lBQ+HvoihklGcWDSz/WDHikbVUkD/nDPAfuB6dCF+am5Is+REQgZ8sv975k/r23fkXTyyOvN
	GwSglGjKa9fHqiJdzGH/VRmTs13ArzgQmHGsqymRlsUJviB4xgXqtFCxyr7jZ+JVNTlY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] automation: update xilinx test scripts (tty)
Message-Id: <E1u3Jmb-00G9Nu-2V@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 19:11:21 +0000

commit 3e1a31e7d3ed9fc9719ab6f6381daa4f25609b72
Author:     Victor Lira <victorm.lira@amd.com>
AuthorDate: Fri Aug 23 15:29:04 2024 -0700
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 17:27:59 2025 +0100

    automation: update xilinx test scripts (tty)
    
    Update serial device names from ttyUSB* to test board specific names.
    
    Update xilinx-smoke-dom0-x86_64 with new Xen command line console options,
    which are now set as Gitlab CI/CD variables. Abstract the directory where
    binaries are stored. Increase the timeout to match new setup.
    
    Signed-off-by: Victor Lira <victorm.lira@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 95764a0817a51741b7ffb1f78cba2a19b08ab2d1)
    [Stripped down to xilinx-smoke-dom0less-arm64.sh only]
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/scripts/xilinx-smoke-dom0less-arm64.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/automation/scripts/xilinx-smoke-dom0less-arm64.sh b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
index 075305241c..d4bf19855a 100755
--- a/automation/scripts/xilinx-smoke-dom0less-arm64.sh
+++ b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
@@ -134,9 +134,10 @@ sleep 5
 cd $START
 
 # connect to serial
+SERIAL_DEV="/dev/serial/zynq"
 set +e
-stty -F /dev/ttyUSB0 115200
-timeout -k 1 120 nohup sh -c "cat /dev/ttyUSB0 | tee smoke.serial"
+stty -F ${SERIAL_DEV} 115200
+timeout -k 1 120 nohup sh -c "cat ${SERIAL_DEV} | tee smoke.serial"
 
 # stop the board
 cd /scratch/gitlab-runner
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 19:11:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 19:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947790.1345372 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3Jmn-0002Bt-SN; Fri, 11 Apr 2025 19:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947790.1345372; Fri, 11 Apr 2025 19: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 1u3Jmn-0002Bm-Pc; Fri, 11 Apr 2025 19:11:33 +0000
Received: by outflank-mailman (input) for mailman id 947790;
 Fri, 11 Apr 2025 19:11:31 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u3Jml-0002BQ-UK
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 19:11:31 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3Jml-008Yk4-2w
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 19:11:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3Jml-00G9UL-2p
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 19:11:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=PY/r5uwC+68VPl9+4VRJ1U4JSY2LiQf30cfKvrxA4Tw=; b=lpXDHTdwipM0Xhb/FjISHmi9QZ
	8Nv2R6We4qSxvcM7WkReOgk0xAHBRYDchN473GnicryYSPj0UzdBD78GG5bFFsdL607WkvS71oRyW
	KFudmVR6PihO9Eohsn27Dh0OewKmVrlKVIh/U6sbQAUeGKnnPj8Lz37uYSkAjxyaVAK0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] CI: Resync .cirrus.yml for FreeBSD testing
Message-Id: <E1u3Jml-00G9UL-2p@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 19:11:31 +0000

commit 09c0f1aabb32d978a2c6ad6ae1e764db58064229
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Apr 11 16:56:35 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 17:27:59 2025 +0100

    CI: Resync .cirrus.yml for FreeBSD testing
    
    Includes:
      commit 5395cd7b892d ("automation/cirrus-ci: update FreeBSD to 13.5")
      commit 850a263b7863 ("automation/cirrus-ci: update FreeBSD to 13.4")
      commit 0cc8845fb9fd ("CI: Update to FreeBSD 14.2")
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 .cirrus.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 0ec9586e2c..eb46227892 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -17,11 +17,11 @@ freebsd_template: &FREEBSD_TEMPLATE
 task:
   name: 'FreeBSD 13'
   freebsd_instance:
-    image_family: freebsd-13-3
+    image_family: freebsd-13-5
   << : *FREEBSD_TEMPLATE
 
 task:
   name: 'FreeBSD 14'
   freebsd_instance:
-    image_family: freebsd-14-1
+    image_family: freebsd-14-2
   << : *FREEBSD_TEMPLATE
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 19:11:43 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 19:11:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947791.1345376 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3Jmx-0002EH-UI; Fri, 11 Apr 2025 19:11:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947791.1345376; Fri, 11 Apr 2025 19: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 1u3Jmx-0002EA-RD; Fri, 11 Apr 2025 19:11:43 +0000
Received: by outflank-mailman (input) for mailman id 947791;
 Fri, 11 Apr 2025 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 1u3Jmw-0002E0-0t
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 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 1u3Jmv-008Yk8-3D
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 19:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3Jmv-00G9YZ-36
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 19:11:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=c/3XY/9VSwwj/bsmq6zUnNMeyGR2e4rYM4R4D2pQI84=; b=1Df8JAyfZzhVO2mHt/+K6HTocJ
	c5okqODfw6RDZ7l1fvu5qfqZSpfqocu9M8kDTcwEnVFkLXqssrNxihaQ29G9GrJkQ8k//CZO9XJKu
	qWrB+HQVSc14a5LC4rQzo3Bxlmlb9CNhb0j3UwdRKO6l/7j92x7+4RDmyIOOZRQ/2u9Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] xen/lib: Introduce SHA2-256
Message-Id: <E1u3Jmv-00G9YZ-36@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 19:11:41 +0000

commit ea0110cb3c49f351bdb39f8800fe421a22fc04ce
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Dec 13 14:34:00 2024 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 17:27:59 2025 +0100

    xen/lib: Introduce SHA2-256
    
    A future change will need to calculate SHA2-256 digests.  Introduce an
    implementation in lib/, derived from Trenchboot which itself is derived from
    Linux.
    
    In order to be useful to other architectures, it is careful with endianness
    and misaligned accesses as well as being more MISRA friendly, but is only
    wired up for x86 in the short term.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 372af524411f5a013bcb0b117073d8d07c026563)
    
    Xen: CI fix from XSN-2
    
     * Add U suffix to the K[] table to fix MISRA Rule 7.2 violations.
    
    Fixes: 372af524411f ("xen/lib: Introduce SHA2-256")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 15fe2eb5f1bac8a212c0ba3d6dfe60d1fdf851cf)
---
 xen/include/xen/sha2.h |  15 ++++
 xen/lib/Makefile       |   1 +
 xen/lib/sha2-256.c     | 216 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 232 insertions(+)

diff --git a/xen/include/xen/sha2.h b/xen/include/xen/sha2.h
new file mode 100644
index 0000000000..47d97fbf01
--- /dev/null
+++ b/xen/include/xen/sha2.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * SHA2-256: https://csrc.nist.gov/pubs/fips/180-2/upd1/final
+ */
+#ifndef XEN_SHA2_H
+#define XEN_SHA2_H
+
+#include <xen/types.h>
+
+#define SHA2_256_DIGEST_SIZE 32
+
+void sha2_256_digest(uint8_t digest[SHA2_256_DIGEST_SIZE],
+                     const void *msg, size_t len);
+
+#endif /* XEN_SHA2_H */
diff --git a/xen/lib/Makefile b/xen/lib/Makefile
index 2d9ebb945f..90766e37ce 100644
--- a/xen/lib/Makefile
+++ b/xen/lib/Makefile
@@ -13,6 +13,7 @@ lib-y += memset.o
 lib-y += muldiv64.o
 lib-y += parse-size.o
 lib-y += rbtree.o
+lib-$(CONFIG_X86) += sha2-256.o
 lib-y += sort.o
 lib-y += strcasecmp.o
 lib-y += strchr.o
diff --git a/xen/lib/sha2-256.c b/xen/lib/sha2-256.c
new file mode 100644
index 0000000000..cb02ec1857
--- /dev/null
+++ b/xen/lib/sha2-256.c
@@ -0,0 +1,216 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * SHA2-256: https://csrc.nist.gov/pubs/fips/180-2/upd1/final
+ *
+ * Originally derived from Linux.  Modified substantially to optimise for size
+ * and Xen's expected usecases.
+ */
+#include <xen/bitops.h>
+#include <xen/sha2.h>
+#include <xen/string.h>
+
+#include <asm/unaligned.h>
+
+struct sha2_256_state {
+    uint32_t state[SHA2_256_DIGEST_SIZE / sizeof(uint32_t)];
+    uint8_t buf[64];
+    size_t count; /* Byte count. */
+};
+
+static uint32_t choose(uint32_t x, uint32_t y, uint32_t z)
+{
+    return z ^ (x & (y ^ z));
+}
+
+static uint32_t majority(uint32_t x, uint32_t y, uint32_t z)
+{
+    return (x & y) | (z & (x | y));
+}
+
+static uint32_t e0(uint32_t x)
+{
+    return ror32(x, 2) ^ ror32(x, 13) ^ ror32(x, 22);
+}
+
+static uint32_t e1(uint32_t x)
+{
+    return ror32(x, 6) ^ ror32(x, 11) ^ ror32(x, 25);
+}
+
+static uint32_t s0(uint32_t x)
+{
+    return ror32(x, 7) ^ ror32(x, 18) ^ (x >> 3);
+}
+
+static uint32_t s1(uint32_t x)
+{
+    return ror32(x, 17) ^ ror32(x, 19) ^ (x >> 10);
+}
+
+static uint32_t blend(uint32_t W[16], unsigned int i)
+{
+#define W(i) W[(i) & 15]
+
+    return W(i) += s1(W(i - 2)) + W(i - 7) + s0(W(i - 15));
+
+#undef W
+}
+
+static const uint32_t K[] = {
+    0x428a2f98U, 0x71374491U, 0xb5c0fbcfU, 0xe9b5dba5U,
+    0x3956c25bU, 0x59f111f1U, 0x923f82a4U, 0xab1c5ed5U,
+    0xd807aa98U, 0x12835b01U, 0x243185beU, 0x550c7dc3U,
+    0x72be5d74U, 0x80deb1feU, 0x9bdc06a7U, 0xc19bf174U,
+    0xe49b69c1U, 0xefbe4786U, 0x0fc19dc6U, 0x240ca1ccU,
+    0x2de92c6fU, 0x4a7484aaU, 0x5cb0a9dcU, 0x76f988daU,
+    0x983e5152U, 0xa831c66dU, 0xb00327c8U, 0xbf597fc7U,
+    0xc6e00bf3U, 0xd5a79147U, 0x06ca6351U, 0x14292967U,
+    0x27b70a85U, 0x2e1b2138U, 0x4d2c6dfcU, 0x53380d13U,
+    0x650a7354U, 0x766a0abbU, 0x81c2c92eU, 0x92722c85U,
+    0xa2bfe8a1U, 0xa81a664bU, 0xc24b8b70U, 0xc76c51a3U,
+    0xd192e819U, 0xd6990624U, 0xf40e3585U, 0x106aa070U,
+    0x19a4c116U, 0x1e376c08U, 0x2748774cU, 0x34b0bcb5U,
+    0x391c0cb3U, 0x4ed8aa4aU, 0x5b9cca4fU, 0x682e6ff3U,
+    0x748f82eeU, 0x78a5636fU, 0x84c87814U, 0x8cc70208U,
+    0x90befffaU, 0xa4506cebU, 0xbef9a3f7U, 0xc67178f2U,
+};
+
+static void sha2_256_transform(uint32_t *state, const void *_input)
+{
+    const uint32_t *input = _input;
+    uint32_t a, b, c, d, e, f, g, h, t1, t2;
+    uint32_t W[16];
+    unsigned int i;
+
+    for ( i = 0; i < 16; i++ )
+        W[i] = get_unaligned_be32(&input[i]);
+
+    a = state[0]; b = state[1]; c = state[2]; d = state[3];
+    e = state[4]; f = state[5]; g = state[6]; h = state[7];
+
+    for ( i = 0; i < 16; i += 8 )
+    {
+        t1 = h + e1(e) + choose(e, f, g) + K[i + 0] + W[i + 0];
+        t2 = e0(a) + majority(a, b, c);    d += t1;    h = t1 + t2;
+        t1 = g + e1(d) + choose(d, e, f) + K[i + 1] + W[i + 1];
+        t2 = e0(h) + majority(h, a, b);    c += t1;    g = t1 + t2;
+        t1 = f + e1(c) + choose(c, d, e) + K[i + 2] + W[i + 2];
+        t2 = e0(g) + majority(g, h, a);    b += t1;    f = t1 + t2;
+        t1 = e + e1(b) + choose(b, c, d) + K[i + 3] + W[i + 3];
+        t2 = e0(f) + majority(f, g, h);    a += t1;    e = t1 + t2;
+        t1 = d + e1(a) + choose(a, b, c) + K[i + 4] + W[i + 4];
+        t2 = e0(e) + majority(e, f, g);    h += t1;    d = t1 + t2;
+        t1 = c + e1(h) + choose(h, a, b) + K[i + 5] + W[i + 5];
+        t2 = e0(d) + majority(d, e, f);    g += t1;    c = t1 + t2;
+        t1 = b + e1(g) + choose(g, h, a) + K[i + 6] + W[i + 6];
+        t2 = e0(c) + majority(c, d, e);    f += t1;    b = t1 + t2;
+        t1 = a + e1(f) + choose(f, g, h) + K[i + 7] + W[i + 7];
+        t2 = e0(b) + majority(b, c, d);    e += t1;    a = t1 + t2;
+    }
+
+    for ( ; i < 64; i += 8 )
+    {
+        t1 = h + e1(e) + choose(e, f, g) + K[i + 0] + blend(W, i + 0);
+        t2 = e0(a) + majority(a, b, c);    d += t1;    h = t1 + t2;
+        t1 = g + e1(d) + choose(d, e, f) + K[i + 1] + blend(W, i + 1);
+        t2 = e0(h) + majority(h, a, b);    c += t1;    g = t1 + t2;
+        t1 = f + e1(c) + choose(c, d, e) + K[i + 2] + blend(W, i + 2);
+        t2 = e0(g) + majority(g, h, a);    b += t1;    f = t1 + t2;
+        t1 = e + e1(b) + choose(b, c, d) + K[i + 3] + blend(W, i + 3);
+        t2 = e0(f) + majority(f, g, h);    a += t1;    e = t1 + t2;
+        t1 = d + e1(a) + choose(a, b, c) + K[i + 4] + blend(W, i + 4);
+        t2 = e0(e) + majority(e, f, g);    h += t1;    d = t1 + t2;
+        t1 = c + e1(h) + choose(h, a, b) + K[i + 5] + blend(W, i + 5);
+        t2 = e0(d) + majority(d, e, f);    g += t1;    c = t1 + t2;
+        t1 = b + e1(g) + choose(g, h, a) + K[i + 6] + blend(W, i + 6);
+        t2 = e0(c) + majority(c, d, e);    f += t1;    b = t1 + t2;
+        t1 = a + e1(f) + choose(f, g, h) + K[i + 7] + blend(W, i + 7);
+        t2 = e0(b) + majority(b, c, d);    e += t1;    a = t1 + t2;
+    }
+
+    state[0] += a; state[1] += b; state[2] += c; state[3] += d;
+    state[4] += e; state[5] += f; state[6] += g; state[7] += h;
+}
+
+static void sha2_256_init(struct sha2_256_state *s)
+{
+    *s = (struct sha2_256_state){
+        .state = {
+            0x6a09e667UL,
+            0xbb67ae85UL,
+            0x3c6ef372UL,
+            0xa54ff53aUL,
+            0x510e527fUL,
+            0x9b05688cUL,
+            0x1f83d9abUL,
+            0x5be0cd19UL,
+        },
+    };
+}
+
+static void sha2_256_update(struct sha2_256_state *s, const void *msg,
+                            size_t len)
+{
+    unsigned int partial = s->count & 63;
+
+    s->count += len;
+
+    if ( (partial + len) >= 64 )
+    {
+        if ( partial )
+        {
+            unsigned int rem = 64 - partial;
+
+            /* Fill the partial block. */
+            memcpy(s->buf + partial, msg, rem);
+            msg += rem;
+            len -= rem;
+
+            sha2_256_transform(s->state, s->buf);
+            partial = 0;
+        }
+
+        for ( ; len >= 64; msg += 64, len -= 64 )
+            sha2_256_transform(s->state, msg);
+    }
+
+    /* Remaining data becomes partial. */
+    memcpy(s->buf + partial, msg, len);
+}
+
+static void sha2_256_final(struct sha2_256_state *s, void *_dst)
+{
+    uint32_t *dst = _dst;
+    unsigned int i, partial = s->count & 63;
+
+    /* Start padding */
+    s->buf[partial++] = 0x80;
+
+    if ( partial > 56 )
+    {
+        /* Need one extra block - pad to 64 */
+        memset(s->buf + partial, 0, 64 - partial);
+        sha2_256_transform(s->state, s->buf);
+        partial = 0;
+    }
+    /* Pad to 56 */
+    memset(s->buf + partial, 0, 56 - partial);
+
+    /* Append the bit count */
+    put_unaligned_be64((uint64_t)s->count << 3, &s->buf[56]);
+    sha2_256_transform(s->state, s->buf);
+
+    /* Store state in digest */
+    for ( i = 0; i < 8; i++ )
+        put_unaligned_be32(s->state[i], &dst[i]);
+}
+
+void sha2_256_digest(uint8_t digest[SHA2_256_DIGEST_SIZE],
+                     const void *msg, size_t len)
+{
+    struct sha2_256_state s;
+
+    sha2_256_init(&s);
+    sha2_256_update(&s, msg, len);
+    sha2_256_final(&s, digest);
+}
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 19:11:53 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 19:11:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947792.1345381 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3Jn7-0002H4-0h; Fri, 11 Apr 2025 19:11:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947792.1345381; Fri, 11 Apr 2025 19:11: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 1u3Jn6-0002Gw-UJ; Fri, 11 Apr 2025 19:11:52 +0000
Received: by outflank-mailman (input) for mailman id 947792;
 Fri, 11 Apr 2025 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 1u3Jn6-0002Gq-4U
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 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 1u3Jn6-008YkC-0J
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 19:11:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3Jn6-00G9aZ-0C
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 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=jJoStaH5K1QmbvCeZt2/PL2bpK0xilvhCa1PzskK5X8=; b=MxF2QqE2rrnxuqhmTJCrGkKiRg
	gkVJm5pxPUikkQkhmmB5KN4Ge+EM40BIliRY5I5cnj7tLDDhH3gdzZ6dhwminihpq7qYCjXHn46Ui
	VMFGwJwIxZYhIieYiDBTSbYINCqPEikkUC/3VSb9jtt9xZvRtYfFOlD/rdkvlkVYZVGU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode
Message-Id: <E1u3Jn6-00G9aZ-0C@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 19:11:52 +0000

commit b2b0b4bce10445a0338ecb596cfb3c05838b483b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Dec 13 14:34:00 2024 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 17:27:59 2025 +0100

    x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode
    
    Collisions have been found in the microcode signing algorithm used by AMD
    Fam17h/19h CPUs, and now anyone can sign their own.
    
    For more details, see:
      https://bughunters.google.com/blog/5424842357473280/zen-and-the-art-of-microcode-hacking
      https://www.amd.com/en/resources/product-security/bulletin/amd-sb-7033.html
    
    As a stopgap mitigation, check the digest of patches against a table of blobs
    with known provenance.  These are all Fam17h and Fam19h blobs included in
    linux-firwmare at the time of writing, specifically:
    
      https://git.kernel.org/firmware/linux-firmware/c/48bb90cceb882cab8e9ab692bc5779d3bf3a13b8
    
    This checks can be opted out of by booting with ucode=no-digest-check, but
    doing so is not recommended.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 630e8875ab368b97cc7231aaf3809e3d7d5687e1)
    
    Xen: CI fix from XSN-2
    
     * Add cf_check annotation to cmp_patch_id() used by bsearch().
    
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 15fe2eb5f1bac8a212c0ba3d6dfe60d1fdf851cf)
---
 docs/misc/xen-command-line.pandoc              |  10 +-
 xen/arch/x86/cpu/microcode/amd-patch-digests.c | 226 +++++++++++++++++++++++++
 xen/arch/x86/cpu/microcode/amd.c               |  58 ++++++-
 xen/arch/x86/cpu/microcode/core.c              |  11 ++
 xen/arch/x86/cpu/microcode/private.h           |   2 +
 5 files changed, 304 insertions(+), 3 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 03346aeba5..14c0d0a058 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2641,10 +2641,10 @@ performance.
    Alternatively, selecting `tsx=1` will re-enable TSX at the users own risk.
 
 ### ucode
-> `= List of [ <integer> | scan=<bool>, nmi=<bool>, allow-same=<bool> ]`
+> `= List of [ <integer> | scan=<bool>, nmi=<bool>, allow-same=<bool>, digest-check=<bool> ]`
 
     Applicability: x86
-    Default: `nmi`
+    Default: `nmi,digest-check`
 
 Controls for CPU microcode loading. For early loading, this parameter can
 specify how and where to find the microcode update blob. For late loading,
@@ -2678,6 +2678,12 @@ trying to reload the same version.  Many CPUs will actually reload microcode
 of the same version, and this allows for easy testing of the late microcode
 loading path.
 
+The `digest-check=` option is active by default and controls whether to
+perform additional authenticity checks.  Collisions in the signature algorithm
+used by AMD Fam17h/19h processors have been found.  Xen contains a table of
+digests of microcode patches with known-good provenance, and will block
+loading of patches that do not match.
+
 ### unrestricted_guest (Intel)
 > `= <boolean>`
 
diff --git a/xen/arch/x86/cpu/microcode/amd-patch-digests.c b/xen/arch/x86/cpu/microcode/amd-patch-digests.c
new file mode 100644
index 0000000000..d327612267
--- /dev/null
+++ b/xen/arch/x86/cpu/microcode/amd-patch-digests.c
@@ -0,0 +1,226 @@
+/* Generated from linux-firmware. */
+{
+    .patch_id = 0x0800126f,
+    .digest = {
+        0x2b, 0x5a, 0xf2, 0x9c, 0xdd, 0xd2, 0x7f, 0xec,
+        0xec, 0x96, 0x09, 0x57, 0xb0, 0x96, 0x29, 0x8b,
+        0x2e, 0x26, 0x91, 0xf0, 0x49, 0x33, 0x42, 0x18,
+        0xdd, 0x4b, 0x65, 0x5a, 0xd4, 0x15, 0x3d, 0x33,
+    },
+},
+{
+    .patch_id = 0x0800820d,
+    .digest = {
+        0x68, 0x98, 0x83, 0xcd, 0x22, 0x0d, 0xdd, 0x59,
+        0x73, 0x2c, 0x5b, 0x37, 0x1f, 0x84, 0x0e, 0x67,
+        0x96, 0x43, 0x83, 0x0c, 0x46, 0x44, 0xab, 0x7c,
+        0x7b, 0x65, 0x9e, 0x57, 0xb5, 0x90, 0x4b, 0x0e,
+    },
+},
+{
+    .patch_id = 0x0830107c,
+    .digest = {
+        0x21, 0x64, 0xde, 0xfb, 0x9f, 0x68, 0x96, 0x47,
+        0x70, 0x5c, 0xe2, 0x8f, 0x18, 0x52, 0x6a, 0xac,
+        0xa4, 0xd2, 0x2e, 0xe0, 0xde, 0x68, 0x66, 0xc3,
+        0xeb, 0x1e, 0xd3, 0x3f, 0xbc, 0x51, 0x1d, 0x38,
+    },
+},
+{
+    .patch_id = 0x0860010d,
+    .digest = {
+        0x86, 0xb6, 0x15, 0x83, 0xbc, 0x3b, 0x9c, 0xe0,
+        0xb3, 0xef, 0x1d, 0x99, 0x84, 0x35, 0x15, 0xf7,
+        0x7c, 0x2a, 0xc6, 0x42, 0xdb, 0x73, 0x07, 0x5c,
+        0x7d, 0xc3, 0x02, 0xb5, 0x43, 0x06, 0x5e, 0xf8,
+    },
+},
+{
+    .patch_id = 0x08608108,
+    .digest = {
+        0x14, 0xfe, 0x57, 0x86, 0x49, 0xc8, 0x68, 0xe2,
+        0x11, 0xa3, 0xcb, 0x6e, 0xff, 0x6e, 0xd5, 0x38,
+        0xfe, 0x89, 0x1a, 0xe0, 0x67, 0xbf, 0xc4, 0xcc,
+        0x1b, 0x9f, 0x84, 0x77, 0x2b, 0x9f, 0xaa, 0xbd,
+    },
+},
+{
+    .patch_id = 0x08701034,
+    .digest = {
+        0xc3, 0x14, 0x09, 0xa8, 0x9c, 0x3f, 0x8d, 0x83,
+        0x9b, 0x4c, 0xa5, 0xb7, 0x64, 0x8b, 0x91, 0x5d,
+        0x85, 0x6a, 0x39, 0x26, 0x1e, 0x14, 0x41, 0xa8,
+        0x75, 0xea, 0xa6, 0xf9, 0xc9, 0xd1, 0xea, 0x2b,
+    },
+},
+{
+    .patch_id = 0x08a0000a,
+    .digest = {
+        0x73, 0x31, 0x26, 0x22, 0xd4, 0xf9, 0xee, 0x3c,
+        0x07, 0x06, 0xe7, 0xb9, 0xad, 0xd8, 0x72, 0x44,
+        0x33, 0x31, 0xaa, 0x7d, 0xc3, 0x67, 0x0e, 0xdb,
+        0x47, 0xb5, 0xaa, 0xbc, 0xf5, 0xbb, 0xd9, 0x20,
+    },
+},
+{
+    .patch_id = 0x0a00107a,
+    .digest = {
+        0x5f, 0x92, 0xca, 0xff, 0xc3, 0x59, 0x22, 0x5f,
+        0x02, 0xa0, 0x91, 0x3b, 0x4a, 0x45, 0x10, 0xfd,
+        0x19, 0xe1, 0x8a, 0x6d, 0x9a, 0x92, 0xc1, 0x3f,
+        0x75, 0x78, 0xac, 0x78, 0x03, 0x1d, 0xdb, 0x18,
+    },
+},
+{
+    .patch_id = 0x0a0011d5,
+    .digest = {
+        0xed, 0x69, 0x89, 0xf4, 0xeb, 0x64, 0xc2, 0x13,
+        0xe0, 0x51, 0x1f, 0x03, 0x26, 0x52, 0x7d, 0xb7,
+        0x93, 0x5d, 0x65, 0xca, 0xb8, 0x12, 0x1d, 0x62,
+        0x0d, 0x5b, 0x65, 0x34, 0x69, 0xb2, 0x62, 0x21,
+    },
+},
+{
+    .patch_id = 0x0a001238,
+    .digest = {
+        0x72, 0xf7, 0x4b, 0x0c, 0x7d, 0x58, 0x65, 0xcc,
+        0x00, 0xcc, 0x57, 0x16, 0x68, 0x16, 0xf8, 0x2a,
+        0x1b, 0xb3, 0x8b, 0xe1, 0xb6, 0x83, 0x8c, 0x7e,
+        0xc0, 0xcd, 0x33, 0xf2, 0x8d, 0xf9, 0xef, 0x59,
+    },
+},
+{
+    .patch_id = 0x0a00820c,
+    .digest = {
+        0xa8, 0x0c, 0x81, 0xc0, 0xa6, 0x00, 0xe7, 0xf3,
+        0x5f, 0x65, 0xd3, 0xb9, 0x6f, 0xea, 0x93, 0x63,
+        0xf1, 0x8c, 0x88, 0x45, 0xd7, 0x82, 0x80, 0xd1,
+        0xe1, 0x3b, 0x8d, 0xb2, 0xf8, 0x22, 0x03, 0xe2,
+    },
+},
+{
+    .patch_id = 0x0a101148,
+    .digest = {
+        0x20, 0xd5, 0x6f, 0x40, 0x4a, 0xf6, 0x48, 0x90,
+        0xc2, 0x93, 0x9a, 0xc2, 0xfd, 0xac, 0xef, 0x4f,
+        0xfa, 0xc0, 0x3d, 0x92, 0x3c, 0x6d, 0x01, 0x08,
+        0xf1, 0x5e, 0xb0, 0xde, 0xb4, 0x98, 0xae, 0xc4,
+    },
+},
+{
+    .patch_id = 0x0a101248,
+    .digest = {
+        0xed, 0x3b, 0x95, 0xa6, 0x68, 0xa7, 0x77, 0x3e,
+        0xfc, 0x17, 0x26, 0xe2, 0x7b, 0xd5, 0x56, 0x22,
+        0x2c, 0x1d, 0xef, 0xeb, 0x56, 0xdd, 0xba, 0x6e,
+        0x1b, 0x7d, 0x64, 0x9d, 0x4b, 0x53, 0x13, 0x75,
+    },
+},
+{
+    .patch_id = 0x0a108108,
+    .digest = {
+        0xed, 0xc2, 0xec, 0xa1, 0x15, 0xc6, 0x65, 0xe9,
+        0xd0, 0xef, 0x39, 0xaa, 0x7f, 0x55, 0x06, 0xc6,
+        0xf5, 0xd4, 0x3f, 0x7b, 0x14, 0xd5, 0x60, 0x2c,
+        0x28, 0x1e, 0x9c, 0x59, 0x69, 0x99, 0x4d, 0x16,
+    },
+},
+{
+    .patch_id = 0x0a20102d,
+    .digest = {
+        0xf9, 0x6e, 0xf2, 0x32, 0xd3, 0x0f, 0x5f, 0x11,
+        0x59, 0xa1, 0xfe, 0xcc, 0xcd, 0x9b, 0x42, 0x89,
+        0x8b, 0x89, 0x2f, 0xb5, 0xbb, 0x82, 0xef, 0x23,
+        0x8c, 0xe9, 0x19, 0x3e, 0xcc, 0x3f, 0x7b, 0xb4,
+    },
+},
+{
+    .patch_id = 0x0a201210,
+    .digest = {
+        0xe8, 0x6d, 0x51, 0x6a, 0x8e, 0x72, 0xf3, 0xfe,
+        0x6e, 0x16, 0xbc, 0x62, 0x59, 0x40, 0x17, 0xe9,
+        0x6d, 0x3d, 0x0e, 0x6b, 0xa7, 0xac, 0xe3, 0x68,
+        0xf7, 0x55, 0xf0, 0x13, 0xbb, 0x22, 0xf6, 0x41,
+    },
+},
+{
+    .patch_id = 0x0a404107,
+    .digest = {
+        0xbb, 0x04, 0x4e, 0x47, 0xdd, 0x5e, 0x26, 0x45,
+        0x1a, 0xc9, 0x56, 0x24, 0xa4, 0x4c, 0x82, 0xb0,
+        0x8b, 0x0d, 0x9f, 0xf9, 0x3a, 0xdf, 0xc6, 0x81,
+        0x13, 0xbc, 0xc5, 0x25, 0xe4, 0xc5, 0xc3, 0x99,
+    },
+},
+{
+    .patch_id = 0x0a500011,
+    .digest = {
+        0x23, 0x3d, 0x70, 0x7d, 0x03, 0xc3, 0xc4, 0xf4,
+        0x2b, 0x82, 0xc6, 0x05, 0xda, 0x80, 0x0a, 0xf1,
+        0xd7, 0x5b, 0x65, 0x3a, 0x7d, 0xab, 0xdf, 0xa2,
+        0x11, 0x5e, 0x96, 0x7e, 0x71, 0xe9, 0xfc, 0x74,
+    },
+},
+{
+    .patch_id = 0x0a601209,
+    .digest = {
+        0x66, 0x48, 0xd4, 0x09, 0x05, 0xcb, 0x29, 0x32,
+        0x66, 0xb7, 0x9a, 0x76, 0xcd, 0x11, 0xf3, 0x30,
+        0x15, 0x86, 0xcc, 0x5d, 0x97, 0x0f, 0xc0, 0x46,
+        0xe8, 0x73, 0xe2, 0xd6, 0xdb, 0xd2, 0x77, 0x1d,
+    },
+},
+{
+    .patch_id = 0x0a704107,
+    .digest = {
+        0xf3, 0xc6, 0x58, 0x26, 0xee, 0xac, 0x3f, 0xd6,
+        0xce, 0xa1, 0x72, 0x47, 0x3b, 0xba, 0x2b, 0x93,
+        0x2a, 0xad, 0x8e, 0x6b, 0xea, 0x9b, 0xb7, 0xc2,
+        0x64, 0x39, 0x71, 0x8c, 0xce, 0xe7, 0x41, 0x39,
+    },
+},
+{
+    .patch_id = 0x0a705206,
+    .digest = {
+        0x8d, 0xc0, 0x76, 0xbd, 0x58, 0x9f, 0x8f, 0xa4,
+        0x12, 0x9d, 0x21, 0xfb, 0x48, 0x21, 0xbc, 0xe7,
+        0x67, 0x6f, 0x04, 0x18, 0xae, 0x20, 0x87, 0x4b,
+        0x03, 0x35, 0xe9, 0xbe, 0xfb, 0x06, 0xdf, 0xfc,
+    },
+},
+{
+    .patch_id = 0x0a708007,
+    .digest = {
+        0x6b, 0x76, 0xcc, 0x78, 0xc5, 0x8a, 0xa3, 0xe3,
+        0x32, 0x2d, 0x79, 0xe4, 0xc3, 0x80, 0xdb, 0xb2,
+        0x07, 0xaa, 0x3a, 0xe0, 0x57, 0x13, 0x72, 0x80,
+        0xdf, 0x92, 0x73, 0x84, 0x87, 0x3c, 0x73, 0x93,
+    },
+},
+{
+    .patch_id = 0x0a70c005,
+    .digest = {
+        0x88, 0x5d, 0xfb, 0x79, 0x64, 0xd8, 0x46, 0x3b,
+        0x4a, 0x83, 0x8e, 0x77, 0x7e, 0xcf, 0xb3, 0x0f,
+        0x1f, 0x1f, 0xf1, 0x97, 0xeb, 0xfe, 0x56, 0x55,
+        0xee, 0x49, 0xac, 0xe1, 0x8b, 0x13, 0xc5, 0x13,
+    },
+},
+{
+    .patch_id = 0x0aa00116,
+    .digest = {
+        0xe8, 0x4c, 0x2c, 0x88, 0xa1, 0xac, 0x24, 0x63,
+        0x65, 0xe5, 0xaa, 0x2d, 0x16, 0xa9, 0xc3, 0xf5,
+        0xfe, 0x1d, 0x5e, 0x65, 0xc7, 0xaa, 0x92, 0x4d,
+        0x91, 0xee, 0x76, 0xbb, 0x4c, 0x66, 0x78, 0xc9,
+    },
+},
+{
+    .patch_id = 0x0aa00215,
+    .digest = {
+        0x55, 0xd3, 0x28, 0xcb, 0x87, 0xa9, 0x32, 0xe9,
+        0x4e, 0x85, 0x4b, 0x7c, 0x6b, 0xd5, 0x7c, 0xd4,
+        0x1b, 0x51, 0x71, 0x3a, 0x0e, 0x0b, 0xdc, 0x9b,
+        0x68, 0x2f, 0x46, 0xee, 0xfe, 0xc6, 0x6d, 0xef,
+    },
+},
diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 7c459b86c6..b5c2a55b26 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -16,7 +16,9 @@
 
 #include <xen/err.h>
 #include <xen/init.h>
+#include <xen/lib.h>
 #include <xen/mm.h> /* TODO: Fix asm/tlbflush.h breakage */
+#include <xen/sha2.h>
 
 #include <asm/msr.h>
 
@@ -91,6 +93,59 @@ static struct {
     uint16_t id;
 } equiv __read_mostly;
 
+static const struct patch_digest {
+    uint32_t patch_id;
+    uint8_t digest[SHA2_256_DIGEST_SIZE];
+} patch_digests[] = {
+#include "amd-patch-digests.c"
+};
+
+static int cf_check cmp_patch_id(const void *key, const void *elem)
+{
+    const struct patch_digest *pd = elem;
+    uint32_t patch_id = *(uint32_t *)key;
+
+    if ( patch_id == pd->patch_id )
+        return 0;
+    else if ( patch_id < pd->patch_id )
+        return -1;
+    return 1;
+}
+
+static bool check_digest(const struct container_microcode *mc)
+{
+    const struct microcode_patch *patch = mc->patch;
+    const struct patch_digest *pd;
+    uint8_t digest[SHA2_256_DIGEST_SIZE];
+
+    /* Only Fam17h/19h are known to need extra checks.  Skip other families. */
+    if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x19 ||
+         !opt_digest_check )
+        return true;
+
+    pd = bsearch(&patch->patch_id, patch_digests, ARRAY_SIZE(patch_digests),
+                 sizeof(struct patch_digest), cmp_patch_id);
+    if ( !pd )
+    {
+        printk(XENLOG_WARNING "No digest found for patch_id %08x\n",
+               patch->patch_id);
+        return false;
+    }
+
+    sha2_256_digest(digest, patch, mc->len);
+
+    if ( memcmp(digest, pd->digest, sizeof(digest)) )
+    {
+        printk(XENLOG_WARNING "Patch %08x SHA256 mismatch:\n"
+               "  expected %" STR(SHA2_256_DIGEST_SIZE) "phN\n"
+               "       got %" STR(SHA2_256_DIGEST_SIZE) "phN\n",
+               patch->patch_id, pd->digest, digest);
+        return false;
+    }
+
+    return true;
+}
+
 static void cf_check collect_cpu_info(void)
 {
     struct cpu_signature *csig = &this_cpu(cpu_sig);
@@ -394,7 +449,8 @@ static struct microcode_patch *cf_check cpu_request_microcode(
              * one with higher revision.
              */
             if ( (microcode_fits(mc->patch) != MIS_UCODE) &&
-                 (!saved || (compare_header(mc->patch, saved) == NEW_UCODE)) )
+                 (!saved || (compare_header(mc->patch, saved) == NEW_UCODE)) &&
+                 check_digest(mc) )
             {
                 saved = mc->patch;
                 saved_size = mc->len;
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 2ee0db5b21..fa92355a7e 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -99,6 +99,7 @@ static bool_t __initdata ucode_scan;
 static bool ucode_in_nmi = true;
 
 bool __read_mostly opt_ucode_allow_same;
+bool __ro_after_init opt_digest_check = true;
 
 /* Protected by microcode_mutex */
 static struct microcode_patch *microcode_cache;
@@ -128,6 +129,8 @@ static int __init cf_check parse_ucode(const char *s)
             ucode_in_nmi = val;
         else if ( (val = parse_boolean("allow-same", s, ss)) >= 0 )
             opt_ucode_allow_same = val;
+        else if ( (val = parse_boolean("digest-check", s, ss)) >= 0 )
+            opt_digest_check = val;
         else if ( !ucode_mod_forced ) /* Not forced by EFI */
         {
             if ( (val = parse_boolean("scan", s, ss)) >= 0 )
@@ -867,6 +870,14 @@ int __init early_microcode_init(unsigned long *module_map,
     switch ( c->x86_vendor )
     {
     case X86_VENDOR_AMD:
+        if ( !opt_digest_check &&
+             boot_cpu_data.x86 >= 0x17 && boot_cpu_data.x86 <= 0x19 )
+        {
+            printk(XENLOG_WARNING
+                   "Microcode patch additional digest checks disabled");
+            add_taint(TAINT_CPU_OUT_OF_SPEC);
+        }
+
         if ( c->x86 >= 0x10 )
         {
             ucode_ops = amd_ucode_ops;
diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h
index d80787205a..158cbda9cc 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -60,6 +60,8 @@ struct microcode_ops {
         const struct microcode_patch *new, const struct microcode_patch *old);
 };
 
+extern bool opt_digest_check;
+
 /**
  * Checks whether we can perform microcode updates on this Intel system
  *
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 19:12:03 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 19:12:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.947793.1345385 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3JnH-0002Js-26; Fri, 11 Apr 2025 19:12:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 947793.1345385; Fri, 11 Apr 2025 19: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 1u3JnG-0002Jk-Vo; Fri, 11 Apr 2025 19:12:02 +0000
Received: by outflank-mailman (input) for mailman id 947793;
 Fri, 11 Apr 2025 19: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 1u3JnG-0002JX-7O
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 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 1u3JnG-008Ykb-0e
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 19:12:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3JnG-00G9hp-0U
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 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=jMfv/0gfU3RT2ENnBkypWaRx90iYurCliIL++pr5f+Y=; b=XDhn9hmj69TEtZnPjNFoUqcQ2r
	2Cagn9gZ+osfkdTbi37KUMpmuxHGVompmzteTw5leZFCAjdplovyvkFWP/0vI4/uEvtrGvyQLNRNQ
	+9BYEni1oSstWR46zRxpAm0MloB9YWyATJ9sJRywgQyIVi7gxBX9BEuJ0i0V5T6YxzBo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] x86/ucode: Extend AMD digest checks to cover Zen5 CPUs
Message-Id: <E1u3JnG-00G9hp-0U@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 19:12:02 +0000

commit 0b999cf7e7b5e857e20aee977cfd147925c34066
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 8 17:09:15 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 17:27:59 2025 +0100

    x86/ucode: Extend AMD digest checks to cover Zen5 CPUs
    
    AMD have updated the SB-7033 advisory to include Zen5 CPUs.  Extend the digest
    check to cover Zen5 too.
    
    In practice, cover everything until further notice.
    
    Observant readers may be wondering where the update to the digest list is.  At
    the time of writing, no Zen5 patches are available via a verifiable channel.
    
    Link: https://www.amd.com/en/resources/product-security/bulletin/amd-sb-7033.html
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit b63951467e964bcc927f823fc943e40069fac0c9)
    
    x86/ucode: Extend warning about disabling digest check too
    
    This was missed by accident.
    
    Fixes: b63951467e96 ("x86/ucode: Extend AMD digest checks to cover Zen5 CPUs")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 59bb316ea89e7f9461690fe00547d7d2af96321d)
---
 xen/arch/x86/cpu/microcode/amd.c  | 8 ++++++--
 xen/arch/x86/cpu/microcode/core.c | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index b5c2a55b26..48466403ba 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -118,8 +118,12 @@ static bool check_digest(const struct container_microcode *mc)
     const struct patch_digest *pd;
     uint8_t digest[SHA2_256_DIGEST_SIZE];
 
-    /* Only Fam17h/19h are known to need extra checks.  Skip other families. */
-    if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x19 ||
+    /*
+     * Zen1 thru Zen5 CPUs are known to use a weak signature algorithm on
+     * microcode updates.  Mitigate by checking the digest of the patch
+     * against a list of known provenance.
+     */
+    if ( boot_cpu_data.x86 < 0x17 ||
          !opt_digest_check )
         return true;
 
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index fa92355a7e..fce38404d5 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -871,7 +871,7 @@ int __init early_microcode_init(unsigned long *module_map,
     {
     case X86_VENDOR_AMD:
         if ( !opt_digest_check &&
-             boot_cpu_data.x86 >= 0x17 && boot_cpu_data.x86 <= 0x19 )
+             boot_cpu_data.x86 >= 0x17 )
         {
             printk(XENLOG_WARNING
                    "Microcode patch additional digest checks disabled");
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 22:44:08 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 22:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.948034.1345559 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3N6S-00048t-4D; Fri, 11 Apr 2025 22:44:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 948034.1345559; Fri, 11 Apr 2025 22: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 1u3N6S-00048l-1V; Fri, 11 Apr 2025 22:44:04 +0000
Received: by outflank-mailman (input) for mailman id 948034;
 Fri, 11 Apr 2025 22: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 1u3N6Q-00048d-JM
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 22: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 1u3N6Q-008deF-1J
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 22:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3N6Q-001Pse-18
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 22: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=tLsm5lESsPScbZaVkj12Rd7G3dICRBNthhFr39i14wU=; b=g+jv7o/zBsrcHrbQDkKf65kmOU
	ChIWv+xyUeA5lBg69Rm268oVyGTgSKP07opXO3rIZ2K9DNi82JjC+vmm9wfPGIBsW5LwsrdwiQC4m
	ukC6IfylYIXXVXMzpGbP4/wsosNTR0TViz8Dbfn1VuGQSK0ZwqAfYHuFwNGqCtPNPEQs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: wait for Xen to start before waiting for test to complete
Message-Id: <E1u3N6Q-001Pse-18@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 22:44:02 +0000

commit 7c96a27e375d8d7cbbb5493ebef0e29f90bfd273
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Fri Apr 11 22:32:13 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 22:07:57 2025 +0100

    CI: wait for Xen to start before waiting for test to complete
    
    Add additional stage in console output parsing - wait for first message
    from Xen. The message is defined via BOOT_MSG variable. This has two
    effects:
    - distinguishes failing Xen to load at all from later test failures
    - resets timeout when Xen starts loading
    
    The latter is especially relevant for hardware tests where firmware +
    network boot may take some time before Xen starts booting. The two-stage
    timeout is more robust solution than increasing the overall timeout.
    The issue has been observed on some dom0pvh-hvm jobs, at least on
    runners hw3 and hw11. This patch is a first stage before qubes-x86-64.sh
    is switched to use expect in the next stage.
    
    While at it, consistently use 'expect -re' for all matches. This
    especially allows matching newlines ("\n"), which will become relevant
    in the next patch. And document variables used in console.exp.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/scripts/console.exp                    | 27 ++++++++++++++++++-----
 automation/scripts/qemu-alpine-x86_64.sh          |  1 +
 automation/scripts/qemu-smoke-dom0-arm32.sh       |  1 +
 automation/scripts/qemu-smoke-dom0-arm64.sh       |  1 +
 automation/scripts/qemu-smoke-dom0less-arm32.sh   |  1 +
 automation/scripts/qemu-xtf-dom0less-arm64.sh     |  1 +
 automation/scripts/xilinx-smoke-dom0-x86_64.sh    |  1 +
 automation/scripts/xilinx-smoke-dom0less-arm64.sh |  1 +
 8 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/automation/scripts/console.exp b/automation/scripts/console.exp
index 31ce97b91b..c27f893dfb 100755
--- a/automation/scripts/console.exp
+++ b/automation/scripts/console.exp
@@ -1,4 +1,17 @@
 #!/usr/bin/env expect
+#
+# Variables used by this script:
+# - TEST_TIMEOUT: timeout between each *_MSG match
+# - TEST_TIMEOUT_OVERRIDE: when set, overrides TEST_TIMEOUT
+# - TEST_LOG: save console log to this file
+# - TEST_CMD: commands that prints test system console output to stdout - in
+#   qemu tests that's usually qemu itself (with -serial stdio), in hardware
+#   tests that's a command to read serial console
+# - UBOOT_CMD (optional): command to enter at u-boot prompt
+# - BOOT_MSG (optional): initial Xen message to wait for (aka sign-of-life)
+# - LOG_MSG (optional): final console message to wait for
+# - PASSED: message to look for to consider test a success; if LOG_MSG is set,
+#   both LOG_MSG and PASSED must appear (in any order) for test to succeed
 
 if {[info exists env(TEST_TIMEOUT_OVERRIDE)]} {
     set timeout $env(TEST_TIMEOUT_OVERRIDE)
@@ -28,21 +41,25 @@ if {[info exists env(UBOOT_CMD)]} {
     send "$env(UBOOT_CMD)\r"
 }
 
+if {[info exists env(BOOT_MSG)]} {
+    expect -re "$env(BOOT_MSG)"
+}
+
 if {[info exists env(LOG_MSG)]} {
     expect {
-        "$env(PASSED)" {
-            expect "$env(LOG_MSG)"
+        -re "$env(PASSED)" {
+            expect -re "$env(LOG_MSG)"
             exit 0
         }
-        "$env(LOG_MSG)" {
-            expect "$env(PASSED)"
+        -re "$env(LOG_MSG)" {
+            expect -re "$env(PASSED)"
             exit 0
         }
     }
 }
 
 expect {
-    "$env(PASSED)" {
+    -re "$env(PASSED)" {
         exit 0
     }
 }
diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
index 17e2141d62..89bdb4df7d 100755
--- a/automation/scripts/qemu-alpine-x86_64.sh
+++ b/automation/scripts/qemu-alpine-x86_64.sh
@@ -85,6 +85,7 @@ export TEST_CMD="qemu-system-x86_64 \
     -netdev user,id=n0,tftp=binaries,bootfile=/pxelinux.0"
 
 export TEST_LOG="smoke.serial"
+export BOOT_MSG="Latest ChangeSet: "
 export LOG_MSG="Domain-0"
 export PASSED="BusyBox"
 
diff --git a/automation/scripts/qemu-smoke-dom0-arm32.sh b/automation/scripts/qemu-smoke-dom0-arm32.sh
index 0c60a66e25..4f50eabdef 100755
--- a/automation/scripts/qemu-smoke-dom0-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm32.sh
@@ -92,6 +92,7 @@ export TEST_CMD="./qemu-system-arm \
 
 export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
 export TEST_LOG="${serial_log}"
+export BOOT_MSG="Latest ChangeSet: "
 export LOG_MSG="Domain-0"
 export PASSED="/ #"
 
diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
index 8774a87012..51d037b000 100755
--- a/automation/scripts/qemu-smoke-dom0-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
@@ -104,6 +104,7 @@ export TEST_CMD="./binaries/qemu-system-aarch64 \
     -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"
 
 export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
+export BOOT_MSG="Latest ChangeSet: "
 export TEST_LOG="smoke.serial"
 export LOG_MSG="Domain-0"
 export PASSED="BusyBox"
diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh b/automation/scripts/qemu-smoke-dom0less-arm32.sh
index 0c94e662aa..0e2c5496db 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
@@ -144,6 +144,7 @@ export TEST_CMD="./qemu-system-arm \
     -bios /usr/lib/u-boot/qemu_arm/u-boot.bin"
 
 export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
+export BOOT_MSG="Latest ChangeSet: "
 export TEST_LOG="${serial_log}"
 export LOG_MSG="${dom0_prompt}"
 export PASSED="${passed}"
diff --git a/automation/scripts/qemu-xtf-dom0less-arm64.sh b/automation/scripts/qemu-xtf-dom0less-arm64.sh
index 9608de6ec0..436f460c3c 100755
--- a/automation/scripts/qemu-xtf-dom0less-arm64.sh
+++ b/automation/scripts/qemu-xtf-dom0less-arm64.sh
@@ -61,6 +61,7 @@ export TEST_CMD="./binaries/qemu-system-aarch64 \
     -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"
 
 export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
+export BOOT_MSG="Latest ChangeSet: "
 export TEST_LOG="smoke.serial"
 export PASSED="${passed}"
 
diff --git a/automation/scripts/xilinx-smoke-dom0-x86_64.sh b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
index 7834ffbe05..69caabe2d8 100755
--- a/automation/scripts/xilinx-smoke-dom0-x86_64.sh
+++ b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
@@ -159,6 +159,7 @@ stty -F ${SERIAL_DEV} 57600
 
 # Capture test result and power off board before exiting.
 export PASSED="${PASS_MSG}"
+export BOOT_MSG="Latest ChangeSet: "
 export TEST_CMD="cat ${SERIAL_DEV}"
 export TEST_LOG="smoke.serial"
 
diff --git a/automation/scripts/xilinx-smoke-dom0less-arm64.sh b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
index b24ad11b8c..3e1fcf6bf9 100755
--- a/automation/scripts/xilinx-smoke-dom0less-arm64.sh
+++ b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
@@ -140,6 +140,7 @@ stty -F ${SERIAL_DEV} 115200
 
 # Capture test result and power off board before exiting.
 export PASSED="${passed}"
+export BOOT_MSG="Latest ChangeSet: "
 export LOG_MSG="Welcome to Alpine Linux"
 export TEST_CMD="cat ${SERIAL_DEV}"
 export TEST_LOG="smoke.serial"
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 22:44:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 22:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.948035.1345564 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3N6c-0004BI-7a; Fri, 11 Apr 2025 22:44:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 948035.1345564; Fri, 11 Apr 2025 22: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 1u3N6c-0004BA-4B; Fri, 11 Apr 2025 22:44:14 +0000
Received: by outflank-mailman (input) for mailman id 948035;
 Fri, 11 Apr 2025 22: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 1u3N6a-0004At-H5
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 22: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 1u3N6a-008deL-1c
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 22:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3N6a-001PxQ-1U
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 22: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=a4snBqLkqykISbAdltLirbt/TH8OG05fqY0ncmWnsyE=; b=xiOgtH496L2UVwvj3hsDQ/h8Hi
	f1cR5bC6beK1OtJVIfeSv60QKsFYxx9ap5BWqlMWGbJjS3K4i9Se5axj5BFiwZpVN9QjD0ZS7ZBiC
	DJq4kkqWZWYVsnf0+HVGphkmTBEVckNWOfBSvnu3xTtHgCBEujNuN9yjZ63IPDTkPLf4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: fix waiting for final test message
Message-Id: <E1u3N6a-001PxQ-1U@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 22:44:12 +0000

commit 1e12cbd6af2c92e61a1363ef208f71da1eae47ab
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Fri Apr 11 22:32:14 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 22:07:57 2025 +0100

    CI: fix waiting for final test message
    
    Expect normally discards initial part of its buffer after matching the
    patter, before looking for the next one. If both PASSED and LOG_MSG
    happen to be in the buffer at the same time, depending on their order,
    only one will be matched and the waiting for the other will timeout.
    Example expect -d output of this happening (parts eclipsed for brevity):
    
        expect: does "\r\r\r\nWelcome to Alpine Linux 3.18\r\r\r\n...\r\r\r\r\n(domU) + echo 'pci test passed'\r\r\r\r\n(domU) pci test passed\r\r\r\r..." (spawn_id exp4) match regular expression "pci test passed"? Gate "pci test passed"? gate=yes re=yes
        ...
        Gate keeper glob pattern for '\nWelcome to Alpine Linux' is '
        Welcome to Alpine Linux'. Activating booster.
        expect: does "'\r\r\r\r\n(domU) pci test passed\r\r\r\r\n(domU)  [ ok ]\r\r\r\r\n(domU)  [ ok ]\r\r\r\r\n(domU) \r\r\r\r\r\n(domU) domU Welcome to Alpine Linux 3.18\r\r\r\r\n(domU) \rKernel 6.6.56 on an x86_64 (/dev/hvc0)\r\r\r\r\n(domU) \r\r\r\r\r\n" (spawn_id exp4) match regular expression "\nWelcome to Alpine Linux"? Gate "\nWelcome to Alpine Linux"? gate=no
    
    Fix this by using -notransfer flag to keep matched part in the buffer.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citix.com>
---
 automation/scripts/console.exp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/automation/scripts/console.exp b/automation/scripts/console.exp
index c27f893dfb..834a08db1b 100755
--- a/automation/scripts/console.exp
+++ b/automation/scripts/console.exp
@@ -48,11 +48,11 @@ if {[info exists env(BOOT_MSG)]} {
 if {[info exists env(LOG_MSG)]} {
     expect {
         -re "$env(PASSED)" {
-            expect -re "$env(LOG_MSG)"
+            expect -notransfer -re "$env(LOG_MSG)"
             exit 0
         }
         -re "$env(LOG_MSG)" {
-            expect -re "$env(PASSED)"
+            expect -notransfer -re "$env(PASSED)"
             exit 0
         }
     }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 11 22:44:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Apr 2025 22:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.948036.1345566 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3N6m-0004E2-8A; Fri, 11 Apr 2025 22:44:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 948036.1345566; Fri, 11 Apr 2025 22: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 1u3N6m-0004Du-5c; Fri, 11 Apr 2025 22:44:24 +0000
Received: by outflank-mailman (input) for mailman id 948036;
 Fri, 11 Apr 2025 22: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 1u3N6k-0004Dg-MS
 for xen-changelog@lists.xenproject.org; Fri, 11 Apr 2025 22: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 1u3N6k-008deP-1x
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 22:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3N6k-001Q1k-1n
 for xen-changelog@lists.xenproject.org;
 Fri, 11 Apr 2025 22: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=9YCTknD/GPj0fjBphh3nG8LMK2NsrHPN3QPcdXKnv/E=; b=tfO1Oep2MpzpcaL/PdMfD9LNVj
	cRd7T2SXXYPmPLRtEdZeHyTlxeafkL+OCMGkb8LbZb3Oapl8JKhp03+3gpP1h96NRWznC1SZKem4+
	bvrrvAQhvKAH+zbrGSu3iPpNc/acNP0GVQ3rIc4MWBOHk7pS72wuuDXPIBmyJpWSyWUc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: switch qubes runners to use console.exp
Message-Id: <E1u3N6k-001Q1k-1n@xenbits.xenproject.org>
Date: Fri, 11 Apr 2025 22:44:22 +0000

commit d604d774a24bae21e15c831e172455bd4600663d
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Fri Apr 11 22:32:15 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 22:07:57 2025 +0100

    CI: switch qubes runners to use console.exp
    
    It appears as sometimes it takes more time for Xen even start booting,
    mostly due to firmware and fetching large boot files by grub. In some
    jobs the current timeout is pretty close to the actual time needed, and
    sometimes (rarely for now) test fails due to timeout expiring in the
    middle of dom0 booting. This will be happening more often if the
    initramfs will grow (and with more complex tests).
    This has been observed on some dom0pvh-hvm jobs, at least on runners hw3
    and hw11.
    
    Switch to using expect (console.exp) for more robust test output
    handling. This allows waiting separately for Xen starting to boot and
    then for the test to complete. For now, set both of those to 120s, which
    pessimistically bumps timeout for the whole test to 240s (from 120s).
    
    Add S3 handling to console.exp via SUSPEND_MSG + WAKEUP_CMD.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 automation/build/alpine/3.18-arm64v8.dockerfile |  1 +
 automation/scripts/console.exp                  | 13 +++++++
 automation/scripts/qubes-x86-64.sh              | 52 +++++++------------------
 3 files changed, 27 insertions(+), 39 deletions(-)

diff --git a/automation/build/alpine/3.18-arm64v8.dockerfile b/automation/build/alpine/3.18-arm64v8.dockerfile
index 19fe46f841..b8482d5bf4 100644
--- a/automation/build/alpine/3.18-arm64v8.dockerfile
+++ b/automation/build/alpine/3.18-arm64v8.dockerfile
@@ -48,3 +48,4 @@ RUN apk --no-cache add \
   # qubes test deps
   openssh-client \
   fakeroot \
+  expect \
diff --git a/automation/scripts/console.exp b/automation/scripts/console.exp
index 834a08db1b..bdb1dd9820 100755
--- a/automation/scripts/console.exp
+++ b/automation/scripts/console.exp
@@ -9,6 +9,10 @@
 #   tests that's a command to read serial console
 # - UBOOT_CMD (optional): command to enter at u-boot prompt
 # - BOOT_MSG (optional): initial Xen message to wait for (aka sign-of-life)
+# - SUSPEND_MSG (optional): message signaling system is going to sleep, it's
+#   trigger for WAKEUP_CMD (see below)
+# - WAKEUP_CMD (optional): command to execute to wakeup the system 30s after
+#   seeing SUSPEND_MSG
 # - LOG_MSG (optional): final console message to wait for
 # - PASSED: message to look for to consider test a success; if LOG_MSG is set,
 #   both LOG_MSG and PASSED must appear (in any order) for test to succeed
@@ -45,6 +49,15 @@ if {[info exists env(BOOT_MSG)]} {
     expect -re "$env(BOOT_MSG)"
 }
 
+if {[info exists env(WAKEUP_CMD)]} {
+    expect -re "$env(SUSPEND_MSG)"
+
+    # keep it suspended a bit, then wakeup
+    sleep 30
+
+    system "$env(WAKEUP_CMD)"
+}
+
 if {[info exists env(LOG_MSG)]} {
     expect {
         -re "$env(PASSED)" {
diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index a964ac4b7a..861e302d84 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-set -ex
+set -ex -o pipefail
 
 # One of:
 #  - ""             PV dom0,  PVH domU
@@ -267,52 +267,26 @@ cp -f binaries/xen $TFTP/xen
 cp -f binaries/bzImage $TFTP/vmlinuz
 cp -f binaries/dom0-rootfs.cpio.gz $TFTP/initrd-dom0
 
-# start logging the serial; this gives interactive console, don't close its
-# stdin to not close it; the 'cat' is important, plain redirection would hang
-# until somebody opens the pipe; opening and closing the pipe is used to close
-# the console
-mkfifo /tmp/console-stdin
-cat /tmp/console-stdin |\
-ssh $CONTROLLER console | tee smoke.serial | sed 's/\r//' &
-
 # start the system pointing at gitlab-ci predefined config
 ssh $CONTROLLER gitlabci poweron
-trap "ssh $CONTROLLER poweroff; : > /tmp/console-stdin" EXIT
+trap "ssh $CONTROLLER poweroff" EXIT
 
 if [ -n "$wait_and_wakeup" ]; then
-    # wait for suspend or a timeout
-    until grep "$wait_and_wakeup" smoke.serial || [ $timeout -le 0 ]; do
-        sleep 1;
-        : $((--timeout))
-    done
-    if [ $timeout -le 0 ]; then
-        echo "ERROR: suspend timeout, aborting"
-        exit 1
-    fi
-    # keep it suspended a bit, then wakeup
-    sleep 30
-    ssh $CONTROLLER wake
+    export SUSPEND_MSG="$wait_and_wakeup"
+    export WAKEUP_CMD="ssh $CONTROLLER wake"
 fi
 
-set +x
-until grep "^Welcome to Alpine Linux" smoke.serial || [ $timeout -le 0 ]; do
-    sleep 1;
-    : $((--timeout))
-done
-set -x
-
-tail -n 100 smoke.serial
-
-if [ $timeout -le 0 ]; then
-    echo "ERROR: test timeout, aborting"
-    exit 1
-fi
+export PASSED="${passed}"
+export BOOT_MSG="Latest ChangeSet: "
+export LOG_MSG="\nWelcome to Alpine Linux"
+export TEST_CMD="ssh $CONTROLLER console"
+export TEST_LOG="smoke.serial"
+export TEST_TIMEOUT="$timeout"
+./automation/scripts/console.exp | sed 's/\r\+$//'
+TEST_RESULT=$?
 
 if [ -n "$retrieve_xml" ]; then
     nc -w 10 "$SUT_ADDR" 8080 > tests-junit.xml </dev/null
 fi
 
-sleep 1
-
-(grep -q "^Welcome to Alpine Linux" smoke.serial && grep -q "${passed}" smoke.serial) || exit 1
-exit 0
+exit "$TEST_RESULT"
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Sat Apr 12 12:55:10 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 12 Apr 2025 12:55:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.948221.1345601 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3aO0-0006Jh-Cx; Sat, 12 Apr 2025 12:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 948221.1345601; Sat, 12 Apr 2025 12: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 1u3aO0-0006JZ-9q; Sat, 12 Apr 2025 12:55:04 +0000
Received: by outflank-mailman (input) for mailman id 948221;
 Sat, 12 Apr 2025 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 1u3aNy-0006JT-Jm
 for xen-changelog@lists.xenproject.org; Sat, 12 Apr 2025 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 1u3aNy-00ATyy-0q
 for xen-changelog@lists.xenproject.org;
 Sat, 12 Apr 2025 12:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3aNy-007JnC-0f
 for xen-changelog@lists.xenproject.org;
 Sat, 12 Apr 2025 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=as+m3FxIGG4qRcAHYSwTonIT56QsciMjIqr2s0emKMo=; b=JI+CPiMRbqkQ1xKaInr6O693mm
	jzSt/nVdtaVfh3ODRiFA+kGVjlkuneiaWG9D95/Iy87+31vFnBs7ny1HIhkjRa3TVFw8/eJ9/atRG
	zjkmFSYIHCtH044y84SjtEZDvv79dmKJhRi+XrZLjdjxfYlG+ZAAdScdKPgP5p3GenFo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: wait for Xen to start before waiting for test to complete
Message-Id: <E1u3aNy-007JnC-0f@xenbits.xenproject.org>
Date: Sat, 12 Apr 2025 12:55:02 +0000

commit 7c96a27e375d8d7cbbb5493ebef0e29f90bfd273
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Fri Apr 11 22:32:13 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 22:07:57 2025 +0100

    CI: wait for Xen to start before waiting for test to complete
    
    Add additional stage in console output parsing - wait for first message
    from Xen. The message is defined via BOOT_MSG variable. This has two
    effects:
    - distinguishes failing Xen to load at all from later test failures
    - resets timeout when Xen starts loading
    
    The latter is especially relevant for hardware tests where firmware +
    network boot may take some time before Xen starts booting. The two-stage
    timeout is more robust solution than increasing the overall timeout.
    The issue has been observed on some dom0pvh-hvm jobs, at least on
    runners hw3 and hw11. This patch is a first stage before qubes-x86-64.sh
    is switched to use expect in the next stage.
    
    While at it, consistently use 'expect -re' for all matches. This
    especially allows matching newlines ("\n"), which will become relevant
    in the next patch. And document variables used in console.exp.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/scripts/console.exp                    | 27 ++++++++++++++++++-----
 automation/scripts/qemu-alpine-x86_64.sh          |  1 +
 automation/scripts/qemu-smoke-dom0-arm32.sh       |  1 +
 automation/scripts/qemu-smoke-dom0-arm64.sh       |  1 +
 automation/scripts/qemu-smoke-dom0less-arm32.sh   |  1 +
 automation/scripts/qemu-xtf-dom0less-arm64.sh     |  1 +
 automation/scripts/xilinx-smoke-dom0-x86_64.sh    |  1 +
 automation/scripts/xilinx-smoke-dom0less-arm64.sh |  1 +
 8 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/automation/scripts/console.exp b/automation/scripts/console.exp
index 31ce97b91b..c27f893dfb 100755
--- a/automation/scripts/console.exp
+++ b/automation/scripts/console.exp
@@ -1,4 +1,17 @@
 #!/usr/bin/env expect
+#
+# Variables used by this script:
+# - TEST_TIMEOUT: timeout between each *_MSG match
+# - TEST_TIMEOUT_OVERRIDE: when set, overrides TEST_TIMEOUT
+# - TEST_LOG: save console log to this file
+# - TEST_CMD: commands that prints test system console output to stdout - in
+#   qemu tests that's usually qemu itself (with -serial stdio), in hardware
+#   tests that's a command to read serial console
+# - UBOOT_CMD (optional): command to enter at u-boot prompt
+# - BOOT_MSG (optional): initial Xen message to wait for (aka sign-of-life)
+# - LOG_MSG (optional): final console message to wait for
+# - PASSED: message to look for to consider test a success; if LOG_MSG is set,
+#   both LOG_MSG and PASSED must appear (in any order) for test to succeed
 
 if {[info exists env(TEST_TIMEOUT_OVERRIDE)]} {
     set timeout $env(TEST_TIMEOUT_OVERRIDE)
@@ -28,21 +41,25 @@ if {[info exists env(UBOOT_CMD)]} {
     send "$env(UBOOT_CMD)\r"
 }
 
+if {[info exists env(BOOT_MSG)]} {
+    expect -re "$env(BOOT_MSG)"
+}
+
 if {[info exists env(LOG_MSG)]} {
     expect {
-        "$env(PASSED)" {
-            expect "$env(LOG_MSG)"
+        -re "$env(PASSED)" {
+            expect -re "$env(LOG_MSG)"
             exit 0
         }
-        "$env(LOG_MSG)" {
-            expect "$env(PASSED)"
+        -re "$env(LOG_MSG)" {
+            expect -re "$env(PASSED)"
             exit 0
         }
     }
 }
 
 expect {
-    "$env(PASSED)" {
+    -re "$env(PASSED)" {
         exit 0
     }
 }
diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
index 17e2141d62..89bdb4df7d 100755
--- a/automation/scripts/qemu-alpine-x86_64.sh
+++ b/automation/scripts/qemu-alpine-x86_64.sh
@@ -85,6 +85,7 @@ export TEST_CMD="qemu-system-x86_64 \
     -netdev user,id=n0,tftp=binaries,bootfile=/pxelinux.0"
 
 export TEST_LOG="smoke.serial"
+export BOOT_MSG="Latest ChangeSet: "
 export LOG_MSG="Domain-0"
 export PASSED="BusyBox"
 
diff --git a/automation/scripts/qemu-smoke-dom0-arm32.sh b/automation/scripts/qemu-smoke-dom0-arm32.sh
index 0c60a66e25..4f50eabdef 100755
--- a/automation/scripts/qemu-smoke-dom0-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm32.sh
@@ -92,6 +92,7 @@ export TEST_CMD="./qemu-system-arm \
 
 export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
 export TEST_LOG="${serial_log}"
+export BOOT_MSG="Latest ChangeSet: "
 export LOG_MSG="Domain-0"
 export PASSED="/ #"
 
diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
index 8774a87012..51d037b000 100755
--- a/automation/scripts/qemu-smoke-dom0-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
@@ -104,6 +104,7 @@ export TEST_CMD="./binaries/qemu-system-aarch64 \
     -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"
 
 export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
+export BOOT_MSG="Latest ChangeSet: "
 export TEST_LOG="smoke.serial"
 export LOG_MSG="Domain-0"
 export PASSED="BusyBox"
diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh b/automation/scripts/qemu-smoke-dom0less-arm32.sh
index 0c94e662aa..0e2c5496db 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
@@ -144,6 +144,7 @@ export TEST_CMD="./qemu-system-arm \
     -bios /usr/lib/u-boot/qemu_arm/u-boot.bin"
 
 export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
+export BOOT_MSG="Latest ChangeSet: "
 export TEST_LOG="${serial_log}"
 export LOG_MSG="${dom0_prompt}"
 export PASSED="${passed}"
diff --git a/automation/scripts/qemu-xtf-dom0less-arm64.sh b/automation/scripts/qemu-xtf-dom0less-arm64.sh
index 9608de6ec0..436f460c3c 100755
--- a/automation/scripts/qemu-xtf-dom0less-arm64.sh
+++ b/automation/scripts/qemu-xtf-dom0less-arm64.sh
@@ -61,6 +61,7 @@ export TEST_CMD="./binaries/qemu-system-aarch64 \
     -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"
 
 export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
+export BOOT_MSG="Latest ChangeSet: "
 export TEST_LOG="smoke.serial"
 export PASSED="${passed}"
 
diff --git a/automation/scripts/xilinx-smoke-dom0-x86_64.sh b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
index 7834ffbe05..69caabe2d8 100755
--- a/automation/scripts/xilinx-smoke-dom0-x86_64.sh
+++ b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
@@ -159,6 +159,7 @@ stty -F ${SERIAL_DEV} 57600
 
 # Capture test result and power off board before exiting.
 export PASSED="${PASS_MSG}"
+export BOOT_MSG="Latest ChangeSet: "
 export TEST_CMD="cat ${SERIAL_DEV}"
 export TEST_LOG="smoke.serial"
 
diff --git a/automation/scripts/xilinx-smoke-dom0less-arm64.sh b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
index b24ad11b8c..3e1fcf6bf9 100755
--- a/automation/scripts/xilinx-smoke-dom0less-arm64.sh
+++ b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
@@ -140,6 +140,7 @@ stty -F ${SERIAL_DEV} 115200
 
 # Capture test result and power off board before exiting.
 export PASSED="${passed}"
+export BOOT_MSG="Latest ChangeSet: "
 export LOG_MSG="Welcome to Alpine Linux"
 export TEST_CMD="cat ${SERIAL_DEV}"
 export TEST_LOG="smoke.serial"
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Apr 12 12:55:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 12 Apr 2025 12:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.948222.1345605 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3aO9-0006LK-Dz; Sat, 12 Apr 2025 12:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 948222.1345605; Sat, 12 Apr 2025 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 1u3aO9-0006LC-BN; Sat, 12 Apr 2025 12:55:13 +0000
Received: by outflank-mailman (input) for mailman id 948222;
 Sat, 12 Apr 2025 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 1u3aO8-0006L6-ER
 for xen-changelog@lists.xenproject.org; Sat, 12 Apr 2025 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 1u3aO8-00ATz8-1L
 for xen-changelog@lists.xenproject.org;
 Sat, 12 Apr 2025 12:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3aO8-007Jr2-12
 for xen-changelog@lists.xenproject.org;
 Sat, 12 Apr 2025 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=LOnk7zRlm0q8oVN0vXG4vzbC4y03H4/kU5vLZ5wIJAw=; b=bo7UMTv4fI66XDuLcgp8gZRPGc
	hpifV3JNRjLDiOo3eNjlzNJ5yyr/G8+uctsyNe6wZ6FD4zvHL8A3YZ7tmAuWHOCNOrrbX6E6auGCJ
	JrESkcJ+z2PiWmpKNh1hBkxIM1ewaCJbDv/BIWnNYue0tPcItZPsnYBOGN6UlFmQtxtk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: fix waiting for final test message
Message-Id: <E1u3aO8-007Jr2-12@xenbits.xenproject.org>
Date: Sat, 12 Apr 2025 12:55:12 +0000

commit 1e12cbd6af2c92e61a1363ef208f71da1eae47ab
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Fri Apr 11 22:32:14 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 22:07:57 2025 +0100

    CI: fix waiting for final test message
    
    Expect normally discards initial part of its buffer after matching the
    patter, before looking for the next one. If both PASSED and LOG_MSG
    happen to be in the buffer at the same time, depending on their order,
    only one will be matched and the waiting for the other will timeout.
    Example expect -d output of this happening (parts eclipsed for brevity):
    
        expect: does "\r\r\r\nWelcome to Alpine Linux 3.18\r\r\r\n...\r\r\r\r\n(domU) + echo 'pci test passed'\r\r\r\r\n(domU) pci test passed\r\r\r\r..." (spawn_id exp4) match regular expression "pci test passed"? Gate "pci test passed"? gate=yes re=yes
        ...
        Gate keeper glob pattern for '\nWelcome to Alpine Linux' is '
        Welcome to Alpine Linux'. Activating booster.
        expect: does "'\r\r\r\r\n(domU) pci test passed\r\r\r\r\n(domU)  [ ok ]\r\r\r\r\n(domU)  [ ok ]\r\r\r\r\n(domU) \r\r\r\r\r\n(domU) domU Welcome to Alpine Linux 3.18\r\r\r\r\n(domU) \rKernel 6.6.56 on an x86_64 (/dev/hvc0)\r\r\r\r\n(domU) \r\r\r\r\r\n" (spawn_id exp4) match regular expression "\nWelcome to Alpine Linux"? Gate "\nWelcome to Alpine Linux"? gate=no
    
    Fix this by using -notransfer flag to keep matched part in the buffer.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citix.com>
---
 automation/scripts/console.exp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/automation/scripts/console.exp b/automation/scripts/console.exp
index c27f893dfb..834a08db1b 100755
--- a/automation/scripts/console.exp
+++ b/automation/scripts/console.exp
@@ -48,11 +48,11 @@ if {[info exists env(BOOT_MSG)]} {
 if {[info exists env(LOG_MSG)]} {
     expect {
         -re "$env(PASSED)" {
-            expect -re "$env(LOG_MSG)"
+            expect -notransfer -re "$env(LOG_MSG)"
             exit 0
         }
         -re "$env(LOG_MSG)" {
-            expect -re "$env(PASSED)"
+            expect -notransfer -re "$env(PASSED)"
             exit 0
         }
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Apr 12 12:55:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 12 Apr 2025 12:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.948223.1345609 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3aOJ-0006PJ-Fz; Sat, 12 Apr 2025 12:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 948223.1345609; Sat, 12 Apr 2025 12: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 1u3aOJ-0006PD-Cn; Sat, 12 Apr 2025 12:55:23 +0000
Received: by outflank-mailman (input) for mailman id 948223;
 Sat, 12 Apr 2025 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 1u3aOI-0006P4-Hg
 for xen-changelog@lists.xenproject.org; Sat, 12 Apr 2025 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 1u3aOI-00ATzG-1d
 for xen-changelog@lists.xenproject.org;
 Sat, 12 Apr 2025 12:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3aOI-007Jsj-1X
 for xen-changelog@lists.xenproject.org;
 Sat, 12 Apr 2025 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=PX4B1KwcsTEPOW0r6h6FhOAHGKPpq2muSso6U5Vai88=; b=vDmhIZ5VLV24UHjJIKhjwtP9lk
	l29fYQFUrggdvb9W4Tq2SN8smbP3Vk7hael4G6LikzcEa27o9LuuPkuC8rbM1rZGKlSwpNEVsu8tE
	7A/fOfw+hOZq96MqdjVsr9LW4wApPuqiQmLCvxJX17I9vWL8epReZ7Ftna8Vht6cpjxc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: switch qubes runners to use console.exp
Message-Id: <E1u3aOI-007Jsj-1X@xenbits.xenproject.org>
Date: Sat, 12 Apr 2025 12:55:22 +0000

commit d604d774a24bae21e15c831e172455bd4600663d
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Fri Apr 11 22:32:15 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 11 22:07:57 2025 +0100

    CI: switch qubes runners to use console.exp
    
    It appears as sometimes it takes more time for Xen even start booting,
    mostly due to firmware and fetching large boot files by grub. In some
    jobs the current timeout is pretty close to the actual time needed, and
    sometimes (rarely for now) test fails due to timeout expiring in the
    middle of dom0 booting. This will be happening more often if the
    initramfs will grow (and with more complex tests).
    This has been observed on some dom0pvh-hvm jobs, at least on runners hw3
    and hw11.
    
    Switch to using expect (console.exp) for more robust test output
    handling. This allows waiting separately for Xen starting to boot and
    then for the test to complete. For now, set both of those to 120s, which
    pessimistically bumps timeout for the whole test to 240s (from 120s).
    
    Add S3 handling to console.exp via SUSPEND_MSG + WAKEUP_CMD.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 automation/build/alpine/3.18-arm64v8.dockerfile |  1 +
 automation/scripts/console.exp                  | 13 +++++++
 automation/scripts/qubes-x86-64.sh              | 52 +++++++------------------
 3 files changed, 27 insertions(+), 39 deletions(-)

diff --git a/automation/build/alpine/3.18-arm64v8.dockerfile b/automation/build/alpine/3.18-arm64v8.dockerfile
index 19fe46f841..b8482d5bf4 100644
--- a/automation/build/alpine/3.18-arm64v8.dockerfile
+++ b/automation/build/alpine/3.18-arm64v8.dockerfile
@@ -48,3 +48,4 @@ RUN apk --no-cache add \
   # qubes test deps
   openssh-client \
   fakeroot \
+  expect \
diff --git a/automation/scripts/console.exp b/automation/scripts/console.exp
index 834a08db1b..bdb1dd9820 100755
--- a/automation/scripts/console.exp
+++ b/automation/scripts/console.exp
@@ -9,6 +9,10 @@
 #   tests that's a command to read serial console
 # - UBOOT_CMD (optional): command to enter at u-boot prompt
 # - BOOT_MSG (optional): initial Xen message to wait for (aka sign-of-life)
+# - SUSPEND_MSG (optional): message signaling system is going to sleep, it's
+#   trigger for WAKEUP_CMD (see below)
+# - WAKEUP_CMD (optional): command to execute to wakeup the system 30s after
+#   seeing SUSPEND_MSG
 # - LOG_MSG (optional): final console message to wait for
 # - PASSED: message to look for to consider test a success; if LOG_MSG is set,
 #   both LOG_MSG and PASSED must appear (in any order) for test to succeed
@@ -45,6 +49,15 @@ if {[info exists env(BOOT_MSG)]} {
     expect -re "$env(BOOT_MSG)"
 }
 
+if {[info exists env(WAKEUP_CMD)]} {
+    expect -re "$env(SUSPEND_MSG)"
+
+    # keep it suspended a bit, then wakeup
+    sleep 30
+
+    system "$env(WAKEUP_CMD)"
+}
+
 if {[info exists env(LOG_MSG)]} {
     expect {
         -re "$env(PASSED)" {
diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index a964ac4b7a..861e302d84 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-set -ex
+set -ex -o pipefail
 
 # One of:
 #  - ""             PV dom0,  PVH domU
@@ -267,52 +267,26 @@ cp -f binaries/xen $TFTP/xen
 cp -f binaries/bzImage $TFTP/vmlinuz
 cp -f binaries/dom0-rootfs.cpio.gz $TFTP/initrd-dom0
 
-# start logging the serial; this gives interactive console, don't close its
-# stdin to not close it; the 'cat' is important, plain redirection would hang
-# until somebody opens the pipe; opening and closing the pipe is used to close
-# the console
-mkfifo /tmp/console-stdin
-cat /tmp/console-stdin |\
-ssh $CONTROLLER console | tee smoke.serial | sed 's/\r//' &
-
 # start the system pointing at gitlab-ci predefined config
 ssh $CONTROLLER gitlabci poweron
-trap "ssh $CONTROLLER poweroff; : > /tmp/console-stdin" EXIT
+trap "ssh $CONTROLLER poweroff" EXIT
 
 if [ -n "$wait_and_wakeup" ]; then
-    # wait for suspend or a timeout
-    until grep "$wait_and_wakeup" smoke.serial || [ $timeout -le 0 ]; do
-        sleep 1;
-        : $((--timeout))
-    done
-    if [ $timeout -le 0 ]; then
-        echo "ERROR: suspend timeout, aborting"
-        exit 1
-    fi
-    # keep it suspended a bit, then wakeup
-    sleep 30
-    ssh $CONTROLLER wake
+    export SUSPEND_MSG="$wait_and_wakeup"
+    export WAKEUP_CMD="ssh $CONTROLLER wake"
 fi
 
-set +x
-until grep "^Welcome to Alpine Linux" smoke.serial || [ $timeout -le 0 ]; do
-    sleep 1;
-    : $((--timeout))
-done
-set -x
-
-tail -n 100 smoke.serial
-
-if [ $timeout -le 0 ]; then
-    echo "ERROR: test timeout, aborting"
-    exit 1
-fi
+export PASSED="${passed}"
+export BOOT_MSG="Latest ChangeSet: "
+export LOG_MSG="\nWelcome to Alpine Linux"
+export TEST_CMD="ssh $CONTROLLER console"
+export TEST_LOG="smoke.serial"
+export TEST_TIMEOUT="$timeout"
+./automation/scripts/console.exp | sed 's/\r\+$//'
+TEST_RESULT=$?
 
 if [ -n "$retrieve_xml" ]; then
     nc -w 10 "$SUT_ADDR" 8080 > tests-junit.xml </dev/null
 fi
 
-sleep 1
-
-(grep -q "^Welcome to Alpine Linux" smoke.serial && grep -q "${passed}" smoke.serial) || exit 1
-exit 0
+exit "$TEST_RESULT"
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Apr 12 14:11:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 12 Apr 2025 14:11:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.948262.1345624 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3bZW-00035h-Qr; Sat, 12 Apr 2025 14:11:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 948262.1345624; Sat, 12 Apr 2025 14:11:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3bZW-00035L-N8; Sat, 12 Apr 2025 14:11:02 +0000
Received: by outflank-mailman (input) for mailman id 948262;
 Sat, 12 Apr 2025 14: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 1u3bZW-00032D-2M
 for xen-changelog@lists.xenproject.org; Sat, 12 Apr 2025 14: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 1u3bZV-00AXF3-2o
 for xen-changelog@lists.xenproject.org;
 Sat, 12 Apr 2025 14:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3bZV-007nrS-2Y
 for xen-changelog@lists.xenproject.org;
 Sat, 12 Apr 2025 14:11:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SDg/q4BnCsQWHruOZHzfGk0PRlMEygiU1xmol8FqHMI=; b=q8qTcY5EfqSUb7x/fYCHxZBDET
	Wv6EWLpSrODeBZAXh1zkP5DAWkY+e0uIHgJjShZDspLuRJxpODfKslXITCD6tm+EHXKG/jI3cAE2/
	okLz6pc+S+ZXV6EbL/S+c0KkRQWo23P8AimTzJYBlYsJKsnNhsHxLl0vPPrCDZx9DAQU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: write whole etc/issue for domU initrd
Message-Id: <E1u3bZV-007nrS-2Y@xenbits.xenproject.org>
Date: Sat, 12 Apr 2025 14:11:01 +0000

commit f401eae6ec446671ad79deac84421d56808d43f2
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Fri Apr 11 22:32:16 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Sat Apr 12 15:06:43 2025 +0100

    CI: write whole etc/issue for domU initrd
    
    Upcoming changes won't unpack original rootfs anymore, so sed on
    existing file cannot be used. Override the whole file instead.
    
    No functional change intended.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/scripts/qubes-x86-64.sh             | 5 ++++-
 automation/scripts/xilinx-smoke-dom0-x86_64.sh | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index 861e302d84..c4be714642 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -182,7 +182,10 @@ ${domU_check}
 " > etc/local.d/xen.start
     chmod +x etc/local.d/xen.start
     echo "rc_verbose=yes" >> etc/rc.conf
-    sed -i -e 's/^Welcome/domU \0/' etc/issue
+    echo "domU Welcome to Alpine Linux
+Kernel \r on an \m (\l)
+
+" > etc/issue
     find . | fakeroot -i ../fakeroot-save cpio -H newc -o | gzip > ../binaries/domU-rootfs.cpio.gz
     cd ..
     rm -rf rootfs
diff --git a/automation/scripts/xilinx-smoke-dom0-x86_64.sh b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
index 69caabe2d8..7e5382931b 100755
--- a/automation/scripts/xilinx-smoke-dom0-x86_64.sh
+++ b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
@@ -103,7 +103,10 @@ ${DOMU_CMD}
 " > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
 echo "rc_verbose=yes" >> etc/rc.conf
-sed -i -e 's/^Welcome/domU \0/' etc/issue
+echo "domU Welcome to Alpine Linux
+Kernel \r on an \m (\l)
+
+" > etc/issue
 copy_domU_files
 find . | cpio -H newc -o | gzip > ../binaries/domU-rootfs.cpio.gz
 cd ..
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Sat Apr 12 16:00:08 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 12 Apr 2025 16:00:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.948301.1345637 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3dH1-0007NK-4l; Sat, 12 Apr 2025 16:00:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 948301.1345637; Sat, 12 Apr 2025 16:00:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u3dH1-0007Mt-23; Sat, 12 Apr 2025 16:00:03 +0000
Received: by outflank-mailman (input) for mailman id 948301;
 Sat, 12 Apr 2025 16: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 1u3dGz-0006i5-IA
 for xen-changelog@lists.xenproject.org; Sat, 12 Apr 2025 16: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 1u3dGz-00Abmi-1F
 for xen-changelog@lists.xenproject.org;
 Sat, 12 Apr 2025 16:00:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u3dGz-008jvR-10
 for xen-changelog@lists.xenproject.org;
 Sat, 12 Apr 2025 16: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=XkrLDyqZ6e6UOElUAlTSCOEy2fY2Yz3C9VOmxVIL6qg=; b=AYP1ILeUnGgknTBQCytxCO1Whn
	2KOXkGpBm0fpmQRvh9a9Yniw9D6HdocyASOUOtYqDUtCmG+rG573LUuggCDaFpxtbDHom7/kNaZ+p
	8EV8OrckKbnAf6qJXfQHT8Yg89h+IjEE2amWy/EoMJBsYOGAuG8atKCxLghmxL2nlfcA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: write whole etc/issue for domU initrd
Message-Id: <E1u3dGz-008jvR-10@xenbits.xenproject.org>
Date: Sat, 12 Apr 2025 16:00:01 +0000

commit f401eae6ec446671ad79deac84421d56808d43f2
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Fri Apr 11 22:32:16 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Sat Apr 12 15:06:43 2025 +0100

    CI: write whole etc/issue for domU initrd
    
    Upcoming changes won't unpack original rootfs anymore, so sed on
    existing file cannot be used. Override the whole file instead.
    
    No functional change intended.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/scripts/qubes-x86-64.sh             | 5 ++++-
 automation/scripts/xilinx-smoke-dom0-x86_64.sh | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index 861e302d84..c4be714642 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -182,7 +182,10 @@ ${domU_check}
 " > etc/local.d/xen.start
     chmod +x etc/local.d/xen.start
     echo "rc_verbose=yes" >> etc/rc.conf
-    sed -i -e 's/^Welcome/domU \0/' etc/issue
+    echo "domU Welcome to Alpine Linux
+Kernel \r on an \m (\l)
+
+" > etc/issue
     find . | fakeroot -i ../fakeroot-save cpio -H newc -o | gzip > ../binaries/domU-rootfs.cpio.gz
     cd ..
     rm -rf rootfs
diff --git a/automation/scripts/xilinx-smoke-dom0-x86_64.sh b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
index 69caabe2d8..7e5382931b 100755
--- a/automation/scripts/xilinx-smoke-dom0-x86_64.sh
+++ b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
@@ -103,7 +103,10 @@ ${DOMU_CMD}
 " > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
 echo "rc_verbose=yes" >> etc/rc.conf
-sed -i -e 's/^Welcome/domU \0/' etc/issue
+echo "domU Welcome to Alpine Linux
+Kernel \r on an \m (\l)
+
+" > etc/issue
 copy_domU_files
 find . | cpio -H newc -o | gzip > ../binaries/domU-rootfs.cpio.gz
 cd ..
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 14 11:22:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 14 Apr 2025 11:22:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.949871.1346311 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4Ht5-0003d2-Ga; Mon, 14 Apr 2025 11:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 949871.1346311; Mon, 14 Apr 2025 11: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 1u4Ht5-0003cu-Di; Mon, 14 Apr 2025 11:22:03 +0000
Received: by outflank-mailman (input) for mailman id 949871;
 Mon, 14 Apr 2025 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 1u4Ht3-0003ch-OA
 for xen-changelog@lists.xenproject.org; Mon, 14 Apr 2025 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 1u4Ht3-00EoaP-2K
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 11:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4Ht3-00D5WC-2C
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 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=Qs68o7PXECdDNJrhbAua+N5S1NXGW5jrexbj6oTQYPM=; b=fuIBK70HhIhifgF5bIayucs/r7
	XE5r7RW4uH9ahH+roqA6Yk46FWiX2pRxU53of6DenOjKmysSIuVAtdO6Y9COLBUW8z2G1CLbbDYb/
	xjwPDK64P70GQU9xn3T5FQUmu3lOigxKCjWprSroWoxcwe8sZdPEAQH2aMkbR+bM5+Eo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/EFI: sanitize DLL characteristics in binary
Message-Id: <E1u4Ht3-00D5WC-2C@xenbits.xenproject.org>
Date: Mon, 14 Apr 2025 11:22:01 +0000

commit f2148773b8ac64a27933afe13027fee02558f8c5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 14 13:04:28 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 14 13:04:28 2025 +0200

    x86/EFI: sanitize DLL characteristics in binary
    
    In GNU ld --disable-reloc-section implies --disable-dynamicbase (and
    also --disable-high-entropy-va, just fyi). Therefore to yield
    functionally identical binaries independent of whether mkreloc needs to
    come into play, add --dynamicbase as well.
    
    GNU ld further defaults to --high-entropy-va (along with --dynamicbase
    and --nxcompat) unless "Cygwin-like". This seems wrong to me; that
    default should be dependent upon "MinGW-like" instead; for the purpose
    of building EFI binaries with a PE32+-capable ELF linker neither
    "Cygwin-like" nor "MinGW-like" ought to be true. We certainly don't mean
    to have this bit set in the DLL characteristics, so suppress its
    setting.
    
    Sadly while --high-entropy-va is supported by GNU ld 2.25,
    --disable-high-entropy-va was introduced only in 2.36. Luckily the
    defaulting to --high-entropy-va was also only introduced in 2.36. Plus
    --disable-reloc-section was introduced precisely there, too. Hence
    leverage the probing we do as to base relocation generation, to also
    determine whether to pass --disable-high-entropy-va.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/arch.mk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk
index 7882fb895e..09b6d8758e 100644
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -103,6 +103,7 @@ efi-nr-fixups := $(shell LC_ALL=C $(OBJDUMP) -p $(efi-check).efi | grep '^[[:bla
 
 ifeq ($(efi-nr-fixups),2)
 MKRELOC := :
+EFI_LDFLAGS += --disable-high-entropy-va
 else
 MKRELOC := arch/x86/efi/mkreloc
 # If the linker produced fixups but not precisely two of them, we need to
@@ -113,6 +114,8 @@ EFI_LDFLAGS += --disable-reloc-section
 endif
 endif
 
+EFI_LDFLAGS += --dynamicbase
+
 endif # $(XEN_BUILD_PE)
 
 export XEN_BUILD_EFI XEN_BUILD_PE
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 14 11:22:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 14 Apr 2025 11:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.949872.1346315 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4HtF-0003lC-IW; Mon, 14 Apr 2025 11:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 949872.1346315; Mon, 14 Apr 2025 11: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 1u4HtF-0003l3-F8; Mon, 14 Apr 2025 11:22:13 +0000
Received: by outflank-mailman (input) for mailman id 949872;
 Mon, 14 Apr 2025 11:22:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u4HtD-0003kh-Rr
 for xen-changelog@lists.xenproject.org; Mon, 14 Apr 2025 11:22:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4HtD-00Eoad-2g
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 11:22:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4HtD-00D5bc-2U
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 11: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=Pew54K0OYyWFT791ZNJ3mtGo5k5LSFQCyKUDhB5P4eY=; b=d8McOv2nrfPNRhhd1ysuknaAE/
	H07+ii0r3CipGvrGJedVNbY2EHeN04S/UivnUVGfAj2todF77Fa5n4kC2s17ORWELTNPOINKjbRcQ
	P/fUY2aKQFaTIeV6L2e9gTbuyUUnltTMkRiciGlvK7rWibSbcAtFeDFVgC4sa0rGpzjg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/mem-sharing: short-circuit p2m_is_shared() when MEM_SHARING=n
Message-Id: <E1u4HtD-00D5bc-2U@xenbits.xenproject.org>
Date: Mon, 14 Apr 2025 11:22:11 +0000

commit 40bc520ca0f484163e440e3eb3c930c719ebf9f6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 14 13:05:52 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 14 13:05:52 2025 +0200

    x86/mem-sharing: short-circuit p2m_is_shared() when MEM_SHARING=n
    
    Some of the uses of dom_cow aren't easily DCE-able (without extra
    #ifdef-ary), and hence it being constantly NULL when MEM_SHARING=n
    misguides Coverity into thinking that there may be a NULL deref in
    
            if ( p2m_is_shared(t) )
                d = dom_cow;
    
            if ( get_page(page, d) )
                return page;
    
    (in get_page_from_mfn_and_type()). Help the situation by making
    p2m_is_shared() be compile-time false when MEM_SHARING=n, thus also
    permitting the compiler to DCE some other code.
    
    Note that p2m_is_sharable() isn't used outside of mem_sharing.c, and
    hence P2M_SHARABLE_TYPES can simply be left undefined when
    MEM_SHARING=n.
    
    Coverity ID: 1645573
    Fixes: 79d91e178a1a ("dom_cow is needed for mem-sharing only")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/arch/x86/include/asm/p2m.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/arch/x86/include/asm/p2m.h b/xen/arch/x86/include/asm/p2m.h
index 6816a1be91..b9ce7d8705 100644
--- a/xen/arch/x86/include/asm/p2m.h
+++ b/xen/arch/x86/include/asm/p2m.h
@@ -136,11 +136,16 @@ typedef unsigned int p2m_query_t;
 #endif
 
 /* Shared types */
+#ifdef CONFIG_MEM_SHARING
 /* XXX: Sharable types could include p2m_ram_ro too, but we would need to
  * reinit the type correctly after fault */
 #define P2M_SHARABLE_TYPES (p2m_to_mask(p2m_ram_rw) \
                             | p2m_to_mask(p2m_ram_logdirty) )
 #define P2M_SHARED_TYPES   (p2m_to_mask(p2m_ram_shared))
+#else
+/* P2M_SHARABLE_TYPES deliberately not provided. */
+#define P2M_SHARED_TYPES 0
+#endif
 
 /* Types established/cleaned up via special accessors. */
 #define P2M_SPECIAL_TYPES (P2M_GRANT_TYPES | \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 14 11:22:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 14 Apr 2025 11:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.949874.1346319 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4HtP-0003sQ-Jc; Mon, 14 Apr 2025 11:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 949874.1346319; Mon, 14 Apr 2025 11: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 1u4HtP-0003sI-GW; Mon, 14 Apr 2025 11:22:23 +0000
Received: by outflank-mailman (input) for mailman id 949874;
 Mon, 14 Apr 2025 11: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 1u4HtN-0003q3-Uo
 for xen-changelog@lists.xenproject.org; Mon, 14 Apr 2025 11:22:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4HtN-00Eoau-2y
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 11:22:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4HtN-00D5fG-2r
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 11:22:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Zb7PzgjnZ6nNMN7G2hTPUL/SpJoUhUqVTBmjFyMiLcA=; b=qKE8cptuNvEaTYi6v1ZaB8OiA2
	S+3iEqxN7HVG9H1WyUU40JvSgLf4q3/zob4i3kVcmzP9v1PC/S+0gzui1teHVgnApq20BKBLD1bvo
	wU3vqSKuiRLObu82Vz6TtsAEYGQRjV6H5hHZlbWNuxCw33fgSATkhno/fhmmEVZkVZSE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: common: add ability to enable stack protector
Message-Id: <E1u4HtN-00D5fG-2r@xenbits.xenproject.org>
Date: Mon, 14 Apr 2025 11:22:21 +0000

commit be2a6a10962a7f54fd72fa4962261bcc748725cb
Author:     Volodymyr Babchuk <volodymyr_babchuk@epam.com>
AuthorDate: Mon Apr 14 13:07:12 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 14 13:07:12 2025 +0200

    xen: common: add ability to enable stack protector
    
    Both GCC and Clang support -fstack-protector feature, which add stack
    canaries to functions where stack corruption is possible. This patch
    makes general preparations to enable this feature on different
    supported architectures:
    
     - Added CONFIG_HAS_STACK_PROTECTOR option so each architecture
       can enable this feature individually
     - Added user-selectable CONFIG_STACK_PROTECTOR option
     - Implemented code that sets up random stack canary and a basic
       handler for stack protector failures
    
    Stack guard value is initialized in two phases:
    
    1. Pre-defined randomly-selected value.
    
    2. Own implementation of linear congruent random number generator. It
    relies on get_cycles() being available very early. If get_cycles()
    returns zero, it would leave pre-defined value from the previous step.
    
    boot_stack_chk_guard_setup() is declared as always_inline to ensure
    that it will not trigger stack protector by itself. And of course,
    caller should ensure that stack protection code will not be reached
    later. It is possible to call the same function from an ASM code by
    introducing simple trampoline in stack-protector.c, but right now
    there is no use case for such trampoline.
    
    As __stack_chk_fail() is not called by Xen source code directly, and
    only called by compiler-generated code, it does not needed to be
    declared separately. So we need separate MISRA deviation for it.
    
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 docs/misra/safe.json              |  8 ++++++++
 xen/Makefile                      |  4 ++++
 xen/common/Kconfig                | 15 +++++++++++++++
 xen/common/Makefile               |  1 +
 xen/common/stack-protector.c      | 22 ++++++++++++++++++++++
 xen/include/xen/stack-protector.h | 39 +++++++++++++++++++++++++++++++++++++++
 6 files changed, 89 insertions(+)

diff --git a/docs/misra/safe.json b/docs/misra/safe.json
index 3d68b59169..e3489dba8e 100644
--- a/docs/misra/safe.json
+++ b/docs/misra/safe.json
@@ -108,6 +108,14 @@
         },
         {
             "id": "SAF-13-safe",
+            "analyser": {
+                "eclair": "MC3A2.R8.4"
+            },
+            "name": "Rule 8.4: compiler-called function",
+            "text": "A function, all invocations of which are compiler generated, does not need to have a visible declaration prior to its definition."
+        },
+        {
+            "id": "SAF-14-safe",
             "analyser": {},
             "name": "Sentinel",
             "text": "Next ID to be used"
diff --git a/xen/Makefile b/xen/Makefile
index 58fafab33d..8fc4e042ff 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -435,7 +435,11 @@ else
 CFLAGS_UBSAN :=
 endif
 
+ifeq ($(CONFIG_STACK_PROTECTOR),y)
+CFLAGS += -fstack-protector
+else
 CFLAGS += -fno-stack-protector
+endif
 
 ifeq ($(CONFIG_LTO),y)
 CFLAGS += -flto
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 06ae9751aa..42a2b6a03f 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -100,6 +100,9 @@ config HAS_PMAP
 config HAS_SCHED_GRANULARITY
 	bool
 
+config HAS_STACK_PROTECTOR
+	bool
+
 config HAS_UBSAN
 	bool
 
@@ -233,6 +236,18 @@ config SPECULATIVE_HARDEN_LOCK
 
 endmenu
 
+menu "Other hardening"
+
+config STACK_PROTECTOR
+	bool "Stack protector"
+	depends on HAS_STACK_PROTECTOR
+	help
+	  Enable the Stack Protector compiler hardening option. This inserts a
+	  canary value in the stack frame of functions, and performs an integrity
+	  check on function exit.
+
+endmenu
+
 config DIT_DEFAULT
 	bool "Data Independent Timing default"
 	depends on HAS_DIT
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 9da8a7244d..f625031d16 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -46,6 +46,7 @@ obj-y += shutdown.o
 obj-y += softirq.o
 obj-y += smp.o
 obj-y += spinlock.o
+obj-$(CONFIG_STACK_PROTECTOR) += stack-protector.o
 obj-y += stop_machine.o
 obj-y += symbols.o
 obj-y += tasklet.o
diff --git a/xen/common/stack-protector.c b/xen/common/stack-protector.c
new file mode 100644
index 0000000000..2115912c3b
--- /dev/null
+++ b/xen/common/stack-protector.c
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#include <xen/init.h>
+#include <xen/lib.h>
+#include <xen/random.h>
+#include <xen/time.h>
+
+/*
+ * Initial value is chosen by a fair dice roll.
+ * It will be updated during boot process.
+ */
+#if BITS_PER_LONG == 32
+unsigned long __ro_after_init __stack_chk_guard = 0xdd2cc927UL;
+#else
+unsigned long __ro_after_init __stack_chk_guard = 0x2d853605a4d9a09cUL;
+#endif
+
+/* SAF-13-safe compiler-called function */
+void noreturn __stack_chk_fail(void)
+{
+    dump_execution_state();
+    panic("Stack Protector integrity violation identified\n");
+}
diff --git a/xen/include/xen/stack-protector.h b/xen/include/xen/stack-protector.h
new file mode 100644
index 0000000000..931affd919
--- /dev/null
+++ b/xen/include/xen/stack-protector.h
@@ -0,0 +1,39 @@
+#ifndef __XEN_STACK_PROTECTOR_H__
+#define __XEN_STACK_PROTECTOR_H__
+
+extern unsigned long __stack_chk_guard;
+
+/*
+ * This function should be called from a C function that escapes stack
+ * canary tracking (by calling reset_stack_and_jump() for example).
+ */
+static always_inline void boot_stack_chk_guard_setup(void)
+{
+#ifdef CONFIG_STACK_PROTECTOR
+
+    /*
+     * Linear congruent generator (X_n+1 = X_n * a + c).
+     *
+     * Constant is taken from "Tables Of Linear Congruential
+     * Generators Of Different Sizes And Good Lattice Structure" by
+     * Pierre L’Ecuyer.
+     */
+#if BITS_PER_LONG == 32
+    const unsigned long a = 2891336453UL;
+#else
+    const unsigned long a = 2862933555777941757UL;
+#endif
+    const unsigned long c = 1;
+
+    unsigned long cycles = get_cycles();
+
+    /* Use the initial value if we can't generate random one */
+    if ( !cycles )
+        return;
+
+    __stack_chk_guard = cycles * a + c;
+
+#endif	/* CONFIG_STACK_PROTECTOR */
+}
+
+#endif	/* __XEN_STACK_PROTECTOR_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 14 11:22:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 14 Apr 2025 11:22:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.949875.1346323 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4HtZ-0003zO-Kv; Mon, 14 Apr 2025 11:22:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 949875.1346323; Mon, 14 Apr 2025 11: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 1u4HtZ-0003zG-Hx; Mon, 14 Apr 2025 11:22:33 +0000
Received: by outflank-mailman (input) for mailman id 949875;
 Mon, 14 Apr 2025 11: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 1u4HtY-0003yu-1L
 for xen-changelog@lists.xenproject.org; Mon, 14 Apr 2025 11: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 1u4HtY-00EobK-02
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 11:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4HtX-00D5kI-39
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 11:22:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7fCEES0ZhSUdjn71lHkIgINOZ4+TyAvu4fHNqFxXc/8=; b=FzpSnG2RUXT5Y8FhIis7UryJDG
	6WVT/MpxNHXMzphxuwinipEFXiUR4/i+lmwUE1ifN+x7klfquL2nl6sUpSaJBqGm4HIp0+ty5Xg6q
	oK6OY3rdzDbhFlA9ozwODrhb3sJawhLXmatkpMG/0ezw3WuJfDOf3xebVgOEnFRFWxfU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: arm: enable stack protector feature
Message-Id: <E1u4HtX-00D5kI-39@xenbits.xenproject.org>
Date: Mon, 14 Apr 2025 11:22:31 +0000

commit 1ec1462032f7d48ef34b65a679767bdef9d7ea46
Author:     Volodymyr Babchuk <volodymyr_babchuk@epam.com>
AuthorDate: Mon Apr 14 13:07:38 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 14 13:07:38 2025 +0200

    xen: arm: enable stack protector feature
    
    Enable previously added CONFIG_STACK_PROTECTOR feature for ARM
    platform. Initialize stack protector magic value very early, at the
    very beginning of start_xen() function.
    
    We want to do this early because prior to that
    boot_stack_chk_guard_setup() call, default stack protector guard value
    is used. While it is fine for general development and testing, it does
    not provide highest security level, because potential attacker will
    know the default value and can alter a payload, so correct stack
    guard value will be placed in the correct position.
    
    Apart from that argument, boot_stack_chk_guard_setup() should be
    called prior to enabling secondary CPUs to avoid race with them.
    
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/Kconfig | 1 +
 xen/arch/arm/setup.c | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 565f288331..da8a406f5a 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -15,6 +15,7 @@ config ARM
 	select GENERIC_UART_INIT
 	select HAS_ALTERNATIVE if HAS_VMAP
 	select HAS_DEVICE_TREE
+	select HAS_STACK_PROTECTOR
 	select HAS_UBSAN
 
 config ARCH_DEFCONFIG
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index bf39d41e9b..07703a15e1 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -30,6 +30,7 @@
 #include <xen/virtual_region.h>
 #include <xen/version.h>
 #include <xen/vmap.h>
+#include <xen/stack-protector.h>
 #include <xen/trace.h>
 #include <xen/libfdt/libfdt-xen.h>
 #include <xen/acpi.h>
@@ -306,6 +307,8 @@ void asmlinkage __init start_xen(unsigned long fdt_paddr)
     struct domain *d;
     int rc, i;
 
+    boot_stack_chk_guard_setup();
+
     dcache_line_bytes = read_dcache_line_bytes();
 
     percpu_init_areas();
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 14 11:22:42 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 14 Apr 2025 11:22:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.949876.1346326 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4Hti-0004AK-Lr; Mon, 14 Apr 2025 11:22:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 949876.1346326; Mon, 14 Apr 2025 11: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 1u4Hti-0004AD-JO; Mon, 14 Apr 2025 11:22:42 +0000
Received: by outflank-mailman (input) for mailman id 949876;
 Mon, 14 Apr 2025 11: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 1u4Hti-0004A2-4W
 for xen-changelog@lists.xenproject.org; Mon, 14 Apr 2025 11: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 1u4Hti-00EobV-0L
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 11:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4Hti-00D5s3-0C
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 11: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=PLDuKTKPEc9talR+S0F7oi7qbdYRuV6qav7WKjmq0Qc=; b=eHXO5nX36VcaXzjEy+82PyRecV
	CcyUQL6SeAoq2Edlqx72S3oZFGEiR12eA7Z32LlJo9Dyktmo3E8qLbeEXmbQMHThzM9oyVUgJI4/U
	EPPFQzL2ELreReTmHknxY1PzYqZD+lXz/2Gyhq2kg3Ob/TipmYgfw16D48mmF2nwOhlA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CHANGELOG.md: Mention stack-protector feature
Message-Id: <E1u4Hti-00D5s3-0C@xenbits.xenproject.org>
Date: Mon, 14 Apr 2025 11:22:42 +0000

commit 7177602d46465f7a425e40f1be4ee82f5e316a7c
Author:     Volodymyr Babchuk <volodymyr_babchuk@epam.com>
AuthorDate: Mon Apr 14 13:08:27 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 14 13:08:27 2025 +0200

    CHANGELOG.md: Mention stack-protector feature
    
    Stack protector is meant to be enabled on all architectures, but
    currently it is tested (and enabled) only on ARM, so mention it in ARM
    section.
    
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 CHANGELOG.md | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8f6afa5c85..d3dd31dea2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
      capability usage is not yet supported on PVH dom0).
    - Smoke tests for the FreeBSD Xen builds in Cirrus CI.
 
+ - On Arm:
+    - Ability to enable stack protector
+
 ### Removed
 
 ## [4.20.0](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.20.0) - 2025-03-05
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 14 11:22:52 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 14 Apr 2025 11:22:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.949877.1346332 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4Hts-0004KJ-O7; Mon, 14 Apr 2025 11:22:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 949877.1346332; Mon, 14 Apr 2025 11:22: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 1u4Hts-0004K8-Kr; Mon, 14 Apr 2025 11:22:52 +0000
Received: by outflank-mailman (input) for mailman id 949877;
 Mon, 14 Apr 2025 11: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 1u4Hts-0004K2-78
 for xen-changelog@lists.xenproject.org; Mon, 14 Apr 2025 11: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 1u4Hts-00EobZ-0c
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 11:22:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4Hts-00D5vJ-0U
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 11: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=OUcOppS30IeI26aDpTXgp/HkzDV1lRl22eON57doMTo=; b=5pAecCToMKK1Fi+APiQGmKmsz1
	WUk2BjLaO1ZiaSmgqYQBx7/n7t/pf6xnxqC6xp5rLfeIePUO+Hk/vdOwlrueHmmhFdfOLDbjHKFqi
	yIyGu+nMrYdXhigm4scUY3gwB2BKWOuObKDqOBygdMfPni1ENHUGBpbjU0wntKDDlCtw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] kconfig: introduce option to independently enable libfdt
Message-Id: <E1u4Hts-00D5vJ-0U@xenbits.xenproject.org>
Date: Mon, 14 Apr 2025 11:22:52 +0000

commit 373c67d8a65556278e7cf8a226d19682c626de68
Author:     Daniel P. Smith <dpsmith@apertussolutions.com>
AuthorDate: Mon Apr 14 13:08:56 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 14 13:08:56 2025 +0200

    kconfig: introduce option to independently enable libfdt
    
    Currently, the inclusion of libfdt is controlled by the CONFIG_HAS_DEVICE_TREE
    kconfig flag. This flag also changes behavior in a few places, such as boot
    module processing for XSM. To support the ability to include libfdt without
    changing these behaviors, introduce CONFIG_LIBFDT. The inclusion of
    libfdt is then moved under CONFIG_LIBFDT.
    
    Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Denis Mukhin <dmukhin@ford.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/Kconfig  | 4 ++++
 xen/common/Makefile | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 42a2b6a03f..be28060716 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -72,6 +72,7 @@ config HAS_COMPAT
 
 config HAS_DEVICE_TREE
 	bool
+	select LIBFDT
 
 config HAS_DIT # Data Independent Timing
 	bool
@@ -109,6 +110,9 @@ config HAS_UBSAN
 config HAS_VMAP
 	bool
 
+config LIBFDT
+	bool
+
 config MEM_ACCESS_ALWAYS_ON
 	bool
 
diff --git a/xen/common/Makefile b/xen/common/Makefile
index f625031d16..98f0873056 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -80,7 +80,7 @@ obj-y += sched/
 obj-$(CONFIG_UBSAN) += ubsan/
 
 obj-$(CONFIG_NEEDS_LIBELF) += libelf/
-obj-$(CONFIG_HAS_DEVICE_TREE) += libfdt/
+obj-$(CONFIG_LIBFDT) += libfdt/
 
 CONF_FILE := $(if $(patsubst /%,,$(KCONFIG_CONFIG)),$(objtree)/)$(KCONFIG_CONFIG)
 $(obj)/config.gz: $(CONF_FILE)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 14 11:23:02 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 14 Apr 2025 11:23:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.949878.1346336 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4Hu2-0004NJ-PV; Mon, 14 Apr 2025 11:23:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 949878.1346336; Mon, 14 Apr 2025 11:23: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 1u4Hu2-0004NB-MH; Mon, 14 Apr 2025 11:23:02 +0000
Received: by outflank-mailman (input) for mailman id 949878;
 Mon, 14 Apr 2025 11: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 1u4Hu2-0004N3-Br
 for xen-changelog@lists.xenproject.org; Mon, 14 Apr 2025 11: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 1u4Hu2-00Eobx-0t
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 11:23:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4Hu2-00D5yB-0m
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 11: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=sCkvRHOPh2mf2/FIZv3ga4HbF8gKTOp+MBGHwbjTM7s=; b=bpfB/OmADnfztSlT/wFx6B7oOX
	6qX51sHGJZ0Fl07t/fPvSV5TcqGqoebiwKCvfT5aegdQ0j9AcJFW3EukvfrveaSp29JuPsdMpIwyH
	4PT0OrYsHW/xvsAeFWncJXECZoZMjnoyI71Tlk6jdDz33iEb4pXxah71WJAY3hYrcSAA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/cpufreq: only set gov NULL when cpufreq_driver.setpolicy is NULL
Message-Id: <E1u4Hu2-00D5yB-0m@xenbits.xenproject.org>
Date: Mon, 14 Apr 2025 11:23:02 +0000

commit 7610180ff9e741bf1c29a9d0e9753e1ee818e0e4
Author:     Penny Zheng <Penny.Zheng@amd.com>
AuthorDate: Mon Apr 14 13:10:55 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 14 13:10:55 2025 +0200

    xen/cpufreq: only set gov NULL when cpufreq_driver.setpolicy is NULL
    
    amd-cppc on active mode bypasses the scaling governor layer, and
    provides its own P-state selection algorithms in hardware. Consequently,
    when it is used, the driver's -> setpolicy() callback is invoked
    to register per-CPU utilization update callbacks, not the ->target()
    callback.
    
    So, only when cpufreq_driver.setpolicy is NULL, we need to deliberately
    set old gov as NULL to trigger the according gov starting.
    
    Signed-off-by: Penny Zheng <Penny.Zheng@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/cpufreq/cpufreq.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c
index 4a103c6de9..19e2992335 100644
--- a/xen/drivers/cpufreq/cpufreq.c
+++ b/xen/drivers/cpufreq/cpufreq.c
@@ -307,7 +307,13 @@ int cpufreq_add_cpu(unsigned int cpu)
     if (hw_all || (cpumask_weight(cpufreq_dom->map) ==
                    perf->domain_info.num_processors)) {
         memcpy(&new_policy, policy, sizeof(struct cpufreq_policy));
-        policy->governor = NULL;
+
+        /*
+         * Only when cpufreq_driver.setpolicy == NULL, we need to deliberately
+         * set old gov as NULL to trigger the according gov starting.
+         */
+        if ( cpufreq_driver.setpolicy == NULL )
+            policy->governor = NULL;
 
         cpufreq_cmdline_common_para(&new_policy);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 14 11:23:12 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 14 Apr 2025 11:23:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.949879.1346341 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4HuC-0004Uf-St; Mon, 14 Apr 2025 11:23:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 949879.1346341; Mon, 14 Apr 2025 11:23: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 1u4HuC-0004UT-Ox; Mon, 14 Apr 2025 11:23:12 +0000
Received: by outflank-mailman (input) for mailman id 949879;
 Mon, 14 Apr 2025 11: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 1u4HuC-0004UN-CN
 for xen-changelog@lists.xenproject.org; Mon, 14 Apr 2025 11: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 1u4HuC-00Eoc3-19
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 11:23:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4HuC-00D60U-13
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 11: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=Leq9wARsKq/JHNGNuX564dhieWiG7/jmChHSTbsXas8=; b=1WTrUuC2Yu8SL3hbdGj3iGKbLh
	atBZvfVT3i1D/yW40aPPl2iElBv7amLAPGGHgHP5eCXU+gOVbNT+6AZ/mJxDgNMyuIBthUEJIJGi0
	D27nSlLUVk8O6kp7revGYitsFjW6+qrtOgjTf69nLDZ1RidwtgbCnsZlWeLYqidlSFKU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: fix waiting for final test message (again)
Message-Id: <E1u4HuC-00D60U-13@xenbits.xenproject.org>
Date: Mon, 14 Apr 2025 11:23:12 +0000

commit 79de6507c59021484e7c0b359f45035eab891e88
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Sun Apr 13 15:47:31 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 14 12:16:43 2025 +0100

    CI: fix waiting for final test message (again)
    
    The previous attempt has correct diagnosis, but added -notransfer flag
    in a wrong place - it should be used in the first (outer) match out of
    two, not the second (inner) one.
    
    Fixes: 1e12cbd6af2c ("CI: fix waiting for final test message")
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/scripts/console.exp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/automation/scripts/console.exp b/automation/scripts/console.exp
index bdb1dd9820..fc80513dfb 100755
--- a/automation/scripts/console.exp
+++ b/automation/scripts/console.exp
@@ -60,12 +60,12 @@ if {[info exists env(WAKEUP_CMD)]} {
 
 if {[info exists env(LOG_MSG)]} {
     expect {
-        -re "$env(PASSED)" {
-            expect -notransfer -re "$env(LOG_MSG)"
+        -notransfer -re "$env(PASSED)" {
+            expect -re "$env(LOG_MSG)"
             exit 0
         }
-        -re "$env(LOG_MSG)" {
-            expect -notransfer -re "$env(PASSED)"
+        -notransfer -re "$env(LOG_MSG)" {
+            expect -re "$env(PASSED)"
             exit 0
         }
     }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 14 12:11:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 14 Apr 2025 12:11:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.950042.1346452 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4IeU-0007AC-R5; Mon, 14 Apr 2025 12:11:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 950042.1346452; Mon, 14 Apr 2025 12: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 1u4IeU-0007A4-Ny; Mon, 14 Apr 2025 12:11:02 +0000
Received: by outflank-mailman (input) for mailman id 950042;
 Mon, 14 Apr 2025 12: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 1u4IeT-00079s-Ko
 for xen-changelog@lists.xenproject.org; Mon, 14 Apr 2025 12: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 1u4IeT-00Epwk-1k
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 12:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4IeT-00DKhy-1c
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 12: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=AcimmFhjryx9tjMp8EfJCAX9PM55drh/bhqD1WABzD8=; b=meuabUQvSqppLahfFp3B5UR2p6
	8G++Oll5cQkDxocCAHbM0W5Wdeg1YLcTR31V82bTgE6eNQYScdx9Q79x22/XyQKjux7YcQMoaAoyj
	pO9xmjU0pznJ7Jhuq+t90ibu7T+B5mvjDdm3tQois+frqWhTo/h/BoXsE/SeeG/mp6zE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/EFI: sanitize DLL characteristics in binary
Message-Id: <E1u4IeT-00DKhy-1c@xenbits.xenproject.org>
Date: Mon, 14 Apr 2025 12:11:01 +0000

commit f2148773b8ac64a27933afe13027fee02558f8c5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 14 13:04:28 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 14 13:04:28 2025 +0200

    x86/EFI: sanitize DLL characteristics in binary
    
    In GNU ld --disable-reloc-section implies --disable-dynamicbase (and
    also --disable-high-entropy-va, just fyi). Therefore to yield
    functionally identical binaries independent of whether mkreloc needs to
    come into play, add --dynamicbase as well.
    
    GNU ld further defaults to --high-entropy-va (along with --dynamicbase
    and --nxcompat) unless "Cygwin-like". This seems wrong to me; that
    default should be dependent upon "MinGW-like" instead; for the purpose
    of building EFI binaries with a PE32+-capable ELF linker neither
    "Cygwin-like" nor "MinGW-like" ought to be true. We certainly don't mean
    to have this bit set in the DLL characteristics, so suppress its
    setting.
    
    Sadly while --high-entropy-va is supported by GNU ld 2.25,
    --disable-high-entropy-va was introduced only in 2.36. Luckily the
    defaulting to --high-entropy-va was also only introduced in 2.36. Plus
    --disable-reloc-section was introduced precisely there, too. Hence
    leverage the probing we do as to base relocation generation, to also
    determine whether to pass --disable-high-entropy-va.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/arch.mk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk
index 7882fb895e..09b6d8758e 100644
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -103,6 +103,7 @@ efi-nr-fixups := $(shell LC_ALL=C $(OBJDUMP) -p $(efi-check).efi | grep '^[[:bla
 
 ifeq ($(efi-nr-fixups),2)
 MKRELOC := :
+EFI_LDFLAGS += --disable-high-entropy-va
 else
 MKRELOC := arch/x86/efi/mkreloc
 # If the linker produced fixups but not precisely two of them, we need to
@@ -113,6 +114,8 @@ EFI_LDFLAGS += --disable-reloc-section
 endif
 endif
 
+EFI_LDFLAGS += --dynamicbase
+
 endif # $(XEN_BUILD_PE)
 
 export XEN_BUILD_EFI XEN_BUILD_PE
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 14 12:11:12 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 14 Apr 2025 12:11:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.950043.1346458 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4Iee-0007EY-SW; Mon, 14 Apr 2025 12:11:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 950043.1346458; Mon, 14 Apr 2025 12: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 1u4Iee-0007EO-PN; Mon, 14 Apr 2025 12:11:12 +0000
Received: by outflank-mailman (input) for mailman id 950043;
 Mon, 14 Apr 2025 12: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 1u4Ied-0007EE-M0
 for xen-changelog@lists.xenproject.org; Mon, 14 Apr 2025 12: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 1u4Ied-00Epx2-26
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 12:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4Ied-00DKj9-1v
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 12: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=y+uh3L1Yk+FFQ9O1a1iGtTMoF05nzkuKF3GdIYzvL8E=; b=tgasUtwJY+V59u+wAUSLiDmlJ4
	oal9LMb46+EYBUsTOc8q5h/YklG/BvfJUTXz0J06BADo3pdeha8cp+TFWNKLHhjHaFNGudpGJJbFb
	zh/BalzJBrDKWl37xvCofbW3doLsPWRPyLEU0iR9/LlNT6deR80APNqC2Yjo06uGjTGs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mem-sharing: short-circuit p2m_is_shared() when MEM_SHARING=n
Message-Id: <E1u4Ied-00DKj9-1v@xenbits.xenproject.org>
Date: Mon, 14 Apr 2025 12:11:11 +0000

commit 40bc520ca0f484163e440e3eb3c930c719ebf9f6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 14 13:05:52 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 14 13:05:52 2025 +0200

    x86/mem-sharing: short-circuit p2m_is_shared() when MEM_SHARING=n
    
    Some of the uses of dom_cow aren't easily DCE-able (without extra
    #ifdef-ary), and hence it being constantly NULL when MEM_SHARING=n
    misguides Coverity into thinking that there may be a NULL deref in
    
            if ( p2m_is_shared(t) )
                d = dom_cow;
    
            if ( get_page(page, d) )
                return page;
    
    (in get_page_from_mfn_and_type()). Help the situation by making
    p2m_is_shared() be compile-time false when MEM_SHARING=n, thus also
    permitting the compiler to DCE some other code.
    
    Note that p2m_is_sharable() isn't used outside of mem_sharing.c, and
    hence P2M_SHARABLE_TYPES can simply be left undefined when
    MEM_SHARING=n.
    
    Coverity ID: 1645573
    Fixes: 79d91e178a1a ("dom_cow is needed for mem-sharing only")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/arch/x86/include/asm/p2m.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/arch/x86/include/asm/p2m.h b/xen/arch/x86/include/asm/p2m.h
index 6816a1be91..b9ce7d8705 100644
--- a/xen/arch/x86/include/asm/p2m.h
+++ b/xen/arch/x86/include/asm/p2m.h
@@ -136,11 +136,16 @@ typedef unsigned int p2m_query_t;
 #endif
 
 /* Shared types */
+#ifdef CONFIG_MEM_SHARING
 /* XXX: Sharable types could include p2m_ram_ro too, but we would need to
  * reinit the type correctly after fault */
 #define P2M_SHARABLE_TYPES (p2m_to_mask(p2m_ram_rw) \
                             | p2m_to_mask(p2m_ram_logdirty) )
 #define P2M_SHARED_TYPES   (p2m_to_mask(p2m_ram_shared))
+#else
+/* P2M_SHARABLE_TYPES deliberately not provided. */
+#define P2M_SHARED_TYPES 0
+#endif
 
 /* Types established/cleaned up via special accessors. */
 #define P2M_SPECIAL_TYPES (P2M_GRANT_TYPES | \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 14 12:11:22 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 14 Apr 2025 12:11:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.950044.1346461 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4Ieo-0007Mo-TY; Mon, 14 Apr 2025 12:11:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 950044.1346461; Mon, 14 Apr 2025 12: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 1u4Ieo-0007Mg-Qk; Mon, 14 Apr 2025 12:11:22 +0000
Received: by outflank-mailman (input) for mailman id 950044;
 Mon, 14 Apr 2025 12:11:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u4Ien-0007Jj-PJ
 for xen-changelog@lists.xenproject.org; Mon, 14 Apr 2025 12:11:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4Ien-00Epx6-2Q
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 12:11:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4Ien-00DKl8-2I
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 12: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=Uf0d2C+KXdvDOdG3WplH9pVY+7/k8GHSt0CIHi55Cd0=; b=YedTCHf314KWFKovFOhapsv9g4
	IKqzeJ0KsuEjzY9teXJDjoXQfH3m9642umUyZR0n6tZ+FdnRd+IWFrHQCRx0bj/Hq3+8C6N1MJ7N1
	M/7JNVNVsSYOFTlvXgOhxLmoEUopx0mUeM9cI3YWVmFXsPPHQGyVeDezukMLsDlt1NNg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: common: add ability to enable stack protector
Message-Id: <E1u4Ien-00DKl8-2I@xenbits.xenproject.org>
Date: Mon, 14 Apr 2025 12:11:21 +0000

commit be2a6a10962a7f54fd72fa4962261bcc748725cb
Author:     Volodymyr Babchuk <volodymyr_babchuk@epam.com>
AuthorDate: Mon Apr 14 13:07:12 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 14 13:07:12 2025 +0200

    xen: common: add ability to enable stack protector
    
    Both GCC and Clang support -fstack-protector feature, which add stack
    canaries to functions where stack corruption is possible. This patch
    makes general preparations to enable this feature on different
    supported architectures:
    
     - Added CONFIG_HAS_STACK_PROTECTOR option so each architecture
       can enable this feature individually
     - Added user-selectable CONFIG_STACK_PROTECTOR option
     - Implemented code that sets up random stack canary and a basic
       handler for stack protector failures
    
    Stack guard value is initialized in two phases:
    
    1. Pre-defined randomly-selected value.
    
    2. Own implementation of linear congruent random number generator. It
    relies on get_cycles() being available very early. If get_cycles()
    returns zero, it would leave pre-defined value from the previous step.
    
    boot_stack_chk_guard_setup() is declared as always_inline to ensure
    that it will not trigger stack protector by itself. And of course,
    caller should ensure that stack protection code will not be reached
    later. It is possible to call the same function from an ASM code by
    introducing simple trampoline in stack-protector.c, but right now
    there is no use case for such trampoline.
    
    As __stack_chk_fail() is not called by Xen source code directly, and
    only called by compiler-generated code, it does not needed to be
    declared separately. So we need separate MISRA deviation for it.
    
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 docs/misra/safe.json              |  8 ++++++++
 xen/Makefile                      |  4 ++++
 xen/common/Kconfig                | 15 +++++++++++++++
 xen/common/Makefile               |  1 +
 xen/common/stack-protector.c      | 22 ++++++++++++++++++++++
 xen/include/xen/stack-protector.h | 39 +++++++++++++++++++++++++++++++++++++++
 6 files changed, 89 insertions(+)

diff --git a/docs/misra/safe.json b/docs/misra/safe.json
index 3d68b59169..e3489dba8e 100644
--- a/docs/misra/safe.json
+++ b/docs/misra/safe.json
@@ -108,6 +108,14 @@
         },
         {
             "id": "SAF-13-safe",
+            "analyser": {
+                "eclair": "MC3A2.R8.4"
+            },
+            "name": "Rule 8.4: compiler-called function",
+            "text": "A function, all invocations of which are compiler generated, does not need to have a visible declaration prior to its definition."
+        },
+        {
+            "id": "SAF-14-safe",
             "analyser": {},
             "name": "Sentinel",
             "text": "Next ID to be used"
diff --git a/xen/Makefile b/xen/Makefile
index 58fafab33d..8fc4e042ff 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -435,7 +435,11 @@ else
 CFLAGS_UBSAN :=
 endif
 
+ifeq ($(CONFIG_STACK_PROTECTOR),y)
+CFLAGS += -fstack-protector
+else
 CFLAGS += -fno-stack-protector
+endif
 
 ifeq ($(CONFIG_LTO),y)
 CFLAGS += -flto
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 06ae9751aa..42a2b6a03f 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -100,6 +100,9 @@ config HAS_PMAP
 config HAS_SCHED_GRANULARITY
 	bool
 
+config HAS_STACK_PROTECTOR
+	bool
+
 config HAS_UBSAN
 	bool
 
@@ -233,6 +236,18 @@ config SPECULATIVE_HARDEN_LOCK
 
 endmenu
 
+menu "Other hardening"
+
+config STACK_PROTECTOR
+	bool "Stack protector"
+	depends on HAS_STACK_PROTECTOR
+	help
+	  Enable the Stack Protector compiler hardening option. This inserts a
+	  canary value in the stack frame of functions, and performs an integrity
+	  check on function exit.
+
+endmenu
+
 config DIT_DEFAULT
 	bool "Data Independent Timing default"
 	depends on HAS_DIT
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 9da8a7244d..f625031d16 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -46,6 +46,7 @@ obj-y += shutdown.o
 obj-y += softirq.o
 obj-y += smp.o
 obj-y += spinlock.o
+obj-$(CONFIG_STACK_PROTECTOR) += stack-protector.o
 obj-y += stop_machine.o
 obj-y += symbols.o
 obj-y += tasklet.o
diff --git a/xen/common/stack-protector.c b/xen/common/stack-protector.c
new file mode 100644
index 0000000000..2115912c3b
--- /dev/null
+++ b/xen/common/stack-protector.c
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#include <xen/init.h>
+#include <xen/lib.h>
+#include <xen/random.h>
+#include <xen/time.h>
+
+/*
+ * Initial value is chosen by a fair dice roll.
+ * It will be updated during boot process.
+ */
+#if BITS_PER_LONG == 32
+unsigned long __ro_after_init __stack_chk_guard = 0xdd2cc927UL;
+#else
+unsigned long __ro_after_init __stack_chk_guard = 0x2d853605a4d9a09cUL;
+#endif
+
+/* SAF-13-safe compiler-called function */
+void noreturn __stack_chk_fail(void)
+{
+    dump_execution_state();
+    panic("Stack Protector integrity violation identified\n");
+}
diff --git a/xen/include/xen/stack-protector.h b/xen/include/xen/stack-protector.h
new file mode 100644
index 0000000000..931affd919
--- /dev/null
+++ b/xen/include/xen/stack-protector.h
@@ -0,0 +1,39 @@
+#ifndef __XEN_STACK_PROTECTOR_H__
+#define __XEN_STACK_PROTECTOR_H__
+
+extern unsigned long __stack_chk_guard;
+
+/*
+ * This function should be called from a C function that escapes stack
+ * canary tracking (by calling reset_stack_and_jump() for example).
+ */
+static always_inline void boot_stack_chk_guard_setup(void)
+{
+#ifdef CONFIG_STACK_PROTECTOR
+
+    /*
+     * Linear congruent generator (X_n+1 = X_n * a + c).
+     *
+     * Constant is taken from "Tables Of Linear Congruential
+     * Generators Of Different Sizes And Good Lattice Structure" by
+     * Pierre L’Ecuyer.
+     */
+#if BITS_PER_LONG == 32
+    const unsigned long a = 2891336453UL;
+#else
+    const unsigned long a = 2862933555777941757UL;
+#endif
+    const unsigned long c = 1;
+
+    unsigned long cycles = get_cycles();
+
+    /* Use the initial value if we can't generate random one */
+    if ( !cycles )
+        return;
+
+    __stack_chk_guard = cycles * a + c;
+
+#endif	/* CONFIG_STACK_PROTECTOR */
+}
+
+#endif	/* __XEN_STACK_PROTECTOR_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 14 12:11:32 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 14 Apr 2025 12:11:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.950045.1346465 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4Iey-0007Ue-Up; Mon, 14 Apr 2025 12:11:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 950045.1346465; Mon, 14 Apr 2025 12:11: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 1u4Iey-0007UX-SA; Mon, 14 Apr 2025 12:11:32 +0000
Received: by outflank-mailman (input) for mailman id 950045;
 Mon, 14 Apr 2025 12:11:31 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u4Iex-0007UJ-SP
 for xen-changelog@lists.xenproject.org; Mon, 14 Apr 2025 12:11:31 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4Iex-00EpxX-2k
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 12:11:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4Iex-00DKoy-2c
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 12:11:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YV8Z7YdjmHpIbK+GKEef3WT1hhmO9IevdAkf5MECYn8=; b=uAp+L9D+NRBglX5DlPtICVmUKI
	iM6+dxhNz3DLylhBTTLya2PM8Crt3AbKBJnvuelI5LG794wdZxp+9K3aHuX47R16pfLUST49zpxdF
	qe947agAoi9DAHgGqdQQ/f6cyhiz8GN2dHPZOt2g/s5K3+doMP6w3ViVOPtjQRqxFbc4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: arm: enable stack protector feature
Message-Id: <E1u4Iex-00DKoy-2c@xenbits.xenproject.org>
Date: Mon, 14 Apr 2025 12:11:31 +0000

commit 1ec1462032f7d48ef34b65a679767bdef9d7ea46
Author:     Volodymyr Babchuk <volodymyr_babchuk@epam.com>
AuthorDate: Mon Apr 14 13:07:38 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 14 13:07:38 2025 +0200

    xen: arm: enable stack protector feature
    
    Enable previously added CONFIG_STACK_PROTECTOR feature for ARM
    platform. Initialize stack protector magic value very early, at the
    very beginning of start_xen() function.
    
    We want to do this early because prior to that
    boot_stack_chk_guard_setup() call, default stack protector guard value
    is used. While it is fine for general development and testing, it does
    not provide highest security level, because potential attacker will
    know the default value and can alter a payload, so correct stack
    guard value will be placed in the correct position.
    
    Apart from that argument, boot_stack_chk_guard_setup() should be
    called prior to enabling secondary CPUs to avoid race with them.
    
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/Kconfig | 1 +
 xen/arch/arm/setup.c | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 565f288331..da8a406f5a 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -15,6 +15,7 @@ config ARM
 	select GENERIC_UART_INIT
 	select HAS_ALTERNATIVE if HAS_VMAP
 	select HAS_DEVICE_TREE
+	select HAS_STACK_PROTECTOR
 	select HAS_UBSAN
 
 config ARCH_DEFCONFIG
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index bf39d41e9b..07703a15e1 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -30,6 +30,7 @@
 #include <xen/virtual_region.h>
 #include <xen/version.h>
 #include <xen/vmap.h>
+#include <xen/stack-protector.h>
 #include <xen/trace.h>
 #include <xen/libfdt/libfdt-xen.h>
 #include <xen/acpi.h>
@@ -306,6 +307,8 @@ void asmlinkage __init start_xen(unsigned long fdt_paddr)
     struct domain *d;
     int rc, i;
 
+    boot_stack_chk_guard_setup();
+
     dcache_line_bytes = read_dcache_line_bytes();
 
     percpu_init_areas();
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 14 12:11:43 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 14 Apr 2025 12:11:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.950046.1346469 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4If9-0007ho-01; Mon, 14 Apr 2025 12:11:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 950046.1346469; Mon, 14 Apr 2025 12:11: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 1u4If8-0007hg-TZ; Mon, 14 Apr 2025 12:11:42 +0000
Received: by outflank-mailman (input) for mailman id 950046;
 Mon, 14 Apr 2025 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 1u4If7-0007hS-VN
 for xen-changelog@lists.xenproject.org; Mon, 14 Apr 2025 12:11:41 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4If7-00Epxb-32
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 12:11:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4If7-00DKrZ-2u
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 12:11:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZA2xFkXiwzyzCrkPFmmp9hb32oDqK9kf5R6jgJl+35M=; b=IBbc/BnJX/TsrFsqH6UDlvd/eN
	TMXO48NjlWzhyVtavcWNEGAHVgzNDHAcnJ32WKF6AYJJ5IjrCeDCvrnyZ+LrfVjs8eFrrcbXJVFzw
	5Aic4ABnl3IIgTarStZU55rVE3yt5NfhZ2XucQvcWiwqf3BMJzMFqN25CFbZi+sj/bms=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CHANGELOG.md: Mention stack-protector feature
Message-Id: <E1u4If7-00DKrZ-2u@xenbits.xenproject.org>
Date: Mon, 14 Apr 2025 12:11:41 +0000

commit 7177602d46465f7a425e40f1be4ee82f5e316a7c
Author:     Volodymyr Babchuk <volodymyr_babchuk@epam.com>
AuthorDate: Mon Apr 14 13:08:27 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 14 13:08:27 2025 +0200

    CHANGELOG.md: Mention stack-protector feature
    
    Stack protector is meant to be enabled on all architectures, but
    currently it is tested (and enabled) only on ARM, so mention it in ARM
    section.
    
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 CHANGELOG.md | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8f6afa5c85..d3dd31dea2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
      capability usage is not yet supported on PVH dom0).
    - Smoke tests for the FreeBSD Xen builds in Cirrus CI.
 
+ - On Arm:
+    - Ability to enable stack protector
+
 ### Removed
 
 ## [4.20.0](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.20.0) - 2025-03-05
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 14 12:11:53 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 14 Apr 2025 12:11:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.950048.1346472 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4IfJ-0007sV-1C; Mon, 14 Apr 2025 12:11:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 950048.1346472; Mon, 14 Apr 2025 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 1u4IfI-0007sO-V1; Mon, 14 Apr 2025 12:11:52 +0000
Received: by outflank-mailman (input) for mailman id 950048;
 Mon, 14 Apr 2025 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 1u4IfI-0007sD-1v
 for xen-changelog@lists.xenproject.org; Mon, 14 Apr 2025 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 1u4IfI-00Epxf-06
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 12:11:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4IfH-00DKt3-3D
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 12:11:51 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mzUfF+IWXGeS15TMiE55LScsvrHbR1AW1Wyc7EtUxKw=; b=kJhuk6BJ/9gLgwC5vcsO5xrwmo
	BIA+7PRk5mLKQ1TkUqShr5WGQa5voShszUDEAiuGfJaCBnmOSnqwYbq+z8/DkhSFkobfe7rqH1OVC
	dj4IFU+I/GKo31ompLZ/a2XWviD146krMoNFCRFMd5vV3vTVpJBIUMtK8Y7VMe6jYyEI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] kconfig: introduce option to independently enable libfdt
Message-Id: <E1u4IfH-00DKt3-3D@xenbits.xenproject.org>
Date: Mon, 14 Apr 2025 12:11:51 +0000

commit 373c67d8a65556278e7cf8a226d19682c626de68
Author:     Daniel P. Smith <dpsmith@apertussolutions.com>
AuthorDate: Mon Apr 14 13:08:56 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 14 13:08:56 2025 +0200

    kconfig: introduce option to independently enable libfdt
    
    Currently, the inclusion of libfdt is controlled by the CONFIG_HAS_DEVICE_TREE
    kconfig flag. This flag also changes behavior in a few places, such as boot
    module processing for XSM. To support the ability to include libfdt without
    changing these behaviors, introduce CONFIG_LIBFDT. The inclusion of
    libfdt is then moved under CONFIG_LIBFDT.
    
    Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Denis Mukhin <dmukhin@ford.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/Kconfig  | 4 ++++
 xen/common/Makefile | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 42a2b6a03f..be28060716 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -72,6 +72,7 @@ config HAS_COMPAT
 
 config HAS_DEVICE_TREE
 	bool
+	select LIBFDT
 
 config HAS_DIT # Data Independent Timing
 	bool
@@ -109,6 +110,9 @@ config HAS_UBSAN
 config HAS_VMAP
 	bool
 
+config LIBFDT
+	bool
+
 config MEM_ACCESS_ALWAYS_ON
 	bool
 
diff --git a/xen/common/Makefile b/xen/common/Makefile
index f625031d16..98f0873056 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -80,7 +80,7 @@ obj-y += sched/
 obj-$(CONFIG_UBSAN) += ubsan/
 
 obj-$(CONFIG_NEEDS_LIBELF) += libelf/
-obj-$(CONFIG_HAS_DEVICE_TREE) += libfdt/
+obj-$(CONFIG_LIBFDT) += libfdt/
 
 CONF_FILE := $(if $(patsubst /%,,$(KCONFIG_CONFIG)),$(objtree)/)$(KCONFIG_CONFIG)
 $(obj)/config.gz: $(CONF_FILE)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 14 12:12:03 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 14 Apr 2025 12:12:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.950049.1346477 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4IfT-0007wP-39; Mon, 14 Apr 2025 12:12:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 950049.1346477; Mon, 14 Apr 2025 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 1u4IfT-0007wH-0C; Mon, 14 Apr 2025 12:12:03 +0000
Received: by outflank-mailman (input) for mailman id 950049;
 Mon, 14 Apr 2025 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 1u4IfS-0007w4-4h
 for xen-changelog@lists.xenproject.org; Mon, 14 Apr 2025 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 1u4IfS-00Epy2-0N
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 12:12:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4IfS-00DKwP-0G
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 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=Z+VjolrpBjlxd+CLu6Lyy0NCaf5bwKuGMfNHSFi57Hg=; b=z3XtQGgKQPwh3Tp7CBUYlHl0l+
	DEe8BVGX/cS8gh1hmM3JgZuYNsx37SvwFPLAlVuq+CAlpBLexPc7GFgd9PHO2YOwBMBH5tFOmnPuK
	BM5F5dJ8L9xTT0fgCbLU+Y1cWRtm4DHol1z4XFXU5nm9RLa9EZ25s/PSBDB6u04qJuxs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/cpufreq: only set gov NULL when cpufreq_driver.setpolicy is NULL
Message-Id: <E1u4IfS-00DKwP-0G@xenbits.xenproject.org>
Date: Mon, 14 Apr 2025 12:12:02 +0000

commit 7610180ff9e741bf1c29a9d0e9753e1ee818e0e4
Author:     Penny Zheng <Penny.Zheng@amd.com>
AuthorDate: Mon Apr 14 13:10:55 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 14 13:10:55 2025 +0200

    xen/cpufreq: only set gov NULL when cpufreq_driver.setpolicy is NULL
    
    amd-cppc on active mode bypasses the scaling governor layer, and
    provides its own P-state selection algorithms in hardware. Consequently,
    when it is used, the driver's -> setpolicy() callback is invoked
    to register per-CPU utilization update callbacks, not the ->target()
    callback.
    
    So, only when cpufreq_driver.setpolicy is NULL, we need to deliberately
    set old gov as NULL to trigger the according gov starting.
    
    Signed-off-by: Penny Zheng <Penny.Zheng@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/cpufreq/cpufreq.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c
index 4a103c6de9..19e2992335 100644
--- a/xen/drivers/cpufreq/cpufreq.c
+++ b/xen/drivers/cpufreq/cpufreq.c
@@ -307,7 +307,13 @@ int cpufreq_add_cpu(unsigned int cpu)
     if (hw_all || (cpumask_weight(cpufreq_dom->map) ==
                    perf->domain_info.num_processors)) {
         memcpy(&new_policy, policy, sizeof(struct cpufreq_policy));
-        policy->governor = NULL;
+
+        /*
+         * Only when cpufreq_driver.setpolicy == NULL, we need to deliberately
+         * set old gov as NULL to trigger the according gov starting.
+         */
+        if ( cpufreq_driver.setpolicy == NULL )
+            policy->governor = NULL;
 
         cpufreq_cmdline_common_para(&new_policy);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 14 13:11:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 14 Apr 2025 13:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.950151.1346540 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4JaZ-0001jD-Lo; Mon, 14 Apr 2025 13:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 950151.1346540; Mon, 14 Apr 2025 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 1u4JaZ-0001j5-JJ; Mon, 14 Apr 2025 13:11:03 +0000
Received: by outflank-mailman (input) for mailman id 950151;
 Mon, 14 Apr 2025 13: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 1u4JaX-0001it-NE
 for xen-changelog@lists.xenproject.org; Mon, 14 Apr 2025 13: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 1u4JaX-00ErbA-1h
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 13:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4JaX-00Dxuk-1T
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 13: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=5i2ikHE24dvLY13lNDiT4Fdf8Dr67daYK+RPEAyPQhY=; b=xGv4sjp/if23b8e5r7+Jzl7rOH
	vP3nHkeJTE+Vo4wcTXukgKbyTCPEWkTKsbmLw1uQjV8meTSbHcNiMy62E7NrLy5/3X4+SgKHUU8Ws
	ZhBF+Ck97/QUz4Hvew0p86FPr9X5cFB4zQk06vzstsank3T5BsLhNIN/HDdj4RSwTRN0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: fix waiting for final test message (again)
Message-Id: <E1u4JaX-00Dxuk-1T@xenbits.xenproject.org>
Date: Mon, 14 Apr 2025 13:11:01 +0000

commit 79de6507c59021484e7c0b359f45035eab891e88
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Sun Apr 13 15:47:31 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 14 12:16:43 2025 +0100

    CI: fix waiting for final test message (again)
    
    The previous attempt has correct diagnosis, but added -notransfer flag
    in a wrong place - it should be used in the first (outer) match out of
    two, not the second (inner) one.
    
    Fixes: 1e12cbd6af2c ("CI: fix waiting for final test message")
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/scripts/console.exp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/automation/scripts/console.exp b/automation/scripts/console.exp
index bdb1dd9820..fc80513dfb 100755
--- a/automation/scripts/console.exp
+++ b/automation/scripts/console.exp
@@ -60,12 +60,12 @@ if {[info exists env(WAKEUP_CMD)]} {
 
 if {[info exists env(LOG_MSG)]} {
     expect {
-        -re "$env(PASSED)" {
-            expect -notransfer -re "$env(LOG_MSG)"
+        -notransfer -re "$env(PASSED)" {
+            expect -re "$env(LOG_MSG)"
             exit 0
         }
-        -re "$env(LOG_MSG)" {
-            expect -notransfer -re "$env(PASSED)"
+        -notransfer -re "$env(LOG_MSG)" {
+            expect -re "$env(PASSED)"
             exit 0
         }
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 14 19:22:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 14 Apr 2025 19:22:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.951327.1347407 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4PNb-0003df-OE; Mon, 14 Apr 2025 19:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 951327.1347407; Mon, 14 Apr 2025 19:22:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4PNb-0003dX-Lb; Mon, 14 Apr 2025 19:22:03 +0000
Received: by outflank-mailman (input) for mailman id 951327;
 Mon, 14 Apr 2025 19: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 1u4PNa-0003dR-LJ
 for xen-changelog@lists.xenproject.org; Mon, 14 Apr 2025 19: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 1u4PNZ-00F2DL-33
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 19:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4PNZ-002DzY-2o
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 19:22:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mIa/Sl3Nm/L2F6aSkDe8Y/xBMKmHa1AK6bChQw2JtRg=; b=BkTkW3Z9sQV8jcqMqilp+p7TWS
	S4hH+l0TIQVhvB/8VrGQFxSmaOwz0w8N3V3b4b9hiQKtlT3r9ByAnJn/tGPxnCTk4oAvuXLgc7D1h
	KQhNhg4brUKepwq4MsC1AQ8CtP/5DUSZrYMVfK+ffErBWjq9XVIstmPBSbrvySdiD8gI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: Rename intermediate artefacts in qemu-* scripts
Message-Id: <E1u4PNZ-002DzY-2o@xenbits.xenproject.org>
Date: Mon, 14 Apr 2025 19:22:01 +0000

commit 9caca83404e707694d229853f8158c4c243c575c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sat Apr 12 15:33:01 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 14 19:20:58 2025 +0100

    CI: Rename intermediate artefacts in qemu-* scripts
    
    Right now, we have initrd.cpio.gz as domU, and initrd.tar.gz as the base for
    dom0.
    
    Rename initrd.cpio.gz to domU-rootfs.cpio.gz, and xen-rootfs.cpio.gz to
    dom0-rootfs.cpio.gz to make it clearer which is which.  Rename the VM from
    test to domU.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 automation/scripts/qemu-alpine-x86_64.sh    | 16 ++++++++--------
 automation/scripts/qemu-smoke-dom0-arm64.sh | 16 ++++++++--------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
index 89bdb4df7d..569bd766d3 100755
--- a/automation/scripts/qemu-alpine-x86_64.sh
+++ b/automation/scripts/qemu-alpine-x86_64.sh
@@ -25,7 +25,7 @@ mount -t devtmpfs devtmpfs /dev
 chmod +x initrd/init
 # DomU rootfs
 cd initrd
-find . | cpio --create --format='newc' | gzip > ../initrd.cpio.gz
+find . | cpio -H newc -o | gzip > ../domU-rootfs.cpio.gz
 cd ..
 
 # initrd.tar.gz is Dom0 rootfs
@@ -38,15 +38,15 @@ mkdir srv
 mkdir sys
 rm var/run
 cp -ar ../dist/install/* .
-mv ../initrd.cpio.gz ./root
+mv ../domU-rootfs.cpio.gz ./root
 cp ../bzImage ./root
-echo "name=\"test\"
+echo "name=\"domU\"
 memory=512
 vcpus=1
 kernel=\"/root/bzImage\"
-ramdisk=\"/root/initrd.cpio.gz\"
+ramdisk=\"/root/domU-rootfs.cpio.gz\"
 extra=\"console=hvc0 root=/dev/ram0 rdinit=/bin/sh\"
-" > root/test.cfg
+" > root/domU.cfg
 echo "#!/bin/bash
 
 set -x
@@ -56,13 +56,13 @@ bash /etc/init.d/xencommons start
 
 xl list
 
-xl -vvv create -c /root/test.cfg
+xl -vvv create -c /root/domU.cfg
 
 " > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
 echo "rc_verbose=yes" >> etc/rc.conf
 # rebuild Dom0 rootfs
-find . |cpio -H newc -o|gzip > ../xen-rootfs.cpio.gz
+find . | cpio -H newc -o | gzip > ../dom0-rootfs.cpio.gz
 cd ../..
 
 cat >> binaries/pxelinux.0 << EOF
@@ -70,7 +70,7 @@ cat >> binaries/pxelinux.0 << EOF
 
 kernel xen console=com1 console_timestamps=boot
 module bzImage console=hvc0
-module xen-rootfs.cpio.gz
+module dom0-rootfs.cpio.gz
 boot
 EOF
 
diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
index 51d037b000..e8e49ded24 100755
--- a/automation/scripts/qemu-smoke-dom0-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
@@ -24,7 +24,7 @@ mount -t devtmpfs devtmpfs /dev
 /bin/sh" > initrd/init
 chmod +x initrd/init
 cd initrd
-find . | cpio --create --format='newc' | gzip > ../initrd.cpio.gz
+find . | cpio -H newc -o | gzip > ../domU-rootfs.cpio.gz
 cd ..
 
 mkdir -p rootfs
@@ -36,15 +36,15 @@ mkdir srv
 mkdir sys
 rm var/run
 cp -ar ../dist/install/* .
-mv ../initrd.cpio.gz ./root
+mv ../domU-rootfs.cpio.gz ./root
 cp ../Image ./root
-echo "name=\"test\"
+echo "name=\"domU\"
 memory=512
 vcpus=1
 kernel=\"/root/Image\"
-ramdisk=\"/root/initrd.cpio.gz\"
+ramdisk=\"/root/domU-rootfs.cpio.gz\"
 extra=\"console=hvc0 root=/dev/ram0 rdinit=/bin/sh\"
-" > root/test.cfg
+" > root/domU.cfg
 echo "#!/bin/bash
 
 export LD_LIBRARY_PATH=/usr/local/lib
@@ -52,12 +52,12 @@ bash /etc/init.d/xencommons start
 
 xl list
 
-xl -vvv create -c /root/test.cfg
+xl -vvv create -c /root/domU.cfg
 
 " > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
 echo "rc_verbose=yes" >> etc/rc.conf
-find . |cpio -H newc -o|gzip > ../xen-rootfs.cpio.gz
+find . | cpio -H newc -o | gzip > ../dom0-rootfs.cpio.gz
 cd ../..
 
 # XXX QEMU looks for "efi-virtio.rom" even if it is unneeded
@@ -78,7 +78,7 @@ MEMORY_END="0xC0000000"
 DEVICE_TREE="virt-gicv2.dtb"
 XEN="xen"
 DOM0_KERNEL="Image"
-DOM0_RAMDISK="xen-rootfs.cpio.gz"
+DOM0_RAMDISK="dom0-rootfs.cpio.gz"
 XEN_CMD="console=dtuart dom0_mem=1024M console_timestamps=boot"
 
 NUM_DOMUS=0
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 14 19:22:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 14 Apr 2025 19:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.951331.1347411 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4PNl-0003fq-PV; Mon, 14 Apr 2025 19:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 951331.1347411; Mon, 14 Apr 2025 19: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 1u4PNl-0003fi-Mw; Mon, 14 Apr 2025 19:22:13 +0000
Received: by outflank-mailman (input) for mailman id 951331;
 Mon, 14 Apr 2025 19: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 1u4PNk-0003fT-2j
 for xen-changelog@lists.xenproject.org; Mon, 14 Apr 2025 19: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 1u4PNk-00F2DP-0A
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 19:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4PNk-002E4U-01
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 19: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=SDVIUb2KPMdYuwP49hDx+Z6hx5IprPCZ054UAiINceM=; b=DkF3SXsQVsh8SZFO6l7UjPCQOR
	GyrZrPP62rPbWfAD8wjLNKgFbKHH/DT0YxNv3KTf29ixd9QlzBJoikkFER7VGHs622VK1XV7Aso8M
	sEkP9KXXiI85zgwUPLgdoiLmYsJAKY5AwjA49Y84RsSSeDnynw0yNB8mFLAQQLSUDuLA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: avoid repacking initrd as part of the test job
Message-Id: <E1u4PNk-002E4U-01@xenbits.xenproject.org>
Date: Mon, 14 Apr 2025 19:22:12 +0000

commit 786f3238094f9460f59bce9f250adbf426f89297
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Fri Apr 11 22:32:17 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 14 19:20:58 2025 +0100

    CI: avoid repacking initrd as part of the test job
    
    Use the new test-artifacts which provide rootfs.cpio.gz rather than
    initrd.tar.gz.  rootfs.cpio.gz also has all the necessary top-level
    directories, and includes the rc_verbose setting, so these modifications can
    be dropped.
    
    Having that, do not repack the whole initrd, but only pack modified
    files and rely on Linux handling of concatenated archives.
    This allows packing just test-related files (which includes the whole
    toolstack), instead of the whole initrd.
    
    For xilinx-smoke-dom0-x86_64.sh, this involves instructing grub not to unzip
    the archive, as doing so corrupts it.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 automation/gitlab-ci/test.yaml                    |  8 +++---
 automation/scripts/qemu-alpine-x86_64.sh          | 16 +++++-------
 automation/scripts/qemu-smoke-dom0-arm64.sh       | 14 +++++-----
 automation/scripts/qemu-smoke-dom0less-arm64.sh   | 15 +++++------
 automation/scripts/qubes-x86-64.sh                | 32 +++++++++--------------
 automation/scripts/xilinx-smoke-dom0-x86_64.sh    | 27 ++++++++++---------
 automation/scripts/xilinx-smoke-dom0less-arm64.sh | 30 +++++++++------------
 7 files changed, 61 insertions(+), 81 deletions(-)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 59a2de28c8..51229cbe56 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -11,7 +11,9 @@
   - project: xen-project/hardware/test-artifacts
     job: linux-6.6.86-arm64
     ref: master
-  - alpine-3.18-arm64-rootfs-export
+  - project: xen-project/hardware/test-artifacts
+    job: alpine-3.18-arm64-rootfs
+    ref: master
   - qemu-system-aarch64-6.0.0-arm64-export
 
 .arm32-test-needs: &arm32-test-needs
@@ -22,7 +24,7 @@
     job: linux-6.6.56-x86_64
     ref: master
   - project: xen-project/hardware/test-artifacts
-    job: x86_64-rootfs-alpine-3.18
+    job: alpine-3.18-x86_64-rootfs
     ref: master
 
 .qemu-arm64:
@@ -243,7 +245,7 @@ xilinx-smoke-dom0-x86_64-gcc-debug-argo:
       job: x86_64-kernel-linux-6.6.56
       ref: master
     - project: xen-project/hardware/test-artifacts
-      job: x86_64-rootfs-alpine-3.18
+      job: alpine-3.18-x86_64-rootfs
       ref: master
     - project: xen-project/hardware/test-artifacts
       job: x86_64-argo-linux-6.6.56
diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
index 569bd766d3..c7dd121978 100755
--- a/automation/scripts/qemu-alpine-x86_64.sh
+++ b/automation/scripts/qemu-alpine-x86_64.sh
@@ -28,16 +28,14 @@ cd initrd
 find . | cpio -H newc -o | gzip > ../domU-rootfs.cpio.gz
 cd ..
 
-# initrd.tar.gz is Dom0 rootfs
+# Dom0 rootfs
+cp rootfs.cpio.gz dom0-rootfs.cpio.gz
+
+# test-local configuration
 mkdir -p rootfs
 cd rootfs
-tar xvzf ../initrd.tar.gz
-mkdir proc
-mkdir run
-mkdir srv
-mkdir sys
-rm var/run
 cp -ar ../dist/install/* .
+mkdir -p root etc/local.d
 mv ../domU-rootfs.cpio.gz ./root
 cp ../bzImage ./root
 echo "name=\"domU\"
@@ -60,9 +58,7 @@ xl -vvv create -c /root/domU.cfg
 
 " > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
-echo "rc_verbose=yes" >> etc/rc.conf
-# rebuild Dom0 rootfs
-find . | cpio -H newc -o | gzip > ../dom0-rootfs.cpio.gz
+find . | cpio -H newc -o | gzip >> ../dom0-rootfs.cpio.gz
 cd ../..
 
 cat >> binaries/pxelinux.0 << EOF
diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
index e8e49ded24..c0cf61ff8f 100755
--- a/automation/scripts/qemu-smoke-dom0-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
@@ -27,15 +27,14 @@ cd initrd
 find . | cpio -H newc -o | gzip > ../domU-rootfs.cpio.gz
 cd ..
 
+# Dom0 rootfs
+cp rootfs.cpio.gz dom0-rootfs.cpio.gz
+
+# test-local configuration
 mkdir -p rootfs
 cd rootfs
-tar xvzf ../initrd.tar.gz
-mkdir proc
-mkdir run
-mkdir srv
-mkdir sys
-rm var/run
 cp -ar ../dist/install/* .
+mkdir -p etc/local.d root
 mv ../domU-rootfs.cpio.gz ./root
 cp ../Image ./root
 echo "name=\"domU\"
@@ -56,8 +55,7 @@ xl -vvv create -c /root/domU.cfg
 
 " > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
-echo "rc_verbose=yes" >> etc/rc.conf
-find . | cpio -H newc -o | gzip > ../dom0-rootfs.cpio.gz
+find . | cpio -H newc -o | gzip >> ../dom0-rootfs.cpio.gz
 cd ../..
 
 # XXX QEMU looks for "efi-virtio.rom" even if it is unneeded
diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh b/automation/scripts/qemu-smoke-dom0less-arm64.sh
index f72d209361..8e939f0b72 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
@@ -114,16 +114,14 @@ cd initrd
 find . | cpio --create --format='newc' | gzip > ../binaries/initrd
 cd ..
 
-# DOM0 rootfs
+# Dom0 rootfs
+cp binaries/rootfs.cpio.gz binaries/dom0-rootfs.cpio.gz
+
+# test-local configuration
 mkdir -p rootfs
 cd rootfs
-tar xzf ../binaries/initrd.tar.gz
-mkdir proc
-mkdir run
-mkdir srv
-mkdir sys
-rm var/run
 cp -ar ../binaries/dist/install/* .
+mkdir -p etc/local.d
 
 echo "#!/bin/bash
 
@@ -142,8 +140,7 @@ xl network-attach 1 type=vif
 ${dom0_check}
 " > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
-echo "rc_verbose=yes" >> etc/rc.conf
-find . | cpio -H newc -o | gzip > ../binaries/dom0-rootfs.cpio.gz
+find . | cpio -H newc -o | gzip >> ../binaries/dom0-rootfs.cpio.gz
 cd ..
 
 # ImageBuilder
diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index c4be714642..e2376cb51c 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -164,16 +164,13 @@ ${domU_extra_config}
 "
 
 if [ -n "$domU_check" ]; then
-    # DomU
+    # DomU rootfs
+    cp binaries/rootfs.cpio.gz binaries/domU-rootfs.cpio.gz
+
+    # test-local configuration
     mkdir -p rootfs
     cd rootfs
-    # fakeroot is needed to preserve device nodes in rootless podman container
-    fakeroot -s ../fakeroot-save tar xzf ../binaries/initrd.tar.gz
-    mkdir proc
-    mkdir run
-    mkdir srv
-    mkdir sys
-    rm var/run
+    mkdir -p etc/local.d
     echo "#!/bin/sh
 
 echo 8 > /proc/sys/kernel/printk
@@ -181,26 +178,22 @@ echo 8 > /proc/sys/kernel/printk
 ${domU_check}
 " > etc/local.d/xen.start
     chmod +x etc/local.d/xen.start
-    echo "rc_verbose=yes" >> etc/rc.conf
     echo "domU Welcome to Alpine Linux
 Kernel \r on an \m (\l)
 
 " > etc/issue
-    find . | fakeroot -i ../fakeroot-save cpio -H newc -o | gzip > ../binaries/domU-rootfs.cpio.gz
+    find . | cpio -H newc -o | gzip >> ../binaries/domU-rootfs.cpio.gz
     cd ..
     rm -rf rootfs
 fi
 
-# DOM0 rootfs
+# Dom0 rootfs
+cp binaries/rootfs.cpio.gz binaries/dom0-rootfs.cpio.gz
+
+# test-local configuration
 mkdir -p rootfs
 cd rootfs
-fakeroot -s ../fakeroot-save tar xzf ../binaries/initrd.tar.gz
-mkdir boot
-mkdir proc
-mkdir run
-mkdir srv
-mkdir sys
-rm var/run
+mkdir -p boot etc/local.d
 cp -ar ../binaries/dist/install/* .
 cp -ar ../binaries/tests .
 cp -a ../automation/scripts/run-tools-tests tests/
@@ -237,7 +230,6 @@ fi
 chmod +x etc/local.d/xen.start
 echo "$domU_config" > etc/xen/domU.cfg
 
-echo "rc_verbose=yes" >> etc/rc.conf
 echo "XENCONSOLED_TRACE=all" >> etc/default/xencommons
 echo "QEMU_XEN=/bin/false" >> etc/default/xencommons
 mkdir -p var/log/xen/console
@@ -245,7 +237,7 @@ cp ../binaries/bzImage boot/vmlinuz
 if [ -n "$domU_check" ]; then
     cp ../binaries/domU-rootfs.cpio.gz boot/initrd-domU
 fi
-find . | fakeroot -i ../fakeroot-save cpio -H newc -o | gzip > ../binaries/dom0-rootfs.cpio.gz
+find . | cpio -H newc -o | gzip >> ../binaries/dom0-rootfs.cpio.gz
 cd ..
 
 
diff --git a/automation/scripts/xilinx-smoke-dom0-x86_64.sh b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
index 7e5382931b..1fc52d78db 100755
--- a/automation/scripts/xilinx-smoke-dom0-x86_64.sh
+++ b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
@@ -80,6 +80,7 @@ argo-exec -l -p 28333 -- /bin/echo
 "
 copy_dom0_files ()
 {
+    mkdir -p root usr/local/lib usr/local/bin
     cp "${WORKDIR}/binaries/xen-argo.ko" "root/"
     cp -ar "${WORKDIR}/binaries/lib/"* "usr/local/lib/"
     cp "${WORKDIR}/binaries/argo-exec" "usr/local/bin/"
@@ -89,12 +90,13 @@ else
     fatal "Unknown test: ${TEST}"
 fi
 
-# Set up domU rootfs.
+# DomU rootfs
+cp binaries/rootfs.cpio.gz binaries/domU-rootfs.cpio.gz
+
+# test-local configuration
 mkdir -p rootfs
 cd rootfs
-tar xzf ../binaries/initrd.tar.gz
-mkdir proc run srv sys
-rm var/run
+mkdir -p etc/local.d
 echo "#!/bin/sh
 set -x
 export LD_LIBRARY_PATH=/usr/local/lib
@@ -102,22 +104,22 @@ PATH=/usr/local/bin:/usr/local/sbin:\$PATH
 ${DOMU_CMD}
 " > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
-echo "rc_verbose=yes" >> etc/rc.conf
 echo "domU Welcome to Alpine Linux
 Kernel \r on an \m (\l)
 
 " > etc/issue
 copy_domU_files
-find . | cpio -H newc -o | gzip > ../binaries/domU-rootfs.cpio.gz
+find . | cpio -H newc -o | gzip >> ../binaries/domU-rootfs.cpio.gz
 cd ..
 rm -rf rootfs
 
-# Set up dom0 rootfs.
+# Dom0 rootfs
+cp binaries/rootfs.cpio.gz binaries/dom0-rootfs.cpio.gz
+
+# test-local configuration
 mkdir -p rootfs
 cd rootfs
-tar xzf ../binaries/initrd.tar.gz
-mkdir boot proc run srv sys
-rm var/run
+mkdir -p boot etc/local.d
 cp -ar ../binaries/dist/install/* .
 echo "#!/bin/bash
 set -x
@@ -127,14 +129,13 @@ ${DOM0_CMD}
 " > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
 echo "${DOMU_CFG}${DOMU_CFG_EXTRA}" > etc/xen/domU.cfg
-echo "rc_verbose=yes" >> etc/rc.conf
 echo "XENCONSOLED_TRACE=all" >> etc/default/xencommons
 echo "QEMU_XEN=/bin/false" >> etc/default/xencommons
 mkdir -p var/log/xen/console
 cp ../binaries/bzImage boot/vmlinuz
 cp ../binaries/domU-rootfs.cpio.gz boot/initrd-domU
 copy_dom0_files
-find . | cpio -H newc -o | gzip > ../binaries/dom0-rootfs.cpio.gz
+find . | cpio -H newc -o | gzip >> ../binaries/dom0-rootfs.cpio.gz
 cd ..
 
 # Load software into TFTP server directory.
@@ -147,7 +148,7 @@ echo "
 net_default_server=10.0.6.1
 multiboot2 (tftp)/${TEST_BOARD}/xen ${XEN_CMDLINE} sync_console
 module2 (tftp)/${TEST_BOARD}/vmlinuz console=hvc0 root=/dev/ram0 earlyprintk=xen
-module2 (tftp)/${TEST_BOARD}/initrd-dom0
+module2 --nounzip (tftp)/${TEST_BOARD}/initrd-dom0
 boot
 " > ${TFTP}/${TEST_BOARD}/grub.cfg
 
diff --git a/automation/scripts/xilinx-smoke-dom0less-arm64.sh b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
index 3e1fcf6bf9..a3031ecab0 100755
--- a/automation/scripts/xilinx-smoke-dom0less-arm64.sh
+++ b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
@@ -38,36 +38,31 @@ echo \"${passed}\"
 "
 fi
 
-# DomU
+# DomU rootfs
+cp binaries/rootfs.cpio.gz binaries/domU-rootfs.cpio.gz
+
+# test-local configuration
 mkdir -p rootfs
 cd rootfs
-tar xzf ../binaries/initrd.tar.gz
-mkdir proc
-mkdir run
-mkdir srv
-mkdir sys
-rm var/run
+mkdir -p etc/local.d
 echo "#!/bin/sh
 
 ${domU_check}
 /bin/sh" > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
-echo "rc_verbose=yes" >> etc/rc.conf
-find . | cpio -H newc -o | gzip > ../binaries/domU-rootfs.cpio.gz
+find . | cpio -H newc -o | gzip >> ../binaries/domU-rootfs.cpio.gz
 cd ..
 rm -rf rootfs
 
-# DOM0 rootfs
+# Dom0 rootfs
+cp binaries/rootfs.cpio.gz binaries/dom0-rootfs.cpio.gz
+
+# test-local configuration
 mkdir -p rootfs
 cd rootfs
-tar xzf ../binaries/initrd.tar.gz
-mkdir proc
-mkdir run
-mkdir srv
-mkdir sys
-rm var/run
 cp -ar ../binaries/dist/install/* .
 
+mkdir -p etc/local.d
 echo "#!/bin/bash
 
 export LD_LIBRARY_PATH=/usr/local/lib
@@ -78,8 +73,7 @@ bash /etc/init.d/xencommons start
 ${dom0_check}
 " > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
-echo "rc_verbose=yes" >> etc/rc.conf
-find . | cpio -H newc -o | gzip > ../binaries/dom0-rootfs.cpio.gz
+find . | cpio -H newc -o | gzip >> ../binaries/dom0-rootfs.cpio.gz
 cd ..
 
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 14 19:22:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 14 Apr 2025 19:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.951332.1347415 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4PNv-0003iE-RB; Mon, 14 Apr 2025 19:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 951332.1347415; Mon, 14 Apr 2025 19: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 1u4PNv-0003i7-ON; Mon, 14 Apr 2025 19:22:23 +0000
Received: by outflank-mailman (input) for mailman id 951332;
 Mon, 14 Apr 2025 19: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 1u4PNu-0003hi-5j
 for xen-changelog@lists.xenproject.org; Mon, 14 Apr 2025 19: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 1u4PNu-00F2DX-0T
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 19:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4PNu-002E9O-0L
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 19: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=v2PhlGtvHZvVIbqhZaJJ2XztdvS1IS8ouOAifLlcMBI=; b=IsoDgLd1I3yjjVSj3oF7UOOiU9
	Ze5HsHl9G6ZhJe5A1E3LI38XGkQZXJS5Kzr/LgpcRf6I5TBjF27+tELOiCkxAnP5968PeKcLRv2St
	htblEMcYoVohkP8q6kr5MaPPtDlNlUhoOvZpK1q7IUwVMva7ef2mXA0WmRAX7FJ/JPhY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: remove now unused alpine-3.18-arm64-rootfs job and its container
Message-Id: <E1u4PNu-002E9O-0L@xenbits.xenproject.org>
Date: Mon, 14 Apr 2025 19:22:22 +0000

commit 93f12111c749962b77eb4671d740d3d010429174
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Fri Apr 11 15:47:22 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 14 19:20:58 2025 +0100

    CI: remove now unused alpine-3.18-arm64-rootfs job and its container
    
    This got moved to test-artifacts.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 automation/gitlab-ci/build.yaml                    | 11 ----
 .../tests-artifacts/alpine/3.18-arm64v8.dockerfile | 66 ----------------------
 2 files changed, 77 deletions(-)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 40dcd31f1b..1b82b359d0 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -264,17 +264,6 @@
 
 # Arm test artifacts
 
-alpine-3.18-arm64-rootfs-export:
-  extends: .test-jobs-artifact-common
-  image: registry.gitlab.com/xen-project/xen/tests-artifacts/alpine:3.18-arm64v8
-  script:
-    - mkdir binaries && cp /initrd.tar.gz binaries/initrd.tar.gz
-  artifacts:
-    paths:
-      - binaries/initrd.tar.gz
-  tags:
-    - arm64
-
 qemu-system-aarch64-6.0.0-arm64-export:
   extends: .test-jobs-artifact-common
   image: registry.gitlab.com/xen-project/xen/tests-artifacts/qemu-system-aarch64:6.0.0-arm64v8
diff --git a/automation/tests-artifacts/alpine/3.18-arm64v8.dockerfile b/automation/tests-artifacts/alpine/3.18-arm64v8.dockerfile
deleted file mode 100644
index a4542f7039..0000000000
--- a/automation/tests-artifacts/alpine/3.18-arm64v8.dockerfile
+++ /dev/null
@@ -1,66 +0,0 @@
-# syntax=docker/dockerfile:1
-FROM --platform=linux/arm64/v8 alpine:3.18
-LABEL maintainer.name="The Xen Project" \
-      maintainer.email="xen-devel@lists.xenproject.org"
-
-ENV USER root
-
-RUN mkdir /build
-WORKDIR /build
-
-RUN \
-  # apk
-  apk update && \
-  \
-  # xen runtime deps
-  apk add musl && \
-  apk add openrc && \
-  apk add busybox && \
-  apk add sudo && \
-  apk add dbus && \
-  apk add bash && \
-  apk add python3 && \
-  apk add zlib && \
-  apk add ncurses && \
-  apk add yajl && \
-  apk add libaio && \
-  apk add xz && \
-  apk add util-linux && \
-  apk add argp-standalone && \
-  apk add libfdt && \
-  apk add glib && \
-  apk add pixman && \
-  apk add curl && \
-  apk add udev && \
-  \
-  # Xen
-  cd / && \
-  # Minimal ramdisk environment in case of cpio output
-  rc-update add udev && \
-  rc-update add udev-trigger && \
-  rc-update add udev-settle && \
-  rc-update add networking sysinit && \
-  rc-update add loopback sysinit && \
-  rc-update add bootmisc boot && \
-  rc-update add devfs sysinit && \
-  rc-update add dmesg sysinit && \
-  rc-update add hostname boot && \
-  rc-update add hwclock boot && \
-  rc-update add hwdrivers sysinit && \
-  rc-update add killprocs shutdown && \
-  rc-update add modloop sysinit && \
-  rc-update add modules boot && \
-  rc-update add mount-ro shutdown && \
-  rc-update add savecache shutdown && \
-  rc-update add sysctl boot && \
-  rc-update add local default && \
-  cp -a /sbin/init /init && \
-  echo "ttyS0" >> /etc/securetty && \
-  echo "hvc0" >> /etc/securetty && \
-  echo "ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100" >> /etc/inittab && \
-  echo "hvc0::respawn:/sbin/getty -L hvc0 115200 vt100" >> /etc/inittab && \
-  passwd -d "root" root && \
-  \
-  # Create rootfs
-  cd / && \
-  tar cvzf /initrd.tar.gz bin dev etc home init lib mnt opt root sbin usr var
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 14 19:22:34 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 14 Apr 2025 19:22:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.951334.1347419 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4PO5-0003kv-Sx; Mon, 14 Apr 2025 19:22:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 951334.1347419; Mon, 14 Apr 2025 19: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 1u4PO5-0003kn-Pw; Mon, 14 Apr 2025 19:22:33 +0000
Received: by outflank-mailman (input) for mailman id 951334;
 Mon, 14 Apr 2025 19: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 1u4PO4-0003ka-99
 for xen-changelog@lists.xenproject.org; Mon, 14 Apr 2025 19: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 1u4PO4-00F2De-0o
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 19:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4PO4-002EJp-0e
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 19: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=s+0hL9EE7R6HzwYNFoD8q98yUgLIOoCbz3RQazoLmnY=; b=WjeCq5pt+g3q/sWMoM6rn4hXOH
	W+Loh0OLZIXJAns8tRI05pQ1aopDxC3HwhcADvR3sLrg06ql5SNGyRMjKsXYE1yHaiq9YetzfF3Hf
	G/jY2cX2pNpfaCaugx23QLlEjDxBPVI38yNnkr5DXXa1grDQPqBs1mARKc/gY1WNZYVU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: Switch to new argo artefact
Message-Id: <E1u4PO4-002EJp-0e@xenbits.xenproject.org>
Date: Mon, 14 Apr 2025 19:22:32 +0000

commit 464d4dd4565c271a46f01a7909593f89b538259f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Apr 10 21:39:16 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 14 19:20:58 2025 +0100

    CI: Switch to new argo artefact
    
    The argo artefact is now a cpio archive and can be appended to dom?-rootfs
    directly, rather than being part of of the overlay.  Drop the
    copy_dom?_files() functions.
    
    xen-argo.ko has moved into the standard location, so update the insmod path.
    
    No practical change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 automation/gitlab-ci/test.yaml                 |  5 +----
 automation/scripts/xilinx-smoke-dom0-x86_64.sh | 22 ++++++++--------------
 2 files changed, 9 insertions(+), 18 deletions(-)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 51229cbe56..ef3560930c 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -242,14 +242,11 @@ xilinx-smoke-dom0-x86_64-gcc-debug-argo:
   needs:
     - alpine-3.18-gcc-debug
     - project: xen-project/hardware/test-artifacts
-      job: x86_64-kernel-linux-6.6.56
+      job: linux-6.6.56-x86_64
       ref: master
     - project: xen-project/hardware/test-artifacts
       job: alpine-3.18-x86_64-rootfs
       ref: master
-    - project: xen-project/hardware/test-artifacts
-      job: x86_64-argo-linux-6.6.56
-      ref: master
 
 adl-smoke-x86-64-gcc-debug:
   extends: .adl-x86-64
diff --git a/automation/scripts/xilinx-smoke-dom0-x86_64.sh b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
index 1fc52d78db..85007dcc29 100755
--- a/automation/scripts/xilinx-smoke-dom0-x86_64.sh
+++ b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
@@ -28,8 +28,6 @@ extra = "root=/dev/ram0 console=hvc0"
 memory = 512
 '
 DOMU_CFG_EXTRA=""
-copy_domU_files () { :; }
-copy_dom0_files () { :; }
 
 # Select test variant.
 if [ "${TEST}" = "ping" ]; then
@@ -66,7 +64,7 @@ then
     PASS_MSG="TEST: Message from DOMU"
     XEN_CMD_EXTRA="argo=1,mac-permissive=1"
     DOMU_CMD="
-insmod /root/xen-argo.ko
+insmod /lib/modules/\$(uname -r)/updates/xen-argo.ko
 until false
 do
   echo \"${PASS_MSG}\"
@@ -74,24 +72,19 @@ do
 done | argo-exec -p 28333 -d 0 -- /bin/echo
 "
     DOM0_CMD="
-insmod /root/xen-argo.ko
+insmod /lib/modules/\$(uname -r)/updates/xen-argo.ko
 xl -vvv create /etc/xen/domU.cfg
 argo-exec -l -p 28333 -- /bin/echo
 "
-copy_dom0_files ()
-{
-    mkdir -p root usr/local/lib usr/local/bin
-    cp "${WORKDIR}/binaries/xen-argo.ko" "root/"
-    cp -ar "${WORKDIR}/binaries/lib/"* "usr/local/lib/"
-    cp "${WORKDIR}/binaries/argo-exec" "usr/local/bin/"
-}
-copy_domU_files () { copy_dom0_files; }
 else
     fatal "Unknown test: ${TEST}"
 fi
 
 # DomU rootfs
 cp binaries/rootfs.cpio.gz binaries/domU-rootfs.cpio.gz
+if [[ "${TEST}" == argo ]]; then
+    cat binaries/argo.cpio.gz >> binaries/domU-rootfs.cpio.gz
+fi
 
 # test-local configuration
 mkdir -p rootfs
@@ -108,13 +101,15 @@ echo "domU Welcome to Alpine Linux
 Kernel \r on an \m (\l)
 
 " > etc/issue
-copy_domU_files
 find . | cpio -H newc -o | gzip >> ../binaries/domU-rootfs.cpio.gz
 cd ..
 rm -rf rootfs
 
 # Dom0 rootfs
 cp binaries/rootfs.cpio.gz binaries/dom0-rootfs.cpio.gz
+if [[ "${TEST}" == argo ]]; then
+    cat binaries/argo.cpio.gz >> binaries/dom0-rootfs.cpio.gz
+fi
 
 # test-local configuration
 mkdir -p rootfs
@@ -134,7 +129,6 @@ echo "QEMU_XEN=/bin/false" >> etc/default/xencommons
 mkdir -p var/log/xen/console
 cp ../binaries/bzImage boot/vmlinuz
 cp ../binaries/domU-rootfs.cpio.gz boot/initrd-domU
-copy_dom0_files
 find . | cpio -H newc -o | gzip >> ../binaries/dom0-rootfs.cpio.gz
 cd ..
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 14 19:22:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 14 Apr 2025 19:22:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.951335.1347423 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4POF-0003nt-WC; Mon, 14 Apr 2025 19:22:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 951335.1347423; Mon, 14 Apr 2025 19: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 1u4POF-0003nl-TL; Mon, 14 Apr 2025 19:22:43 +0000
Received: by outflank-mailman (input) for mailman id 951335;
 Mon, 14 Apr 2025 19: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 1u4POE-0003nT-CR
 for xen-changelog@lists.xenproject.org; Mon, 14 Apr 2025 19: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 1u4POE-00F2E5-18
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 19:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4POE-002EUM-0y
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 19: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=rAyzqhV8YKUA3iiocNYQdVuuzo444rfUsVY4264BXFI=; b=4e1W9Gbnx1SMt9hVnFeMoJJoRq
	WYlRPsu0MmFu3TpdQlSjFo4yNGxLl64l6KuapgPqvRVB1NpmhWGuSxybt1iTZNTHz5KSfEVibZCva
	6GV0RXh7hya6MSuWS2f0FJeTBT2jLo8jxMaLtoRhJiyKLttIx3+z8lROCQbaG6Fb/pRs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: save toolstack artifact as cpio.gz
Message-Id: <E1u4POE-002EUM-0y@xenbits.xenproject.org>
Date: Mon, 14 Apr 2025 19:22:42 +0000

commit 4611ae6fb8f90d25601fcc0688799ef63a374304
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Fri Apr 11 22:32:19 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 14 19:20:58 2025 +0100

    CI: save toolstack artifact as cpio.gz
    
    This avoids the need to re-compress it in every test job.  This saves minutes
    of wallclock time.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 automation/scripts/build                          | 2 +-
 automation/scripts/qemu-alpine-x86_64.sh          | 2 +-
 automation/scripts/qemu-smoke-dom0-arm64.sh       | 2 +-
 automation/scripts/qemu-smoke-dom0less-arm64.sh   | 2 +-
 automation/scripts/qubes-x86-64.sh                | 4 +++-
 automation/scripts/xilinx-smoke-dom0-x86_64.sh    | 4 ++--
 automation/scripts/xilinx-smoke-dom0less-arm64.sh | 3 +--
 7 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/automation/scripts/build b/automation/scripts/build
index 522efe774e..51effec81d 100755
--- a/automation/scripts/build
+++ b/automation/scripts/build
@@ -108,7 +108,7 @@ else
     # Note: Some smoke tests depending on finding binaries/xen on a full build
     # even though dist/ contains everything, while some containers don't even
     # build Xen
-    cp -r dist binaries/
+    (cd dist/install; find | cpio -o -H newc | gzip) > binaries/xen-tools.cpio.gz
     cp -r tools/tests binaries/
     collect_xen_artefacts
 fi
diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
index c7dd121978..fe86caa393 100755
--- a/automation/scripts/qemu-alpine-x86_64.sh
+++ b/automation/scripts/qemu-alpine-x86_64.sh
@@ -30,11 +30,11 @@ cd ..
 
 # Dom0 rootfs
 cp rootfs.cpio.gz dom0-rootfs.cpio.gz
+cat xen-tools.cpio.gz >> dom0-rootfs.cpio.gz
 
 # test-local configuration
 mkdir -p rootfs
 cd rootfs
-cp -ar ../dist/install/* .
 mkdir -p root etc/local.d
 mv ../domU-rootfs.cpio.gz ./root
 cp ../bzImage ./root
diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
index c0cf61ff8f..61dd24b9ab 100755
--- a/automation/scripts/qemu-smoke-dom0-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
@@ -29,11 +29,11 @@ cd ..
 
 # Dom0 rootfs
 cp rootfs.cpio.gz dom0-rootfs.cpio.gz
+cat xen-tools.cpio.gz >> dom0-rootfs.cpio.gz
 
 # test-local configuration
 mkdir -p rootfs
 cd rootfs
-cp -ar ../dist/install/* .
 mkdir -p etc/local.d root
 mv ../domU-rootfs.cpio.gz ./root
 cp ../Image ./root
diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh b/automation/scripts/qemu-smoke-dom0less-arm64.sh
index 8e939f0b72..58f11dd310 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
@@ -116,11 +116,11 @@ cd ..
 
 # Dom0 rootfs
 cp binaries/rootfs.cpio.gz binaries/dom0-rootfs.cpio.gz
+cat binaries/xen-tools.cpio.gz >> binaries/dom0-rootfs.cpio.gz
 
 # test-local configuration
 mkdir -p rootfs
 cd rootfs
-cp -ar ../binaries/dist/install/* .
 mkdir -p etc/local.d
 
 echo "#!/bin/bash
diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index e2376cb51c..3947027d6e 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -189,12 +189,12 @@ fi
 
 # Dom0 rootfs
 cp binaries/rootfs.cpio.gz binaries/dom0-rootfs.cpio.gz
+cat binaries/xen-tools.cpio.gz >> binaries/dom0-rootfs.cpio.gz
 
 # test-local configuration
 mkdir -p rootfs
 cd rootfs
 mkdir -p boot etc/local.d
-cp -ar ../binaries/dist/install/* .
 cp -ar ../binaries/tests .
 cp -a ../automation/scripts/run-tools-tests tests/
 
@@ -228,8 +228,10 @@ else
 fi
 
 chmod +x etc/local.d/xen.start
+mkdir -p etc/xen
 echo "$domU_config" > etc/xen/domU.cfg
 
+mkdir -p etc/default
 echo "XENCONSOLED_TRACE=all" >> etc/default/xencommons
 echo "QEMU_XEN=/bin/false" >> etc/default/xencommons
 mkdir -p var/log/xen/console
diff --git a/automation/scripts/xilinx-smoke-dom0-x86_64.sh b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
index 85007dcc29..1f8cc172c6 100755
--- a/automation/scripts/xilinx-smoke-dom0-x86_64.sh
+++ b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
@@ -107,6 +107,7 @@ rm -rf rootfs
 
 # Dom0 rootfs
 cp binaries/rootfs.cpio.gz binaries/dom0-rootfs.cpio.gz
+cat binaries/xen-tools.cpio.gz >> binaries/dom0-rootfs.cpio.gz
 if [[ "${TEST}" == argo ]]; then
     cat binaries/argo.cpio.gz >> binaries/dom0-rootfs.cpio.gz
 fi
@@ -114,8 +115,7 @@ fi
 # test-local configuration
 mkdir -p rootfs
 cd rootfs
-mkdir -p boot etc/local.d
-cp -ar ../binaries/dist/install/* .
+mkdir -p boot etc/local.d etc/xen etc/default
 echo "#!/bin/bash
 set -x
 export LD_LIBRARY_PATH=/usr/local/lib
diff --git a/automation/scripts/xilinx-smoke-dom0less-arm64.sh b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
index a3031ecab0..59f3fe7edb 100755
--- a/automation/scripts/xilinx-smoke-dom0less-arm64.sh
+++ b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
@@ -56,12 +56,11 @@ rm -rf rootfs
 
 # Dom0 rootfs
 cp binaries/rootfs.cpio.gz binaries/dom0-rootfs.cpio.gz
+cat binaries/xen-tools.cpio.gz >> binaries/dom0-rootfs.cpio.gz
 
 # test-local configuration
 mkdir -p rootfs
 cd rootfs
-cp -ar ../binaries/dist/install/* .
-
 mkdir -p etc/local.d
 echo "#!/bin/bash
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 14 19:22:54 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 14 Apr 2025 19:22:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.951337.1347428 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4POQ-0003qT-2Q; Mon, 14 Apr 2025 19:22:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 951337.1347428; Mon, 14 Apr 2025 19: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 1u4POP-0003qL-Ur; Mon, 14 Apr 2025 19:22:53 +0000
Received: by outflank-mailman (input) for mailman id 951337;
 Mon, 14 Apr 2025 19: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 1u4POO-0003qB-Et
 for xen-changelog@lists.xenproject.org; Mon, 14 Apr 2025 19: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 1u4POO-00F2EB-1P
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 19:22:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4POO-002EbN-1J
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 19: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=DG8m0RjfCOXbV/NLY14Ycq58BbNA6dqRbsElU/0JC2Y=; b=KnsVUXzVfS7KPpeCbXz6oaLGHJ
	SRQPTaesGdcsJkofJ3HwZq+Y+7Vn2MHSMLnaMheiDj56DUQeDw4RVvsNJOiX9c8EJs/Qyr8S3XIGL
	UHO+faeqBvtIFNu4E3iXT67Wb+eVV3EXItDKVaZxIK5s4izIX6XAMABhOKQmaexN+xEQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: Include microcode for x86 hardware jobs
Message-Id: <E1u4POO-002EbN-1J@xenbits.xenproject.org>
Date: Mon, 14 Apr 2025 19:22:52 +0000

commit 4a39780faafa79034aa4f637ab8a3f1922b95919
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Apr 11 20:28:15 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 14 19:20:58 2025 +0100

    CI: Include microcode for x86 hardware jobs
    
    All the x86 hardware runners are out of date, to varying degrees, in terms of
    microcode.
    
    Microcode must be uncompressed and prepended to the initrd in order for Xen to
    be able to use it during early boot.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 automation/gitlab-ci/build.yaml                | 1 +
 automation/gitlab-ci/test.yaml                 | 6 ++++++
 automation/scripts/qubes-x86-64.sh             | 3 ++-
 automation/scripts/xilinx-smoke-dom0-x86_64.sh | 3 ++-
 4 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 1b82b359d0..ac53678745 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -306,6 +306,7 @@ alpine-3.18-gcc-debug:
       CONFIG_ARGO=y
       CONFIG_UBSAN=y
       CONFIG_UBSAN_FATAL=y
+      CONFIG_UCODE_SCAN_DEFAULT=y
       CONFIG_XHCI=y
 
 debian-12-x86_64-gcc-debug:
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index ef3560930c..5ce445b78f 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -26,6 +26,9 @@
   - project: xen-project/hardware/test-artifacts
     job: alpine-3.18-x86_64-rootfs
     ref: master
+  - project: xen-project/hardware/test-artifacts
+    job: microcode-x86
+    ref: master
 
 .qemu-arm64:
   extends: .test-jobs-common
@@ -247,6 +250,9 @@ xilinx-smoke-dom0-x86_64-gcc-debug-argo:
     - project: xen-project/hardware/test-artifacts
       job: alpine-3.18-x86_64-rootfs
       ref: master
+    - project: xen-project/hardware/test-artifacts
+      job: microcode-x86
+      ref: master
 
 adl-smoke-x86-64-gcc-debug:
   extends: .adl-x86-64
diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index 3947027d6e..1f90e7002c 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -188,7 +188,8 @@ Kernel \r on an \m (\l)
 fi
 
 # Dom0 rootfs
-cp binaries/rootfs.cpio.gz binaries/dom0-rootfs.cpio.gz
+cp binaries/ucode.cpio binaries/dom0-rootfs.cpio.gz
+cat binaries/rootfs.cpio.gz >> binaries/dom0-rootfs.cpio.gz
 cat binaries/xen-tools.cpio.gz >> binaries/dom0-rootfs.cpio.gz
 
 # test-local configuration
diff --git a/automation/scripts/xilinx-smoke-dom0-x86_64.sh b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
index 1f8cc172c6..5bb44188dc 100755
--- a/automation/scripts/xilinx-smoke-dom0-x86_64.sh
+++ b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
@@ -106,7 +106,8 @@ cd ..
 rm -rf rootfs
 
 # Dom0 rootfs
-cp binaries/rootfs.cpio.gz binaries/dom0-rootfs.cpio.gz
+cp binaries/ucode.cpio binaries/dom0-rootfs.cpio.gz
+cat binaries/rootfs.cpio.gz >> binaries/dom0-rootfs.cpio.gz
 cat binaries/xen-tools.cpio.gz >> binaries/dom0-rootfs.cpio.gz
 if [[ "${TEST}" == argo ]]; then
     cat binaries/argo.cpio.gz >> binaries/dom0-rootfs.cpio.gz
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 14 20:00:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 14 Apr 2025 20:00:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.951354.1347442 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4PyM-00045o-Q4; Mon, 14 Apr 2025 20:00:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 951354.1347442; Mon, 14 Apr 2025 20: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 1u4PyM-00045g-My; Mon, 14 Apr 2025 20:00:02 +0000
Received: by outflank-mailman (input) for mailman id 951354;
 Mon, 14 Apr 2025 20: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 1u4PyL-0003tR-Qu
 for xen-changelog@lists.xenproject.org; Mon, 14 Apr 2025 20: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 1u4PyL-00F38X-27
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 20:00:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4PyL-002SRk-1z
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 20: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=OXSd+EbUMigJMoMhnWE9t7UGEVXN1WEsjauSXu5Gypk=; b=R1l0PLfs0W7cdaWTNvWaTQBkgh
	oggW7W/GlRILSeJkkl31t1fnZjjpg846Kj+mrKPVQuOX5sizPc9NbVNyKU5QUxPKp1IA2/HHVJBlM
	5Uv3BhGmYzKQM7B9azPJ+J6196QRPwU966VEK8K6/IY/p43igrRDuTxIAS18zVMQYZBI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: Rename intermediate artefacts in qemu-* scripts
Message-Id: <E1u4PyL-002SRk-1z@xenbits.xenproject.org>
Date: Mon, 14 Apr 2025 20:00:01 +0000

commit 9caca83404e707694d229853f8158c4c243c575c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sat Apr 12 15:33:01 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 14 19:20:58 2025 +0100

    CI: Rename intermediate artefacts in qemu-* scripts
    
    Right now, we have initrd.cpio.gz as domU, and initrd.tar.gz as the base for
    dom0.
    
    Rename initrd.cpio.gz to domU-rootfs.cpio.gz, and xen-rootfs.cpio.gz to
    dom0-rootfs.cpio.gz to make it clearer which is which.  Rename the VM from
    test to domU.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 automation/scripts/qemu-alpine-x86_64.sh    | 16 ++++++++--------
 automation/scripts/qemu-smoke-dom0-arm64.sh | 16 ++++++++--------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
index 89bdb4df7d..569bd766d3 100755
--- a/automation/scripts/qemu-alpine-x86_64.sh
+++ b/automation/scripts/qemu-alpine-x86_64.sh
@@ -25,7 +25,7 @@ mount -t devtmpfs devtmpfs /dev
 chmod +x initrd/init
 # DomU rootfs
 cd initrd
-find . | cpio --create --format='newc' | gzip > ../initrd.cpio.gz
+find . | cpio -H newc -o | gzip > ../domU-rootfs.cpio.gz
 cd ..
 
 # initrd.tar.gz is Dom0 rootfs
@@ -38,15 +38,15 @@ mkdir srv
 mkdir sys
 rm var/run
 cp -ar ../dist/install/* .
-mv ../initrd.cpio.gz ./root
+mv ../domU-rootfs.cpio.gz ./root
 cp ../bzImage ./root
-echo "name=\"test\"
+echo "name=\"domU\"
 memory=512
 vcpus=1
 kernel=\"/root/bzImage\"
-ramdisk=\"/root/initrd.cpio.gz\"
+ramdisk=\"/root/domU-rootfs.cpio.gz\"
 extra=\"console=hvc0 root=/dev/ram0 rdinit=/bin/sh\"
-" > root/test.cfg
+" > root/domU.cfg
 echo "#!/bin/bash
 
 set -x
@@ -56,13 +56,13 @@ bash /etc/init.d/xencommons start
 
 xl list
 
-xl -vvv create -c /root/test.cfg
+xl -vvv create -c /root/domU.cfg
 
 " > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
 echo "rc_verbose=yes" >> etc/rc.conf
 # rebuild Dom0 rootfs
-find . |cpio -H newc -o|gzip > ../xen-rootfs.cpio.gz
+find . | cpio -H newc -o | gzip > ../dom0-rootfs.cpio.gz
 cd ../..
 
 cat >> binaries/pxelinux.0 << EOF
@@ -70,7 +70,7 @@ cat >> binaries/pxelinux.0 << EOF
 
 kernel xen console=com1 console_timestamps=boot
 module bzImage console=hvc0
-module xen-rootfs.cpio.gz
+module dom0-rootfs.cpio.gz
 boot
 EOF
 
diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
index 51d037b000..e8e49ded24 100755
--- a/automation/scripts/qemu-smoke-dom0-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
@@ -24,7 +24,7 @@ mount -t devtmpfs devtmpfs /dev
 /bin/sh" > initrd/init
 chmod +x initrd/init
 cd initrd
-find . | cpio --create --format='newc' | gzip > ../initrd.cpio.gz
+find . | cpio -H newc -o | gzip > ../domU-rootfs.cpio.gz
 cd ..
 
 mkdir -p rootfs
@@ -36,15 +36,15 @@ mkdir srv
 mkdir sys
 rm var/run
 cp -ar ../dist/install/* .
-mv ../initrd.cpio.gz ./root
+mv ../domU-rootfs.cpio.gz ./root
 cp ../Image ./root
-echo "name=\"test\"
+echo "name=\"domU\"
 memory=512
 vcpus=1
 kernel=\"/root/Image\"
-ramdisk=\"/root/initrd.cpio.gz\"
+ramdisk=\"/root/domU-rootfs.cpio.gz\"
 extra=\"console=hvc0 root=/dev/ram0 rdinit=/bin/sh\"
-" > root/test.cfg
+" > root/domU.cfg
 echo "#!/bin/bash
 
 export LD_LIBRARY_PATH=/usr/local/lib
@@ -52,12 +52,12 @@ bash /etc/init.d/xencommons start
 
 xl list
 
-xl -vvv create -c /root/test.cfg
+xl -vvv create -c /root/domU.cfg
 
 " > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
 echo "rc_verbose=yes" >> etc/rc.conf
-find . |cpio -H newc -o|gzip > ../xen-rootfs.cpio.gz
+find . | cpio -H newc -o | gzip > ../dom0-rootfs.cpio.gz
 cd ../..
 
 # XXX QEMU looks for "efi-virtio.rom" even if it is unneeded
@@ -78,7 +78,7 @@ MEMORY_END="0xC0000000"
 DEVICE_TREE="virt-gicv2.dtb"
 XEN="xen"
 DOM0_KERNEL="Image"
-DOM0_RAMDISK="xen-rootfs.cpio.gz"
+DOM0_RAMDISK="dom0-rootfs.cpio.gz"
 XEN_CMD="console=dtuart dom0_mem=1024M console_timestamps=boot"
 
 NUM_DOMUS=0
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 14 20:00:12 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 14 Apr 2025 20:00:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.951355.1347445 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4PyW-0004lR-Rr; Mon, 14 Apr 2025 20:00:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 951355.1347445; Mon, 14 Apr 2025 20: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 1u4PyW-0004lH-OO; Mon, 14 Apr 2025 20:00:12 +0000
Received: by outflank-mailman (input) for mailman id 951355;
 Mon, 14 Apr 2025 20: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 1u4PyV-0004l5-Qw
 for xen-changelog@lists.xenproject.org; Mon, 14 Apr 2025 20: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 1u4PyV-00F3Eh-2a
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 20:00:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4PyV-002SVu-2J
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 20: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=zQN3LV/8VczpMgIRich+k3Q/v6Udb5q5aBJDgWkiD24=; b=ZOTXo8DMKT7FJQX+6VUyuQz6vG
	eE8ALVGUxHaNYxhoONnjmW3MgKIAqIqUe3UfICmKuZJV2RLd3TP0B1Fnna5QVj8NZAKtU02Nt7CTz
	tEh7ot6dHrdOgsJLhlnsbF0VWs3hpUZTV6pr8QiaCQgfpg0Bkb0zq5kwCQBKYOJvXQYc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: avoid repacking initrd as part of the test job
Message-Id: <E1u4PyV-002SVu-2J@xenbits.xenproject.org>
Date: Mon, 14 Apr 2025 20:00:11 +0000

commit 786f3238094f9460f59bce9f250adbf426f89297
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Fri Apr 11 22:32:17 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 14 19:20:58 2025 +0100

    CI: avoid repacking initrd as part of the test job
    
    Use the new test-artifacts which provide rootfs.cpio.gz rather than
    initrd.tar.gz.  rootfs.cpio.gz also has all the necessary top-level
    directories, and includes the rc_verbose setting, so these modifications can
    be dropped.
    
    Having that, do not repack the whole initrd, but only pack modified
    files and rely on Linux handling of concatenated archives.
    This allows packing just test-related files (which includes the whole
    toolstack), instead of the whole initrd.
    
    For xilinx-smoke-dom0-x86_64.sh, this involves instructing grub not to unzip
    the archive, as doing so corrupts it.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 automation/gitlab-ci/test.yaml                    |  8 +++---
 automation/scripts/qemu-alpine-x86_64.sh          | 16 +++++-------
 automation/scripts/qemu-smoke-dom0-arm64.sh       | 14 +++++-----
 automation/scripts/qemu-smoke-dom0less-arm64.sh   | 15 +++++------
 automation/scripts/qubes-x86-64.sh                | 32 +++++++++--------------
 automation/scripts/xilinx-smoke-dom0-x86_64.sh    | 27 ++++++++++---------
 automation/scripts/xilinx-smoke-dom0less-arm64.sh | 30 +++++++++------------
 7 files changed, 61 insertions(+), 81 deletions(-)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 59a2de28c8..51229cbe56 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -11,7 +11,9 @@
   - project: xen-project/hardware/test-artifacts
     job: linux-6.6.86-arm64
     ref: master
-  - alpine-3.18-arm64-rootfs-export
+  - project: xen-project/hardware/test-artifacts
+    job: alpine-3.18-arm64-rootfs
+    ref: master
   - qemu-system-aarch64-6.0.0-arm64-export
 
 .arm32-test-needs: &arm32-test-needs
@@ -22,7 +24,7 @@
     job: linux-6.6.56-x86_64
     ref: master
   - project: xen-project/hardware/test-artifacts
-    job: x86_64-rootfs-alpine-3.18
+    job: alpine-3.18-x86_64-rootfs
     ref: master
 
 .qemu-arm64:
@@ -243,7 +245,7 @@ xilinx-smoke-dom0-x86_64-gcc-debug-argo:
       job: x86_64-kernel-linux-6.6.56
       ref: master
     - project: xen-project/hardware/test-artifacts
-      job: x86_64-rootfs-alpine-3.18
+      job: alpine-3.18-x86_64-rootfs
       ref: master
     - project: xen-project/hardware/test-artifacts
       job: x86_64-argo-linux-6.6.56
diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
index 569bd766d3..c7dd121978 100755
--- a/automation/scripts/qemu-alpine-x86_64.sh
+++ b/automation/scripts/qemu-alpine-x86_64.sh
@@ -28,16 +28,14 @@ cd initrd
 find . | cpio -H newc -o | gzip > ../domU-rootfs.cpio.gz
 cd ..
 
-# initrd.tar.gz is Dom0 rootfs
+# Dom0 rootfs
+cp rootfs.cpio.gz dom0-rootfs.cpio.gz
+
+# test-local configuration
 mkdir -p rootfs
 cd rootfs
-tar xvzf ../initrd.tar.gz
-mkdir proc
-mkdir run
-mkdir srv
-mkdir sys
-rm var/run
 cp -ar ../dist/install/* .
+mkdir -p root etc/local.d
 mv ../domU-rootfs.cpio.gz ./root
 cp ../bzImage ./root
 echo "name=\"domU\"
@@ -60,9 +58,7 @@ xl -vvv create -c /root/domU.cfg
 
 " > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
-echo "rc_verbose=yes" >> etc/rc.conf
-# rebuild Dom0 rootfs
-find . | cpio -H newc -o | gzip > ../dom0-rootfs.cpio.gz
+find . | cpio -H newc -o | gzip >> ../dom0-rootfs.cpio.gz
 cd ../..
 
 cat >> binaries/pxelinux.0 << EOF
diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
index e8e49ded24..c0cf61ff8f 100755
--- a/automation/scripts/qemu-smoke-dom0-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
@@ -27,15 +27,14 @@ cd initrd
 find . | cpio -H newc -o | gzip > ../domU-rootfs.cpio.gz
 cd ..
 
+# Dom0 rootfs
+cp rootfs.cpio.gz dom0-rootfs.cpio.gz
+
+# test-local configuration
 mkdir -p rootfs
 cd rootfs
-tar xvzf ../initrd.tar.gz
-mkdir proc
-mkdir run
-mkdir srv
-mkdir sys
-rm var/run
 cp -ar ../dist/install/* .
+mkdir -p etc/local.d root
 mv ../domU-rootfs.cpio.gz ./root
 cp ../Image ./root
 echo "name=\"domU\"
@@ -56,8 +55,7 @@ xl -vvv create -c /root/domU.cfg
 
 " > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
-echo "rc_verbose=yes" >> etc/rc.conf
-find . | cpio -H newc -o | gzip > ../dom0-rootfs.cpio.gz
+find . | cpio -H newc -o | gzip >> ../dom0-rootfs.cpio.gz
 cd ../..
 
 # XXX QEMU looks for "efi-virtio.rom" even if it is unneeded
diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh b/automation/scripts/qemu-smoke-dom0less-arm64.sh
index f72d209361..8e939f0b72 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
@@ -114,16 +114,14 @@ cd initrd
 find . | cpio --create --format='newc' | gzip > ../binaries/initrd
 cd ..
 
-# DOM0 rootfs
+# Dom0 rootfs
+cp binaries/rootfs.cpio.gz binaries/dom0-rootfs.cpio.gz
+
+# test-local configuration
 mkdir -p rootfs
 cd rootfs
-tar xzf ../binaries/initrd.tar.gz
-mkdir proc
-mkdir run
-mkdir srv
-mkdir sys
-rm var/run
 cp -ar ../binaries/dist/install/* .
+mkdir -p etc/local.d
 
 echo "#!/bin/bash
 
@@ -142,8 +140,7 @@ xl network-attach 1 type=vif
 ${dom0_check}
 " > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
-echo "rc_verbose=yes" >> etc/rc.conf
-find . | cpio -H newc -o | gzip > ../binaries/dom0-rootfs.cpio.gz
+find . | cpio -H newc -o | gzip >> ../binaries/dom0-rootfs.cpio.gz
 cd ..
 
 # ImageBuilder
diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index c4be714642..e2376cb51c 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -164,16 +164,13 @@ ${domU_extra_config}
 "
 
 if [ -n "$domU_check" ]; then
-    # DomU
+    # DomU rootfs
+    cp binaries/rootfs.cpio.gz binaries/domU-rootfs.cpio.gz
+
+    # test-local configuration
     mkdir -p rootfs
     cd rootfs
-    # fakeroot is needed to preserve device nodes in rootless podman container
-    fakeroot -s ../fakeroot-save tar xzf ../binaries/initrd.tar.gz
-    mkdir proc
-    mkdir run
-    mkdir srv
-    mkdir sys
-    rm var/run
+    mkdir -p etc/local.d
     echo "#!/bin/sh
 
 echo 8 > /proc/sys/kernel/printk
@@ -181,26 +178,22 @@ echo 8 > /proc/sys/kernel/printk
 ${domU_check}
 " > etc/local.d/xen.start
     chmod +x etc/local.d/xen.start
-    echo "rc_verbose=yes" >> etc/rc.conf
     echo "domU Welcome to Alpine Linux
 Kernel \r on an \m (\l)
 
 " > etc/issue
-    find . | fakeroot -i ../fakeroot-save cpio -H newc -o | gzip > ../binaries/domU-rootfs.cpio.gz
+    find . | cpio -H newc -o | gzip >> ../binaries/domU-rootfs.cpio.gz
     cd ..
     rm -rf rootfs
 fi
 
-# DOM0 rootfs
+# Dom0 rootfs
+cp binaries/rootfs.cpio.gz binaries/dom0-rootfs.cpio.gz
+
+# test-local configuration
 mkdir -p rootfs
 cd rootfs
-fakeroot -s ../fakeroot-save tar xzf ../binaries/initrd.tar.gz
-mkdir boot
-mkdir proc
-mkdir run
-mkdir srv
-mkdir sys
-rm var/run
+mkdir -p boot etc/local.d
 cp -ar ../binaries/dist/install/* .
 cp -ar ../binaries/tests .
 cp -a ../automation/scripts/run-tools-tests tests/
@@ -237,7 +230,6 @@ fi
 chmod +x etc/local.d/xen.start
 echo "$domU_config" > etc/xen/domU.cfg
 
-echo "rc_verbose=yes" >> etc/rc.conf
 echo "XENCONSOLED_TRACE=all" >> etc/default/xencommons
 echo "QEMU_XEN=/bin/false" >> etc/default/xencommons
 mkdir -p var/log/xen/console
@@ -245,7 +237,7 @@ cp ../binaries/bzImage boot/vmlinuz
 if [ -n "$domU_check" ]; then
     cp ../binaries/domU-rootfs.cpio.gz boot/initrd-domU
 fi
-find . | fakeroot -i ../fakeroot-save cpio -H newc -o | gzip > ../binaries/dom0-rootfs.cpio.gz
+find . | cpio -H newc -o | gzip >> ../binaries/dom0-rootfs.cpio.gz
 cd ..
 
 
diff --git a/automation/scripts/xilinx-smoke-dom0-x86_64.sh b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
index 7e5382931b..1fc52d78db 100755
--- a/automation/scripts/xilinx-smoke-dom0-x86_64.sh
+++ b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
@@ -80,6 +80,7 @@ argo-exec -l -p 28333 -- /bin/echo
 "
 copy_dom0_files ()
 {
+    mkdir -p root usr/local/lib usr/local/bin
     cp "${WORKDIR}/binaries/xen-argo.ko" "root/"
     cp -ar "${WORKDIR}/binaries/lib/"* "usr/local/lib/"
     cp "${WORKDIR}/binaries/argo-exec" "usr/local/bin/"
@@ -89,12 +90,13 @@ else
     fatal "Unknown test: ${TEST}"
 fi
 
-# Set up domU rootfs.
+# DomU rootfs
+cp binaries/rootfs.cpio.gz binaries/domU-rootfs.cpio.gz
+
+# test-local configuration
 mkdir -p rootfs
 cd rootfs
-tar xzf ../binaries/initrd.tar.gz
-mkdir proc run srv sys
-rm var/run
+mkdir -p etc/local.d
 echo "#!/bin/sh
 set -x
 export LD_LIBRARY_PATH=/usr/local/lib
@@ -102,22 +104,22 @@ PATH=/usr/local/bin:/usr/local/sbin:\$PATH
 ${DOMU_CMD}
 " > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
-echo "rc_verbose=yes" >> etc/rc.conf
 echo "domU Welcome to Alpine Linux
 Kernel \r on an \m (\l)
 
 " > etc/issue
 copy_domU_files
-find . | cpio -H newc -o | gzip > ../binaries/domU-rootfs.cpio.gz
+find . | cpio -H newc -o | gzip >> ../binaries/domU-rootfs.cpio.gz
 cd ..
 rm -rf rootfs
 
-# Set up dom0 rootfs.
+# Dom0 rootfs
+cp binaries/rootfs.cpio.gz binaries/dom0-rootfs.cpio.gz
+
+# test-local configuration
 mkdir -p rootfs
 cd rootfs
-tar xzf ../binaries/initrd.tar.gz
-mkdir boot proc run srv sys
-rm var/run
+mkdir -p boot etc/local.d
 cp -ar ../binaries/dist/install/* .
 echo "#!/bin/bash
 set -x
@@ -127,14 +129,13 @@ ${DOM0_CMD}
 " > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
 echo "${DOMU_CFG}${DOMU_CFG_EXTRA}" > etc/xen/domU.cfg
-echo "rc_verbose=yes" >> etc/rc.conf
 echo "XENCONSOLED_TRACE=all" >> etc/default/xencommons
 echo "QEMU_XEN=/bin/false" >> etc/default/xencommons
 mkdir -p var/log/xen/console
 cp ../binaries/bzImage boot/vmlinuz
 cp ../binaries/domU-rootfs.cpio.gz boot/initrd-domU
 copy_dom0_files
-find . | cpio -H newc -o | gzip > ../binaries/dom0-rootfs.cpio.gz
+find . | cpio -H newc -o | gzip >> ../binaries/dom0-rootfs.cpio.gz
 cd ..
 
 # Load software into TFTP server directory.
@@ -147,7 +148,7 @@ echo "
 net_default_server=10.0.6.1
 multiboot2 (tftp)/${TEST_BOARD}/xen ${XEN_CMDLINE} sync_console
 module2 (tftp)/${TEST_BOARD}/vmlinuz console=hvc0 root=/dev/ram0 earlyprintk=xen
-module2 (tftp)/${TEST_BOARD}/initrd-dom0
+module2 --nounzip (tftp)/${TEST_BOARD}/initrd-dom0
 boot
 " > ${TFTP}/${TEST_BOARD}/grub.cfg
 
diff --git a/automation/scripts/xilinx-smoke-dom0less-arm64.sh b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
index 3e1fcf6bf9..a3031ecab0 100755
--- a/automation/scripts/xilinx-smoke-dom0less-arm64.sh
+++ b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
@@ -38,36 +38,31 @@ echo \"${passed}\"
 "
 fi
 
-# DomU
+# DomU rootfs
+cp binaries/rootfs.cpio.gz binaries/domU-rootfs.cpio.gz
+
+# test-local configuration
 mkdir -p rootfs
 cd rootfs
-tar xzf ../binaries/initrd.tar.gz
-mkdir proc
-mkdir run
-mkdir srv
-mkdir sys
-rm var/run
+mkdir -p etc/local.d
 echo "#!/bin/sh
 
 ${domU_check}
 /bin/sh" > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
-echo "rc_verbose=yes" >> etc/rc.conf
-find . | cpio -H newc -o | gzip > ../binaries/domU-rootfs.cpio.gz
+find . | cpio -H newc -o | gzip >> ../binaries/domU-rootfs.cpio.gz
 cd ..
 rm -rf rootfs
 
-# DOM0 rootfs
+# Dom0 rootfs
+cp binaries/rootfs.cpio.gz binaries/dom0-rootfs.cpio.gz
+
+# test-local configuration
 mkdir -p rootfs
 cd rootfs
-tar xzf ../binaries/initrd.tar.gz
-mkdir proc
-mkdir run
-mkdir srv
-mkdir sys
-rm var/run
 cp -ar ../binaries/dist/install/* .
 
+mkdir -p etc/local.d
 echo "#!/bin/bash
 
 export LD_LIBRARY_PATH=/usr/local/lib
@@ -78,8 +73,7 @@ bash /etc/init.d/xencommons start
 ${dom0_check}
 " > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
-echo "rc_verbose=yes" >> etc/rc.conf
-find . | cpio -H newc -o | gzip > ../binaries/dom0-rootfs.cpio.gz
+find . | cpio -H newc -o | gzip >> ../binaries/dom0-rootfs.cpio.gz
 cd ..
 
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 14 20:00:22 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 14 Apr 2025 20:00:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.951356.1347449 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4Pyg-0004oF-Us; Mon, 14 Apr 2025 20:00:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 951356.1347449; Mon, 14 Apr 2025 20: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 1u4Pyg-0004o7-S7; Mon, 14 Apr 2025 20:00:22 +0000
Received: by outflank-mailman (input) for mailman id 951356;
 Mon, 14 Apr 2025 20: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 1u4Pyf-0004nx-Vh
 for xen-changelog@lists.xenproject.org; Mon, 14 Apr 2025 20: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 1u4Pyf-00F3Em-2t
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 20:00:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4Pyf-002SZ2-2l
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 20: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=D6rkUfzKJ3P74wxnevJ6qvHGwDftW3togt7LN9Eyy/E=; b=W1szcKFm0D7Wh0/I9reYmu2stE
	FyM8h1BWLui7saBMF5snUhIt0YNfW1IF2f4CtsEIXW8/UHUZFyRv0brXb+DrgUWblw37RL1ygOfTB
	N9uOqE6qfajVQfD4hbhFhoilN7VZwyyJAaHK2iB6EJSvF2cX3re1poiClrE2laQOCuMI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: remove now unused alpine-3.18-arm64-rootfs job and its container
Message-Id: <E1u4Pyf-002SZ2-2l@xenbits.xenproject.org>
Date: Mon, 14 Apr 2025 20:00:21 +0000

commit 93f12111c749962b77eb4671d740d3d010429174
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Fri Apr 11 15:47:22 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 14 19:20:58 2025 +0100

    CI: remove now unused alpine-3.18-arm64-rootfs job and its container
    
    This got moved to test-artifacts.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 automation/gitlab-ci/build.yaml                    | 11 ----
 .../tests-artifacts/alpine/3.18-arm64v8.dockerfile | 66 ----------------------
 2 files changed, 77 deletions(-)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 40dcd31f1b..1b82b359d0 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -264,17 +264,6 @@
 
 # Arm test artifacts
 
-alpine-3.18-arm64-rootfs-export:
-  extends: .test-jobs-artifact-common
-  image: registry.gitlab.com/xen-project/xen/tests-artifacts/alpine:3.18-arm64v8
-  script:
-    - mkdir binaries && cp /initrd.tar.gz binaries/initrd.tar.gz
-  artifacts:
-    paths:
-      - binaries/initrd.tar.gz
-  tags:
-    - arm64
-
 qemu-system-aarch64-6.0.0-arm64-export:
   extends: .test-jobs-artifact-common
   image: registry.gitlab.com/xen-project/xen/tests-artifacts/qemu-system-aarch64:6.0.0-arm64v8
diff --git a/automation/tests-artifacts/alpine/3.18-arm64v8.dockerfile b/automation/tests-artifacts/alpine/3.18-arm64v8.dockerfile
deleted file mode 100644
index a4542f7039..0000000000
--- a/automation/tests-artifacts/alpine/3.18-arm64v8.dockerfile
+++ /dev/null
@@ -1,66 +0,0 @@
-# syntax=docker/dockerfile:1
-FROM --platform=linux/arm64/v8 alpine:3.18
-LABEL maintainer.name="The Xen Project" \
-      maintainer.email="xen-devel@lists.xenproject.org"
-
-ENV USER root
-
-RUN mkdir /build
-WORKDIR /build
-
-RUN \
-  # apk
-  apk update && \
-  \
-  # xen runtime deps
-  apk add musl && \
-  apk add openrc && \
-  apk add busybox && \
-  apk add sudo && \
-  apk add dbus && \
-  apk add bash && \
-  apk add python3 && \
-  apk add zlib && \
-  apk add ncurses && \
-  apk add yajl && \
-  apk add libaio && \
-  apk add xz && \
-  apk add util-linux && \
-  apk add argp-standalone && \
-  apk add libfdt && \
-  apk add glib && \
-  apk add pixman && \
-  apk add curl && \
-  apk add udev && \
-  \
-  # Xen
-  cd / && \
-  # Minimal ramdisk environment in case of cpio output
-  rc-update add udev && \
-  rc-update add udev-trigger && \
-  rc-update add udev-settle && \
-  rc-update add networking sysinit && \
-  rc-update add loopback sysinit && \
-  rc-update add bootmisc boot && \
-  rc-update add devfs sysinit && \
-  rc-update add dmesg sysinit && \
-  rc-update add hostname boot && \
-  rc-update add hwclock boot && \
-  rc-update add hwdrivers sysinit && \
-  rc-update add killprocs shutdown && \
-  rc-update add modloop sysinit && \
-  rc-update add modules boot && \
-  rc-update add mount-ro shutdown && \
-  rc-update add savecache shutdown && \
-  rc-update add sysctl boot && \
-  rc-update add local default && \
-  cp -a /sbin/init /init && \
-  echo "ttyS0" >> /etc/securetty && \
-  echo "hvc0" >> /etc/securetty && \
-  echo "ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100" >> /etc/inittab && \
-  echo "hvc0::respawn:/sbin/getty -L hvc0 115200 vt100" >> /etc/inittab && \
-  passwd -d "root" root && \
-  \
-  # Create rootfs
-  cd / && \
-  tar cvzf /initrd.tar.gz bin dev etc home init lib mnt opt root sbin usr var
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 14 20:00:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 14 Apr 2025 20:00:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.951357.1347452 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4Pyq-0004qk-W6; Mon, 14 Apr 2025 20:00:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 951357.1347452; Mon, 14 Apr 2025 20: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 1u4Pyq-0004qc-TW; Mon, 14 Apr 2025 20:00:32 +0000
Received: by outflank-mailman (input) for mailman id 951357;
 Mon, 14 Apr 2025 20: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 1u4Pyq-0004qU-29
 for xen-changelog@lists.xenproject.org; Mon, 14 Apr 2025 20: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 1u4Pyq-00F3Eq-07
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 20:00:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4Pyp-002Sb2-33
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 20: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=CtoeEB63a2sUiwxH8ipvoyTv6M/tcqLIH3r0eAkqajk=; b=ARMr9n4BwaqN7LzUqYEHYTd5Bw
	ThNPNfWw9Us1Qm4x3xhVGV4MlDHB+s4QZFFGzZftxLj3HU7VqfG8G0P5RV4ehCQh9QHfQ3EdmogZN
	SyTbo2fg1/5UBGm1DYuMXT+XGZKjarhVWATB9bmHjZMRoruNExvK9FUhtJMgwWcX01uw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: Switch to new argo artefact
Message-Id: <E1u4Pyp-002Sb2-33@xenbits.xenproject.org>
Date: Mon, 14 Apr 2025 20:00:31 +0000

commit 464d4dd4565c271a46f01a7909593f89b538259f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Apr 10 21:39:16 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 14 19:20:58 2025 +0100

    CI: Switch to new argo artefact
    
    The argo artefact is now a cpio archive and can be appended to dom?-rootfs
    directly, rather than being part of of the overlay.  Drop the
    copy_dom?_files() functions.
    
    xen-argo.ko has moved into the standard location, so update the insmod path.
    
    No practical change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 automation/gitlab-ci/test.yaml                 |  5 +----
 automation/scripts/xilinx-smoke-dom0-x86_64.sh | 22 ++++++++--------------
 2 files changed, 9 insertions(+), 18 deletions(-)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 51229cbe56..ef3560930c 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -242,14 +242,11 @@ xilinx-smoke-dom0-x86_64-gcc-debug-argo:
   needs:
     - alpine-3.18-gcc-debug
     - project: xen-project/hardware/test-artifacts
-      job: x86_64-kernel-linux-6.6.56
+      job: linux-6.6.56-x86_64
       ref: master
     - project: xen-project/hardware/test-artifacts
       job: alpine-3.18-x86_64-rootfs
       ref: master
-    - project: xen-project/hardware/test-artifacts
-      job: x86_64-argo-linux-6.6.56
-      ref: master
 
 adl-smoke-x86-64-gcc-debug:
   extends: .adl-x86-64
diff --git a/automation/scripts/xilinx-smoke-dom0-x86_64.sh b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
index 1fc52d78db..85007dcc29 100755
--- a/automation/scripts/xilinx-smoke-dom0-x86_64.sh
+++ b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
@@ -28,8 +28,6 @@ extra = "root=/dev/ram0 console=hvc0"
 memory = 512
 '
 DOMU_CFG_EXTRA=""
-copy_domU_files () { :; }
-copy_dom0_files () { :; }
 
 # Select test variant.
 if [ "${TEST}" = "ping" ]; then
@@ -66,7 +64,7 @@ then
     PASS_MSG="TEST: Message from DOMU"
     XEN_CMD_EXTRA="argo=1,mac-permissive=1"
     DOMU_CMD="
-insmod /root/xen-argo.ko
+insmod /lib/modules/\$(uname -r)/updates/xen-argo.ko
 until false
 do
   echo \"${PASS_MSG}\"
@@ -74,24 +72,19 @@ do
 done | argo-exec -p 28333 -d 0 -- /bin/echo
 "
     DOM0_CMD="
-insmod /root/xen-argo.ko
+insmod /lib/modules/\$(uname -r)/updates/xen-argo.ko
 xl -vvv create /etc/xen/domU.cfg
 argo-exec -l -p 28333 -- /bin/echo
 "
-copy_dom0_files ()
-{
-    mkdir -p root usr/local/lib usr/local/bin
-    cp "${WORKDIR}/binaries/xen-argo.ko" "root/"
-    cp -ar "${WORKDIR}/binaries/lib/"* "usr/local/lib/"
-    cp "${WORKDIR}/binaries/argo-exec" "usr/local/bin/"
-}
-copy_domU_files () { copy_dom0_files; }
 else
     fatal "Unknown test: ${TEST}"
 fi
 
 # DomU rootfs
 cp binaries/rootfs.cpio.gz binaries/domU-rootfs.cpio.gz
+if [[ "${TEST}" == argo ]]; then
+    cat binaries/argo.cpio.gz >> binaries/domU-rootfs.cpio.gz
+fi
 
 # test-local configuration
 mkdir -p rootfs
@@ -108,13 +101,15 @@ echo "domU Welcome to Alpine Linux
 Kernel \r on an \m (\l)
 
 " > etc/issue
-copy_domU_files
 find . | cpio -H newc -o | gzip >> ../binaries/domU-rootfs.cpio.gz
 cd ..
 rm -rf rootfs
 
 # Dom0 rootfs
 cp binaries/rootfs.cpio.gz binaries/dom0-rootfs.cpio.gz
+if [[ "${TEST}" == argo ]]; then
+    cat binaries/argo.cpio.gz >> binaries/dom0-rootfs.cpio.gz
+fi
 
 # test-local configuration
 mkdir -p rootfs
@@ -134,7 +129,6 @@ echo "QEMU_XEN=/bin/false" >> etc/default/xencommons
 mkdir -p var/log/xen/console
 cp ../binaries/bzImage boot/vmlinuz
 cp ../binaries/domU-rootfs.cpio.gz boot/initrd-domU
-copy_dom0_files
 find . | cpio -H newc -o | gzip >> ../binaries/dom0-rootfs.cpio.gz
 cd ..
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 14 20:00:43 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 14 Apr 2025 20:00:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.951358.1347457 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4Pz1-0005Al-1N; Mon, 14 Apr 2025 20:00:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 951358.1347457; Mon, 14 Apr 2025 20:00:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4Pz0-0005Ad-Uy; Mon, 14 Apr 2025 20:00:42 +0000
Received: by outflank-mailman (input) for mailman id 951358;
 Mon, 14 Apr 2025 20: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 1u4Pz0-0005AS-4w
 for xen-changelog@lists.xenproject.org; Mon, 14 Apr 2025 20: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 1u4Pz0-00F3FD-0O
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 20:00:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4Pz0-002Sfz-0I
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 20: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=knubKDZ49Kfwvbyw5tMfOvjxApSCRyWA++bBVWDz1/w=; b=jt5wrjRDGzNa4ythRozNA4XYlR
	1w9XnDN21pet2ccaNWHXJbCVpE/UFWYFIWKBNZXWw27bCU+Seb4jvDPgHCkDEfNW4or6JrX/+8mJ6
	VPhZZuLBsmygvZcq+wJe+eJgcYZmylH8W4Rfpy8qvcJMTm8vszHvhhBwIfMej+2byFaw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: save toolstack artifact as cpio.gz
Message-Id: <E1u4Pz0-002Sfz-0I@xenbits.xenproject.org>
Date: Mon, 14 Apr 2025 20:00:42 +0000

commit 4611ae6fb8f90d25601fcc0688799ef63a374304
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Fri Apr 11 22:32:19 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 14 19:20:58 2025 +0100

    CI: save toolstack artifact as cpio.gz
    
    This avoids the need to re-compress it in every test job.  This saves minutes
    of wallclock time.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 automation/scripts/build                          | 2 +-
 automation/scripts/qemu-alpine-x86_64.sh          | 2 +-
 automation/scripts/qemu-smoke-dom0-arm64.sh       | 2 +-
 automation/scripts/qemu-smoke-dom0less-arm64.sh   | 2 +-
 automation/scripts/qubes-x86-64.sh                | 4 +++-
 automation/scripts/xilinx-smoke-dom0-x86_64.sh    | 4 ++--
 automation/scripts/xilinx-smoke-dom0less-arm64.sh | 3 +--
 7 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/automation/scripts/build b/automation/scripts/build
index 522efe774e..51effec81d 100755
--- a/automation/scripts/build
+++ b/automation/scripts/build
@@ -108,7 +108,7 @@ else
     # Note: Some smoke tests depending on finding binaries/xen on a full build
     # even though dist/ contains everything, while some containers don't even
     # build Xen
-    cp -r dist binaries/
+    (cd dist/install; find | cpio -o -H newc | gzip) > binaries/xen-tools.cpio.gz
     cp -r tools/tests binaries/
     collect_xen_artefacts
 fi
diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
index c7dd121978..fe86caa393 100755
--- a/automation/scripts/qemu-alpine-x86_64.sh
+++ b/automation/scripts/qemu-alpine-x86_64.sh
@@ -30,11 +30,11 @@ cd ..
 
 # Dom0 rootfs
 cp rootfs.cpio.gz dom0-rootfs.cpio.gz
+cat xen-tools.cpio.gz >> dom0-rootfs.cpio.gz
 
 # test-local configuration
 mkdir -p rootfs
 cd rootfs
-cp -ar ../dist/install/* .
 mkdir -p root etc/local.d
 mv ../domU-rootfs.cpio.gz ./root
 cp ../bzImage ./root
diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
index c0cf61ff8f..61dd24b9ab 100755
--- a/automation/scripts/qemu-smoke-dom0-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
@@ -29,11 +29,11 @@ cd ..
 
 # Dom0 rootfs
 cp rootfs.cpio.gz dom0-rootfs.cpio.gz
+cat xen-tools.cpio.gz >> dom0-rootfs.cpio.gz
 
 # test-local configuration
 mkdir -p rootfs
 cd rootfs
-cp -ar ../dist/install/* .
 mkdir -p etc/local.d root
 mv ../domU-rootfs.cpio.gz ./root
 cp ../Image ./root
diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh b/automation/scripts/qemu-smoke-dom0less-arm64.sh
index 8e939f0b72..58f11dd310 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
@@ -116,11 +116,11 @@ cd ..
 
 # Dom0 rootfs
 cp binaries/rootfs.cpio.gz binaries/dom0-rootfs.cpio.gz
+cat binaries/xen-tools.cpio.gz >> binaries/dom0-rootfs.cpio.gz
 
 # test-local configuration
 mkdir -p rootfs
 cd rootfs
-cp -ar ../binaries/dist/install/* .
 mkdir -p etc/local.d
 
 echo "#!/bin/bash
diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index e2376cb51c..3947027d6e 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -189,12 +189,12 @@ fi
 
 # Dom0 rootfs
 cp binaries/rootfs.cpio.gz binaries/dom0-rootfs.cpio.gz
+cat binaries/xen-tools.cpio.gz >> binaries/dom0-rootfs.cpio.gz
 
 # test-local configuration
 mkdir -p rootfs
 cd rootfs
 mkdir -p boot etc/local.d
-cp -ar ../binaries/dist/install/* .
 cp -ar ../binaries/tests .
 cp -a ../automation/scripts/run-tools-tests tests/
 
@@ -228,8 +228,10 @@ else
 fi
 
 chmod +x etc/local.d/xen.start
+mkdir -p etc/xen
 echo "$domU_config" > etc/xen/domU.cfg
 
+mkdir -p etc/default
 echo "XENCONSOLED_TRACE=all" >> etc/default/xencommons
 echo "QEMU_XEN=/bin/false" >> etc/default/xencommons
 mkdir -p var/log/xen/console
diff --git a/automation/scripts/xilinx-smoke-dom0-x86_64.sh b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
index 85007dcc29..1f8cc172c6 100755
--- a/automation/scripts/xilinx-smoke-dom0-x86_64.sh
+++ b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
@@ -107,6 +107,7 @@ rm -rf rootfs
 
 # Dom0 rootfs
 cp binaries/rootfs.cpio.gz binaries/dom0-rootfs.cpio.gz
+cat binaries/xen-tools.cpio.gz >> binaries/dom0-rootfs.cpio.gz
 if [[ "${TEST}" == argo ]]; then
     cat binaries/argo.cpio.gz >> binaries/dom0-rootfs.cpio.gz
 fi
@@ -114,8 +115,7 @@ fi
 # test-local configuration
 mkdir -p rootfs
 cd rootfs
-mkdir -p boot etc/local.d
-cp -ar ../binaries/dist/install/* .
+mkdir -p boot etc/local.d etc/xen etc/default
 echo "#!/bin/bash
 set -x
 export LD_LIBRARY_PATH=/usr/local/lib
diff --git a/automation/scripts/xilinx-smoke-dom0less-arm64.sh b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
index a3031ecab0..59f3fe7edb 100755
--- a/automation/scripts/xilinx-smoke-dom0less-arm64.sh
+++ b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
@@ -56,12 +56,11 @@ rm -rf rootfs
 
 # Dom0 rootfs
 cp binaries/rootfs.cpio.gz binaries/dom0-rootfs.cpio.gz
+cat binaries/xen-tools.cpio.gz >> binaries/dom0-rootfs.cpio.gz
 
 # test-local configuration
 mkdir -p rootfs
 cd rootfs
-cp -ar ../binaries/dist/install/* .
-
 mkdir -p etc/local.d
 echo "#!/bin/bash
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 14 20:00:53 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 14 Apr 2025 20:00:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.951359.1347461 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4PzB-0005KM-2i; Mon, 14 Apr 2025 20:00:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 951359.1347461; Mon, 14 Apr 2025 20:00:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4PzB-0005KE-09; Mon, 14 Apr 2025 20:00:53 +0000
Received: by outflank-mailman (input) for mailman id 951359;
 Mon, 14 Apr 2025 20: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 1u4PzA-0005K5-9o
 for xen-changelog@lists.xenproject.org; Mon, 14 Apr 2025 20: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 1u4PzA-00F3FJ-0g
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 20:00:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4PzA-002Sig-0a
 for xen-changelog@lists.xenproject.org;
 Mon, 14 Apr 2025 20: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=UeiKbHyVCLYZR4oTZ36zyAlaY8Wj7PIRKtwUbJkmOjg=; b=Viyt8Ls6ntyjsGLA7NlRZ3iFNB
	xJxrachVD6r02JF39SYL2eVMvaS9gg7nrePDI66My72FMt9V0oEa4r+KW8cOmiktsVlQGO2xsBhXN
	elVy5l3r4hg7nJbJzhhodwO2MFghCdNLMQd4EwdTYCvb1abv0KnSZ86KvBxslevziu5w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: Include microcode for x86 hardware jobs
Message-Id: <E1u4PzA-002Sig-0a@xenbits.xenproject.org>
Date: Mon, 14 Apr 2025 20:00:52 +0000

commit 4a39780faafa79034aa4f637ab8a3f1922b95919
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Apr 11 20:28:15 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 14 19:20:58 2025 +0100

    CI: Include microcode for x86 hardware jobs
    
    All the x86 hardware runners are out of date, to varying degrees, in terms of
    microcode.
    
    Microcode must be uncompressed and prepended to the initrd in order for Xen to
    be able to use it during early boot.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 automation/gitlab-ci/build.yaml                | 1 +
 automation/gitlab-ci/test.yaml                 | 6 ++++++
 automation/scripts/qubes-x86-64.sh             | 3 ++-
 automation/scripts/xilinx-smoke-dom0-x86_64.sh | 3 ++-
 4 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 1b82b359d0..ac53678745 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -306,6 +306,7 @@ alpine-3.18-gcc-debug:
       CONFIG_ARGO=y
       CONFIG_UBSAN=y
       CONFIG_UBSAN_FATAL=y
+      CONFIG_UCODE_SCAN_DEFAULT=y
       CONFIG_XHCI=y
 
 debian-12-x86_64-gcc-debug:
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index ef3560930c..5ce445b78f 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -26,6 +26,9 @@
   - project: xen-project/hardware/test-artifacts
     job: alpine-3.18-x86_64-rootfs
     ref: master
+  - project: xen-project/hardware/test-artifacts
+    job: microcode-x86
+    ref: master
 
 .qemu-arm64:
   extends: .test-jobs-common
@@ -247,6 +250,9 @@ xilinx-smoke-dom0-x86_64-gcc-debug-argo:
     - project: xen-project/hardware/test-artifacts
       job: alpine-3.18-x86_64-rootfs
       ref: master
+    - project: xen-project/hardware/test-artifacts
+      job: microcode-x86
+      ref: master
 
 adl-smoke-x86-64-gcc-debug:
   extends: .adl-x86-64
diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index 3947027d6e..1f90e7002c 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -188,7 +188,8 @@ Kernel \r on an \m (\l)
 fi
 
 # Dom0 rootfs
-cp binaries/rootfs.cpio.gz binaries/dom0-rootfs.cpio.gz
+cp binaries/ucode.cpio binaries/dom0-rootfs.cpio.gz
+cat binaries/rootfs.cpio.gz >> binaries/dom0-rootfs.cpio.gz
 cat binaries/xen-tools.cpio.gz >> binaries/dom0-rootfs.cpio.gz
 
 # test-local configuration
diff --git a/automation/scripts/xilinx-smoke-dom0-x86_64.sh b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
index 1f8cc172c6..5bb44188dc 100755
--- a/automation/scripts/xilinx-smoke-dom0-x86_64.sh
+++ b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
@@ -106,7 +106,8 @@ cd ..
 rm -rf rootfs
 
 # Dom0 rootfs
-cp binaries/rootfs.cpio.gz binaries/dom0-rootfs.cpio.gz
+cp binaries/ucode.cpio binaries/dom0-rootfs.cpio.gz
+cat binaries/rootfs.cpio.gz >> binaries/dom0-rootfs.cpio.gz
 cat binaries/xen-tools.cpio.gz >> binaries/dom0-rootfs.cpio.gz
 if [[ "${TEST}" == argo ]]; then
     cat binaries/argo.cpio.gz >> binaries/dom0-rootfs.cpio.gz
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 15 11:33:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 15 Apr 2025 11:33:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.953706.1348147 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4eXH-00045U-AQ; Tue, 15 Apr 2025 11:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 953706.1348147; Tue, 15 Apr 2025 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 1u4eXH-00045M-7Y; Tue, 15 Apr 2025 11:33:03 +0000
Received: by outflank-mailman (input) for mailman id 953706;
 Tue, 15 Apr 2025 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 1u4eXG-00043X-Bx
 for xen-changelog@lists.xenproject.org; Tue, 15 Apr 2025 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 1u4eXG-00GzCS-0I
 for xen-changelog@lists.xenproject.org;
 Tue, 15 Apr 2025 11:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4eXG-006JMn-06
 for xen-changelog@lists.xenproject.org;
 Tue, 15 Apr 2025 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=Aaz787SUIYjQ3+U9C2Q8SvajYfYNdpvId+qnDdrsM18=; b=NxBYi56uL93RO+5Ks8cDZ2MGgC
	kKa4ucENqS7Vqo/VFoA/jSzqswaf837fB2oMirFqeC8gizTkeVM8acpYq3kW6cWrkHCSCnKl3LQ3P
	8S+XHg9EzV4Im6BmihYNFIFEhLrtZE0xEkygPRqG9Z0U0TBMxU5CA0mpcM3mJulvjnNI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/config.h: Move BITS_PER_* definitions from asm/config.h to xen/config.h
Message-Id: <E1u4eXG-006JMn-06@xenbits.xenproject.org>
Date: Tue, 15 Apr 2025 11:33:02 +0000

commit 56a8f0bf8dff31778ba65bf05cc8546d56750d7b
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Tue Apr 15 13:23:39 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 15 13:23:39 2025 +0200

    xen/config.h: Move BITS_PER_* definitions from asm/config.h to xen/config.h
    
    BITS_PER_* values can be defined in a common way using compiler-provided macros.
    Thus, these definitions are moved to xen/config.h to reduce duplication across
    architectures.
    
    Additionally, *_BYTEORDER macros are removed, as BITS_PER_* values now come
    directly from the compiler environment.
    
    The arch_fls() implementation for Arm and PPC is updated to use BITS_PER_INT
    instead of a hardcoded value of 32.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/include/asm/bitops.h   |  4 +---
 xen/arch/arm/include/asm/config.h   |  8 --------
 xen/arch/ppc/include/asm/bitops.h   |  4 +---
 xen/arch/ppc/include/asm/config.h   |  7 -------
 xen/arch/riscv/include/asm/config.h | 13 -------------
 xen/arch/x86/include/asm/config.h   |  8 --------
 xen/include/xen/config.h            | 10 ++++++++++
 7 files changed, 12 insertions(+), 42 deletions(-)

diff --git a/xen/arch/arm/include/asm/bitops.h b/xen/arch/arm/include/asm/bitops.h
index f163d9bb45..60686a3a55 100644
--- a/xen/arch/arm/include/asm/bitops.h
+++ b/xen/arch/arm/include/asm/bitops.h
@@ -22,8 +22,6 @@
 #define __set_bit(n,p)            set_bit(n,p)
 #define __clear_bit(n,p)          clear_bit(n,p)
 
-#define BITS_PER_BYTE           8
-
 #define ADDR (*(volatile int *) addr)
 #define CONST_ADDR (*(const volatile int *) addr)
 
@@ -75,7 +73,7 @@ bool clear_mask16_timeout(uint16_t mask, volatile void *p,
 
 #define arch_ffs(x)  ((x) ? 1 + __builtin_ctz(x) : 0)
 #define arch_ffsl(x) ((x) ? 1 + __builtin_ctzl(x) : 0)
-#define arch_fls(x)  ((x) ? 32 - __builtin_clz(x) : 0)
+#define arch_fls(x)  ((x) ? BITS_PER_INT - __builtin_clz(x) : 0)
 #define arch_flsl(x) ((x) ? BITS_PER_LONG - __builtin_clzl(x) : 0)
 
 #endif /* _ARM_BITOPS_H */
diff --git a/xen/arch/arm/include/asm/config.h b/xen/arch/arm/include/asm/config.h
index 799bc2a8ac..272e4565e5 100644
--- a/xen/arch/arm/include/asm/config.h
+++ b/xen/arch/arm/include/asm/config.h
@@ -8,19 +8,11 @@
 #define __ARM_CONFIG_H__
 
 #if defined(CONFIG_ARM_64)
-# define LONG_BYTEORDER 3
 # define ELFSIZE 64
 #else
-# define LONG_BYTEORDER 2
 # define ELFSIZE 32
 #endif
 
-#define BYTES_PER_LONG (1 << LONG_BYTEORDER)
-#define BITS_PER_LONG (BYTES_PER_LONG << 3)
-#define POINTER_ALIGN BYTES_PER_LONG
-
-#define BITS_PER_LLONG 64
-
 /* xen_ulong_t is always 64 bits */
 #define BITS_PER_XEN_ULONG 64
 
diff --git a/xen/arch/ppc/include/asm/bitops.h b/xen/arch/ppc/include/asm/bitops.h
index c942e9432e..e72942cca0 100644
--- a/xen/arch/ppc/include/asm/bitops.h
+++ b/xen/arch/ppc/include/asm/bitops.h
@@ -15,8 +15,6 @@
 #define __set_bit(n, p)         set_bit(n, p)
 #define __clear_bit(n, p)       clear_bit(n, p)
 
-#define BITS_PER_BYTE           8
-
 /* PPC bit number conversion */
 #define PPC_BITLSHIFT(be)    (BITS_PER_LONG - 1 - (be))
 #define PPC_BIT(bit)         (1UL << PPC_BITLSHIFT(bit))
@@ -121,7 +119,7 @@ static inline int test_and_set_bit(unsigned int nr, volatile void *addr)
 
 #define arch_ffs(x)  ((x) ? 1 + __builtin_ctz(x) : 0)
 #define arch_ffsl(x) ((x) ? 1 + __builtin_ctzl(x) : 0)
-#define arch_fls(x)  ((x) ? 32 - __builtin_clz(x) : 0)
+#define arch_fls(x)  ((x) ? BITS_PER_INT - __builtin_clz(x) : 0)
 #define arch_flsl(x) ((x) ? BITS_PER_LONG - __builtin_clzl(x) : 0)
 
 #define arch_hweightl(x) __builtin_popcountl(x)
diff --git a/xen/arch/ppc/include/asm/config.h b/xen/arch/ppc/include/asm/config.h
index 148fb3074d..8e32edd5a5 100644
--- a/xen/arch/ppc/include/asm/config.h
+++ b/xen/arch/ppc/include/asm/config.h
@@ -6,19 +6,12 @@
 #include <xen/page-size.h>
 
 #if defined(CONFIG_PPC64)
-#define LONG_BYTEORDER 3
 #define ELFSIZE        64
 #define MAX_VIRT_CPUS  1024u
 #else
 #error "Unsupported PowerPC variant"
 #endif
 
-#define BYTES_PER_LONG (1 << LONG_BYTEORDER)
-#define BITS_PER_LONG  (BYTES_PER_LONG << 3)
-#define POINTER_ALIGN  BYTES_PER_LONG
-
-#define BITS_PER_LLONG 64
-
 /* xen_ulong_t is always 64 bits */
 #define BITS_PER_XEN_ULONG 64
 
diff --git a/xen/arch/riscv/include/asm/config.h b/xen/arch/riscv/include/asm/config.h
index 7141bd9e46..314c97c20a 100644
--- a/xen/arch/riscv/include/asm/config.h
+++ b/xen/arch/riscv/include/asm/config.h
@@ -119,25 +119,12 @@
 #define HYPERVISOR_VIRT_START XEN_VIRT_START
 
 #if defined(CONFIG_RISCV_64)
-# define INT_BYTEORDER 2
-# define LONG_BYTEORDER 3
 # define ELFSIZE 64
 # define MAX_VIRT_CPUS 128u
 #else
 # error "Unsupported RISCV variant"
 #endif
 
-#define BYTES_PER_INT  (1 << INT_BYTEORDER)
-#define BITS_PER_INT  (BYTES_PER_INT << 3)
-
-#define BYTES_PER_LONG (1 << LONG_BYTEORDER)
-#define BITS_PER_LONG  (BYTES_PER_LONG << 3)
-#define POINTER_ALIGN  BYTES_PER_LONG
-
-#define BITS_PER_LLONG 64
-
-#define BITS_PER_BYTE 8
-
 /* xen_ulong_t is always 64 bits */
 #define BITS_PER_XEN_ULONG 64
 
diff --git a/xen/arch/x86/include/asm/config.h b/xen/arch/x86/include/asm/config.h
index 19746f956e..f0123a7de9 100644
--- a/xen/arch/x86/include/asm/config.h
+++ b/xen/arch/x86/include/asm/config.h
@@ -7,16 +7,8 @@
 #ifndef __X86_CONFIG_H__
 #define __X86_CONFIG_H__
 
-#define LONG_BYTEORDER 3
 #define CONFIG_PAGING_LEVELS 4
 
-#define BYTES_PER_LONG (1 << LONG_BYTEORDER)
-#define BITS_PER_LONG (BYTES_PER_LONG << 3)
-#define BITS_PER_BYTE 8
-#define POINTER_ALIGN BYTES_PER_LONG
-
-#define BITS_PER_LLONG 64
-
 #define BITS_PER_XEN_ULONG BITS_PER_LONG
 
 #define CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS 1
diff --git a/xen/include/xen/config.h b/xen/include/xen/config.h
index d888b2314d..7d43159efb 100644
--- a/xen/include/xen/config.h
+++ b/xen/include/xen/config.h
@@ -98,4 +98,14 @@
 #define ZERO_BLOCK_PTR ((void *)-1L)
 #endif
 
+#define BYTES_PER_LONG  __SIZEOF_LONG__
+
+#define BITS_PER_BYTE   __CHAR_BIT__
+#define BITS_PER_INT    (BITS_PER_BYTE * __SIZEOF_INT__)
+#define BITS_PER_LONG   (BITS_PER_BYTE * BYTES_PER_LONG)
+#define BITS_PER_LLONG  (BITS_PER_BYTE * __SIZEOF_LONG_LONG__)
+
+/* It is assumed that sizeof(void *) == __alignof(void *) */
+#define POINTER_ALIGN   __SIZEOF_POINTER__
+
 #endif /* __XEN_CONFIG_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 15 11:33:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 15 Apr 2025 11:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.953708.1348152 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4eXR-0004Bp-EO; Tue, 15 Apr 2025 11:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 953708.1348152; Tue, 15 Apr 2025 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 1u4eXR-0004Bi-Bb; Tue, 15 Apr 2025 11:33:13 +0000
Received: by outflank-mailman (input) for mailman id 953708;
 Tue, 15 Apr 2025 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 1u4eXQ-0004BW-9h
 for xen-changelog@lists.xenproject.org; Tue, 15 Apr 2025 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 1u4eXQ-00GzCY-0s
 for xen-changelog@lists.xenproject.org;
 Tue, 15 Apr 2025 11:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4eXQ-006JsU-0j
 for xen-changelog@lists.xenproject.org;
 Tue, 15 Apr 2025 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=XDKFZNSuFqN6xP1SoAeho/a5UkgLlKbiSAvXFuMwOzo=; b=Ux5KBfN8K2tMBOKnbvK18c2k5Y
	96qXiRlBAVbjvLsjBsI6gAdOMBXy1HtbO6sN4AbeOy6BQr8NNuSje09PJYVkn1eON3at3zOFkh7El
	syPmSRYQFxryP+F0Rb8zo/K+VHp0bH15FCyigXZkaZNCLQSgeX9EDIUzsTOe/oDAqlEk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: implement get_s_time()
Message-Id: <E1u4eXQ-006JsU-0j@xenbits.xenproject.org>
Date: Tue, 15 Apr 2025 11:33:12 +0000

commit 0589bf22156e7778e813dac75acef3471409aaca
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Tue Apr 15 13:25:19 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 15 13:26:42 2025 +0200

    xen/riscv: implement get_s_time()
    
    Also tick_to_ns() is implemeted as it is used in get_s_time().
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Jan Beulich<jbeulich@suse.com>
---
 xen/arch/riscv/include/asm/time.h | 6 ++++++
 xen/arch/riscv/stubs.c            | 5 -----
 xen/arch/riscv/time.c             | 8 ++++++++
 3 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/xen/arch/riscv/include/asm/time.h b/xen/arch/riscv/include/asm/time.h
index e8d9ffec57..63bdd471cc 100644
--- a/xen/arch/riscv/include/asm/time.h
+++ b/xen/arch/riscv/include/asm/time.h
@@ -3,6 +3,7 @@
 #define ASM__RISCV__TIME_H
 
 #include <xen/bug.h>
+#include <xen/lib.h>
 #include <xen/types.h>
 #include <asm/csr.h>
 
@@ -23,6 +24,11 @@ static inline cycles_t get_cycles(void)
     return csr_read(CSR_TIME);
 }
 
+static inline s_time_t ticks_to_ns(uint64_t ticks)
+{
+    return muldiv64(ticks, MILLISECS(1), cpu_khz);
+}
+
 void preinit_xen_time(void);
 
 #endif /* ASM__RISCV__TIME_H */
diff --git a/xen/arch/riscv/stubs.c b/xen/arch/riscv/stubs.c
index a1d64534cd..83416d3350 100644
--- a/xen/arch/riscv/stubs.c
+++ b/xen/arch/riscv/stubs.c
@@ -27,11 +27,6 @@ nodemask_t __read_mostly node_online_map = { { [0] = 1UL } };
 
 /* time.c */
 
-s_time_t get_s_time(void)
-{
-    BUG_ON("unimplemented");
-}
-
 int reprogram_timer(s_time_t timeout)
 {
     BUG_ON("unimplemented");
diff --git a/xen/arch/riscv/time.c b/xen/arch/riscv/time.c
index 905bb13eb4..e962f8518d 100644
--- a/xen/arch/riscv/time.c
+++ b/xen/arch/riscv/time.c
@@ -4,10 +4,18 @@
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/sections.h>
+#include <xen/types.h>
 
 unsigned long __ro_after_init cpu_khz; /* CPU clock frequency in kHz. */
 uint64_t __ro_after_init boot_clock_cycles;
 
+s_time_t get_s_time(void)
+{
+    uint64_t ticks = get_cycles() - boot_clock_cycles;
+
+    return ticks_to_ns(ticks);
+}
+
 /* Set up the timer on the boot CPU (early init function) */
 static void __init preinit_dt_xen_time(void)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 15 14:33:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 15 Apr 2025 14:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.954074.1348417 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4hLT-0001Kn-B7; Tue, 15 Apr 2025 14:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 954074.1348417; Tue, 15 Apr 2025 14: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 1u4hLT-0001Kf-8D; Tue, 15 Apr 2025 14:33:03 +0000
Received: by outflank-mailman (input) for mailman id 954074;
 Tue, 15 Apr 2025 14: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 1u4hLS-0001KZ-3V
 for xen-changelog@lists.xenproject.org; Tue, 15 Apr 2025 14: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 1u4hLR-00H40C-2v
 for xen-changelog@lists.xenproject.org;
 Tue, 15 Apr 2025 14:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4hLR-00ClVp-2i
 for xen-changelog@lists.xenproject.org;
 Tue, 15 Apr 2025 14: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=KC/z5HzgkJqtjL/nnOledYHsTdrnKq1jZHr4F2Dzum0=; b=V7+nS/OLlTubAKFKEICv1V7k0x
	l/B3CJxfraIdN5/32ZRdfQWtMCbio4iEzbKtQbJmptAR8NCW532H0+20wzh8ZO7ckANcJIc6bb/JT
	SL1h+aT9s15qqex3chHX5HoItiprDxPdpeoRdvPLt0zaP8U81sUXHPmuClntVuMExhrU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/config.h: Move BITS_PER_* definitions from asm/config.h to xen/config.h
Message-Id: <E1u4hLR-00ClVp-2i@xenbits.xenproject.org>
Date: Tue, 15 Apr 2025 14:33:01 +0000

commit 56a8f0bf8dff31778ba65bf05cc8546d56750d7b
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Tue Apr 15 13:23:39 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 15 13:23:39 2025 +0200

    xen/config.h: Move BITS_PER_* definitions from asm/config.h to xen/config.h
    
    BITS_PER_* values can be defined in a common way using compiler-provided macros.
    Thus, these definitions are moved to xen/config.h to reduce duplication across
    architectures.
    
    Additionally, *_BYTEORDER macros are removed, as BITS_PER_* values now come
    directly from the compiler environment.
    
    The arch_fls() implementation for Arm and PPC is updated to use BITS_PER_INT
    instead of a hardcoded value of 32.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/include/asm/bitops.h   |  4 +---
 xen/arch/arm/include/asm/config.h   |  8 --------
 xen/arch/ppc/include/asm/bitops.h   |  4 +---
 xen/arch/ppc/include/asm/config.h   |  7 -------
 xen/arch/riscv/include/asm/config.h | 13 -------------
 xen/arch/x86/include/asm/config.h   |  8 --------
 xen/include/xen/config.h            | 10 ++++++++++
 7 files changed, 12 insertions(+), 42 deletions(-)

diff --git a/xen/arch/arm/include/asm/bitops.h b/xen/arch/arm/include/asm/bitops.h
index f163d9bb45..60686a3a55 100644
--- a/xen/arch/arm/include/asm/bitops.h
+++ b/xen/arch/arm/include/asm/bitops.h
@@ -22,8 +22,6 @@
 #define __set_bit(n,p)            set_bit(n,p)
 #define __clear_bit(n,p)          clear_bit(n,p)
 
-#define BITS_PER_BYTE           8
-
 #define ADDR (*(volatile int *) addr)
 #define CONST_ADDR (*(const volatile int *) addr)
 
@@ -75,7 +73,7 @@ bool clear_mask16_timeout(uint16_t mask, volatile void *p,
 
 #define arch_ffs(x)  ((x) ? 1 + __builtin_ctz(x) : 0)
 #define arch_ffsl(x) ((x) ? 1 + __builtin_ctzl(x) : 0)
-#define arch_fls(x)  ((x) ? 32 - __builtin_clz(x) : 0)
+#define arch_fls(x)  ((x) ? BITS_PER_INT - __builtin_clz(x) : 0)
 #define arch_flsl(x) ((x) ? BITS_PER_LONG - __builtin_clzl(x) : 0)
 
 #endif /* _ARM_BITOPS_H */
diff --git a/xen/arch/arm/include/asm/config.h b/xen/arch/arm/include/asm/config.h
index 799bc2a8ac..272e4565e5 100644
--- a/xen/arch/arm/include/asm/config.h
+++ b/xen/arch/arm/include/asm/config.h
@@ -8,19 +8,11 @@
 #define __ARM_CONFIG_H__
 
 #if defined(CONFIG_ARM_64)
-# define LONG_BYTEORDER 3
 # define ELFSIZE 64
 #else
-# define LONG_BYTEORDER 2
 # define ELFSIZE 32
 #endif
 
-#define BYTES_PER_LONG (1 << LONG_BYTEORDER)
-#define BITS_PER_LONG (BYTES_PER_LONG << 3)
-#define POINTER_ALIGN BYTES_PER_LONG
-
-#define BITS_PER_LLONG 64
-
 /* xen_ulong_t is always 64 bits */
 #define BITS_PER_XEN_ULONG 64
 
diff --git a/xen/arch/ppc/include/asm/bitops.h b/xen/arch/ppc/include/asm/bitops.h
index c942e9432e..e72942cca0 100644
--- a/xen/arch/ppc/include/asm/bitops.h
+++ b/xen/arch/ppc/include/asm/bitops.h
@@ -15,8 +15,6 @@
 #define __set_bit(n, p)         set_bit(n, p)
 #define __clear_bit(n, p)       clear_bit(n, p)
 
-#define BITS_PER_BYTE           8
-
 /* PPC bit number conversion */
 #define PPC_BITLSHIFT(be)    (BITS_PER_LONG - 1 - (be))
 #define PPC_BIT(bit)         (1UL << PPC_BITLSHIFT(bit))
@@ -121,7 +119,7 @@ static inline int test_and_set_bit(unsigned int nr, volatile void *addr)
 
 #define arch_ffs(x)  ((x) ? 1 + __builtin_ctz(x) : 0)
 #define arch_ffsl(x) ((x) ? 1 + __builtin_ctzl(x) : 0)
-#define arch_fls(x)  ((x) ? 32 - __builtin_clz(x) : 0)
+#define arch_fls(x)  ((x) ? BITS_PER_INT - __builtin_clz(x) : 0)
 #define arch_flsl(x) ((x) ? BITS_PER_LONG - __builtin_clzl(x) : 0)
 
 #define arch_hweightl(x) __builtin_popcountl(x)
diff --git a/xen/arch/ppc/include/asm/config.h b/xen/arch/ppc/include/asm/config.h
index 148fb3074d..8e32edd5a5 100644
--- a/xen/arch/ppc/include/asm/config.h
+++ b/xen/arch/ppc/include/asm/config.h
@@ -6,19 +6,12 @@
 #include <xen/page-size.h>
 
 #if defined(CONFIG_PPC64)
-#define LONG_BYTEORDER 3
 #define ELFSIZE        64
 #define MAX_VIRT_CPUS  1024u
 #else
 #error "Unsupported PowerPC variant"
 #endif
 
-#define BYTES_PER_LONG (1 << LONG_BYTEORDER)
-#define BITS_PER_LONG  (BYTES_PER_LONG << 3)
-#define POINTER_ALIGN  BYTES_PER_LONG
-
-#define BITS_PER_LLONG 64
-
 /* xen_ulong_t is always 64 bits */
 #define BITS_PER_XEN_ULONG 64
 
diff --git a/xen/arch/riscv/include/asm/config.h b/xen/arch/riscv/include/asm/config.h
index 7141bd9e46..314c97c20a 100644
--- a/xen/arch/riscv/include/asm/config.h
+++ b/xen/arch/riscv/include/asm/config.h
@@ -119,25 +119,12 @@
 #define HYPERVISOR_VIRT_START XEN_VIRT_START
 
 #if defined(CONFIG_RISCV_64)
-# define INT_BYTEORDER 2
-# define LONG_BYTEORDER 3
 # define ELFSIZE 64
 # define MAX_VIRT_CPUS 128u
 #else
 # error "Unsupported RISCV variant"
 #endif
 
-#define BYTES_PER_INT  (1 << INT_BYTEORDER)
-#define BITS_PER_INT  (BYTES_PER_INT << 3)
-
-#define BYTES_PER_LONG (1 << LONG_BYTEORDER)
-#define BITS_PER_LONG  (BYTES_PER_LONG << 3)
-#define POINTER_ALIGN  BYTES_PER_LONG
-
-#define BITS_PER_LLONG 64
-
-#define BITS_PER_BYTE 8
-
 /* xen_ulong_t is always 64 bits */
 #define BITS_PER_XEN_ULONG 64
 
diff --git a/xen/arch/x86/include/asm/config.h b/xen/arch/x86/include/asm/config.h
index 19746f956e..f0123a7de9 100644
--- a/xen/arch/x86/include/asm/config.h
+++ b/xen/arch/x86/include/asm/config.h
@@ -7,16 +7,8 @@
 #ifndef __X86_CONFIG_H__
 #define __X86_CONFIG_H__
 
-#define LONG_BYTEORDER 3
 #define CONFIG_PAGING_LEVELS 4
 
-#define BYTES_PER_LONG (1 << LONG_BYTEORDER)
-#define BITS_PER_LONG (BYTES_PER_LONG << 3)
-#define BITS_PER_BYTE 8
-#define POINTER_ALIGN BYTES_PER_LONG
-
-#define BITS_PER_LLONG 64
-
 #define BITS_PER_XEN_ULONG BITS_PER_LONG
 
 #define CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS 1
diff --git a/xen/include/xen/config.h b/xen/include/xen/config.h
index d888b2314d..7d43159efb 100644
--- a/xen/include/xen/config.h
+++ b/xen/include/xen/config.h
@@ -98,4 +98,14 @@
 #define ZERO_BLOCK_PTR ((void *)-1L)
 #endif
 
+#define BYTES_PER_LONG  __SIZEOF_LONG__
+
+#define BITS_PER_BYTE   __CHAR_BIT__
+#define BITS_PER_INT    (BITS_PER_BYTE * __SIZEOF_INT__)
+#define BITS_PER_LONG   (BITS_PER_BYTE * BYTES_PER_LONG)
+#define BITS_PER_LLONG  (BITS_PER_BYTE * __SIZEOF_LONG_LONG__)
+
+/* It is assumed that sizeof(void *) == __alignof(void *) */
+#define POINTER_ALIGN   __SIZEOF_POINTER__
+
 #endif /* __XEN_CONFIG_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 15 14:33:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 15 Apr 2025 14:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.954075.1348421 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4hLd-0001MT-CM; Tue, 15 Apr 2025 14:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 954075.1348421; Tue, 15 Apr 2025 14: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 1u4hLd-0001ML-9a; Tue, 15 Apr 2025 14:33:13 +0000
Received: by outflank-mailman (input) for mailman id 954075;
 Tue, 15 Apr 2025 14: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 1u4hLc-0001MB-2B
 for xen-changelog@lists.xenproject.org; Tue, 15 Apr 2025 14: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 1u4hLc-00H40I-07
 for xen-changelog@lists.xenproject.org;
 Tue, 15 Apr 2025 14:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4hLb-00ClaD-37
 for xen-changelog@lists.xenproject.org;
 Tue, 15 Apr 2025 14:33:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mOgk133kXvo6H0ZZ2ofB6/bmY7Sv/AqUSb9soXdxaM8=; b=DeWxzCrKNgXEXV8TBk+UznNaXC
	mH1t6ftg2oozPXO2+IJz2VvKukqbjFvtbZYhN/LNZzOUqPn9ECXtFl47RAyvCJI3IFR3oM2X5Vmww
	XdaejZkYxiB1Fql2k7m9S5LRS57v2+mmM3hEDz/k5gd3CnRdDmdrqJLJS/5sfy8ChuXU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: implement get_s_time()
Message-Id: <E1u4hLb-00ClaD-37@xenbits.xenproject.org>
Date: Tue, 15 Apr 2025 14:33:11 +0000

commit 0589bf22156e7778e813dac75acef3471409aaca
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Tue Apr 15 13:25:19 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 15 13:26:42 2025 +0200

    xen/riscv: implement get_s_time()
    
    Also tick_to_ns() is implemeted as it is used in get_s_time().
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Jan Beulich<jbeulich@suse.com>
---
 xen/arch/riscv/include/asm/time.h | 6 ++++++
 xen/arch/riscv/stubs.c            | 5 -----
 xen/arch/riscv/time.c             | 8 ++++++++
 3 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/xen/arch/riscv/include/asm/time.h b/xen/arch/riscv/include/asm/time.h
index e8d9ffec57..63bdd471cc 100644
--- a/xen/arch/riscv/include/asm/time.h
+++ b/xen/arch/riscv/include/asm/time.h
@@ -3,6 +3,7 @@
 #define ASM__RISCV__TIME_H
 
 #include <xen/bug.h>
+#include <xen/lib.h>
 #include <xen/types.h>
 #include <asm/csr.h>
 
@@ -23,6 +24,11 @@ static inline cycles_t get_cycles(void)
     return csr_read(CSR_TIME);
 }
 
+static inline s_time_t ticks_to_ns(uint64_t ticks)
+{
+    return muldiv64(ticks, MILLISECS(1), cpu_khz);
+}
+
 void preinit_xen_time(void);
 
 #endif /* ASM__RISCV__TIME_H */
diff --git a/xen/arch/riscv/stubs.c b/xen/arch/riscv/stubs.c
index a1d64534cd..83416d3350 100644
--- a/xen/arch/riscv/stubs.c
+++ b/xen/arch/riscv/stubs.c
@@ -27,11 +27,6 @@ nodemask_t __read_mostly node_online_map = { { [0] = 1UL } };
 
 /* time.c */
 
-s_time_t get_s_time(void)
-{
-    BUG_ON("unimplemented");
-}
-
 int reprogram_timer(s_time_t timeout)
 {
     BUG_ON("unimplemented");
diff --git a/xen/arch/riscv/time.c b/xen/arch/riscv/time.c
index 905bb13eb4..e962f8518d 100644
--- a/xen/arch/riscv/time.c
+++ b/xen/arch/riscv/time.c
@@ -4,10 +4,18 @@
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/sections.h>
+#include <xen/types.h>
 
 unsigned long __ro_after_init cpu_khz; /* CPU clock frequency in kHz. */
 uint64_t __ro_after_init boot_clock_cycles;
 
+s_time_t get_s_time(void)
+{
+    uint64_t ticks = get_cycles() - boot_clock_cycles;
+
+    return ticks_to_ns(ticks);
+}
+
 /* Set up the timer on the boot CPU (early init function) */
 static void __init preinit_dt_xen_time(void)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 15 14:55:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 15 Apr 2025 14:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.954099.1348443 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4hgl-0005sv-AP; Tue, 15 Apr 2025 14:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 954099.1348443; Tue, 15 Apr 2025 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 1u4hgl-0005so-7z; Tue, 15 Apr 2025 14:55:03 +0000
Received: by outflank-mailman (input) for mailman id 954099;
 Tue, 15 Apr 2025 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 1u4hgk-0005sg-1P
 for xen-changelog@lists.xenproject.org; Tue, 15 Apr 2025 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 1u4hgj-00H4YE-2e
 for xen-changelog@lists.xenproject.org;
 Tue, 15 Apr 2025 14:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4hgj-00CxAR-2Q
 for xen-changelog@lists.xenproject.org;
 Tue, 15 Apr 2025 14: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=sbsRJOud9T/1EDnV+PElcpCBsQdWPso8GzrTWLVQHQs=; b=AZcu9DmNSXvuVdUWYgrS7T8C9A
	B8jAeSqI8/HEeYHqVloeSOIvhfI+2Ai+1dyiikxG+6L7vGHzKtbAWRwZyqBm+SSD403Y68RFgTcLu
	MyFr6s20/xN6HKCCEDrAg/EtevKHt8Ia/xH8FzsC+cZ6luzcE0/jQem2tj2lxis8mHoo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/mm: account for the offset when performing subpage r/o MMIO access
Message-Id: <E1u4hgj-00CxAR-2Q@xenbits.xenproject.org>
Date: Tue, 15 Apr 2025 14:55:01 +0000

commit 38d07809794e3c723a4de7e10c25c1f6cb590dc6
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Apr 9 18:51:31 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Tue Apr 15 16:01:48 2025 +0200

    x86/mm: account for the offset when performing subpage r/o MMIO access
    
    The current logic in subpage_mmio_write_emulate() doesn't take into account
    the page offset, and always performs the writes at offset 0 (start of the
    page).
    
    Fix this by accounting for the offset before performing the write.
    
    Fixes: 8847d6e23f97 ('x86/mm: add API for marking only part of a MMIO page read only')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 4fecd37aec..1cf2365167 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5131,6 +5131,7 @@ static void subpage_mmio_write_emulate(
         return;
     }
 
+    addr += offset;
     switch ( len )
     {
     case 1:
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 15 15:55:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 15 Apr 2025 15:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.954206.1348518 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4icp-0002yW-Ak; Tue, 15 Apr 2025 15:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 954206.1348518; Tue, 15 Apr 2025 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 1u4icp-0002yO-88; Tue, 15 Apr 2025 15:55:03 +0000
Received: by outflank-mailman (input) for mailman id 954206;
 Tue, 15 Apr 2025 15:55:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u4icn-0002yI-Rg
 for xen-changelog@lists.xenproject.org; Tue, 15 Apr 2025 15:55:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4icn-00H67m-1z
 for xen-changelog@lists.xenproject.org;
 Tue, 15 Apr 2025 15:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4icn-00DS5N-1s
 for xen-changelog@lists.xenproject.org;
 Tue, 15 Apr 2025 15:55:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=N4XtFgNvAStFeK6r47LyrLvAyW+RpDNXUVvjiT8AJlQ=; b=aGc9QzN+bhGWT8O/G3SeW+vZoB
	2nicrhD4kJvr3wjgG31KWqw3bZWM8ipXJkLHvWOCNldUoT9heJrV9VV91rHFWISP9+bU3LyiXONTq
	MoGKyJTxfliZ5YofCusznmrWZXbkB75mSvIRfAWMtiaOO67OA7cPztQo1pp9Ke0rEi90=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mm: account for the offset when performing subpage r/o MMIO access
Message-Id: <E1u4icn-00DS5N-1s@xenbits.xenproject.org>
Date: Tue, 15 Apr 2025 15:55:01 +0000

commit 38d07809794e3c723a4de7e10c25c1f6cb590dc6
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Apr 9 18:51:31 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Tue Apr 15 16:01:48 2025 +0200

    x86/mm: account for the offset when performing subpage r/o MMIO access
    
    The current logic in subpage_mmio_write_emulate() doesn't take into account
    the page offset, and always performs the writes at offset 0 (start of the
    page).
    
    Fix this by accounting for the offset before performing the write.
    
    Fixes: 8847d6e23f97 ('x86/mm: add API for marking only part of a MMIO page read only')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 4fecd37aec..1cf2365167 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5131,6 +5131,7 @@ static void subpage_mmio_write_emulate(
         return;
     }
 
+    addr += offset;
     switch ( len )
     {
     case 1:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 16 07:44:08 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Apr 2025 07:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.955230.1349059 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4xRE-0001cI-CK; Wed, 16 Apr 2025 07:44:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 955230.1349059; Wed, 16 Apr 2025 07:44:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4xRE-0001cA-9c; Wed, 16 Apr 2025 07:44:04 +0000
Received: by outflank-mailman (input) for mailman id 955230;
 Wed, 16 Apr 2025 07:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u4xRC-0001c4-8t
 for xen-changelog@lists.xenproject.org; Wed, 16 Apr 2025 07:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4xRC-001SF1-0X
 for xen-changelog@lists.xenproject.org;
 Wed, 16 Apr 2025 07:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4xRC-00FpS7-0I
 for xen-changelog@lists.xenproject.org;
 Wed, 16 Apr 2025 07:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uw7M/jBz+VVS5QyBmq/jrMPfpFxpoblqknnVdcqfbGM=; b=GV+Z871O7kbaRAMUst/lr9swS4
	B9uyAgW9jls+wzgMiVovyeRNihifMOy47aay8ctZm2j2RyFa2VtA3woJo/Ly1qMEKIdrfdH+wOM/V
	9QlcfPuh9sEP/fyJFPrx5mrzMHtIXkIkHb+8X6P7EhyIS/qGBMKtkYPEs7LoIvZYHyK0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: Move some of the functions to common file
Message-Id: <E1u4xRC-00FpS7-0I@xenbits.xenproject.org>
Date: Wed, 16 Apr 2025 07:44:02 +0000

commit a9445d160667347087ede822f91f2750eb579461
Author:     Ayan Kumar Halder <ayan.kumar.halder@amd.com>
AuthorDate: Mon Apr 14 17:45:12 2025 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 16 08:35:32 2025 +0200

    xen/arm: Move some of the functions to common file
    
    regions.inc is added to hold the common earlyboot MPU regions configurations
    between arm64 and arm32.
    
    prepare_xen_region, fail_insufficient_regions() will be used by both arm32 and
    arm64. Thus, they have been moved to regions.inc.
    
    *_PRBAR are moved to arm64/sysregs.h.
    *_PRLAR are moved to regions.inc as they are common between arm32 and arm64.
    
    Introduce WRITE_SYSREG_ASM to write to the system registers from regions.inc.
    
    Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
    Tested-by: Luca Fancellu <luca.fancellu@arm.com>
---
 xen/arch/arm/arm64/mpu/head.S            | 78 +------------------------------
 xen/arch/arm/include/asm/arm64/sysregs.h | 13 ++++++
 xen/arch/arm/include/asm/mpu/regions.inc | 79 ++++++++++++++++++++++++++++++++
 3 files changed, 93 insertions(+), 77 deletions(-)

diff --git a/xen/arch/arm/arm64/mpu/head.S b/xen/arch/arm/arm64/mpu/head.S
index ed01993d85..6d336cafbb 100644
--- a/xen/arch/arm/arm64/mpu/head.S
+++ b/xen/arch/arm/arm64/mpu/head.S
@@ -3,83 +3,7 @@
  * Start-of-day code for an Armv8-R MPU system.
  */
 
-#include <asm/early_printk.h>
-#include <asm/mpu.h>
-
-/* Backgroud region enable/disable */
-#define SCTLR_ELx_BR    BIT(17, UL)
-
-#define REGION_TEXT_PRBAR       0x38    /* SH=11 AP=10 XN=00 */
-#define REGION_RO_PRBAR         0x3A    /* SH=11 AP=10 XN=10 */
-#define REGION_DATA_PRBAR       0x32    /* SH=11 AP=00 XN=10 */
-#define REGION_DEVICE_PRBAR     0x22    /* SH=10 AP=00 XN=10 */
-
-#define REGION_NORMAL_PRLAR     0x0f    /* NS=0 ATTR=111 EN=1 */
-#define REGION_DEVICE_PRLAR     0x09    /* NS=0 ATTR=100 EN=1 */
-
-/*
- * Macro to prepare and set a EL2 MPU memory region.
- * We will also create an according MPU memory region entry, which
- * is a structure of pr_t,  in table \prmap.
- *
- * sel:         region selector
- * base:        reg storing base address
- * limit:       reg storing limit address
- * prbar:       store computed PRBAR_EL2 value
- * prlar:       store computed PRLAR_EL2 value
- * maxcount:    maximum number of EL2 regions supported
- * attr_prbar:  PRBAR_EL2-related memory attributes. If not specified it will be
- *              REGION_DATA_PRBAR
- * attr_prlar:  PRLAR_EL2-related memory attributes. If not specified it will be
- *              REGION_NORMAL_PRLAR
- *
- * Preserves \maxcount
- * Output:
- *  \sel: Next available region selector index.
- * Clobbers \base, \limit, \prbar, \prlar
- *
- * Note that all parameters using registers should be distinct.
- */
-.macro prepare_xen_region, sel, base, limit, prbar, prlar, maxcount, attr_prbar=REGION_DATA_PRBAR, attr_prlar=REGION_NORMAL_PRLAR
-    /* Check if the region is empty */
-    cmp   \base, \limit
-    beq   1f
-
-    /* Check if the number of regions exceeded the count specified in MPUIR_EL2 */
-    cmp   \sel, \maxcount
-    bge   fail_insufficient_regions
-
-    /* Prepare value for PRBAR_EL2 reg and preserve it in \prbar.*/
-    and   \base, \base, #MPU_REGION_MASK
-    mov   \prbar, #\attr_prbar
-    orr   \prbar, \prbar, \base
-
-    /* Limit address should be inclusive */
-    sub   \limit, \limit, #1
-    and   \limit, \limit, #MPU_REGION_MASK
-    mov   \prlar, #\attr_prlar
-    orr   \prlar, \prlar, \limit
-
-    msr   PRSELR_EL2, \sel
-    isb
-    msr   PRBAR_EL2, \prbar
-    msr   PRLAR_EL2, \prlar
-    dsb   sy
-    isb
-
-    add   \sel, \sel, #1
-
-1:
-.endm
-
-/*
- * Failure caused due to insufficient MPU regions.
- */
-FUNC_LOCAL(fail_insufficient_regions)
-    PRINT("- Selected MPU region is above the implemented number in MPUIR_EL2 -\r\n")
-1:  wfe
-    b   1b
-END(fail_insufficient_regions)
+#include <asm/mpu/regions.inc>
 
 /*
  * Enable EL2 MPU and data cache
diff --git a/xen/arch/arm/include/asm/arm64/sysregs.h b/xen/arch/arm/include/asm/arm64/sysregs.h
index b593e4028b..7440d495e4 100644
--- a/xen/arch/arm/include/asm/arm64/sysregs.h
+++ b/xen/arch/arm/include/asm/arm64/sysregs.h
@@ -462,6 +462,17 @@
 #define ZCR_ELx_LEN_SIZE             9
 #define ZCR_ELx_LEN_MASK             0x1ff
 
+#define REGION_TEXT_PRBAR       0x38    /* SH=11 AP=10 XN=00 */
+#define REGION_RO_PRBAR         0x3A    /* SH=11 AP=10 XN=10 */
+#define REGION_DATA_PRBAR       0x32    /* SH=11 AP=00 XN=10 */
+#define REGION_DEVICE_PRBAR     0x22    /* SH=10 AP=00 XN=10 */
+
+#ifdef __ASSEMBLY__
+
+#define WRITE_SYSREG_ASM(v, name) "msr " __stringify(name,) #v
+
+#else /* __ASSEMBLY__ */
+
 /* Access to system registers */
 
 #define WRITE_SYSREG64(v, name) do {                    \
@@ -481,6 +492,8 @@
 #define WRITE_SYSREG_LR(v, index)  WRITE_SYSREG(v, ICH_LR_REG(index))
 #define READ_SYSREG_LR(index)      READ_SYSREG(ICH_LR_REG(index))
 
+#endif /* !__ASSEMBLY__ */
+
 #endif /* _ASM_ARM_ARM64_SYSREGS_H */
 
 /*
diff --git a/xen/arch/arm/include/asm/mpu/regions.inc b/xen/arch/arm/include/asm/mpu/regions.inc
new file mode 100644
index 0000000000..47868a1526
--- /dev/null
+++ b/xen/arch/arm/include/asm/mpu/regions.inc
@@ -0,0 +1,79 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <asm/mpu.h>
+#include <asm/sysregs.h>
+
+/* Backgroud region enable/disable */
+#define SCTLR_ELx_BR    BIT(17, UL)
+
+#define REGION_NORMAL_PRLAR     0x0f    /* NS=0 ATTR=111 EN=1 */
+#define REGION_DEVICE_PRLAR     0x09    /* NS=0 ATTR=100 EN=1 */
+
+/*
+ * Macro to prepare and set a EL2 MPU memory region.
+ * We will also create an according MPU memory region entry, which
+ * is a structure of pr_t,  in table \prmap.
+ *
+ * sel:         region selector
+ * base:        reg storing base address
+ * limit:       reg storing limit address
+ * prbar:       store computed PRBAR_EL2 value
+ * prlar:       store computed PRLAR_EL2 value
+ * maxcount:    maximum number of EL2 regions supported
+ * attr_prbar:  PRBAR_EL2-related memory attributes. If not specified it will be
+ *              REGION_DATA_PRBAR
+ * attr_prlar:  PRLAR_EL2-related memory attributes. If not specified it will be
+ *              REGION_NORMAL_PRLAR
+ *
+ * Preserves maxcount
+ * Output:
+ *  sel: Next available region selector index.
+ * Clobbers base, limit, prbar, prlar
+ *
+ * Note that all parameters using registers should be distinct.
+ */
+.macro prepare_xen_region, sel, base, limit, prbar, prlar, maxcount, attr_prbar=REGION_DATA_PRBAR, attr_prlar=REGION_NORMAL_PRLAR
+    /* Check if the region is empty */
+    cmp   \base, \limit
+    beq   1f
+
+    /* Check if the number of regions exceeded the count specified in MPUIR_EL2 */
+    cmp   \sel, \maxcount
+    bge   fail_insufficient_regions
+
+    /* Prepare value for PRBAR_EL2 reg and preserve it in \prbar.*/
+    and   \base, \base, #MPU_REGION_MASK
+    mov   \prbar, #\attr_prbar
+    orr   \prbar, \prbar, \base
+
+    /* Limit address should be inclusive */
+    sub   \limit, \limit, #1
+    and   \limit, \limit, #MPU_REGION_MASK
+    mov   \prlar, #\attr_prlar
+    orr   \prlar, \prlar, \limit
+
+    WRITE_SYSREG_ASM(\sel, PRSELR_EL2)
+    isb
+    WRITE_SYSREG_ASM(\prbar, PRBAR_EL2)
+    WRITE_SYSREG_ASM(\prlar, PRLAR_EL2)
+    dsb   sy
+    isb
+
+    add   \sel, \sel, #1
+
+1:
+.endm
+
+/* Failure caused due to insufficient MPU regions. */
+FUNC_LOCAL(fail_insufficient_regions)
+    PRINT("- Selected MPU region is above the implemented number in MPUIR_EL2 -\r\n")
+1:  wfe
+    b   1b
+END(fail_insufficient_regions)
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 16 07:44:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Apr 2025 07:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.955231.1349064 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4xRO-0001ee-Ed; Wed, 16 Apr 2025 07:44:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 955231.1349064; Wed, 16 Apr 2025 07:44:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4xRO-0001eW-B4; Wed, 16 Apr 2025 07:44:14 +0000
Received: by outflank-mailman (input) for mailman id 955231;
 Wed, 16 Apr 2025 07:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u4xRM-0001dr-BA
 for xen-changelog@lists.xenproject.org; Wed, 16 Apr 2025 07:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4xRM-001SJq-11
 for xen-changelog@lists.xenproject.org;
 Wed, 16 Apr 2025 07:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4xRM-00FpXx-0j
 for xen-changelog@lists.xenproject.org;
 Wed, 16 Apr 2025 07:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9oQwZslUFWXAnJc0lAs7kWEuGh+2ESGL2fHJlaE/v4M=; b=TfsWmR9jtiJ4uhgwtPkMgxYWgW
	3+9nnGBGITy8h9nDd1yQbVWJIwcPRXITWZyNZDzf65oK5j4aKc+U47mkWswAnrfRJrJE3vYdamQX5
	ZgSw44GdUAivNMxv5vdduC7To7W3EjgGAEkrFp87s4MOzauOT6thnIZthAOTuZecSLdU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm32: Create the same boot-time MPU regions as arm64
Message-Id: <E1u4xRM-00FpXx-0j@xenbits.xenproject.org>
Date: Wed, 16 Apr 2025 07:44:12 +0000

commit 76e9dd7cdccbe427dc31d508001f6fe7c5f5fb8a
Author:     Ayan Kumar Halder <ayan.kumar.halder@amd.com>
AuthorDate: Mon Apr 14 17:45:13 2025 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 16 08:36:10 2025 +0200

    xen/arm32: Create the same boot-time MPU regions as arm64
    
    Create Boot-time MPU protection regions (similar to Armv8-R AArch64) for
    Armv8-R AArch32.
    Also, defined *_PRBAR macros for arm32. The only difference from arm64 is that
    XN is 1-bit for arm32.
    Define the system registers and macros in mpu/cpregs.h.
    
    Introduce WRITE_SYSREG_ASM() to write to system registers in assembly.
    
    Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
    Tested-by: Luca Fancellu <luca.fancellu@arm.com>
---
 xen/arch/arm/arm32/Makefile              |   1 +
 xen/arch/arm/arm32/mpu/Makefile          |   1 +
 xen/arch/arm/arm32/mpu/head.S            | 104 +++++++++++++++++++++++++++++++
 xen/arch/arm/include/asm/arm32/sysregs.h |  13 +++-
 xen/arch/arm/include/asm/cpregs.h        |   2 +
 xen/arch/arm/include/asm/mpu/cpregs.h    |  32 ++++++++++
 6 files changed, 151 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/arm32/Makefile b/xen/arch/arm/arm32/Makefile
index 40a2b4803f..537969d753 100644
--- a/xen/arch/arm/arm32/Makefile
+++ b/xen/arch/arm/arm32/Makefile
@@ -1,5 +1,6 @@
 obj-y += lib/
 obj-$(CONFIG_MMU) += mmu/
+obj-$(CONFIG_MPU) += mpu/
 
 obj-$(CONFIG_EARLY_PRINTK) += debug.o
 obj-y += domctl.o
diff --git a/xen/arch/arm/arm32/mpu/Makefile b/xen/arch/arm/arm32/mpu/Makefile
new file mode 100644
index 0000000000..3340058c08
--- /dev/null
+++ b/xen/arch/arm/arm32/mpu/Makefile
@@ -0,0 +1 @@
+obj-y += head.o
diff --git a/xen/arch/arm/arm32/mpu/head.S b/xen/arch/arm/arm32/mpu/head.S
new file mode 100644
index 0000000000..b2c5245e51
--- /dev/null
+++ b/xen/arch/arm/arm32/mpu/head.S
@@ -0,0 +1,104 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Start-of-day code for an Armv8-R-AArch32 MPU system.
+ */
+
+#include <asm/arm32/macros.h>
+#include <asm/arm32/sysregs.h>
+#include <asm/cpregs.h>
+#include <asm/mpu.h>
+#include <asm/mpu/regions.inc>
+#include <asm/page.h>
+
+/*
+ * Set up the memory attribute type tables and enable EL2 MPU and data cache.
+ * If the Background region is enabled, then the MPU uses the default memory
+ * map as the Background region for generating the memory
+ * attributes when MPU is disabled.
+ * Since the default memory map of the Armv8-R AArch32 architecture is
+ * IMPLEMENTATION DEFINED, we intend to turn off the Background region here.
+ *
+ * Clobbers r0
+ */
+FUNC_LOCAL(enable_mpu)
+    /* Set up memory attribute type tables */
+    mov_w r0, MAIR0VAL
+    mcr   CP32(r0, HMAIR0)
+    mov_w r0, MAIR1VAL
+    mcr   CP32(r0, HMAIR1)
+
+    mrc   CP32(r0, HSCTLR)
+    bic   r0, r0, #SCTLR_ELx_BR       /* Disable Background region */
+    orr   r0, r0, #SCTLR_Axx_ELx_M    /* Enable MPU */
+    orr   r0, r0, #SCTLR_Axx_ELx_C    /* Enable D-cache */
+    mcr   CP32(r0, HSCTLR)
+    isb
+
+    ret
+END(enable_mpu)
+
+/*
+ * Maps the various sections of Xen (described in xen.lds.S) as different MPU
+ * regions.
+ *
+ * Clobbers r0 - r5
+ *
+ */
+FUNC(enable_boot_cpu_mm)
+    /* Get the number of regions specified in MPUIR_EL2 */
+    mrc   CP32(r5, MPUIR_EL2)
+    and   r5, r5, #NUM_MPU_REGIONS_MASK
+
+    /* x0: region sel */
+    mov   r0, #0
+    /* Xen text section. */
+    mov_w   r1, _stext
+    mov_w   r2, _etext
+    prepare_xen_region r0, r1, r2, r3, r4, r5, attr_prbar=REGION_TEXT_PRBAR
+
+    /* Xen read-only data section. */
+    mov_w   r1, _srodata
+    mov_w   r2, _erodata
+    prepare_xen_region r0, r1, r2, r3, r4, r5, attr_prbar=REGION_RO_PRBAR
+
+    /* Xen read-only after init and data section. (RW data) */
+    mov_w   r1, __ro_after_init_start
+    mov_w   r2, __init_begin
+    prepare_xen_region r0, r1, r2, r3, r4, r5
+
+    /* Xen code section. */
+    mov_w   r1, __init_begin
+    mov_w   r2, __init_data_begin
+    prepare_xen_region r0, r1, r2, r3, r4, r5, attr_prbar=REGION_TEXT_PRBAR
+
+    /* Xen data and BSS section. */
+    mov_w   r1, __init_data_begin
+    mov_w   r2, __bss_end
+    prepare_xen_region r0, r1, r2, r3, r4, r5
+
+#ifdef CONFIG_EARLY_PRINTK
+    /* Xen early UART section. */
+    mov_w   r1, CONFIG_EARLY_UART_BASE_ADDRESS
+    mov_w   r2, (CONFIG_EARLY_UART_BASE_ADDRESS + CONFIG_EARLY_UART_SIZE)
+    prepare_xen_region r0, r1, r2, r3, r4, r5, attr_prbar=REGION_DEVICE_PRBAR, attr_prlar=REGION_DEVICE_PRLAR
+#endif
+
+    b    enable_mpu
+END(enable_boot_cpu_mm)
+
+/*
+ * We don't yet support secondary CPUs bring-up. Implement a dummy helper to
+ * please the common code.
+ */
+FUNC(enable_secondary_cpu_mm)
+    PRINT("- SMP not enabled yet -\r\n")
+1:  wfe
+    b 1b
+END(enable_secondary_cpu_mm)
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/include/asm/arm32/sysregs.h b/xen/arch/arm/include/asm/arm32/sysregs.h
index 22871999af..ef1a870fd6 100644
--- a/xen/arch/arm/include/asm/arm32/sysregs.h
+++ b/xen/arch/arm/include/asm/arm32/sysregs.h
@@ -20,7 +20,16 @@
  * uses r0 as a placeholder register. */
 #define CMD_CP32(name...)      "mcr " __stringify(CP32(r0, name)) ";"
 
-#ifndef __ASSEMBLY__
+#define REGION_TEXT_PRBAR       0x18    /* SH=11 AP=10 XN=0 */
+#define REGION_RO_PRBAR         0x1D    /* SH=11 AP=10 XN=1 */
+#define REGION_DATA_PRBAR       0x19    /* SH=11 AP=00 XN=1 */
+#define REGION_DEVICE_PRBAR     0x11    /* SH=10 AP=00 XN=1 */
+
+#ifdef __ASSEMBLY__
+
+#define WRITE_SYSREG_ASM(v, name) mcr CP32(v, name)
+
+#else /* __ASSEMBLY__ */
 
 /* C wrappers */
 #define READ_CP32(name...) ({                                   \
@@ -84,7 +93,7 @@
 /* MVFR2 is not defined on ARMv7 */
 #define MVFR2_MAYBE_UNDEFINED
 
-#endif /* __ASSEMBLY__ */
+#endif /* !__ASSEMBLY__ */
 
 #endif /* __ASM_ARM_ARM32_SYSREGS_H */
 /*
diff --git a/xen/arch/arm/include/asm/cpregs.h b/xen/arch/arm/include/asm/cpregs.h
index aec9e8f329..a7503a190f 100644
--- a/xen/arch/arm/include/asm/cpregs.h
+++ b/xen/arch/arm/include/asm/cpregs.h
@@ -1,6 +1,8 @@
 #ifndef __ASM_ARM_CPREGS_H
 #define __ASM_ARM_CPREGS_H
 
+#include <asm/mpu/cpregs.h>
+
 /*
  * AArch32 Co-processor registers.
  *
diff --git a/xen/arch/arm/include/asm/mpu/cpregs.h b/xen/arch/arm/include/asm/mpu/cpregs.h
new file mode 100644
index 0000000000..d5cd0e04d5
--- /dev/null
+++ b/xen/arch/arm/include/asm/mpu/cpregs.h
@@ -0,0 +1,32 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef __ARM_MPU_CPREGS_H
+#define __ARM_MPU_CPREGS_H
+
+/* CP15 CR0: MPU Type Register */
+#define HMPUIR          p15,4,c0,c0,4
+
+/* CP15 CR6: MPU Protection Region Base/Limit/Select Address Register */
+#define HPRSELR         p15,4,c6,c2,1
+#define HPRBAR          p15,4,c6,c3,0
+#define HPRLAR          p15,4,c6,c8,1
+
+/* Aliases of AArch64 names for use in common code */
+#ifdef CONFIG_ARM_32
+/* Alphabetically... */
+#define MPUIR_EL2       HMPUIR
+#define PRBAR_EL2       HPRBAR
+#define PRLAR_EL2       HPRLAR
+#define PRSELR_EL2      HPRSELR
+#endif /* CONFIG_ARM_32 */
+
+#endif /* __ARM_MPU_CPREGS_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 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 Apr 16 07:44:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Apr 2025 07:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.955232.1349067 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4xRY-0001i2-HE; Wed, 16 Apr 2025 07:44:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 955232.1349067; Wed, 16 Apr 2025 07:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4xRY-0001hu-ES; Wed, 16 Apr 2025 07:44:24 +0000
Received: by outflank-mailman (input) for mailman id 955232;
 Wed, 16 Apr 2025 07:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u4xRW-0001hb-EC
 for xen-changelog@lists.xenproject.org; Wed, 16 Apr 2025 07:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4xRW-001SJv-1K
 for xen-changelog@lists.xenproject.org;
 Wed, 16 Apr 2025 07:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4xRW-00Fpd3-1C
 for xen-changelog@lists.xenproject.org;
 Wed, 16 Apr 2025 07:44:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=H0L8iArAGLONzJl2mhJ4OzgIPF8cc2tZ0OOCNMRkp0A=; b=iZzdw9yMAb/+TTrxPLvXfr+DdC
	aMjq7ocp6Vd6EsCZqSfI8ew+1oaBb4F0LJEaDgxsno49NdT/su4b8ERkk7SSaZax2J8aMayQnAFDv
	Ed4tO7ITwCZTesPk4ciDcrTxwHqrbJ2HZDbnPQD1N3ResJSkvwOEFUIP/3I/E7vZxbtc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm32: mpu: Stubs to build MPU for arm32
Message-Id: <E1u4xRW-00Fpd3-1C@xenbits.xenproject.org>
Date: Wed, 16 Apr 2025 07:44:22 +0000

commit 62a4858dd576ec611178c4afbd9a5564412ca08e
Author:     Ayan Kumar Halder <ayan.kumar.halder@amd.com>
AuthorDate: Mon Apr 14 17:45:14 2025 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 16 08:50:13 2025 +0200

    xen/arm32: mpu: Stubs to build MPU for arm32
    
    Add stubs to enable compilation.
    
    is_xen_heap_page() and is_xen_heap_mfn() are not implemented for arm32 MPU.
    Thus, introduce the stubs for these functions in asm/mpu/mm.h and move the
    original code to asm/mmu/mm.h (as it is used for arm32 MMU based system).
    
    Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
    Tested-by: Luca Fancellu <luca.fancellu@arm.com>
---
 xen/arch/arm/arm32/mpu/Makefile   |  2 ++
 xen/arch/arm/arm32/mpu/p2m.c      | 19 +++++++++++++++++
 xen/arch/arm/arm32/mpu/smpboot.c  | 26 ++++++++++++++++++++++
 xen/arch/arm/include/asm/mm.h     |  9 +-------
 xen/arch/arm/include/asm/mmu/mm.h |  7 ++++++
 xen/arch/arm/include/asm/mpu/mm.h |  5 +++++
 xen/arch/arm/mpu/Makefile         |  1 +
 xen/arch/arm/mpu/domain-page.c    | 45 +++++++++++++++++++++++++++++++++++++++
 8 files changed, 106 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/arm32/mpu/Makefile b/xen/arch/arm/arm32/mpu/Makefile
index 3340058c08..cf0540aecc 100644
--- a/xen/arch/arm/arm32/mpu/Makefile
+++ b/xen/arch/arm/arm32/mpu/Makefile
@@ -1 +1,3 @@
 obj-y += head.o
+obj-y += p2m.o
+obj-y += smpboot.o
diff --git a/xen/arch/arm/arm32/mpu/p2m.c b/xen/arch/arm/arm32/mpu/p2m.c
new file mode 100644
index 0000000000..3d9abe4400
--- /dev/null
+++ b/xen/arch/arm/arm32/mpu/p2m.c
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <asm/p2m.h>
+#include <xen/bug.h>
+#include <xen/init.h>
+
+void __init setup_virt_paging(void)
+{
+    BUG_ON("unimplemented");
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/arm32/mpu/smpboot.c b/xen/arch/arm/arm32/mpu/smpboot.c
new file mode 100644
index 0000000000..5090f443f5
--- /dev/null
+++ b/xen/arch/arm/arm32/mpu/smpboot.c
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/bug.h>
+#include <xen/errno.h>
+#include <xen/mm.h>
+#include <xen/stdbool.h>
+
+int prepare_secondary_mm(int cpu)
+{
+    BUG_ON("unimplemented");
+    return -EINVAL;
+}
+
+void update_boot_mapping(bool enable)
+{
+    BUG_ON("unimplemented");
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index fbffaccef4..5b67c0f8bb 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -170,14 +170,7 @@ struct page_info
 #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) ({                                 \
-    unsigned long mfn_ = mfn_x(mfn);                            \
-    (mfn_ >= mfn_x(directmap_mfn_start) &&                      \
-     mfn_ < mfn_x(directmap_mfn_end));                          \
-})
-#else
+#ifdef CONFIG_ARM_64
 #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/arm/include/asm/mmu/mm.h b/xen/arch/arm/include/asm/mmu/mm.h
index caba987edc..7f4d59137d 100644
--- a/xen/arch/arm/include/asm/mmu/mm.h
+++ b/xen/arch/arm/include/asm/mmu/mm.h
@@ -27,6 +27,13 @@ extern unsigned long directmap_base_pdx;
 })
 
 #ifdef CONFIG_ARM_32
+#define is_xen_heap_page(page) is_xen_heap_mfn(page_to_mfn(page))
+#define is_xen_heap_mfn(mfn) ({                                 \
+    unsigned long mfn_ = mfn_x(mfn);                            \
+    (mfn_ >= mfn_x(directmap_mfn_start) &&                      \
+     mfn_ < mfn_x(directmap_mfn_end));                          \
+})
+
 /**
  * Find the virtual address corresponding to a machine address
  *
diff --git a/xen/arch/arm/include/asm/mpu/mm.h b/xen/arch/arm/include/asm/mpu/mm.h
index 86f33d9836..bfd840fa5d 100644
--- a/xen/arch/arm/include/asm/mpu/mm.h
+++ b/xen/arch/arm/include/asm/mpu/mm.h
@@ -13,6 +13,11 @@ extern struct page_info *frame_table;
 
 #define virt_to_maddr(va) ((paddr_t)((vaddr_t)(va) & PADDR_MASK))
 
+#ifdef CONFIG_ARM_32
+#define is_xen_heap_page(page) ({ BUG_ON("unimplemented"); false; })
+#define is_xen_heap_mfn(mfn) ({ BUG_ON("unimplemented"); false; })
+#endif
+
 /* On MPU systems there is no translation, ma == va. */
 static inline void *maddr_to_virt(paddr_t ma)
 {
diff --git a/xen/arch/arm/mpu/Makefile b/xen/arch/arm/mpu/Makefile
index 21bbc517b5..808e3e2cb3 100644
--- a/xen/arch/arm/mpu/Makefile
+++ b/xen/arch/arm/mpu/Makefile
@@ -1,3 +1,4 @@
+obj-$(CONFIG_ARM_32) += domain-page.o
 obj-y += mm.o
 obj-y += p2m.o
 obj-y += setup.init.o
diff --git a/xen/arch/arm/mpu/domain-page.c b/xen/arch/arm/mpu/domain-page.c
new file mode 100644
index 0000000000..df5e06b6db
--- /dev/null
+++ b/xen/arch/arm/mpu/domain-page.c
@@ -0,0 +1,45 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/bug.h>
+#include <xen/domain_page.h>
+#include <xen/mm-frame.h>
+#include <xen/types.h>
+
+void *map_domain_page_global(mfn_t mfn)
+{
+    BUG_ON("unimplemented");
+    return NULL;
+}
+
+/* Map a page of domheap memory */
+void *map_domain_page(mfn_t mfn)
+{
+    BUG_ON("unimplemented");
+    return NULL;
+}
+
+/* Release a mapping taken with map_domain_page() */
+void unmap_domain_page(const void *ptr)
+{
+    BUG_ON("unimplemented");
+}
+
+mfn_t domain_page_map_to_mfn(const void *ptr)
+{
+    BUG_ON("unimplemented");
+    return INVALID_MFN;
+}
+
+void unmap_domain_page_global(const void *va)
+{
+    BUG_ON("unimplemented");
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 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 Apr 16 08:22:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Apr 2025 08:22:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.955301.1349101 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4y1y-0001Px-Oy; Wed, 16 Apr 2025 08:22:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 955301.1349101; Wed, 16 Apr 2025 08: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 1u4y1y-0001Pm-MR; Wed, 16 Apr 2025 08:22:02 +0000
Received: by outflank-mailman (input) for mailman id 955301;
 Wed, 16 Apr 2025 08: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 1u4y1x-0001PH-Ry
 for xen-changelog@lists.xenproject.org; Wed, 16 Apr 2025 08: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 1u4y1x-001Tm9-2B
 for xen-changelog@lists.xenproject.org;
 Wed, 16 Apr 2025 08:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4y1x-00GDwj-21
 for xen-changelog@lists.xenproject.org;
 Wed, 16 Apr 2025 08: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=YsCkKWUtAGOP/SL2v5I0BvIKf2WC1ZJCwmVPzJ5aD+Y=; b=evAQbSblA/IQ+HG6g3iVJVigZF
	D7/R4MYGhxulDh8JL6u21EgDNJDCV7dPSWW5eQQcu/x2nVtbHpEHQKmat24lsjjeFJZ3YybmYRCpv
	MdIveZtKQNE7uRrC1KuhuftevOwMoNIBQNgIX+jzrh+B4i2p8srV9j+4UcwNUPZ5XCqE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Move some of the functions to common file
Message-Id: <E1u4y1x-00GDwj-21@xenbits.xenproject.org>
Date: Wed, 16 Apr 2025 08:22:01 +0000

commit a9445d160667347087ede822f91f2750eb579461
Author:     Ayan Kumar Halder <ayan.kumar.halder@amd.com>
AuthorDate: Mon Apr 14 17:45:12 2025 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 16 08:35:32 2025 +0200

    xen/arm: Move some of the functions to common file
    
    regions.inc is added to hold the common earlyboot MPU regions configurations
    between arm64 and arm32.
    
    prepare_xen_region, fail_insufficient_regions() will be used by both arm32 and
    arm64. Thus, they have been moved to regions.inc.
    
    *_PRBAR are moved to arm64/sysregs.h.
    *_PRLAR are moved to regions.inc as they are common between arm32 and arm64.
    
    Introduce WRITE_SYSREG_ASM to write to the system registers from regions.inc.
    
    Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
    Tested-by: Luca Fancellu <luca.fancellu@arm.com>
---
 xen/arch/arm/arm64/mpu/head.S            | 78 +------------------------------
 xen/arch/arm/include/asm/arm64/sysregs.h | 13 ++++++
 xen/arch/arm/include/asm/mpu/regions.inc | 79 ++++++++++++++++++++++++++++++++
 3 files changed, 93 insertions(+), 77 deletions(-)

diff --git a/xen/arch/arm/arm64/mpu/head.S b/xen/arch/arm/arm64/mpu/head.S
index ed01993d85..6d336cafbb 100644
--- a/xen/arch/arm/arm64/mpu/head.S
+++ b/xen/arch/arm/arm64/mpu/head.S
@@ -3,83 +3,7 @@
  * Start-of-day code for an Armv8-R MPU system.
  */
 
-#include <asm/early_printk.h>
-#include <asm/mpu.h>
-
-/* Backgroud region enable/disable */
-#define SCTLR_ELx_BR    BIT(17, UL)
-
-#define REGION_TEXT_PRBAR       0x38    /* SH=11 AP=10 XN=00 */
-#define REGION_RO_PRBAR         0x3A    /* SH=11 AP=10 XN=10 */
-#define REGION_DATA_PRBAR       0x32    /* SH=11 AP=00 XN=10 */
-#define REGION_DEVICE_PRBAR     0x22    /* SH=10 AP=00 XN=10 */
-
-#define REGION_NORMAL_PRLAR     0x0f    /* NS=0 ATTR=111 EN=1 */
-#define REGION_DEVICE_PRLAR     0x09    /* NS=0 ATTR=100 EN=1 */
-
-/*
- * Macro to prepare and set a EL2 MPU memory region.
- * We will also create an according MPU memory region entry, which
- * is a structure of pr_t,  in table \prmap.
- *
- * sel:         region selector
- * base:        reg storing base address
- * limit:       reg storing limit address
- * prbar:       store computed PRBAR_EL2 value
- * prlar:       store computed PRLAR_EL2 value
- * maxcount:    maximum number of EL2 regions supported
- * attr_prbar:  PRBAR_EL2-related memory attributes. If not specified it will be
- *              REGION_DATA_PRBAR
- * attr_prlar:  PRLAR_EL2-related memory attributes. If not specified it will be
- *              REGION_NORMAL_PRLAR
- *
- * Preserves \maxcount
- * Output:
- *  \sel: Next available region selector index.
- * Clobbers \base, \limit, \prbar, \prlar
- *
- * Note that all parameters using registers should be distinct.
- */
-.macro prepare_xen_region, sel, base, limit, prbar, prlar, maxcount, attr_prbar=REGION_DATA_PRBAR, attr_prlar=REGION_NORMAL_PRLAR
-    /* Check if the region is empty */
-    cmp   \base, \limit
-    beq   1f
-
-    /* Check if the number of regions exceeded the count specified in MPUIR_EL2 */
-    cmp   \sel, \maxcount
-    bge   fail_insufficient_regions
-
-    /* Prepare value for PRBAR_EL2 reg and preserve it in \prbar.*/
-    and   \base, \base, #MPU_REGION_MASK
-    mov   \prbar, #\attr_prbar
-    orr   \prbar, \prbar, \base
-
-    /* Limit address should be inclusive */
-    sub   \limit, \limit, #1
-    and   \limit, \limit, #MPU_REGION_MASK
-    mov   \prlar, #\attr_prlar
-    orr   \prlar, \prlar, \limit
-
-    msr   PRSELR_EL2, \sel
-    isb
-    msr   PRBAR_EL2, \prbar
-    msr   PRLAR_EL2, \prlar
-    dsb   sy
-    isb
-
-    add   \sel, \sel, #1
-
-1:
-.endm
-
-/*
- * Failure caused due to insufficient MPU regions.
- */
-FUNC_LOCAL(fail_insufficient_regions)
-    PRINT("- Selected MPU region is above the implemented number in MPUIR_EL2 -\r\n")
-1:  wfe
-    b   1b
-END(fail_insufficient_regions)
+#include <asm/mpu/regions.inc>
 
 /*
  * Enable EL2 MPU and data cache
diff --git a/xen/arch/arm/include/asm/arm64/sysregs.h b/xen/arch/arm/include/asm/arm64/sysregs.h
index b593e4028b..7440d495e4 100644
--- a/xen/arch/arm/include/asm/arm64/sysregs.h
+++ b/xen/arch/arm/include/asm/arm64/sysregs.h
@@ -462,6 +462,17 @@
 #define ZCR_ELx_LEN_SIZE             9
 #define ZCR_ELx_LEN_MASK             0x1ff
 
+#define REGION_TEXT_PRBAR       0x38    /* SH=11 AP=10 XN=00 */
+#define REGION_RO_PRBAR         0x3A    /* SH=11 AP=10 XN=10 */
+#define REGION_DATA_PRBAR       0x32    /* SH=11 AP=00 XN=10 */
+#define REGION_DEVICE_PRBAR     0x22    /* SH=10 AP=00 XN=10 */
+
+#ifdef __ASSEMBLY__
+
+#define WRITE_SYSREG_ASM(v, name) "msr " __stringify(name,) #v
+
+#else /* __ASSEMBLY__ */
+
 /* Access to system registers */
 
 #define WRITE_SYSREG64(v, name) do {                    \
@@ -481,6 +492,8 @@
 #define WRITE_SYSREG_LR(v, index)  WRITE_SYSREG(v, ICH_LR_REG(index))
 #define READ_SYSREG_LR(index)      READ_SYSREG(ICH_LR_REG(index))
 
+#endif /* !__ASSEMBLY__ */
+
 #endif /* _ASM_ARM_ARM64_SYSREGS_H */
 
 /*
diff --git a/xen/arch/arm/include/asm/mpu/regions.inc b/xen/arch/arm/include/asm/mpu/regions.inc
new file mode 100644
index 0000000000..47868a1526
--- /dev/null
+++ b/xen/arch/arm/include/asm/mpu/regions.inc
@@ -0,0 +1,79 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <asm/mpu.h>
+#include <asm/sysregs.h>
+
+/* Backgroud region enable/disable */
+#define SCTLR_ELx_BR    BIT(17, UL)
+
+#define REGION_NORMAL_PRLAR     0x0f    /* NS=0 ATTR=111 EN=1 */
+#define REGION_DEVICE_PRLAR     0x09    /* NS=0 ATTR=100 EN=1 */
+
+/*
+ * Macro to prepare and set a EL2 MPU memory region.
+ * We will also create an according MPU memory region entry, which
+ * is a structure of pr_t,  in table \prmap.
+ *
+ * sel:         region selector
+ * base:        reg storing base address
+ * limit:       reg storing limit address
+ * prbar:       store computed PRBAR_EL2 value
+ * prlar:       store computed PRLAR_EL2 value
+ * maxcount:    maximum number of EL2 regions supported
+ * attr_prbar:  PRBAR_EL2-related memory attributes. If not specified it will be
+ *              REGION_DATA_PRBAR
+ * attr_prlar:  PRLAR_EL2-related memory attributes. If not specified it will be
+ *              REGION_NORMAL_PRLAR
+ *
+ * Preserves maxcount
+ * Output:
+ *  sel: Next available region selector index.
+ * Clobbers base, limit, prbar, prlar
+ *
+ * Note that all parameters using registers should be distinct.
+ */
+.macro prepare_xen_region, sel, base, limit, prbar, prlar, maxcount, attr_prbar=REGION_DATA_PRBAR, attr_prlar=REGION_NORMAL_PRLAR
+    /* Check if the region is empty */
+    cmp   \base, \limit
+    beq   1f
+
+    /* Check if the number of regions exceeded the count specified in MPUIR_EL2 */
+    cmp   \sel, \maxcount
+    bge   fail_insufficient_regions
+
+    /* Prepare value for PRBAR_EL2 reg and preserve it in \prbar.*/
+    and   \base, \base, #MPU_REGION_MASK
+    mov   \prbar, #\attr_prbar
+    orr   \prbar, \prbar, \base
+
+    /* Limit address should be inclusive */
+    sub   \limit, \limit, #1
+    and   \limit, \limit, #MPU_REGION_MASK
+    mov   \prlar, #\attr_prlar
+    orr   \prlar, \prlar, \limit
+
+    WRITE_SYSREG_ASM(\sel, PRSELR_EL2)
+    isb
+    WRITE_SYSREG_ASM(\prbar, PRBAR_EL2)
+    WRITE_SYSREG_ASM(\prlar, PRLAR_EL2)
+    dsb   sy
+    isb
+
+    add   \sel, \sel, #1
+
+1:
+.endm
+
+/* Failure caused due to insufficient MPU regions. */
+FUNC_LOCAL(fail_insufficient_regions)
+    PRINT("- Selected MPU region is above the implemented number in MPUIR_EL2 -\r\n")
+1:  wfe
+    b   1b
+END(fail_insufficient_regions)
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 16 08:22:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Apr 2025 08:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.955304.1349106 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4y29-0001X4-RF; Wed, 16 Apr 2025 08:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 955304.1349106; Wed, 16 Apr 2025 08:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4y29-0001Ww-Ns; Wed, 16 Apr 2025 08:22:13 +0000
Received: by outflank-mailman (input) for mailman id 955304;
 Wed, 16 Apr 2025 08:22:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u4y27-0001Uw-U6
 for xen-changelog@lists.xenproject.org; Wed, 16 Apr 2025 08:22:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4y27-001TmT-2j
 for xen-changelog@lists.xenproject.org;
 Wed, 16 Apr 2025 08:22:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4y27-00GE6z-2O
 for xen-changelog@lists.xenproject.org;
 Wed, 16 Apr 2025 08: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=KqGR5jQc7uR21xKZRJaGsIZk7n2arHeEQeaRUOTkW7k=; b=mHiC+NNyp7IImC3GFv2A+cgTL1
	zLeUjm2FCCKE/EHpgcbnuDxkEcctCxzUxIpyi1d6/8BVJSrY3EoRuWrYuHBc9FUtagQHFA9wCyCKz
	lLYgI6u5MB7Fi9OG9Kux8ygwdZForHmHYAXCIUcsvv/M3G+8NrqsoJxqsm9jhA8kyIOA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm32: Create the same boot-time MPU regions as arm64
Message-Id: <E1u4y27-00GE6z-2O@xenbits.xenproject.org>
Date: Wed, 16 Apr 2025 08:22:11 +0000

commit 76e9dd7cdccbe427dc31d508001f6fe7c5f5fb8a
Author:     Ayan Kumar Halder <ayan.kumar.halder@amd.com>
AuthorDate: Mon Apr 14 17:45:13 2025 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 16 08:36:10 2025 +0200

    xen/arm32: Create the same boot-time MPU regions as arm64
    
    Create Boot-time MPU protection regions (similar to Armv8-R AArch64) for
    Armv8-R AArch32.
    Also, defined *_PRBAR macros for arm32. The only difference from arm64 is that
    XN is 1-bit for arm32.
    Define the system registers and macros in mpu/cpregs.h.
    
    Introduce WRITE_SYSREG_ASM() to write to system registers in assembly.
    
    Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
    Tested-by: Luca Fancellu <luca.fancellu@arm.com>
---
 xen/arch/arm/arm32/Makefile              |   1 +
 xen/arch/arm/arm32/mpu/Makefile          |   1 +
 xen/arch/arm/arm32/mpu/head.S            | 104 +++++++++++++++++++++++++++++++
 xen/arch/arm/include/asm/arm32/sysregs.h |  13 +++-
 xen/arch/arm/include/asm/cpregs.h        |   2 +
 xen/arch/arm/include/asm/mpu/cpregs.h    |  32 ++++++++++
 6 files changed, 151 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/arm32/Makefile b/xen/arch/arm/arm32/Makefile
index 40a2b4803f..537969d753 100644
--- a/xen/arch/arm/arm32/Makefile
+++ b/xen/arch/arm/arm32/Makefile
@@ -1,5 +1,6 @@
 obj-y += lib/
 obj-$(CONFIG_MMU) += mmu/
+obj-$(CONFIG_MPU) += mpu/
 
 obj-$(CONFIG_EARLY_PRINTK) += debug.o
 obj-y += domctl.o
diff --git a/xen/arch/arm/arm32/mpu/Makefile b/xen/arch/arm/arm32/mpu/Makefile
new file mode 100644
index 0000000000..3340058c08
--- /dev/null
+++ b/xen/arch/arm/arm32/mpu/Makefile
@@ -0,0 +1 @@
+obj-y += head.o
diff --git a/xen/arch/arm/arm32/mpu/head.S b/xen/arch/arm/arm32/mpu/head.S
new file mode 100644
index 0000000000..b2c5245e51
--- /dev/null
+++ b/xen/arch/arm/arm32/mpu/head.S
@@ -0,0 +1,104 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Start-of-day code for an Armv8-R-AArch32 MPU system.
+ */
+
+#include <asm/arm32/macros.h>
+#include <asm/arm32/sysregs.h>
+#include <asm/cpregs.h>
+#include <asm/mpu.h>
+#include <asm/mpu/regions.inc>
+#include <asm/page.h>
+
+/*
+ * Set up the memory attribute type tables and enable EL2 MPU and data cache.
+ * If the Background region is enabled, then the MPU uses the default memory
+ * map as the Background region for generating the memory
+ * attributes when MPU is disabled.
+ * Since the default memory map of the Armv8-R AArch32 architecture is
+ * IMPLEMENTATION DEFINED, we intend to turn off the Background region here.
+ *
+ * Clobbers r0
+ */
+FUNC_LOCAL(enable_mpu)
+    /* Set up memory attribute type tables */
+    mov_w r0, MAIR0VAL
+    mcr   CP32(r0, HMAIR0)
+    mov_w r0, MAIR1VAL
+    mcr   CP32(r0, HMAIR1)
+
+    mrc   CP32(r0, HSCTLR)
+    bic   r0, r0, #SCTLR_ELx_BR       /* Disable Background region */
+    orr   r0, r0, #SCTLR_Axx_ELx_M    /* Enable MPU */
+    orr   r0, r0, #SCTLR_Axx_ELx_C    /* Enable D-cache */
+    mcr   CP32(r0, HSCTLR)
+    isb
+
+    ret
+END(enable_mpu)
+
+/*
+ * Maps the various sections of Xen (described in xen.lds.S) as different MPU
+ * regions.
+ *
+ * Clobbers r0 - r5
+ *
+ */
+FUNC(enable_boot_cpu_mm)
+    /* Get the number of regions specified in MPUIR_EL2 */
+    mrc   CP32(r5, MPUIR_EL2)
+    and   r5, r5, #NUM_MPU_REGIONS_MASK
+
+    /* x0: region sel */
+    mov   r0, #0
+    /* Xen text section. */
+    mov_w   r1, _stext
+    mov_w   r2, _etext
+    prepare_xen_region r0, r1, r2, r3, r4, r5, attr_prbar=REGION_TEXT_PRBAR
+
+    /* Xen read-only data section. */
+    mov_w   r1, _srodata
+    mov_w   r2, _erodata
+    prepare_xen_region r0, r1, r2, r3, r4, r5, attr_prbar=REGION_RO_PRBAR
+
+    /* Xen read-only after init and data section. (RW data) */
+    mov_w   r1, __ro_after_init_start
+    mov_w   r2, __init_begin
+    prepare_xen_region r0, r1, r2, r3, r4, r5
+
+    /* Xen code section. */
+    mov_w   r1, __init_begin
+    mov_w   r2, __init_data_begin
+    prepare_xen_region r0, r1, r2, r3, r4, r5, attr_prbar=REGION_TEXT_PRBAR
+
+    /* Xen data and BSS section. */
+    mov_w   r1, __init_data_begin
+    mov_w   r2, __bss_end
+    prepare_xen_region r0, r1, r2, r3, r4, r5
+
+#ifdef CONFIG_EARLY_PRINTK
+    /* Xen early UART section. */
+    mov_w   r1, CONFIG_EARLY_UART_BASE_ADDRESS
+    mov_w   r2, (CONFIG_EARLY_UART_BASE_ADDRESS + CONFIG_EARLY_UART_SIZE)
+    prepare_xen_region r0, r1, r2, r3, r4, r5, attr_prbar=REGION_DEVICE_PRBAR, attr_prlar=REGION_DEVICE_PRLAR
+#endif
+
+    b    enable_mpu
+END(enable_boot_cpu_mm)
+
+/*
+ * We don't yet support secondary CPUs bring-up. Implement a dummy helper to
+ * please the common code.
+ */
+FUNC(enable_secondary_cpu_mm)
+    PRINT("- SMP not enabled yet -\r\n")
+1:  wfe
+    b 1b
+END(enable_secondary_cpu_mm)
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/include/asm/arm32/sysregs.h b/xen/arch/arm/include/asm/arm32/sysregs.h
index 22871999af..ef1a870fd6 100644
--- a/xen/arch/arm/include/asm/arm32/sysregs.h
+++ b/xen/arch/arm/include/asm/arm32/sysregs.h
@@ -20,7 +20,16 @@
  * uses r0 as a placeholder register. */
 #define CMD_CP32(name...)      "mcr " __stringify(CP32(r0, name)) ";"
 
-#ifndef __ASSEMBLY__
+#define REGION_TEXT_PRBAR       0x18    /* SH=11 AP=10 XN=0 */
+#define REGION_RO_PRBAR         0x1D    /* SH=11 AP=10 XN=1 */
+#define REGION_DATA_PRBAR       0x19    /* SH=11 AP=00 XN=1 */
+#define REGION_DEVICE_PRBAR     0x11    /* SH=10 AP=00 XN=1 */
+
+#ifdef __ASSEMBLY__
+
+#define WRITE_SYSREG_ASM(v, name) mcr CP32(v, name)
+
+#else /* __ASSEMBLY__ */
 
 /* C wrappers */
 #define READ_CP32(name...) ({                                   \
@@ -84,7 +93,7 @@
 /* MVFR2 is not defined on ARMv7 */
 #define MVFR2_MAYBE_UNDEFINED
 
-#endif /* __ASSEMBLY__ */
+#endif /* !__ASSEMBLY__ */
 
 #endif /* __ASM_ARM_ARM32_SYSREGS_H */
 /*
diff --git a/xen/arch/arm/include/asm/cpregs.h b/xen/arch/arm/include/asm/cpregs.h
index aec9e8f329..a7503a190f 100644
--- a/xen/arch/arm/include/asm/cpregs.h
+++ b/xen/arch/arm/include/asm/cpregs.h
@@ -1,6 +1,8 @@
 #ifndef __ASM_ARM_CPREGS_H
 #define __ASM_ARM_CPREGS_H
 
+#include <asm/mpu/cpregs.h>
+
 /*
  * AArch32 Co-processor registers.
  *
diff --git a/xen/arch/arm/include/asm/mpu/cpregs.h b/xen/arch/arm/include/asm/mpu/cpregs.h
new file mode 100644
index 0000000000..d5cd0e04d5
--- /dev/null
+++ b/xen/arch/arm/include/asm/mpu/cpregs.h
@@ -0,0 +1,32 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef __ARM_MPU_CPREGS_H
+#define __ARM_MPU_CPREGS_H
+
+/* CP15 CR0: MPU Type Register */
+#define HMPUIR          p15,4,c0,c0,4
+
+/* CP15 CR6: MPU Protection Region Base/Limit/Select Address Register */
+#define HPRSELR         p15,4,c6,c2,1
+#define HPRBAR          p15,4,c6,c3,0
+#define HPRLAR          p15,4,c6,c8,1
+
+/* Aliases of AArch64 names for use in common code */
+#ifdef CONFIG_ARM_32
+/* Alphabetically... */
+#define MPUIR_EL2       HMPUIR
+#define PRBAR_EL2       HPRBAR
+#define PRLAR_EL2       HPRLAR
+#define PRSELR_EL2      HPRSELR
+#endif /* CONFIG_ARM_32 */
+
+#endif /* __ARM_MPU_CPREGS_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 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 Apr 16 08:22:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Apr 2025 08:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.955309.1349108 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4y2J-0001h8-S2; Wed, 16 Apr 2025 08:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 955309.1349108; Wed, 16 Apr 2025 08: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 1u4y2J-0001h1-PS; Wed, 16 Apr 2025 08:22:23 +0000
Received: by outflank-mailman (input) for mailman id 955309;
 Wed, 16 Apr 2025 08:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u4y2H-0001eN-VM
 for xen-changelog@lists.xenproject.org; Wed, 16 Apr 2025 08:22:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4y2H-001Tmi-32
 for xen-changelog@lists.xenproject.org;
 Wed, 16 Apr 2025 08:22:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4y2H-00GEIo-2u
 for xen-changelog@lists.xenproject.org;
 Wed, 16 Apr 2025 08:22:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DNYXqiQAUEwHL94415g8DuHEnimStEF3DpeU+P4OsN4=; b=h+fuLPB1DBjxqdSmEni9XB261I
	SYGIMad3ecAHwrxqXlH/gQpnYXu0TO5Hflb794XMv8iXS2VjQv4jFrMZmJeq71Lj9+ScYttKk34aA
	SFD/AqifJck+rJha5g3fKXEQHc5iInet3CWW/zduAnueV4QES1REUbdWDalXhaa9YQSY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm32: mpu: Stubs to build MPU for arm32
Message-Id: <E1u4y2H-00GEIo-2u@xenbits.xenproject.org>
Date: Wed, 16 Apr 2025 08:22:21 +0000

commit 62a4858dd576ec611178c4afbd9a5564412ca08e
Author:     Ayan Kumar Halder <ayan.kumar.halder@amd.com>
AuthorDate: Mon Apr 14 17:45:14 2025 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 16 08:50:13 2025 +0200

    xen/arm32: mpu: Stubs to build MPU for arm32
    
    Add stubs to enable compilation.
    
    is_xen_heap_page() and is_xen_heap_mfn() are not implemented for arm32 MPU.
    Thus, introduce the stubs for these functions in asm/mpu/mm.h and move the
    original code to asm/mmu/mm.h (as it is used for arm32 MMU based system).
    
    Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
    Tested-by: Luca Fancellu <luca.fancellu@arm.com>
---
 xen/arch/arm/arm32/mpu/Makefile   |  2 ++
 xen/arch/arm/arm32/mpu/p2m.c      | 19 +++++++++++++++++
 xen/arch/arm/arm32/mpu/smpboot.c  | 26 ++++++++++++++++++++++
 xen/arch/arm/include/asm/mm.h     |  9 +-------
 xen/arch/arm/include/asm/mmu/mm.h |  7 ++++++
 xen/arch/arm/include/asm/mpu/mm.h |  5 +++++
 xen/arch/arm/mpu/Makefile         |  1 +
 xen/arch/arm/mpu/domain-page.c    | 45 +++++++++++++++++++++++++++++++++++++++
 8 files changed, 106 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/arm32/mpu/Makefile b/xen/arch/arm/arm32/mpu/Makefile
index 3340058c08..cf0540aecc 100644
--- a/xen/arch/arm/arm32/mpu/Makefile
+++ b/xen/arch/arm/arm32/mpu/Makefile
@@ -1 +1,3 @@
 obj-y += head.o
+obj-y += p2m.o
+obj-y += smpboot.o
diff --git a/xen/arch/arm/arm32/mpu/p2m.c b/xen/arch/arm/arm32/mpu/p2m.c
new file mode 100644
index 0000000000..3d9abe4400
--- /dev/null
+++ b/xen/arch/arm/arm32/mpu/p2m.c
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <asm/p2m.h>
+#include <xen/bug.h>
+#include <xen/init.h>
+
+void __init setup_virt_paging(void)
+{
+    BUG_ON("unimplemented");
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/arm32/mpu/smpboot.c b/xen/arch/arm/arm32/mpu/smpboot.c
new file mode 100644
index 0000000000..5090f443f5
--- /dev/null
+++ b/xen/arch/arm/arm32/mpu/smpboot.c
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/bug.h>
+#include <xen/errno.h>
+#include <xen/mm.h>
+#include <xen/stdbool.h>
+
+int prepare_secondary_mm(int cpu)
+{
+    BUG_ON("unimplemented");
+    return -EINVAL;
+}
+
+void update_boot_mapping(bool enable)
+{
+    BUG_ON("unimplemented");
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index fbffaccef4..5b67c0f8bb 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -170,14 +170,7 @@ struct page_info
 #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) ({                                 \
-    unsigned long mfn_ = mfn_x(mfn);                            \
-    (mfn_ >= mfn_x(directmap_mfn_start) &&                      \
-     mfn_ < mfn_x(directmap_mfn_end));                          \
-})
-#else
+#ifdef CONFIG_ARM_64
 #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/arm/include/asm/mmu/mm.h b/xen/arch/arm/include/asm/mmu/mm.h
index caba987edc..7f4d59137d 100644
--- a/xen/arch/arm/include/asm/mmu/mm.h
+++ b/xen/arch/arm/include/asm/mmu/mm.h
@@ -27,6 +27,13 @@ extern unsigned long directmap_base_pdx;
 })
 
 #ifdef CONFIG_ARM_32
+#define is_xen_heap_page(page) is_xen_heap_mfn(page_to_mfn(page))
+#define is_xen_heap_mfn(mfn) ({                                 \
+    unsigned long mfn_ = mfn_x(mfn);                            \
+    (mfn_ >= mfn_x(directmap_mfn_start) &&                      \
+     mfn_ < mfn_x(directmap_mfn_end));                          \
+})
+
 /**
  * Find the virtual address corresponding to a machine address
  *
diff --git a/xen/arch/arm/include/asm/mpu/mm.h b/xen/arch/arm/include/asm/mpu/mm.h
index 86f33d9836..bfd840fa5d 100644
--- a/xen/arch/arm/include/asm/mpu/mm.h
+++ b/xen/arch/arm/include/asm/mpu/mm.h
@@ -13,6 +13,11 @@ extern struct page_info *frame_table;
 
 #define virt_to_maddr(va) ((paddr_t)((vaddr_t)(va) & PADDR_MASK))
 
+#ifdef CONFIG_ARM_32
+#define is_xen_heap_page(page) ({ BUG_ON("unimplemented"); false; })
+#define is_xen_heap_mfn(mfn) ({ BUG_ON("unimplemented"); false; })
+#endif
+
 /* On MPU systems there is no translation, ma == va. */
 static inline void *maddr_to_virt(paddr_t ma)
 {
diff --git a/xen/arch/arm/mpu/Makefile b/xen/arch/arm/mpu/Makefile
index 21bbc517b5..808e3e2cb3 100644
--- a/xen/arch/arm/mpu/Makefile
+++ b/xen/arch/arm/mpu/Makefile
@@ -1,3 +1,4 @@
+obj-$(CONFIG_ARM_32) += domain-page.o
 obj-y += mm.o
 obj-y += p2m.o
 obj-y += setup.init.o
diff --git a/xen/arch/arm/mpu/domain-page.c b/xen/arch/arm/mpu/domain-page.c
new file mode 100644
index 0000000000..df5e06b6db
--- /dev/null
+++ b/xen/arch/arm/mpu/domain-page.c
@@ -0,0 +1,45 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/bug.h>
+#include <xen/domain_page.h>
+#include <xen/mm-frame.h>
+#include <xen/types.h>
+
+void *map_domain_page_global(mfn_t mfn)
+{
+    BUG_ON("unimplemented");
+    return NULL;
+}
+
+/* Map a page of domheap memory */
+void *map_domain_page(mfn_t mfn)
+{
+    BUG_ON("unimplemented");
+    return NULL;
+}
+
+/* Release a mapping taken with map_domain_page() */
+void unmap_domain_page(const void *ptr)
+{
+    BUG_ON("unimplemented");
+}
+
+mfn_t domain_page_map_to_mfn(const void *ptr)
+{
+    BUG_ON("unimplemented");
+    return INVALID_MFN;
+}
+
+void unmap_domain_page_global(const void *va)
+{
+    BUG_ON("unimplemented");
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 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 Apr 16 08:44:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Apr 2025 08:44:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.955368.1349155 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4yNH-0007VM-8m; Wed, 16 Apr 2025 08:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 955368.1349155; Wed, 16 Apr 2025 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 1u4yNH-0007VE-5W; Wed, 16 Apr 2025 08:44:03 +0000
Received: by outflank-mailman (input) for mailman id 955368;
 Wed, 16 Apr 2025 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 1u4yNF-0007V8-PX
 for xen-changelog@lists.xenproject.org; Wed, 16 Apr 2025 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 1u4yNF-001UKK-1W
 for xen-changelog@lists.xenproject.org;
 Wed, 16 Apr 2025 08:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4yNF-00GSI8-1I
 for xen-changelog@lists.xenproject.org;
 Wed, 16 Apr 2025 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=aiQltnpHHQHMmcH/WuR97jdjYys7cYUjEUgpuIUwqNE=; b=p0hJXD1bSmcagCvBvQmxwD0ZU0
	8B7z1e9+Rn/Lf3RHY5MKdEJFeB9kBum6abQc3WvJ5L//JZSIBGTXjRfi3CrYWFA+crq+Fwwxnvc9U
	sEG3HZR8sXf/zesvjjFHGJykhHLmfLTi4gNi4CaTV7ooI5cTAT+0y4SKHohTPOLuP8oM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: Build with --prefix=/usr rather than setting LD_LIBRARY_PATH
Message-Id: <E1u4yNF-00GSI8-1I@xenbits.xenproject.org>
Date: Wed, 16 Apr 2025 08:44:01 +0000

commit 7f8c2dd829358406dc9e50d5e386e4d2b20b4303
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 15 13:49:01 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 16 09:37:14 2025 +0100

    CI: Build with --prefix=/usr rather than setting LD_LIBRARY_PATH
    
    This also moves executables too.
    
    I'm not sure why xilinx-smoke-dom0-x86_64.sh was overriding PATH too, as
    /usr/local is clearly in PATH given the other tests, but drop that too.
    
    No practical change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/scripts/build                          | 2 +-
 automation/scripts/qemu-alpine-x86_64.sh          | 1 -
 automation/scripts/qemu-smoke-dom0-arm64.sh       | 1 -
 automation/scripts/qemu-smoke-dom0less-arm64.sh   | 3 +--
 automation/scripts/qubes-x86-64.sh                | 1 -
 automation/scripts/xilinx-smoke-dom0-x86_64.sh    | 3 ---
 automation/scripts/xilinx-smoke-dom0less-arm64.sh | 3 +--
 7 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/automation/scripts/build b/automation/scripts/build
index 51effec81d..a348c781d1 100755
--- a/automation/scripts/build
+++ b/automation/scripts/build
@@ -67,7 +67,7 @@ elif [[ "${HYPERVISOR_ONLY}" == "y" ]]; then
     collect_xen_artefacts
 else
     # Full build.  Figure out our ./configure options
-    cfgargs=()
+    cfgargs=("--prefix=/usr")
     cfgargs+=("--enable-docs")
 
     # booleans for which compiler is in use
diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
index fe86caa393..746e70483d 100755
--- a/automation/scripts/qemu-alpine-x86_64.sh
+++ b/automation/scripts/qemu-alpine-x86_64.sh
@@ -49,7 +49,6 @@ echo "#!/bin/bash
 
 set -x
 
-export LD_LIBRARY_PATH=/usr/local/lib
 bash /etc/init.d/xencommons start
 
 xl list
diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
index 61dd24b9ab..d6f6b74880 100755
--- a/automation/scripts/qemu-smoke-dom0-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
@@ -46,7 +46,6 @@ extra=\"console=hvc0 root=/dev/ram0 rdinit=/bin/sh\"
 " > root/domU.cfg
 echo "#!/bin/bash
 
-export LD_LIBRARY_PATH=/usr/local/lib
 bash /etc/init.d/xencommons start
 
 xl list
diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh b/automation/scripts/qemu-smoke-dom0less-arm64.sh
index 58f11dd310..e7a3e670d0 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
@@ -125,10 +125,9 @@ mkdir -p etc/local.d
 
 echo "#!/bin/bash
 
-export LD_LIBRARY_PATH=/usr/local/lib
 bash /etc/init.d/xencommons start
 
-/usr/local/lib/xen/bin/init-dom0less
+/usr/lib/xen/bin/init-dom0less
 
 brctl addbr xenbr0
 brctl addif xenbr0 eth0
diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index 1f90e7002c..bfdd2ceb99 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -201,7 +201,6 @@ cp -a ../automation/scripts/run-tools-tests tests/
 
 echo "#!/bin/bash
 
-export LD_LIBRARY_PATH=/usr/local/lib
 bash /etc/init.d/xencommons start
 
 brctl addbr xenbr0
diff --git a/automation/scripts/xilinx-smoke-dom0-x86_64.sh b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
index 5bb44188dc..8f02fa73bd 100755
--- a/automation/scripts/xilinx-smoke-dom0-x86_64.sh
+++ b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
@@ -92,8 +92,6 @@ cd rootfs
 mkdir -p etc/local.d
 echo "#!/bin/sh
 set -x
-export LD_LIBRARY_PATH=/usr/local/lib
-PATH=/usr/local/bin:/usr/local/sbin:\$PATH
 ${DOMU_CMD}
 " > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
@@ -119,7 +117,6 @@ cd rootfs
 mkdir -p boot etc/local.d etc/xen etc/default
 echo "#!/bin/bash
 set -x
-export LD_LIBRARY_PATH=/usr/local/lib
 bash /etc/init.d/xencommons start
 ${DOM0_CMD}
 " > etc/local.d/xen.start
diff --git a/automation/scripts/xilinx-smoke-dom0less-arm64.sh b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
index 59f3fe7edb..293232eebf 100755
--- a/automation/scripts/xilinx-smoke-dom0less-arm64.sh
+++ b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
@@ -64,10 +64,9 @@ cd rootfs
 mkdir -p etc/local.d
 echo "#!/bin/bash
 
-export LD_LIBRARY_PATH=/usr/local/lib
 bash /etc/init.d/xencommons start
 
-/usr/local/lib/xen/bin/init-dom0less
+/usr/lib/xen/bin/init-dom0less
 
 ${dom0_check}
 " > etc/local.d/xen.start
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 16 09:11:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Apr 2025 09:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.955393.1349176 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u4ynP-0005U7-IP; Wed, 16 Apr 2025 09:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 955393.1349176; Wed, 16 Apr 2025 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 1u4ynP-0005U0-Fy; Wed, 16 Apr 2025 09:11:03 +0000
Received: by outflank-mailman (input) for mailman id 955393;
 Wed, 16 Apr 2025 09: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 1u4ynN-0005To-Up
 for xen-changelog@lists.xenproject.org; Wed, 16 Apr 2025 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 1u4ynN-001V5r-2e
 for xen-changelog@lists.xenproject.org;
 Wed, 16 Apr 2025 09:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u4ynN-00Giqh-2Q
 for xen-changelog@lists.xenproject.org;
 Wed, 16 Apr 2025 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=iLp1a9Uw7Vb7yWwSDllE3Anvsre3K92ZWG/IU2eY+og=; b=SPAwyF1V7FzxVgQ3miZd/DhQxI
	ZNJDACzYcWEcOJlKVsYKTBVzT/mzi3BwHiffVs+xN/m5bnynv2OsdMQ7LInuh45k0ujfDwaJk7FWD
	oXGDrKv1j2LWf2Q0Uz3aK66MPI8yNkhXx73AfRaV8qPANiD7DyTGqA65CYWimPxa0BU4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: Build with --prefix=/usr rather than setting LD_LIBRARY_PATH
Message-Id: <E1u4ynN-00Giqh-2Q@xenbits.xenproject.org>
Date: Wed, 16 Apr 2025 09:11:01 +0000

commit 7f8c2dd829358406dc9e50d5e386e4d2b20b4303
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 15 13:49:01 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 16 09:37:14 2025 +0100

    CI: Build with --prefix=/usr rather than setting LD_LIBRARY_PATH
    
    This also moves executables too.
    
    I'm not sure why xilinx-smoke-dom0-x86_64.sh was overriding PATH too, as
    /usr/local is clearly in PATH given the other tests, but drop that too.
    
    No practical change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/scripts/build                          | 2 +-
 automation/scripts/qemu-alpine-x86_64.sh          | 1 -
 automation/scripts/qemu-smoke-dom0-arm64.sh       | 1 -
 automation/scripts/qemu-smoke-dom0less-arm64.sh   | 3 +--
 automation/scripts/qubes-x86-64.sh                | 1 -
 automation/scripts/xilinx-smoke-dom0-x86_64.sh    | 3 ---
 automation/scripts/xilinx-smoke-dom0less-arm64.sh | 3 +--
 7 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/automation/scripts/build b/automation/scripts/build
index 51effec81d..a348c781d1 100755
--- a/automation/scripts/build
+++ b/automation/scripts/build
@@ -67,7 +67,7 @@ elif [[ "${HYPERVISOR_ONLY}" == "y" ]]; then
     collect_xen_artefacts
 else
     # Full build.  Figure out our ./configure options
-    cfgargs=()
+    cfgargs=("--prefix=/usr")
     cfgargs+=("--enable-docs")
 
     # booleans for which compiler is in use
diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
index fe86caa393..746e70483d 100755
--- a/automation/scripts/qemu-alpine-x86_64.sh
+++ b/automation/scripts/qemu-alpine-x86_64.sh
@@ -49,7 +49,6 @@ echo "#!/bin/bash
 
 set -x
 
-export LD_LIBRARY_PATH=/usr/local/lib
 bash /etc/init.d/xencommons start
 
 xl list
diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
index 61dd24b9ab..d6f6b74880 100755
--- a/automation/scripts/qemu-smoke-dom0-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
@@ -46,7 +46,6 @@ extra=\"console=hvc0 root=/dev/ram0 rdinit=/bin/sh\"
 " > root/domU.cfg
 echo "#!/bin/bash
 
-export LD_LIBRARY_PATH=/usr/local/lib
 bash /etc/init.d/xencommons start
 
 xl list
diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh b/automation/scripts/qemu-smoke-dom0less-arm64.sh
index 58f11dd310..e7a3e670d0 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
@@ -125,10 +125,9 @@ mkdir -p etc/local.d
 
 echo "#!/bin/bash
 
-export LD_LIBRARY_PATH=/usr/local/lib
 bash /etc/init.d/xencommons start
 
-/usr/local/lib/xen/bin/init-dom0less
+/usr/lib/xen/bin/init-dom0less
 
 brctl addbr xenbr0
 brctl addif xenbr0 eth0
diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index 1f90e7002c..bfdd2ceb99 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -201,7 +201,6 @@ cp -a ../automation/scripts/run-tools-tests tests/
 
 echo "#!/bin/bash
 
-export LD_LIBRARY_PATH=/usr/local/lib
 bash /etc/init.d/xencommons start
 
 brctl addbr xenbr0
diff --git a/automation/scripts/xilinx-smoke-dom0-x86_64.sh b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
index 5bb44188dc..8f02fa73bd 100755
--- a/automation/scripts/xilinx-smoke-dom0-x86_64.sh
+++ b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
@@ -92,8 +92,6 @@ cd rootfs
 mkdir -p etc/local.d
 echo "#!/bin/sh
 set -x
-export LD_LIBRARY_PATH=/usr/local/lib
-PATH=/usr/local/bin:/usr/local/sbin:\$PATH
 ${DOMU_CMD}
 " > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
@@ -119,7 +117,6 @@ cd rootfs
 mkdir -p boot etc/local.d etc/xen etc/default
 echo "#!/bin/bash
 set -x
-export LD_LIBRARY_PATH=/usr/local/lib
 bash /etc/init.d/xencommons start
 ${DOM0_CMD}
 " > etc/local.d/xen.start
diff --git a/automation/scripts/xilinx-smoke-dom0less-arm64.sh b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
index 59f3fe7edb..293232eebf 100755
--- a/automation/scripts/xilinx-smoke-dom0less-arm64.sh
+++ b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
@@ -64,10 +64,9 @@ cd rootfs
 mkdir -p etc/local.d
 echo "#!/bin/bash
 
-export LD_LIBRARY_PATH=/usr/local/lib
 bash /etc/init.d/xencommons start
 
-/usr/local/lib/xen/bin/init-dom0less
+/usr/lib/xen/bin/init-dom0less
 
 ${dom0_check}
 " > etc/local.d/xen.start
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 16 23:11:08 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Apr 2025 23:11:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.956783.1350060 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5BuK-0002kB-8f; Wed, 16 Apr 2025 23:11:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 956783.1350060; Wed, 16 Apr 2025 23: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 1u5BuK-0002k3-65; Wed, 16 Apr 2025 23:11:04 +0000
Received: by outflank-mailman (input) for mailman id 956783;
 Wed, 16 Apr 2025 23: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 1u5BuI-0002jr-Cy
 for xen-changelog@lists.xenproject.org; Wed, 16 Apr 2025 23: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 1u5BuI-001roQ-0P
 for xen-changelog@lists.xenproject.org;
 Wed, 16 Apr 2025 23:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5BuH-000nYV-36
 for xen-changelog@lists.xenproject.org;
 Wed, 16 Apr 2025 23:11:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vf4k2Dh/h1N+9BOvqapU9baLiqIOts4lSI/CbEInRRA=; b=O5IE2dy1ZmyZ3u0Z3XFCmty9Wt
	Eeo3lCQuE3x/4/cZvYAaLnpJE7IU4tqN8ImlVn0xOqGWNxY7fKS34cgs/U8y9eibaZcNQb9HhGjXJ
	gIwuxhtQpLQY5oZXzFr1UQoyH7R0TqikUx/q1hihCDdYMHeA1Wc7GSxkbitJOsBU08Uk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: Add Arm64/Arm32 MPU build jobs
Message-Id: <E1u5BuH-000nYV-36@xenbits.xenproject.org>
Date: Wed, 16 Apr 2025 23:11:01 +0000

commit 7cf8d185388fbfc091e05712ba31df29bed03dbc
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Apr 16 10:21:30 2025 +0200
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Wed Apr 16 16:03:25 2025 -0700

    CI: Add Arm64/Arm32 MPU build jobs
    
    Just like for RISCV and PPC, the earlier we enable the CI build the
    better.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/gitlab-ci/build.yaml | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index ac53678745..ab5211f77e 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -379,6 +379,16 @@ debian-bookworm-gcc-arm32-debug-earlyprintk:
       CONFIG_EARLY_UART_CHOICE_PL011=y
       CONFIG_EARLY_UART_BASE_ADDRESS=0x9000000
 
+debian-bookworm-gcc-arm32-debug-mpu:
+  extends: .gcc-arm32-cross-build-debug
+  variables:
+    CONTAINER: debian:bookworm-arm64v8-arm32-gcc
+    HYPERVISOR_ONLY: y
+    EXTRA_XEN_CONFIG: |
+      CONFIG_XEN_START_ADDRESS=0x0
+      CONFIG_MPU=y
+      CONFIG_UNSUPPORTED=y
+
 # Arm builds
 
 debian-bookworm-gcc-arm64:
@@ -443,6 +453,16 @@ alpine-3.18-gcc-debug-arm64-earlyprintk:
       CONFIG_EARLY_UART_CHOICE_PL011=y
       CONFIG_EARLY_UART_BASE_ADDRESS=0x9000000
 
+alpine-3.18-gcc-debug-arm64-mpu:
+  extends: .gcc-arm64-build-debug
+  variables:
+    CONTAINER: alpine:3.18-arm64v8
+    HYPERVISOR_ONLY: y
+    EXTRA_XEN_CONFIG: |
+      CONFIG_XEN_START_ADDRESS=0x0
+      CONFIG_MPU=y
+      CONFIG_UNSUPPORTED=y
+
 # Yocto test jobs
 yocto-qemuarm64:
   extends: .yocto-test-arm64
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 17 01:00:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 17 Apr 2025 01:00:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.956882.1350137 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5Dbm-0006Ac-T8; Thu, 17 Apr 2025 01:00:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 956882.1350137; Thu, 17 Apr 2025 01: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 1u5Dbm-00069k-Pr; Thu, 17 Apr 2025 01:00:02 +0000
Received: by outflank-mailman (input) for mailman id 956882;
 Thu, 17 Apr 2025 01: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 1u5Dbl-0005hW-SX
 for xen-changelog@lists.xenproject.org; Thu, 17 Apr 2025 01: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 1u5Dbl-001vC7-2T
 for xen-changelog@lists.xenproject.org;
 Thu, 17 Apr 2025 01:00:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5Dbl-004StN-2G
 for xen-changelog@lists.xenproject.org;
 Thu, 17 Apr 2025 01: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=AYuoXSv+5Uwkx11i5snFpxR+/kfQb6WnLIp+EVfmjnc=; b=EFp0vpSDD6L1/imN9M/2WhLx6b
	qDLL7CHmcSEN/0DiB+DqRl4WURxVBrF8lVtqLteJ+mtJTbqlHvR8kGvLLxBT4Dlngl7NRpb1JZqYX
	dCX7wg3FGl6T+KKcc88wkj8+iyUIDWJFcccbdlJ5jNcqBGABMEEgnQDy8IeOMjyzLQag=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: Add Arm64/Arm32 MPU build jobs
Message-Id: <E1u5Dbl-004StN-2G@xenbits.xenproject.org>
Date: Thu, 17 Apr 2025 01:00:01 +0000

commit 7cf8d185388fbfc091e05712ba31df29bed03dbc
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Apr 16 10:21:30 2025 +0200
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Wed Apr 16 16:03:25 2025 -0700

    CI: Add Arm64/Arm32 MPU build jobs
    
    Just like for RISCV and PPC, the earlier we enable the CI build the
    better.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/gitlab-ci/build.yaml | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index ac53678745..ab5211f77e 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -379,6 +379,16 @@ debian-bookworm-gcc-arm32-debug-earlyprintk:
       CONFIG_EARLY_UART_CHOICE_PL011=y
       CONFIG_EARLY_UART_BASE_ADDRESS=0x9000000
 
+debian-bookworm-gcc-arm32-debug-mpu:
+  extends: .gcc-arm32-cross-build-debug
+  variables:
+    CONTAINER: debian:bookworm-arm64v8-arm32-gcc
+    HYPERVISOR_ONLY: y
+    EXTRA_XEN_CONFIG: |
+      CONFIG_XEN_START_ADDRESS=0x0
+      CONFIG_MPU=y
+      CONFIG_UNSUPPORTED=y
+
 # Arm builds
 
 debian-bookworm-gcc-arm64:
@@ -443,6 +453,16 @@ alpine-3.18-gcc-debug-arm64-earlyprintk:
       CONFIG_EARLY_UART_CHOICE_PL011=y
       CONFIG_EARLY_UART_BASE_ADDRESS=0x9000000
 
+alpine-3.18-gcc-debug-arm64-mpu:
+  extends: .gcc-arm64-build-debug
+  variables:
+    CONTAINER: alpine:3.18-arm64v8
+    HYPERVISOR_ONLY: y
+    EXTRA_XEN_CONFIG: |
+      CONFIG_XEN_START_ADDRESS=0x0
+      CONFIG_MPU=y
+      CONFIG_UNSUPPORTED=y
+
 # Yocto test jobs
 yocto-qemuarm64:
   extends: .yocto-test-arm64
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 17 08:11:09 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 17 Apr 2025 08:11:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.957095.1350279 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5KKu-0001PQ-BJ; Thu, 17 Apr 2025 08:11:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 957095.1350279; Thu, 17 Apr 2025 08: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 1u5KKu-0001PJ-8E; Thu, 17 Apr 2025 08:11:04 +0000
Received: by outflank-mailman (input) for mailman id 957095;
 Thu, 17 Apr 2025 08:11: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 1u5KKt-0001PD-1b
 for xen-changelog@lists.xenproject.org; Thu, 17 Apr 2025 08:11: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 1u5KKs-003dT4-2k
 for xen-changelog@lists.xenproject.org;
 Thu, 17 Apr 2025 08:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5KKs-001492-23
 for xen-changelog@lists.xenproject.org;
 Thu, 17 Apr 2025 08:11:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/ZE+PNUkvcjlY8GnKdkcJjfKvSkC4+M/bZi7oaHUSw8=; b=Eqt+oN5NtgsJ9KRp2RAtzjHaNG
	R/UlR9LZmUX0RTEYlIp9qjojsQezbrfFLSofG8jIHtRD8odKDugKD5c0ByJYXT3IHl5RWTyS3pFo8
	HF1esJsSAEC3H+Ro7rP1dMfOnQ6oIHkiRQFRValN9wxCUzLLWQHOM93AtB0+Rxb9EGCY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] EFI: Avoid crash calling PrintErrMesg from efi_multiboot2
Message-Id: <E1u5KKs-001492-23@xenbits.xenproject.org>
Date: Thu, 17 Apr 2025 08:11:02 +0000

commit a05598bd12643d17f5c4ac9fbe9b5dc8e3d4c433
Author:     Frediano Ziglio <frediano.ziglio@cloud.com>
AuthorDate: Thu Apr 17 09:59:41 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 17 09:59:41 2025 +0200

    EFI: Avoid crash calling PrintErrMesg from efi_multiboot2
    
    Although code is compiled with -fpic option data is not position
    independent. This causes data pointer to become invalid if
    code is not relocated properly which is what happens for
    efi_multiboot2 which is called by multiboot entry code.
    
    Code tested adding
       PrintErrMesg(L"Test message", EFI_BUFFER_TOO_SMALL);
    in efi_multiboot2 before calling efi_arch_edd (this function
    can potentially call PrintErrMesg).
    
    Before the patch (XenServer installation on Qemu, xen replaced
    with vanilla xen.gz):
      Booting `XenServer (Serial)'Booting `XenServer (Serial)'
      Test message: !!!! X64 Exception Type - 0E(#PF - Page-Fault)  CPU Apic ID - 00000000 !!!!
      ExceptionData - 0000000000000000  I:0 R:0 U:0 W:0 P:0 PK:0 SS:0 SGX:0
      RIP  - 000000007EE21E9A, CS  - 0000000000000038, RFLAGS - 0000000000210246
      RAX  - 000000007FF0C1B5, RCX - 0000000000000050, RDX - 0000000000000010
      RBX  - 0000000000000000, RSP - 000000007FF0C180, RBP - 000000007FF0C210
      RSI  - FFFF82D040467CE8, RDI - 0000000000000000
      R8   - 000000007FF0C1C8, R9  - 000000007FF0C1C0, R10 - 0000000000000000
      R11  - 0000000000001020, R12 - FFFF82D040467CE8, R13 - 000000007FF0C1B8
      R14  - 000000007EA33328, R15 - 000000007EA332D8
      DS   - 0000000000000030, ES  - 0000000000000030, FS  - 0000000000000030
      GS   - 0000000000000030, SS  - 0000000000000030
      CR0  - 0000000080010033, CR2 - FFFF82D040467CE8, CR3 - 000000007FC01000
      CR4  - 0000000000000668, CR8 - 0000000000000000
      DR0  - 0000000000000000, DR1 - 0000000000000000, DR2 - 0000000000000000
      DR3  - 0000000000000000, DR6 - 00000000FFFF0FF0, DR7 - 0000000000000400
      GDTR - 000000007F9DB000 0000000000000047, LDTR - 0000000000000000
      IDTR - 000000007F48E018 0000000000000FFF,   TR - 0000000000000000
      FXSAVE_STATE - 000000007FF0BDE0
      !!!! Find image based on IP(0x7EE21E9A) (No PDB)  (ImageBase=000000007EE20000, EntryPoint=000000007EE23935) !!!!
    
    After the patch:
      Booting `XenServer (Serial)'Booting `XenServer (Serial)'
      Test message: Buffer too small
      BdsDxe: loading Boot0000 "UiApp" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3EE4AF6516A1)/FvFile(462CAA21-7614-4503-836E-8AB6F4662331)
      BdsDxe: starting Boot0000 "UiApp" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3EE4AF6516A1)/FvFile(462CAA21-7614-4503-836E-8AB6F4662331)
    
    This partially rollback commit 00d5d5ce23e6.
    
    Fixes: 9180f5365524 ("x86: add multiboot2 protocol support for EFI platforms")
    Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 xen/common/efi/boot.c        | 58 +++++++++++++++++++++++++++++---------------
 xen/common/efi/efi-common.mk |  1 +
 2 files changed, 40 insertions(+), 19 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index efbec00af9..143b5681ba 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -287,33 +287,53 @@ static bool __init match_guid(const EFI_GUID *guid1, const EFI_GUID *guid2)
 /* generic routine for printing error messages */
 static void __init PrintErrMesg(const CHAR16 *mesg, EFI_STATUS ErrCode)
 {
-    static const CHAR16* const ErrCodeToStr[] __initconstrel = {
-        [~EFI_ERROR_MASK & EFI_NOT_FOUND]           = L"Not found",
-        [~EFI_ERROR_MASK & EFI_NO_MEDIA]            = L"The device has no media",
-        [~EFI_ERROR_MASK & EFI_MEDIA_CHANGED]       = L"Media changed",
-        [~EFI_ERROR_MASK & EFI_DEVICE_ERROR]        = L"Device error",
-        [~EFI_ERROR_MASK & EFI_VOLUME_CORRUPTED]    = L"Volume corrupted",
-        [~EFI_ERROR_MASK & EFI_ACCESS_DENIED]       = L"Access denied",
-        [~EFI_ERROR_MASK & EFI_OUT_OF_RESOURCES]    = L"Out of resources",
-        [~EFI_ERROR_MASK & EFI_VOLUME_FULL]         = L"Volume is full",
-        [~EFI_ERROR_MASK & EFI_SECURITY_VIOLATION]  = L"Security violation",
-        [~EFI_ERROR_MASK & EFI_CRC_ERROR]           = L"CRC error",
-        [~EFI_ERROR_MASK & EFI_COMPROMISED_DATA]    = L"Compromised data",
-        [~EFI_ERROR_MASK & EFI_BUFFER_TOO_SMALL]    = L"Buffer too small",
-    };
-    EFI_STATUS ErrIdx = ErrCode & ~EFI_ERROR_MASK;
-
     StdOut = StdErr;
     PrintErr(mesg);
     PrintErr(L": ");
 
-    if( (ErrIdx < ARRAY_SIZE(ErrCodeToStr)) && ErrCodeToStr[ErrIdx] )
-        mesg = ErrCodeToStr[ErrIdx];
-    else
+    switch (ErrCode)
     {
+    case EFI_NOT_FOUND:
+        mesg = L"Not found";
+        break;
+    case EFI_NO_MEDIA:
+        mesg = L"The device has no media";
+        break;
+    case EFI_MEDIA_CHANGED:
+        mesg = L"Media changed";
+        break;
+    case EFI_DEVICE_ERROR:
+        mesg = L"Device error";
+        break;
+    case EFI_VOLUME_CORRUPTED:
+        mesg = L"Volume corrupted";
+        break;
+    case EFI_ACCESS_DENIED:
+        mesg = L"Access denied";
+        break;
+    case EFI_OUT_OF_RESOURCES:
+        mesg = L"Out of resources";
+        break;
+    case EFI_VOLUME_FULL:
+        mesg = L"Volume is full";
+        break;
+    case EFI_SECURITY_VIOLATION:
+        mesg = L"Security violation";
+        break;
+    case EFI_CRC_ERROR:
+        mesg = L"CRC error";
+        break;
+    case EFI_COMPROMISED_DATA:
+        mesg = L"Compromised data";
+        break;
+    case EFI_BUFFER_TOO_SMALL:
+        mesg = L"Buffer too small";
+        break;
+    default:
         PrintErr(L"ErrCode: ");
         DisplayUint(ErrCode, 0);
         mesg = NULL;
+        break;
     }
     blexit(mesg);
 }
diff --git a/xen/common/efi/efi-common.mk b/xen/common/efi/efi-common.mk
index 23cafcf20c..06b1c19674 100644
--- a/xen/common/efi/efi-common.mk
+++ b/xen/common/efi/efi-common.mk
@@ -2,6 +2,7 @@ EFIOBJ-y := boot.init.o pe.init.o ebmalloc.o runtime.o
 EFIOBJ-$(CONFIG_COMPAT) += compat.o
 
 CFLAGS-y += -fshort-wchar
+CFLAGS-y += -fno-jump-tables
 CFLAGS-y += -iquote $(srctree)/common/efi
 CFLAGS-y += -iquote $(srcdir)
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 17 08:11:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 17 Apr 2025 08:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.957096.1350283 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5KL4-0001U7-CT; Thu, 17 Apr 2025 08:11:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 957096.1350283; Thu, 17 Apr 2025 08: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 1u5KL4-0001Tz-9v; Thu, 17 Apr 2025 08:11:14 +0000
Received: by outflank-mailman (input) for mailman id 957096;
 Thu, 17 Apr 2025 08:11: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 1u5KL3-0001To-BS
 for xen-changelog@lists.xenproject.org; Thu, 17 Apr 2025 08:11: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 1u5KL3-003dT8-0z
 for xen-changelog@lists.xenproject.org;
 Thu, 17 Apr 2025 08:11:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5KL3-0014fr-0m
 for xen-changelog@lists.xenproject.org;
 Thu, 17 Apr 2025 08:11: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=a77QK49Zukz8fNZmxmY+4Cy4wcxZWyxPsjlUBvSzeBg=; b=N3GSyLdGOvZOIlclInhu1afQwl
	cE3+G+9n7EDpgD5BhBf/lzYoze/gZabahdJWiBeBjbY2l7+kRQxtwqf6tGxbb409WM34oDHKgXuYl
	iCvz0qQnDAvHJ7vRpMt4mdVFWSeUXtocjPzD86Gv1OQYHFpU6jIoxtGLaL0FqC1UmRwc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] Arm: cpu_*_map adjustments
Message-Id: <E1u5KL3-0014fr-0m@xenbits.xenproject.org>
Date: Thu, 17 Apr 2025 08:11:13 +0000

commit b097a774b3cfaecb985c46e4b2579b4a41c86c24
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 17 10:00:41 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 17 10:00:41 2025 +0200

    Arm: cpu_*_map adjustments
    
    First, they all start out zeroed. There's no point doing an initial
    cpumask_clear() on them.
    
    Next, only cpu_online_map may be altered post-boot, and even that only
    rarely. Add respective placement attributes.
    
    Finally, cpu_present_map really isn't anything more than an alias of
    cpu_possible_map. Avoid the copying, and have the linker provide the
    symbol (if needed in the first place; it is needed right now as
    common code references the symbol).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/smpboot.c | 9 ++-------
 xen/arch/arm/xen.lds.S | 2 ++
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index 04e363088d..cbde4ae351 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -35,9 +35,8 @@
 #undef virt_to_mfn
 #define virt_to_mfn(va) _mfn(__virt_to_mfn(va))
 
-cpumask_t cpu_online_map;
-cpumask_t cpu_present_map;
-cpumask_t cpu_possible_map;
+cpumask_t __read_mostly cpu_online_map;
+cpumask_t __ro_after_init cpu_possible_map;
 
 struct cpuinfo_arm cpu_data[NR_CPUS];
 
@@ -111,8 +110,6 @@ static void remove_cpu_sibling_map(int cpu)
 void __init
 smp_clear_cpu_maps (void)
 {
-    cpumask_clear(&cpu_possible_map);
-    cpumask_clear(&cpu_online_map);
     cpumask_set_cpu(0, &cpu_online_map);
     cpumask_set_cpu(0, &cpu_possible_map);
     cpu_logical_map(0) = READ_SYSREG(MPIDR_EL1) & MPIDR_HWID_MASK;
@@ -312,8 +309,6 @@ smp_prepare_cpus(void)
 {
     int rc;
 
-    cpumask_copy(&cpu_present_map, &cpu_possible_map);
-
     rc = setup_cpu_sibling_map(0);
     if ( rc )
         panic("Unable to allocate CPU sibling/core maps\n");
diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index ae1903246f..5bfbe1e92c 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -206,6 +206,8 @@ SECTIONS
   ELF_DETAILS_SECTIONS
 }
 
+PROVIDE(cpu_present_map = cpu_possible_map);
+
 /*
  * The assembly code use _start and XEN_VIRT_START interchangeably to
  * match the context.
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 17 08:11:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 17 Apr 2025 08:11:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.957099.1350287 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5KLE-0001cb-Dy; Thu, 17 Apr 2025 08:11:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 957099.1350287; Thu, 17 Apr 2025 08: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 1u5KLE-0001cT-BH; Thu, 17 Apr 2025 08:11:24 +0000
Received: by outflank-mailman (input) for mailman id 957099;
 Thu, 17 Apr 2025 08: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 1u5KLD-0001cJ-M9
 for xen-changelog@lists.xenproject.org; Thu, 17 Apr 2025 08: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 1u5KLD-003dTC-27
 for xen-changelog@lists.xenproject.org;
 Thu, 17 Apr 2025 08:11:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5KLD-00151o-1p
 for xen-changelog@lists.xenproject.org;
 Thu, 17 Apr 2025 08:11: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=GLC+MqVuv2FpReIYCxvA5ZPnuP0AX5ij0S5FTMY4hDg=; b=zPmBMjC4dj/+/NzMIMbDnz2Jb0
	CqSe/TbCqUdllWPzq44IRDKSh+wFLvDRWi92BmiQeWWtPJD8n9sBUJ6+Mbncsf2LjvoQEckGZjSyW
	ZqEBa/DllKPCkkyUfvba+utqMYZUoAW2ZcgFzN9BUHGMQdulUdsDhpSRHkS65aCMcVNc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/HVM: update repeat count upon nested lin->phys failure
Message-Id: <E1u5KLD-00151o-1p@xenbits.xenproject.org>
Date: Thu, 17 Apr 2025 08:11:23 +0000

commit c07b16fd6e47782ebf1ee767cd07c1e2b4140f47
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 17 10:01:19 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 17 10:01:19 2025 +0200

    x86/HVM: update repeat count upon nested lin->phys failure
    
    For the X86EMUL_EXCEPTION case the repeat count must be correctly
    propagated back. Since for the recursive invocation we use a local
    helper variable, its value needs copying to the caller's one.
    
    While there also correct the off-by-1 range in the comment ahead of the
    function (strictly speaking for the "DF set" case we'd need to put
    another, different range there as well).
    
    Fixes: 53f87c03b4ea ("x86emul: generalize exception handling for rep_* hooks")
    Reported-by: Manuel Andreas <manuel.andreas@tum.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/emulate.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 9fff1b82f7..79c180b408 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -825,7 +825,7 @@ static void hvmemul_unmap_linear_addr(
 
 /*
  * Convert addr from linear to physical form, valid over the range
- * [addr, addr + *reps * bytes_per_rep]. *reps is adjusted according to
+ * [addr, addr + *reps * bytes_per_rep). *reps is adjusted according to
  * the valid computed range. It is always >0 when X86EMUL_OKAY is returned.
  * @pfec indicates the access checks to be performed during page-table walks.
  */
@@ -865,7 +865,10 @@ static int hvmemul_linear_to_phys(
         int rc = hvmemul_linear_to_phys(
             addr, &_paddr, bytes_per_rep, &one_rep, pfec, hvmemul_ctxt);
         if ( rc != X86EMUL_OKAY )
+        {
+            *reps = one_rep;
             return rc;
+        }
         pfn = _paddr >> PAGE_SHIFT;
     }
     else if ( (pfn = paging_gva_to_gfn(curr, addr, &pfec)) == gfn_x(INVALID_GFN) )
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 17 10:33:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 17 Apr 2025 10:33:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.957371.1350502 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5MYJ-0003Lr-Ih; Thu, 17 Apr 2025 10:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 957371.1350502; Thu, 17 Apr 2025 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 1u5MYJ-0003Lj-Fy; Thu, 17 Apr 2025 10:33:03 +0000
Received: by outflank-mailman (input) for mailman id 957371;
 Thu, 17 Apr 2025 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 1u5MYI-0003LZ-9S
 for xen-changelog@lists.xenproject.org; Thu, 17 Apr 2025 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 1u5MYH-003hAR-2b
 for xen-changelog@lists.xenproject.org;
 Thu, 17 Apr 2025 10:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5MYH-007MPC-2O
 for xen-changelog@lists.xenproject.org;
 Thu, 17 Apr 2025 10: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=x1eAfNVMPOlpSJx6gjG4FamfX87pIfvgkczFl73anHY=; b=PNvOZcE6EFh+oQAUQ3b/83JuQ8
	a4bZYNIRL82YHT6OAxbk4oJZDHZyvuW9Ofd8PT2xZLAaFtCWF5q+dc1rH9F1pZ2W3FRtuH2J7xxHg
	vJzwxOJCe/isBR2/koduDCVpSYCrXrnnEcJRpwgg6p6i+nszbJquefpAKekVQ2Zkn/hE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] EFI: Avoid crash calling PrintErrMesg from efi_multiboot2
Message-Id: <E1u5MYH-007MPC-2O@xenbits.xenproject.org>
Date: Thu, 17 Apr 2025 10:33:01 +0000

commit a05598bd12643d17f5c4ac9fbe9b5dc8e3d4c433
Author:     Frediano Ziglio <frediano.ziglio@cloud.com>
AuthorDate: Thu Apr 17 09:59:41 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 17 09:59:41 2025 +0200

    EFI: Avoid crash calling PrintErrMesg from efi_multiboot2
    
    Although code is compiled with -fpic option data is not position
    independent. This causes data pointer to become invalid if
    code is not relocated properly which is what happens for
    efi_multiboot2 which is called by multiboot entry code.
    
    Code tested adding
       PrintErrMesg(L"Test message", EFI_BUFFER_TOO_SMALL);
    in efi_multiboot2 before calling efi_arch_edd (this function
    can potentially call PrintErrMesg).
    
    Before the patch (XenServer installation on Qemu, xen replaced
    with vanilla xen.gz):
      Booting `XenServer (Serial)'Booting `XenServer (Serial)'
      Test message: !!!! X64 Exception Type - 0E(#PF - Page-Fault)  CPU Apic ID - 00000000 !!!!
      ExceptionData - 0000000000000000  I:0 R:0 U:0 W:0 P:0 PK:0 SS:0 SGX:0
      RIP  - 000000007EE21E9A, CS  - 0000000000000038, RFLAGS - 0000000000210246
      RAX  - 000000007FF0C1B5, RCX - 0000000000000050, RDX - 0000000000000010
      RBX  - 0000000000000000, RSP - 000000007FF0C180, RBP - 000000007FF0C210
      RSI  - FFFF82D040467CE8, RDI - 0000000000000000
      R8   - 000000007FF0C1C8, R9  - 000000007FF0C1C0, R10 - 0000000000000000
      R11  - 0000000000001020, R12 - FFFF82D040467CE8, R13 - 000000007FF0C1B8
      R14  - 000000007EA33328, R15 - 000000007EA332D8
      DS   - 0000000000000030, ES  - 0000000000000030, FS  - 0000000000000030
      GS   - 0000000000000030, SS  - 0000000000000030
      CR0  - 0000000080010033, CR2 - FFFF82D040467CE8, CR3 - 000000007FC01000
      CR4  - 0000000000000668, CR8 - 0000000000000000
      DR0  - 0000000000000000, DR1 - 0000000000000000, DR2 - 0000000000000000
      DR3  - 0000000000000000, DR6 - 00000000FFFF0FF0, DR7 - 0000000000000400
      GDTR - 000000007F9DB000 0000000000000047, LDTR - 0000000000000000
      IDTR - 000000007F48E018 0000000000000FFF,   TR - 0000000000000000
      FXSAVE_STATE - 000000007FF0BDE0
      !!!! Find image based on IP(0x7EE21E9A) (No PDB)  (ImageBase=000000007EE20000, EntryPoint=000000007EE23935) !!!!
    
    After the patch:
      Booting `XenServer (Serial)'Booting `XenServer (Serial)'
      Test message: Buffer too small
      BdsDxe: loading Boot0000 "UiApp" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3EE4AF6516A1)/FvFile(462CAA21-7614-4503-836E-8AB6F4662331)
      BdsDxe: starting Boot0000 "UiApp" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3EE4AF6516A1)/FvFile(462CAA21-7614-4503-836E-8AB6F4662331)
    
    This partially rollback commit 00d5d5ce23e6.
    
    Fixes: 9180f5365524 ("x86: add multiboot2 protocol support for EFI platforms")
    Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 xen/common/efi/boot.c        | 58 +++++++++++++++++++++++++++++---------------
 xen/common/efi/efi-common.mk |  1 +
 2 files changed, 40 insertions(+), 19 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index efbec00af9..143b5681ba 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -287,33 +287,53 @@ static bool __init match_guid(const EFI_GUID *guid1, const EFI_GUID *guid2)
 /* generic routine for printing error messages */
 static void __init PrintErrMesg(const CHAR16 *mesg, EFI_STATUS ErrCode)
 {
-    static const CHAR16* const ErrCodeToStr[] __initconstrel = {
-        [~EFI_ERROR_MASK & EFI_NOT_FOUND]           = L"Not found",
-        [~EFI_ERROR_MASK & EFI_NO_MEDIA]            = L"The device has no media",
-        [~EFI_ERROR_MASK & EFI_MEDIA_CHANGED]       = L"Media changed",
-        [~EFI_ERROR_MASK & EFI_DEVICE_ERROR]        = L"Device error",
-        [~EFI_ERROR_MASK & EFI_VOLUME_CORRUPTED]    = L"Volume corrupted",
-        [~EFI_ERROR_MASK & EFI_ACCESS_DENIED]       = L"Access denied",
-        [~EFI_ERROR_MASK & EFI_OUT_OF_RESOURCES]    = L"Out of resources",
-        [~EFI_ERROR_MASK & EFI_VOLUME_FULL]         = L"Volume is full",
-        [~EFI_ERROR_MASK & EFI_SECURITY_VIOLATION]  = L"Security violation",
-        [~EFI_ERROR_MASK & EFI_CRC_ERROR]           = L"CRC error",
-        [~EFI_ERROR_MASK & EFI_COMPROMISED_DATA]    = L"Compromised data",
-        [~EFI_ERROR_MASK & EFI_BUFFER_TOO_SMALL]    = L"Buffer too small",
-    };
-    EFI_STATUS ErrIdx = ErrCode & ~EFI_ERROR_MASK;
-
     StdOut = StdErr;
     PrintErr(mesg);
     PrintErr(L": ");
 
-    if( (ErrIdx < ARRAY_SIZE(ErrCodeToStr)) && ErrCodeToStr[ErrIdx] )
-        mesg = ErrCodeToStr[ErrIdx];
-    else
+    switch (ErrCode)
     {
+    case EFI_NOT_FOUND:
+        mesg = L"Not found";
+        break;
+    case EFI_NO_MEDIA:
+        mesg = L"The device has no media";
+        break;
+    case EFI_MEDIA_CHANGED:
+        mesg = L"Media changed";
+        break;
+    case EFI_DEVICE_ERROR:
+        mesg = L"Device error";
+        break;
+    case EFI_VOLUME_CORRUPTED:
+        mesg = L"Volume corrupted";
+        break;
+    case EFI_ACCESS_DENIED:
+        mesg = L"Access denied";
+        break;
+    case EFI_OUT_OF_RESOURCES:
+        mesg = L"Out of resources";
+        break;
+    case EFI_VOLUME_FULL:
+        mesg = L"Volume is full";
+        break;
+    case EFI_SECURITY_VIOLATION:
+        mesg = L"Security violation";
+        break;
+    case EFI_CRC_ERROR:
+        mesg = L"CRC error";
+        break;
+    case EFI_COMPROMISED_DATA:
+        mesg = L"Compromised data";
+        break;
+    case EFI_BUFFER_TOO_SMALL:
+        mesg = L"Buffer too small";
+        break;
+    default:
         PrintErr(L"ErrCode: ");
         DisplayUint(ErrCode, 0);
         mesg = NULL;
+        break;
     }
     blexit(mesg);
 }
diff --git a/xen/common/efi/efi-common.mk b/xen/common/efi/efi-common.mk
index 23cafcf20c..06b1c19674 100644
--- a/xen/common/efi/efi-common.mk
+++ b/xen/common/efi/efi-common.mk
@@ -2,6 +2,7 @@ EFIOBJ-y := boot.init.o pe.init.o ebmalloc.o runtime.o
 EFIOBJ-$(CONFIG_COMPAT) += compat.o
 
 CFLAGS-y += -fshort-wchar
+CFLAGS-y += -fno-jump-tables
 CFLAGS-y += -iquote $(srctree)/common/efi
 CFLAGS-y += -iquote $(srcdir)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 17 10:33:12 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 17 Apr 2025 10:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.957372.1350505 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5MYS-0003OG-LI; Thu, 17 Apr 2025 10:33:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 957372.1350505; Thu, 17 Apr 2025 10: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 1u5MYS-0003O8-If; Thu, 17 Apr 2025 10:33:12 +0000
Received: by outflank-mailman (input) for mailman id 957372;
 Thu, 17 Apr 2025 10:33:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u5MYR-0003O2-UN
 for xen-changelog@lists.xenproject.org; Thu, 17 Apr 2025 10:33:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5MYR-003hAV-2x
 for xen-changelog@lists.xenproject.org;
 Thu, 17 Apr 2025 10:33:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5MYR-007MZo-2m
 for xen-changelog@lists.xenproject.org;
 Thu, 17 Apr 2025 10:33:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ufuTSkROXn4Yf5yLga99LKXlyYuane8LJGMQK/LAceo=; b=JkkLc3r6F493lsV3oVBa7BMy/Q
	YuZdV1exgtFS4mF7y44H+W23hGOTLZJmop95LHJXylctt/h/Q1nq/+cnsb8a5ncc50u4w5ZAtuOwR
	XmgqQferUlRFCEjHcvnxNmQucXbTH7l6xm76W733moU4oDeYAjUDdl7tpTeTq8Jb5/n8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Arm: cpu_*_map adjustments
Message-Id: <E1u5MYR-007MZo-2m@xenbits.xenproject.org>
Date: Thu, 17 Apr 2025 10:33:11 +0000

commit b097a774b3cfaecb985c46e4b2579b4a41c86c24
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 17 10:00:41 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 17 10:00:41 2025 +0200

    Arm: cpu_*_map adjustments
    
    First, they all start out zeroed. There's no point doing an initial
    cpumask_clear() on them.
    
    Next, only cpu_online_map may be altered post-boot, and even that only
    rarely. Add respective placement attributes.
    
    Finally, cpu_present_map really isn't anything more than an alias of
    cpu_possible_map. Avoid the copying, and have the linker provide the
    symbol (if needed in the first place; it is needed right now as
    common code references the symbol).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/smpboot.c | 9 ++-------
 xen/arch/arm/xen.lds.S | 2 ++
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index 04e363088d..cbde4ae351 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -35,9 +35,8 @@
 #undef virt_to_mfn
 #define virt_to_mfn(va) _mfn(__virt_to_mfn(va))
 
-cpumask_t cpu_online_map;
-cpumask_t cpu_present_map;
-cpumask_t cpu_possible_map;
+cpumask_t __read_mostly cpu_online_map;
+cpumask_t __ro_after_init cpu_possible_map;
 
 struct cpuinfo_arm cpu_data[NR_CPUS];
 
@@ -111,8 +110,6 @@ static void remove_cpu_sibling_map(int cpu)
 void __init
 smp_clear_cpu_maps (void)
 {
-    cpumask_clear(&cpu_possible_map);
-    cpumask_clear(&cpu_online_map);
     cpumask_set_cpu(0, &cpu_online_map);
     cpumask_set_cpu(0, &cpu_possible_map);
     cpu_logical_map(0) = READ_SYSREG(MPIDR_EL1) & MPIDR_HWID_MASK;
@@ -312,8 +309,6 @@ smp_prepare_cpus(void)
 {
     int rc;
 
-    cpumask_copy(&cpu_present_map, &cpu_possible_map);
-
     rc = setup_cpu_sibling_map(0);
     if ( rc )
         panic("Unable to allocate CPU sibling/core maps\n");
diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index ae1903246f..5bfbe1e92c 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -206,6 +206,8 @@ SECTIONS
   ELF_DETAILS_SECTIONS
 }
 
+PROVIDE(cpu_present_map = cpu_possible_map);
+
 /*
  * The assembly code use _start and XEN_VIRT_START interchangeably to
  * match the context.
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 17 10:33:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 17 Apr 2025 10:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.957373.1350510 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5MYd-0003R7-Nd; Thu, 17 Apr 2025 10:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 957373.1350510; Thu, 17 Apr 2025 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 1u5MYd-0003Qy-K8; Thu, 17 Apr 2025 10:33:23 +0000
Received: by outflank-mailman (input) for mailman id 957373;
 Thu, 17 Apr 2025 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 1u5MYc-0003Qi-3n
 for xen-changelog@lists.xenproject.org; Thu, 17 Apr 2025 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 1u5MYc-003hAZ-0H
 for xen-changelog@lists.xenproject.org;
 Thu, 17 Apr 2025 10:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5MYc-007Mw6-00
 for xen-changelog@lists.xenproject.org;
 Thu, 17 Apr 2025 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=/w2dM0DzldNjmKL2Ng/FudQjAUTMxWcSxRZJi5VB6i8=; b=o38I7prReShZJq/RZtBymVolrQ
	tde/aDaQU6M3T3rqU9g4F2Rz389j29GOh/gou+BUiV9+g6xE/5q4p6loGUHBk00q614ldz1OqrEVG
	hgp1emCmSp2nYOzw7BYJOBPL3PiSaBP3AiCbv1HZy1YZn+/Y3JwuIvrwZNBsA2S3jH+Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/HVM: update repeat count upon nested lin->phys failure
Message-Id: <E1u5MYc-007Mw6-00@xenbits.xenproject.org>
Date: Thu, 17 Apr 2025 10:33:22 +0000

commit c07b16fd6e47782ebf1ee767cd07c1e2b4140f47
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 17 10:01:19 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 17 10:01:19 2025 +0200

    x86/HVM: update repeat count upon nested lin->phys failure
    
    For the X86EMUL_EXCEPTION case the repeat count must be correctly
    propagated back. Since for the recursive invocation we use a local
    helper variable, its value needs copying to the caller's one.
    
    While there also correct the off-by-1 range in the comment ahead of the
    function (strictly speaking for the "DF set" case we'd need to put
    another, different range there as well).
    
    Fixes: 53f87c03b4ea ("x86emul: generalize exception handling for rep_* hooks")
    Reported-by: Manuel Andreas <manuel.andreas@tum.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/emulate.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 9fff1b82f7..79c180b408 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -825,7 +825,7 @@ static void hvmemul_unmap_linear_addr(
 
 /*
  * Convert addr from linear to physical form, valid over the range
- * [addr, addr + *reps * bytes_per_rep]. *reps is adjusted according to
+ * [addr, addr + *reps * bytes_per_rep). *reps is adjusted according to
  * the valid computed range. It is always >0 when X86EMUL_OKAY is returned.
  * @pfec indicates the access checks to be performed during page-table walks.
  */
@@ -865,7 +865,10 @@ static int hvmemul_linear_to_phys(
         int rc = hvmemul_linear_to_phys(
             addr, &_paddr, bytes_per_rep, &one_rep, pfec, hvmemul_ctxt);
         if ( rc != X86EMUL_OKAY )
+        {
+            *reps = one_rep;
             return rc;
+        }
         pfn = _paddr >> PAGE_SHIFT;
     }
     else if ( (pfn = paging_gva_to_gfn(curr, addr, &pfec)) == gfn_x(INVALID_GFN) )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 17 11:11:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 17 Apr 2025 11:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.957382.1350513 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5N95-0001YP-94; Thu, 17 Apr 2025 11:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 957382.1350513; Thu, 17 Apr 2025 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 1u5N95-0001YH-6V; Thu, 17 Apr 2025 11:11:03 +0000
Received: by outflank-mailman (input) for mailman id 957382;
 Thu, 17 Apr 2025 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 1u5N94-0001Y5-CD
 for xen-changelog@lists.xenproject.org; Thu, 17 Apr 2025 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 1u5N94-003i67-0r
 for xen-changelog@lists.xenproject.org;
 Thu, 17 Apr 2025 11:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5N94-0096aO-0f
 for xen-changelog@lists.xenproject.org;
 Thu, 17 Apr 2025 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=0FJtf1vnFAAj1V0J3n0I88wZLcyI97Ozj3HkiQf23EY=; b=h99GFn8XRx/t7vyPwie14afi13
	6CqOUDJ3Bdy7e05h1KZKKaNh+nS3TjK5l4EaZsWI3dJtNvCrMatU31HItbFae6Aq614x245DR/U6w
	DN+Nk5dMZE8YkJOEMB771eoZn/nq3I548EK/WbZcQiV23DfoBMEirVLxfJts0Gp4l7F4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/percpu: NUMA-position the per-CPU area
Message-Id: <E1u5N94-0096aO-0f@xenbits.xenproject.org>
Date: Thu, 17 Apr 2025 11:11:02 +0000

commit a20e5908e218d07c293ac8d49fb58f0f3a72125b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Apr 17 09:14:03 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Apr 17 11:59:57 2025 +0100

    xen/percpu: NUMA-position the per-CPU area
    
    This seems to have been quite an oversight in Xen's NUMA support, albeit it
    probably because NUMA was arch-specific at first.
    
    This is unlikely to be useful for CONFIG_SEPARATE_XENHEAP builds, but that's
    only ARM32 right now, and unlikely to be interested in NUMA.
    
    Take the opportunity to sort the includes.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/percpu.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/common/percpu.c b/xen/common/percpu.c
index c6ecd95a08..cdd70acbea 100644
--- a/xen/common/percpu.c
+++ b/xen/common/percpu.c
@@ -1,8 +1,9 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-#include <xen/percpu.h>
 #include <xen/cpu.h>
 #include <xen/init.h>
 #include <xen/mm.h>
+#include <xen/numa.h>
+#include <xen/percpu.h>
 #include <xen/rcupdate.h>
 #include <xen/sections.h>
 
@@ -27,6 +28,8 @@ void __init percpu_init_areas(void)
 
 static int init_percpu_area(unsigned int cpu)
 {
+    nodeid_t node = cpu_to_node(cpu);
+    unsigned int memflags = node != NUMA_NO_NODE ? MEMF_node(node) : 0;
     char *p;
 
     if ( __per_cpu_offset[cpu] != INVALID_PERCPU_AREA )
@@ -34,7 +37,7 @@ static int init_percpu_area(unsigned int cpu)
                ? 0
                : -EBUSY;
 
-    if ( (p = alloc_xenheap_pages(PERCPU_ORDER, 0)) == NULL )
+    if ( (p = alloc_xenheap_pages(PERCPU_ORDER, memflags)) == NULL )
         return -ENOMEM;
 
     memset(p, 0, __per_cpu_data_end - __per_cpu_start);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 17 11:55:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 17 Apr 2025 11:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.957457.1350577 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5Npf-0002lY-KK; Thu, 17 Apr 2025 11:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 957457.1350577; Thu, 17 Apr 2025 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 1u5Npf-0002lQ-Hj; Thu, 17 Apr 2025 11:55:03 +0000
Received: by outflank-mailman (input) for mailman id 957457;
 Thu, 17 Apr 2025 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 1u5Npe-0002lK-0p
 for xen-changelog@lists.xenproject.org; Thu, 17 Apr 2025 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 1u5Npd-003jE6-2Z
 for xen-changelog@lists.xenproject.org;
 Thu, 17 Apr 2025 11:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5Npd-00B2Z4-2N
 for xen-changelog@lists.xenproject.org;
 Thu, 17 Apr 2025 11: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=+y0NQLNPvyKwplppZ0hcjuTOuxHPZLpzsV6R03a4cMM=; b=j7xHH6SuU+akWV+uKuIrY2DA1h
	6+38cQNToObk6dYbZ/UPCfl07t7iFiMSmPCMTa1nvHlrmdfn6ZDNDsHERve/soaYNQzPdLNUicVS3
	E9MCwXMI9JET8JwgHYACE0B4e+yeRdiBehKvkG16cHBAdTJjAW0T+wQcwD+cW588HmEQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/percpu: NUMA-position the per-CPU area
Message-Id: <E1u5Npd-00B2Z4-2N@xenbits.xenproject.org>
Date: Thu, 17 Apr 2025 11:55:01 +0000

commit a20e5908e218d07c293ac8d49fb58f0f3a72125b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Apr 17 09:14:03 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Apr 17 11:59:57 2025 +0100

    xen/percpu: NUMA-position the per-CPU area
    
    This seems to have been quite an oversight in Xen's NUMA support, albeit it
    probably because NUMA was arch-specific at first.
    
    This is unlikely to be useful for CONFIG_SEPARATE_XENHEAP builds, but that's
    only ARM32 right now, and unlikely to be interested in NUMA.
    
    Take the opportunity to sort the includes.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/percpu.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/common/percpu.c b/xen/common/percpu.c
index c6ecd95a08..cdd70acbea 100644
--- a/xen/common/percpu.c
+++ b/xen/common/percpu.c
@@ -1,8 +1,9 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-#include <xen/percpu.h>
 #include <xen/cpu.h>
 #include <xen/init.h>
 #include <xen/mm.h>
+#include <xen/numa.h>
+#include <xen/percpu.h>
 #include <xen/rcupdate.h>
 #include <xen/sections.h>
 
@@ -27,6 +28,8 @@ void __init percpu_init_areas(void)
 
 static int init_percpu_area(unsigned int cpu)
 {
+    nodeid_t node = cpu_to_node(cpu);
+    unsigned int memflags = node != NUMA_NO_NODE ? MEMF_node(node) : 0;
     char *p;
 
     if ( __per_cpu_offset[cpu] != INVALID_PERCPU_AREA )
@@ -34,7 +37,7 @@ static int init_percpu_area(unsigned int cpu)
                ? 0
                : -EBUSY;
 
-    if ( (p = alloc_xenheap_pages(PERCPU_ORDER, 0)) == NULL )
+    if ( (p = alloc_xenheap_pages(PERCPU_ORDER, memflags)) == NULL )
         return -ENOMEM;
 
     memset(p, 0, __per_cpu_data_end - __per_cpu_start);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 14:22:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 14:22:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959071.1351559 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5mbT-0006il-Ne; Fri, 18 Apr 2025 14:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959071.1351559; Fri, 18 Apr 2025 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 1u5mbT-0006ic-L6; Fri, 18 Apr 2025 14:22:03 +0000
Received: by outflank-mailman (input) for mailman id 959071;
 Fri, 18 Apr 2025 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 1u5mbS-0006iT-8w
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 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 1u5mbS-0065wl-0U
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5mbS-003lZT-0I
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 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=1JbGPipc19hdHtR0cWTYj/OjKDqW2S6EXYDS6bAM0jU=; b=F0F6vOJ4L9Mm3hR2QFThi73B8U
	i7PrV6hYu0GzguHyaiX7wQ0APnOh0IdzsicN44jzVGOpwZlKxWa11ANByR8o361fZThrkLzfwhcpW
	dqQd1OmensQ+dDZD070IPYTRshiew1mH4oNdWT54U5YyV6+VoJKjNR7qWbqm7sfshDow=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: Implement common byte{order,swap}.h
Message-Id: <E1u5mbS-003lZT-0I@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 14:22:02 +0000

commit f6784ea2f967f0bacaad83a0e6a86a648e5d2d65
Author:     Lin Liu <lin.liu@citrix.com>
AuthorDate: Mon May 9 01:47:10 2022 -0400
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    xen: Implement common byte{order,swap}.h
    
    The current swab??() infrastructure is unnecessarily complicated, and can be
    replaced entirely with compiler builtins.
    
    All supported compilers provide __BYTE_ORDER__ and __builtin_bswap??().
    
    Nothing in Xen cares about the values of __{BIG,LITTLE}_ENDIAN; just that one
    of them is defined.  Therefore, centralise their definitions in xen/config.h
    
    Signed-off-by: Lin Liu <lin.liu@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/xen/byteorder.h               | 44 +++++++++++++++++++++++++++++++
 xen/include/xen/byteorder/big_endian.h    |  7 -----
 xen/include/xen/byteorder/little_endian.h |  7 -----
 xen/include/xen/byteswap.h                | 15 +++++++++++
 xen/include/xen/config.h                  |  8 ++++++
 5 files changed, 67 insertions(+), 14 deletions(-)

diff --git a/xen/include/xen/byteorder.h b/xen/include/xen/byteorder.h
new file mode 100644
index 0000000000..2b9b970444
--- /dev/null
+++ b/xen/include/xen/byteorder.h
@@ -0,0 +1,44 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#ifndef XEN_BYTEORDER_H
+#define XEN_BYTEORDER_H
+
+#include <xen/byteswap.h>
+#include <xen/stdint.h>
+
+#if defined(__LITTLE_ENDIAN)
+
+# define cpu_to_le64(x) ((uint64_t)(x))
+# define le64_to_cpu(x) ((uint64_t)(x))
+# define cpu_to_le32(x) ((uint32_t)(x))
+# define le32_to_cpu(x) ((uint32_t)(x))
+# define cpu_to_le16(x) ((uint16_t)(x))
+# define le16_to_cpu(x) ((uint16_t)(x))
+
+# define cpu_to_be64(x) bswap64(x)
+# define be64_to_cpu(x) bswap64(x)
+# define cpu_to_be32(x) bswap32(x)
+# define be32_to_cpu(x) bswap32(x)
+# define cpu_to_be16(x) bswap16(x)
+# define be16_to_cpu(x) bswap16(x)
+
+#elif defined(__BIG_ENDIAN)
+
+# define cpu_to_le64(x) bswap64(x)
+# define le64_to_cpu(x) bswap64(x)
+# define cpu_to_le32(x) bswap32(x)
+# define le32_to_cpu(x) bswap32(x)
+# define cpu_to_le16(x) bswap16(x)
+# define le16_to_cpu(x) bswap16(x)
+
+# define cpu_to_be64(x) ((uint64_t)(x))
+# define be64_to_cpu(x) ((uint64_t)(x))
+# define cpu_to_be32(x) ((uint32_t)(x))
+# define be32_to_cpu(x) ((uint32_t)(x))
+# define cpu_to_be16(x) ((uint16_t)(x))
+# define be16_to_cpu(x) ((uint16_t)(x))
+
+#else
+# error Unknown Endianness
+#endif /* __*_ENDIAN */
+
+#endif /* XEN_BYTEORDER_H */
diff --git a/xen/include/xen/byteorder/big_endian.h b/xen/include/xen/byteorder/big_endian.h
index ce395a17f6..512291c76f 100644
--- a/xen/include/xen/byteorder/big_endian.h
+++ b/xen/include/xen/byteorder/big_endian.h
@@ -1,13 +1,6 @@
 #ifndef __XEN_BYTEORDER_BIG_ENDIAN_H__
 #define __XEN_BYTEORDER_BIG_ENDIAN_H__
 
-#ifndef __BIG_ENDIAN
-#define __BIG_ENDIAN 4321
-#endif
-#ifndef __BIG_ENDIAN_BITFIELD
-#define __BIG_ENDIAN_BITFIELD
-#endif
-
 #include <xen/types.h>
 #include <xen/byteorder/swab.h>
 
diff --git a/xen/include/xen/byteorder/little_endian.h b/xen/include/xen/byteorder/little_endian.h
index 8b118afba5..bd1afc6a67 100644
--- a/xen/include/xen/byteorder/little_endian.h
+++ b/xen/include/xen/byteorder/little_endian.h
@@ -1,13 +1,6 @@
 #ifndef __XEN_BYTEORDER_LITTLE_ENDIAN_H__
 #define __XEN_BYTEORDER_LITTLE_ENDIAN_H__
 
-#ifndef __LITTLE_ENDIAN
-#define __LITTLE_ENDIAN 1234
-#endif
-#ifndef __LITTLE_ENDIAN_BITFIELD
-#define __LITTLE_ENDIAN_BITFIELD
-#endif
-
 #include <xen/types.h>
 #include <xen/byteorder/swab.h>
 
diff --git a/xen/include/xen/byteswap.h b/xen/include/xen/byteswap.h
new file mode 100644
index 0000000000..46d93f88ea
--- /dev/null
+++ b/xen/include/xen/byteswap.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#ifndef XEN_BYTESWAP_H
+#define XEN_BYTESWAP_H
+
+#define bswap16(x) __builtin_bswap16(x)
+#define bswap32(x) __builtin_bswap32(x)
+#define bswap64(x) __builtin_bswap64(x)
+
+#if BITS_PER_LONG == 64
+# define bswapl(x) bswap64(x)
+#elif BITS_PER_LONG == 32
+# define bswapl(x) bswap32(x)
+#endif
+
+#endif /* XEN_BYTESWAP_H */
diff --git a/xen/include/xen/config.h b/xen/include/xen/config.h
index 7d43159efb..1d7195066c 100644
--- a/xen/include/xen/config.h
+++ b/xen/include/xen/config.h
@@ -108,4 +108,12 @@
 /* It is assumed that sizeof(void *) == __alignof(void *) */
 #define POINTER_ALIGN   __SIZEOF_POINTER__
 
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+# define __LITTLE_ENDIAN
+# define __LITTLE_ENDIAN_BITFIELD
+#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+# define __BIG_ENDIAN
+# define __BIG_ENDIAN_BITFIELD
+#endif
+
 #endif /* __XEN_CONFIG_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 14:22:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 14:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959072.1351563 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5mbd-0006kt-Pd; Fri, 18 Apr 2025 14:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959072.1351563; Fri, 18 Apr 2025 14: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 1u5mbd-0006kh-Ma; Fri, 18 Apr 2025 14:22:13 +0000
Received: by outflank-mailman (input) for mailman id 959072;
 Fri, 18 Apr 2025 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 1u5mbc-0006kV-EC
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 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 1u5mbc-0065x6-19
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5mbc-003lrf-0g
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 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=c3HVPIUCXrUh0bonT4yYxpgOStU7QQe+Ef8B+bnDW3k=; b=MmN9FiGt4NLDvWlLoC6uSeRU7k
	wPtTHN6AMf1BKtgPzOvqWwtM+X3o4ySKYcv2rVjRbEZSxu7e6HhjIiCrJkY5lzP4tosuc/QyOacwZ
	FvtNNWsEvahkQpuwyLdxm4HWbjh0ykwJepmLcrLonHbCq+bpnnD5pFCEzqMBOQkLPxK0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] drivers/smmu-v3: Fix impending MISRA R20.6 violation
Message-Id: <E1u5mbc-003lrf-0g@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 14:22:12 +0000

commit 7b55401529f9c4f5bfbc3232df941a9b6dc324d5
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Apr 16 11:54:04 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    drivers/smmu-v3: Fix impending MISRA R20.6 violation
    
    cpu_to_le64() is about to become a macro, at which point the #ifdef in the
    middle of it becomes undefined behaviour.
    
    Use a local variable to prepare strtab, where the #ifdef is fine to use.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/drivers/passthrough/arm/smmu-v3.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/arm/smmu-v3.c b/xen/drivers/passthrough/arm/smmu-v3.c
index cee5724022..df16235057 100644
--- a/xen/drivers/passthrough/arm/smmu-v3.c
+++ b/xen/drivers/passthrough/arm/smmu-v3.c
@@ -722,15 +722,17 @@ static void arm_smmu_write_strtab_ent(struct arm_smmu_master *master, u32 sid,
 	}
 
 	if (s2_cfg) {
-		BUG_ON(ste_live);
-		dst[2] = cpu_to_le64(
+		u64 strtab =
 			 FIELD_PREP(STRTAB_STE_2_S2VMID, s2_cfg->vmid) |
 			 FIELD_PREP(STRTAB_STE_2_VTCR, s2_cfg->vtcr) |
 #ifdef __BIG_ENDIAN
 			 STRTAB_STE_2_S2ENDI |
 #endif
 			 STRTAB_STE_2_S2PTW | STRTAB_STE_2_S2AA64 |
-			 STRTAB_STE_2_S2R);
+			 STRTAB_STE_2_S2R;
+
+		BUG_ON(ste_live);
+		dst[2] = cpu_to_le64(strtab);
 
 		dst[3] = cpu_to_le64(s2_cfg->vttbr & STRTAB_STE_3_S2TTB_MASK);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 14:22:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 14:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959073.1351567 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5mbn-0006nY-Qg; Fri, 18 Apr 2025 14:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959073.1351567; Fri, 18 Apr 2025 14: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 1u5mbn-0006nQ-O3; Fri, 18 Apr 2025 14:22:23 +0000
Received: by outflank-mailman (input) for mailman id 959073;
 Fri, 18 Apr 2025 14: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 1u5mbm-0006nD-Ix
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 14: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 1u5mbm-0065xY-1c
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5mbm-003mFx-1K
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14: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=Ev5abVrDx20AAPMssHbdMOzCslDEMhu/hlLn9ctfnN0=; b=Yv0EKg3XA5ApaCLJpj+3yqFcRX
	3wgavnLEmO/w9fuat4H2usLBQCFnb4a5KoDFCQtk4CpugNxQ0aYed0f3Wxpg4EBBUevdITNsIKnMP
	GMxrxtP7AxCuA9g4ZNo+/mOr8ZOjsH6fnEBd9PRTlj+HGyKmf/8uvSmo7HVDVer/22lU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/lib: Switch to xen/byteorder.h
Message-Id: <E1u5mbm-003mFx-1K@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 14:22:22 +0000

commit 9aaae6cb4df2a4a98147ca7b49a6e97fc3bbb9ad
Author:     Lin Liu <lin.liu@citrix.com>
AuthorDate: Wed Oct 20 04:29:46 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    xen/lib: Switch to xen/byteorder.h
    
    In divmod.c, additionally swap xen/lib.h for xen/macros.h as only ABS() is
    needed.
    
    In find-next-bit.c, ext2 has nothing to do with this logic.  It was a local
    modification when the logic was imported from Linux, because Xen didn't have a
    suitable helper at the time.
    
    The new infrastructure does have a suitable primitive, so use it.
    
    No functional change.
    
    Signed-off-by: Lin Liu <lin.liu@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/lib/divmod.c        |  4 ++--
 xen/lib/find-next-bit.c | 39 +++++++--------------------------------
 2 files changed, 9 insertions(+), 34 deletions(-)

diff --git a/xen/lib/divmod.c b/xen/lib/divmod.c
index 0377d62130..063e867a81 100644
--- a/xen/lib/divmod.c
+++ b/xen/lib/divmod.c
@@ -1,6 +1,6 @@
-#include <xen/lib.h>
+#include <xen/byteorder.h>
+#include <xen/macros.h>
 #include <xen/types.h>
-#include <asm/byteorder.h>
 
 /*
  * A couple of 64 bit operations ported from FreeBSD.
diff --git a/xen/lib/find-next-bit.c b/xen/lib/find-next-bit.c
index 761b027398..9b8d7814f2 100644
--- a/xen/lib/find-next-bit.c
+++ b/xen/lib/find-next-bit.c
@@ -9,8 +9,7 @@
  * 2 of the License, or (at your option) any later version.
  */
 #include <xen/bitops.h>
-
-#include <asm/byteorder.h>
+#include <xen/byteorder.h>
 
 #define __ffs(x) (ffsl(x) - 1)
 #define ffz(x) __ffs(~(x))
@@ -164,30 +163,6 @@ EXPORT_SYMBOL(find_first_zero_bit);
 
 #ifdef __BIG_ENDIAN
 
-/* include/linux/byteorder does not support "unsigned long" type */
-static inline unsigned long ext2_swabp(const unsigned long * x)
-{
-#if BITS_PER_LONG == 64
-	return (unsigned long) __swab64p((u64 *) x);
-#elif BITS_PER_LONG == 32
-	return (unsigned long) __swab32p((u32 *) x);
-#else
-#error BITS_PER_LONG not defined
-#endif
-}
-
-/* include/linux/byteorder doesn't support "unsigned long" type */
-static inline unsigned long ext2_swab(const unsigned long y)
-{
-#if BITS_PER_LONG == 64
-	return (unsigned long) __swab64((u64) y);
-#elif BITS_PER_LONG == 32
-	return (unsigned long) __swab32((u32) y);
-#else
-#error BITS_PER_LONG not defined
-#endif
-}
-
 #ifndef find_next_zero_bit_le
 unsigned long find_next_zero_bit_le(const void *addr, unsigned
 		long size, unsigned long offset)
@@ -202,7 +177,7 @@ unsigned long find_next_zero_bit_le(const void *addr, unsigned
 	size -= result;
 	offset &= (BITS_PER_LONG - 1UL);
 	if (offset) {
-		tmp = ext2_swabp(p++);
+		tmp = bswapl(*p++);
 		tmp |= (~0UL >> (BITS_PER_LONG - offset));
 		if (size < BITS_PER_LONG)
 			goto found_first;
@@ -220,7 +195,7 @@ unsigned long find_next_zero_bit_le(const void *addr, unsigned
 	}
 	if (!size)
 		return result;
-	tmp = ext2_swabp(p);
+	tmp = bswapl(*p);
 found_first:
 	tmp |= ~0UL << size;
 	if (tmp == ~0UL)	/* Are any bits zero? */
@@ -229,7 +204,7 @@ found_middle:
 	return result + ffz(tmp);
 
 found_middle_swap:
-	return result + ffz(ext2_swab(tmp));
+	return result + ffz(bswapl(tmp));
 }
 EXPORT_SYMBOL(find_next_zero_bit_le);
 #endif
@@ -248,7 +223,7 @@ unsigned long find_next_bit_le(const void *addr, unsigned
 	size -= result;
 	offset &= (BITS_PER_LONG - 1UL);
 	if (offset) {
-		tmp = ext2_swabp(p++);
+		tmp = bswapl(*p++);
 		tmp &= (~0UL << offset);
 		if (size < BITS_PER_LONG)
 			goto found_first;
@@ -267,7 +242,7 @@ unsigned long find_next_bit_le(const void *addr, unsigned
 	}
 	if (!size)
 		return result;
-	tmp = ext2_swabp(p);
+	tmp = bswapl(*p);
 found_first:
 	tmp &= (~0UL >> (BITS_PER_LONG - size));
 	if (tmp == 0UL)		/* Are any bits set? */
@@ -276,7 +251,7 @@ found_middle:
 	return result + __ffs(tmp);
 
 found_middle_swap:
-	return result + __ffs(ext2_swab(tmp));
+	return result + __ffs(bswapl(tmp));
 }
 EXPORT_SYMBOL(find_next_bit_le);
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 14:22:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 14:22:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959074.1351571 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5mbx-0006qN-S9; Fri, 18 Apr 2025 14:22:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959074.1351571; Fri, 18 Apr 2025 14:22:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5mbx-0006qF-PR; Fri, 18 Apr 2025 14:22:33 +0000
Received: by outflank-mailman (input) for mailman id 959074;
 Fri, 18 Apr 2025 14:22:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u5mbw-0006q3-L3
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 14:22:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5mbw-0065xx-20
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5mbw-003maG-1q
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14: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=eCP0V9htukx4bRWOQSDCyTVoqRm4FPtFuaC6oiQSxhA=; b=cV2sJYZ/ZU5ysFVdQholSeqs2M
	kbWNBu1EJuwYpP3jpoD4cX+Od6NAJHTd4Hz6Nc1+KxT5pduMaMqaMNAYiVNek8YrBWKhNggTw3zB/
	5Q7ktZM/BpDE482qneZGpMoAuM7d6samqxFBCk87HZXdoPTtEm9hL31QhcCtiJvSw2sM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/device-tree: Remove use of *_to_cpup() helpers
Message-Id: <E1u5mbw-003maG-1q@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 14:22:32 +0000

commit f689c56076695a65ef3d57dbc27e2ee033824c45
Author:     Lin Liu <lin.liu@citrix.com>
AuthorDate: Thu Oct 21 03:52:39 2021 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    xen/device-tree: Remove use of *_to_cpup() helpers
    
    These wrappers simply hide a deference, which adds to the cognitive complexity
    of reading the code.  As such, they're not going to be included in the new
    byteswap infrastructure.
    
    No functional change.
    
    Signed-off-by: Lin Liu <lin.liu@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/common/device-tree/device-tree.c | 44 ++++++++++++++++++------------------
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/xen/common/device-tree/device-tree.c b/xen/common/device-tree/device-tree.c
index e8f810b2fe..90fee2ba03 100644
--- a/xen/common/device-tree/device-tree.c
+++ b/xen/common/device-tree/device-tree.c
@@ -173,7 +173,7 @@ bool dt_property_read_u32(const struct dt_device_node *np,
     if ( !val || len < sizeof(*out_value) )
         return 0;
 
-    *out_value = be32_to_cpup(val);
+    *out_value = be32_to_cpu(*val);
 
     return 1;
 }
@@ -266,7 +266,7 @@ int dt_property_read_variable_u32_array(const struct dt_device_node *np,
 
     count = sz;
     while ( count-- )
-        *out_values++ = be32_to_cpup(val++);
+        *out_values++ = be32_to_cpu(*val++);
 
     return sz;
 }
@@ -493,7 +493,7 @@ static int __dt_n_addr_cells(const struct dt_device_node *np, bool parent)
 
         ip = dt_get_property(np, "#address-cells", NULL);
         if ( ip )
-            return be32_to_cpup(ip);
+            return be32_to_cpu(*ip);
     } while ( np->parent );
     /* No #address-cells property for the root node */
     return DT_ROOT_NODE_ADDR_CELLS_DEFAULT;
@@ -510,7 +510,7 @@ static int __dt_n_size_cells(const struct dt_device_node *np, bool parent)
 
         ip = dt_get_property(np, "#size-cells", NULL);
         if ( ip )
-            return be32_to_cpup(ip);
+            return be32_to_cpu(*ip);
     } while ( np->parent );
     /* No #address-cells property for the root node */
     return DT_ROOT_NODE_SIZE_CELLS_DEFAULT;
@@ -643,7 +643,7 @@ static void dt_bus_pci_count_cells(const struct dt_device_node *np,
 static unsigned int dt_bus_pci_get_flags(const __be32 *addr)
 {
     unsigned int flags = 0;
-    u32 w = be32_to_cpup(addr);
+    u32 w = be32_to_cpu(*addr);
 
     switch((w >> 24) & 0x03) {
     case 0x01:
@@ -1096,7 +1096,7 @@ dt_irq_find_parent(const struct dt_device_node *child)
         if ( parp == NULL )
             p = dt_get_parent(child);
         else
-            p = dt_find_node_by_phandle(be32_to_cpup(parp));
+            p = dt_find_node_by_phandle(be32_to_cpu(*parp));
         child = p;
     } while ( p && dt_get_property(p, "#interrupt-cells", NULL) == NULL );
 
@@ -1129,7 +1129,7 @@ unsigned int dt_number_of_irq(const struct dt_device_node *device)
     intlen /= sizeof(*intspec);
 
     dt_dprintk(" using 'interrupts' property\n");
-    dt_dprintk(" intspec=%d intlen=%d\n", be32_to_cpup(intspec), intlen);
+    dt_dprintk(" intspec=%d intlen=%d\n", be32_to_cpu(*intspec), intlen);
 
     /* Look for the interrupt parent. */
     p = dt_irq_find_parent(device);
@@ -1260,7 +1260,7 @@ int dt_for_each_irq_map(const struct dt_device_node *dev,
         imaplen -= addrsize + intsize;
 
         /* Get the interrupt parent */
-        ipar = dt_find_node_by_phandle(be32_to_cpup(imap));
+        ipar = dt_find_node_by_phandle(be32_to_cpu(*imap));
         imap++;
         --imaplen;
 
@@ -1377,8 +1377,8 @@ static int dt_irq_map_raw(const struct dt_device_node *parent,
     int match, i;
 
     dt_dprintk("dt_irq_map_raw: par=%s,intspec=[0x%08x 0x%08x...],ointsize=%d\n",
-               parent->full_name, be32_to_cpup(intspec),
-               be32_to_cpup(intspec + 1), ointsize);
+               parent->full_name, be32_to_cpu(*intspec),
+               be32_to_cpu(*(intspec+1)), ointsize);
 
     ipar = parent;
 
@@ -1490,7 +1490,7 @@ static int dt_irq_map_raw(const struct dt_device_node *parent,
             dt_dprintk(" -> match=%d (imaplen=%d)\n", match, imaplen);
 
             /* Get the interrupt parent */
-            newpar = dt_find_node_by_phandle(be32_to_cpup(imap));
+            newpar = dt_find_node_by_phandle(be32_to_cpu(*imap));
             imap++;
             --imaplen;
 
@@ -1584,7 +1584,7 @@ int dt_device_get_raw_irq(const struct dt_device_node *device,
     intlen /= sizeof(*intspec);
 
     dt_dprintk(" using 'interrupts' property\n");
-    dt_dprintk(" intspec=%d intlen=%d\n", be32_to_cpup(intspec), intlen);
+    dt_dprintk(" intspec=%d intlen=%d\n", be32_to_cpu(*intspec), intlen);
 
     /* Look for the interrupt parent. */
     p = dt_irq_find_parent(device);
@@ -1695,7 +1695,7 @@ static int __dt_parse_phandle_with_args(const struct dt_device_node *np,
          * If phandle is 0, then it is an empty entry with no
          * arguments.  Skip forward to the next entry.
          * */
-        phandle = be32_to_cpup(list++);
+        phandle = be32_to_cpu(*list++);
         if ( phandle )
         {
             /*
@@ -1764,7 +1764,7 @@ static int __dt_parse_phandle_with_args(const struct dt_device_node *np,
                 out_args->np = node;
                 out_args->args_count = count;
                 for ( i = 0; i < count; i++ )
-                    out_args->args[i] = be32_to_cpup(list++);
+                    out_args->args[i] = be32_to_cpu(*list++);
             }
 
             /* Found it! return success */
@@ -1845,7 +1845,7 @@ static unsigned long unflatten_dt_node(const void *fdt,
     int has_name = 0;
     int new_format = 0;
 
-    tag = be32_to_cpup((__be32 *)(*p));
+    tag = be32_to_cpu(*(__be32 *)(*p));
     if ( tag != FDT_BEGIN_NODE )
     {
         printk(XENLOG_WARNING "Weird tag at start of node: %x\n", tag);
@@ -1938,7 +1938,7 @@ static unsigned long unflatten_dt_node(const void *fdt,
         u32 sz, noff;
         const char *pname;
 
-        tag = be32_to_cpup((__be32 *)(*p));
+        tag = be32_to_cpu(*(__be32 *)(*p));
         if ( tag == FDT_NOP )
         {
             *p += 4;
@@ -1947,8 +1947,8 @@ static unsigned long unflatten_dt_node(const void *fdt,
         if ( tag != FDT_PROP )
             break;
         *p += 4;
-        sz = be32_to_cpup((__be32 *)(*p));
-        noff = be32_to_cpup((__be32 *)((*p) + 4));
+        sz = be32_to_cpu(*(__be32 *)(*p));
+        noff = be32_to_cpu(*(__be32 *)((*p) + 4));
         *p += 8;
         if ( fdt_version(fdt) < 0x10 )
             *p = ROUNDUP(*p, sz >= 8 ? 8 : 4);
@@ -1975,13 +1975,13 @@ static unsigned long unflatten_dt_node(const void *fdt,
                  (strcmp(pname, "linux,phandle") == 0) )
             {
                 if ( np->phandle == 0 )
-                    np->phandle = be32_to_cpup((__be32*)*p);
+                    np->phandle = be32_to_cpu(*(__be32*)*p);
             }
             /* And we process the "ibm,phandle" property
              * used in pSeries dynamic device tree
              * stuff */
             if ( strcmp(pname, "ibm,phandle") == 0 )
-                np->phandle = be32_to_cpup((__be32 *)*p);
+                np->phandle = be32_to_cpu(*(__be32 *)*p);
             pp->name = pname;
             pp->length = sz;
             pp->value = (void *)*p;
@@ -2053,7 +2053,7 @@ static unsigned long unflatten_dt_node(const void *fdt,
             *p += 4;
         else
             mem = unflatten_dt_node(fdt, mem, p, np, allnextpp, fpsize);
-        tag = be32_to_cpup((__be32 *)(*p));
+        tag = be32_to_cpu(*(__be32 *)(*p));
     }
     if ( tag != FDT_END_NODE )
     {
@@ -2099,7 +2099,7 @@ int unflatten_device_tree(const void *fdt, struct dt_device_node **mynodes)
     /* Second pass, do actual unflattening */
     start = ((unsigned long)fdt) + fdt_off_dt_struct(fdt);
     unflatten_dt_node(fdt, mem, &start, NULL, &allnextp, 0);
-    if ( be32_to_cpup((__be32 *)start) != FDT_END )
+    if ( be32_to_cpu(*(__be32 *)start) != FDT_END )
     {
         printk(XENLOG_ERR "Weird tag at end of tree: %08x\n",
                   *((u32 *)start));
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 14:22:43 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 14:22:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959075.1351575 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5mc7-0006t8-Tg; Fri, 18 Apr 2025 14:22:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959075.1351575; Fri, 18 Apr 2025 14: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 1u5mc7-0006t0-Qq; Fri, 18 Apr 2025 14:22:43 +0000
Received: by outflank-mailman (input) for mailman id 959075;
 Fri, 18 Apr 2025 14: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 1u5mc6-0006sm-Nv
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 14: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 1u5mc6-0065yP-2I
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5mc6-003n1f-2C
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14: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=nWE+SccmaJxJO7aREEJAQx05e6wt1fJ1BJJe+IbHhBA=; b=k9LQs5RsXf2JDBjFOsS1iE/Np6
	8pc47Ql8UEfDG9Atixg8pbgwkNwmprTOVs1cLiUGqhQvJ0ADSdi+0vufgnP2TSBsmpBBvVGVozxnw
	TlWAj1tWpH0zz0+ZCYR2WbOaFVLHsnn3K1WRm5AQXw94r62VMLz6ai3K+3LDnv5RK02k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/decompressors: Remove use of *_to_cpup() helpers
Message-Id: <E1u5mc6-003n1f-2C@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 14:22:42 +0000

commit 60dcff871e34fd788bffccfcd5a936f7984d0a69
Author:     Lin Liu <lin.liu@citrix.com>
AuthorDate: Thu Oct 21 02:52:39 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    xen/decompressors: Remove use of *_to_cpup() helpers
    
    These wrappers simply hide a deference, which adds to the cognitive complexity
    of reading the code.  As such, they're not going to be included in the new
    byteswap infrastructure.
    
    No functional change.
    
    Signed-off-by: Lin Liu <lin.liu@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 tools/libs/guest/xg_dom_decompress_lz4.c          | 10 ++++++++--
 tools/libs/guest/xg_dom_decompress_unsafe_lzo1x.c | 19 ++-----------------
 tools/libs/guest/xg_dom_decompress_unsafe_xz.c    | 15 ++++++++-------
 xen/common/lz4/defs.h                             |  8 ++++++--
 xen/common/unlzo.c                                | 16 ++++++++++++----
 xen/common/xz/private.h                           | 16 +++++++++++-----
 6 files changed, 47 insertions(+), 37 deletions(-)

diff --git a/tools/libs/guest/xg_dom_decompress_lz4.c b/tools/libs/guest/xg_dom_decompress_lz4.c
index b26cce3ec5..53ef0bf328 100644
--- a/tools/libs/guest/xg_dom_decompress_lz4.c
+++ b/tools/libs/guest/xg_dom_decompress_lz4.c
@@ -3,6 +3,8 @@
 #include <inttypes.h>
 #include <stdint.h>
 
+#include INCLUDE_ENDIAN_H
+
 #define XG_NEED_UNALIGNED
 #include "xg_private.h"
 #include "xg_dom_decompress.h"
@@ -17,9 +19,13 @@ typedef uint64_t u64;
 #define likely(a) a
 #define unlikely(a) a
 
-static inline uint_fast16_t le16_to_cpup(const unsigned char *buf)
+static inline uint16_t le16_to_cpu(uint16_t v)
 {
-    return buf[0] | (buf[1] << 8);
+#if BYTE_ORDER == BIG_ENDIAN
+    return __builtin_bswap16(v);
+#else
+    return v;
+#endif
 }
 
 #include "../../xen/include/xen/lz4.h"
diff --git a/tools/libs/guest/xg_dom_decompress_unsafe_lzo1x.c b/tools/libs/guest/xg_dom_decompress_unsafe_lzo1x.c
index e58c1b95ed..ca2f37d915 100644
--- a/tools/libs/guest/xg_dom_decompress_unsafe_lzo1x.c
+++ b/tools/libs/guest/xg_dom_decompress_unsafe_lzo1x.c
@@ -16,25 +16,10 @@ typedef uint64_t u64;
 #define noinline
 #define unlikely(a) a
 
-static inline u16 be16_to_cpup(const u16 *p)
+static inline uint16_t be16_to_cpu(const uint16_t v)
 {
-	u16 v = *p;
 #if BYTE_ORDER == LITTLE_ENDIAN
-	return (((v & 0x00ffU) << 8) |
-                ((v & 0xff00U) >> 8));
-#else
-	return v;
-#endif
-}
-
-static inline u32 be32_to_cpup(const u32 *p)
-{
-	u32 v = *p;
-#if BYTE_ORDER == LITTLE_ENDIAN
-	return (((v & 0x000000ffUL) << 24) |
-                ((v & 0x0000ff00UL) <<  8) |
-                ((v & 0x00ff0000UL) >>  8) |
-                ((v & 0xff000000UL) >> 24));
+	return __builtin_bswap16(v);
 #else
 	return v;
 #endif
diff --git a/tools/libs/guest/xg_dom_decompress_unsafe_xz.c b/tools/libs/guest/xg_dom_decompress_unsafe_xz.c
index 80eed912dd..1f52875340 100644
--- a/tools/libs/guest/xg_dom_decompress_unsafe_xz.c
+++ b/tools/libs/guest/xg_dom_decompress_unsafe_xz.c
@@ -16,21 +16,22 @@ typedef uint16_t u16;
 typedef uint32_t u32;
 typedef uint32_t __le32;
 
-static inline u32 cpu_to_le32(const u32 v)
+static inline uint32_t cpu_to_le32(const uint32_t v)
 {
 #if BYTE_ORDER == BIG_ENDIAN
-	return (((v & 0x000000ffUL) << 24) |
-	        ((v & 0x0000ff00UL) <<  8) |
-	        ((v & 0x00ff0000UL) >>  8) |
-	        ((v & 0xff000000UL) >> 24));
+	return __builtin_bswap32(v);
 #else
 	return v;
 #endif
 }
 
-static inline u32 le32_to_cpup(const u32 *p)
+static inline uint32_t le32_to_cpu(const uint32_t p)
 {
-	return cpu_to_le32(*p);
+#if BYTE_ORDER == BIG_ENDIAN
+	return __builtin_bswap32(v);
+#else
+	return v;
+#endif
 }
 
 #define __force
diff --git a/xen/common/lz4/defs.h b/xen/common/lz4/defs.h
index ecfbf07f83..46ec467080 100644
--- a/xen/common/lz4/defs.h
+++ b/xen/common/lz4/defs.h
@@ -16,9 +16,13 @@
 #include <xen/unaligned.h>
 #else
 
-static inline u16 get_unaligned_le16(const void *p)
+static inline uint16_t get_unaligned_le16(const void *p)
 {
-	return le16_to_cpup(p);
+	uint16_t v;
+
+	memcpy(&v, p, sizeof(v));
+
+	return le16_to_cpu(v);
 }
 
 #endif
diff --git a/xen/common/unlzo.c b/xen/common/unlzo.c
index acb8dff600..9022c8f47d 100644
--- a/xen/common/unlzo.c
+++ b/xen/common/unlzo.c
@@ -37,14 +37,22 @@
 #include <xen/unaligned.h>
 #else
 
-static inline u16 get_unaligned_be16(const void *p)
+static inline uint16_t get_unaligned_be16(const void *p)
 {
-	return be16_to_cpup(p);
+	uint16_t v;
+
+	memcpy(&v, p, sizeof(v));
+
+	return be16_to_cpu(v);
 }
 
-static inline u32 get_unaligned_be32(const void *p)
+static inline uint32_t get_unaligned_be32(const void *p)
 {
-	return be32_to_cpup(p);
+	uint32_t v;
+
+	memcpy(&v, p, sizeof(v));
+
+	return be32_to_cpu(v);
 }
 
 #endif
diff --git a/xen/common/xz/private.h b/xen/common/xz/private.h
index 2299705378..d70b2ea6dc 100644
--- a/xen/common/xz/private.h
+++ b/xen/common/xz/private.h
@@ -16,19 +16,25 @@
 #include <xen/unaligned.h>
 #else
 
-static inline u32 get_unaligned_le32(const void *p)
+static inline uint32_t get_unaligned_le32(const void *p)
 {
-	return le32_to_cpup(p);
+	uint32_t v;
+
+	memcpy(&v, p, sizeof(v));
+
+	return le32_to_cpu(v);
 }
 
-static inline void put_unaligned_le32(u32 val, void *p)
+static inline void put_unaligned_le32(uint32_t val, void *p)
 {
-	*(__force __le32*)p = cpu_to_le32(val);
+	uint32_t v = cpu_to_le32(val);
+
+	memcpy(p, &v, sizeof(v));
 }
 
 #endif
 
-#define get_le32(p) le32_to_cpup((const uint32_t *)(p))
+#define get_le32(p) le32_to_cpu(*(const uint32_t *)(p))
 
 #define false 0
 #define true 1
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 14:22:54 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 14:22:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959079.1351578 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5mcI-0006xA-08; Fri, 18 Apr 2025 14:22:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959079.1351578; Fri, 18 Apr 2025 14: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 1u5mcH-0006x3-Tu; Fri, 18 Apr 2025 14:22:53 +0000
Received: by outflank-mailman (input) for mailman id 959079;
 Fri, 18 Apr 2025 14:22:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u5mcH-0006wq-0k
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 14:22:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5mcG-0065z0-3D
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14:22:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5mcG-003nWA-2w
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14: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=s1f8QSo/8Ws6R2P9WSVBPIenXqNjDtu0ZwL9ES/UN9A=; b=sToCp0d5Q5tDMq4UwudYC7erdD
	vSyAou8GFtf7nTQqkszYHMBNrdD/z7y6AfbiuunJVluMjf5c/vSHIEg/Et9WKQuGRoBpMJBtqbzbA
	hvBIAYXjYrp+IvtAP40QN7LajKe4yCBjNGv9LMmt7TOknBpHK1LE642GcCl5Xgk0Nfuw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arch: Switch to new byteorder infrastructure
Message-Id: <E1u5mcG-003nWA-2w@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 14:22:52 +0000

commit 958581014b6fc35ebdc060940e2622960c4d553c
Author:     Lin Liu <lin.liu@citrix.com>
AuthorDate: Mon May 9 06:47:10 2022 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    xen/arch: Switch to new byteorder infrastructure
    
    This needs to be done in several steps, because of common vs arch issues.
    Start by using the new common infrastructure inside the arch infrastructure.
    
    libelf-private.h is awkward, and the only thing in Xen using swab??()
    directly.  It needs updating at the same time.
    
    Signed-off-by: Lin Liu <lin.liu@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/arm/include/asm/byteorder.h   |  4 +---
 xen/arch/ppc/include/asm/byteorder.h   |  8 +-------
 xen/arch/riscv/include/asm/byteorder.h |  4 +---
 xen/arch/x86/include/asm/byteorder.h   | 25 +------------------------
 xen/common/libelf/libelf-private.h     |  6 +++---
 5 files changed, 7 insertions(+), 40 deletions(-)

diff --git a/xen/arch/arm/include/asm/byteorder.h b/xen/arch/arm/include/asm/byteorder.h
index 9c712c4788..7f1419c45a 100644
--- a/xen/arch/arm/include/asm/byteorder.h
+++ b/xen/arch/arm/include/asm/byteorder.h
@@ -1,9 +1,7 @@
 #ifndef __ASM_ARM_BYTEORDER_H__
 #define __ASM_ARM_BYTEORDER_H__
 
-#define __BYTEORDER_HAS_U64__
-
-#include <xen/byteorder/little_endian.h>
+#include <xen/byteorder.h>
 
 #endif /* __ASM_ARM_BYTEORDER_H__ */
 /*
diff --git a/xen/arch/ppc/include/asm/byteorder.h b/xen/arch/ppc/include/asm/byteorder.h
index 2b5f6b9f63..8df6adbf0d 100644
--- a/xen/arch/ppc/include/asm/byteorder.h
+++ b/xen/arch/ppc/include/asm/byteorder.h
@@ -1,12 +1,6 @@
 #ifndef _ASM_PPC_BYTEORDER_H
 #define _ASM_PPC_BYTEORDER_H
 
-#define __arch__swab16 __builtin_bswap16
-#define __arch__swab32 __builtin_bswap32
-#define __arch__swab64 __builtin_bswap64
-
-#define __BYTEORDER_HAS_U64__
-
-#include <xen/byteorder/little_endian.h>
+#include <xen/byteorder.h>
 
 #endif /* _ASM_PPC_BYTEORDER_H */
diff --git a/xen/arch/riscv/include/asm/byteorder.h b/xen/arch/riscv/include/asm/byteorder.h
index 8ca65e1b33..a32bca02df 100644
--- a/xen/arch/riscv/include/asm/byteorder.h
+++ b/xen/arch/riscv/include/asm/byteorder.h
@@ -1,9 +1,7 @@
 #ifndef ASM__RISCV__BYTEORDER_H
 #define ASM__RISCV__BYTEORDER_H
 
-#define __BYTEORDER_HAS_U64__
-
-#include <xen/byteorder/little_endian.h>
+#include <xen/byteorder.h>
 
 #endif /* ASM__RISCV__BYTEORDER_H */
 /*
diff --git a/xen/arch/x86/include/asm/byteorder.h b/xen/arch/x86/include/asm/byteorder.h
index 44c240376d..3524a6cee7 100644
--- a/xen/arch/x86/include/asm/byteorder.h
+++ b/xen/arch/x86/include/asm/byteorder.h
@@ -1,29 +1,6 @@
 #ifndef __ASM_X86_BYTEORDER_H__
 #define __ASM_X86_BYTEORDER_H__
 
-#include <xen/types.h>
-#include <xen/compiler.h>
-
-static inline attr_const uint32_t ___arch__swab32(uint32_t x)
-{
-    asm("bswap %0" : "=r" (x) : "0" (x));
-    return x;
-}
-
-static inline attr_const uint64_t ___arch__swab64(uint64_t x)
-{ 
-    asm ( "bswap %0" : "+r" (x) );
-    return x;
-} 
-
-/* Do not define swab16.  Gcc is smart enough to recognize "C" version and
-   convert it into rotation or exhange.  */
-
-#define __arch__swab64(x) ___arch__swab64(x)
-#define __arch__swab32(x) ___arch__swab32(x)
-
-#define __BYTEORDER_HAS_U64__
-
-#include <xen/byteorder/little_endian.h>
+#include <xen/byteorder.h>
 
 #endif /* __ASM_X86_BYTEORDER_H__ */
diff --git a/xen/common/libelf/libelf-private.h b/xen/common/libelf/libelf-private.h
index 197d7a7623..65417dffc8 100644
--- a/xen/common/libelf/libelf-private.h
+++ b/xen/common/libelf/libelf-private.h
@@ -31,9 +31,9 @@
    printk(fmt, ## args )
 
 #define strtoull(str, end, base) simple_strtoull(str, end, base)
-#define bswap_16(x) swab16(x)
-#define bswap_32(x) swab32(x)
-#define bswap_64(x) swab64(x)
+#define bswap_16(x) bswap16(x)
+#define bswap_32(x) bswap32(x)
+#define bswap_64(x) bswap64(x)
 
 #else /* !__XEN__ */
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 14:23:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 14:23:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959088.1351583 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5mcT-000730-1l; Fri, 18 Apr 2025 14:23:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959088.1351583; Fri, 18 Apr 2025 14: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 1u5mcS-00072t-VL; Fri, 18 Apr 2025 14:23:04 +0000
Received: by outflank-mailman (input) for mailman id 959088;
 Fri, 18 Apr 2025 14:23:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u5mcR-00072b-99
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 14:23:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5mcR-0065zd-0p
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14:23:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5mcR-003oED-0c
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14:23: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=jVcIBbPQL616fANWX8dXvD9ckLvEYpZBbSVddt+zUcM=; b=VfU8HOtzsx1gp26+aYbOqq2ww8
	nxxDpeE/NNvGiQC8HFNw6OrqfPM7wJq6/dxArDPC01Il5WCssoygYlzVS1ClaAVs4bpbDYBlhRwlN
	JhQ7nTvIF9Mo8aw/LSeGAkcYv2jXui0o2jJ9nre5Kms811PSb2XlcUOrJSOVoSPse4BU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/decompressors: Use new byteorder infrastructure
Message-Id: <E1u5mcR-003oED-0c@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 14:23:03 +0000

commit 3e32b4d9742507acb1351d6269c70e636af1b724
Author:     Lin Liu <lin.liu@citrix.com>
AuthorDate: Fri Nov 5 04:15:29 2021 -0400
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    xen/decompressors: Use new byteorder infrastructure
    
    unaligned.h already includes byteorder.h, so most can simply be dropped.
    
    No functional change.
    
    Signed-off-by: Lin Liu <lin.liu@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 tools/libs/guest/xg_dom_decompress_unsafe_zstd.c | 3 +--
 xen/common/lz4/defs.h                            | 1 -
 xen/common/lzo.c                                 | 1 -
 xen/common/unlzo.c                               | 1 -
 xen/common/xz/private.h                          | 1 -
 5 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/tools/libs/guest/xg_dom_decompress_unsafe_zstd.c b/tools/libs/guest/xg_dom_decompress_unsafe_zstd.c
index ff45732a36..319816a390 100644
--- a/tools/libs/guest/xg_dom_decompress_unsafe_zstd.c
+++ b/tools/libs/guest/xg_dom_decompress_unsafe_zstd.c
@@ -30,9 +30,8 @@ typedef uint64_t __be64;
 
 #undef ERROR
 
-#define __BYTEORDER_HAS_U64__
 #define __TYPES_H__ /* xen/types.h guard */
-#include "../../xen/include/xen/byteorder/little_endian.h"
+#include "../../xen/include/xen/byteorder.h"
 #include "../../xen/include/xen/unaligned.h"
 #include "../../xen/include/xen/xxhash.h"
 #include "../../xen/lib/xxhash64.c"
diff --git a/xen/common/lz4/defs.h b/xen/common/lz4/defs.h
index 46ec467080..9e66ab9579 100644
--- a/xen/common/lz4/defs.h
+++ b/xen/common/lz4/defs.h
@@ -12,7 +12,6 @@
 #define COMMON_LZ4_DEFS_H
 
 #ifdef __XEN__
-#include <asm/byteorder.h>
 #include <xen/unaligned.h>
 #else
 
diff --git a/xen/common/lzo.c b/xen/common/lzo.c
index 07b4017812..0393ec5c44 100644
--- a/xen/common/lzo.c
+++ b/xen/common/lzo.c
@@ -68,7 +68,6 @@
 
 #ifdef __XEN__
 #include <xen/lib.h>
-#include <asm/byteorder.h>
 #include <xen/unaligned.h>
 #else
 #define get_unaligned_le16(_p) (*(u16 *)(_p))
diff --git a/xen/common/unlzo.c b/xen/common/unlzo.c
index 9022c8f47d..8d64db7278 100644
--- a/xen/common/unlzo.c
+++ b/xen/common/unlzo.c
@@ -33,7 +33,6 @@
 #include <xen/lzo.h>
 
 #ifdef __XEN__
-#include <asm/byteorder.h>
 #include <xen/unaligned.h>
 #else
 
diff --git a/xen/common/xz/private.h b/xen/common/xz/private.h
index d70b2ea6dc..0130104e80 100644
--- a/xen/common/xz/private.h
+++ b/xen/common/xz/private.h
@@ -12,7 +12,6 @@
 
 #ifdef __XEN__
 #include <xen/kernel.h>
-#include <asm/byteorder.h>
 #include <xen/unaligned.h>
 #else
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 14:23:15 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 14:23:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959089.1351588 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5mcd-00075R-3p; Fri, 18 Apr 2025 14:23:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959089.1351588; Fri, 18 Apr 2025 14:23: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 1u5mcd-00075J-0Y; Fri, 18 Apr 2025 14:23:15 +0000
Received: by outflank-mailman (input) for mailman id 959089;
 Fri, 18 Apr 2025 14: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 1u5mcb-000754-CC
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 14: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 1u5mcb-0065zz-18
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14:23:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5mcb-003ohc-0z
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14: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=SQ8aBIPzwLf56Cmm3gD3bKDRQSpJsoSm4IxK+V7mkxg=; b=JLJuCk0hYJbMXFmZ8tuFbaKrwc
	S1aHJ7RWNhl/hp7192qcw8RE9vt6HlUeDqNdgSzH+PaFjLk80qmi5tTkTtnoL8FBlRcKRcrJK+vve
	shUrmjotYNqMelOEeqe5hxxDepGDMdKx+2dObu00MJaS405Tn3K5X6agvfEgn0qo8Fvs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: Remove old byteorder infrastructure
Message-Id: <E1u5mcb-003ohc-0z@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 14:23:13 +0000

commit de68c123ff73c5ac99fb10116de377c9107e5603
Author:     Lin Liu <lin.liu@citrix.com>
AuthorDate: Thu Oct 21 02:54:19 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    xen: Remove old byteorder infrastructure
    
    It is no longer used.
    
    Signed-off-by: Lin Liu <lin.liu@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/xen/byteorder/big_endian.h    |  95 ----------------
 xen/include/xen/byteorder/generic.h       |  68 ------------
 xen/include/xen/byteorder/little_endian.h |  95 ----------------
 xen/include/xen/byteorder/swab.h          | 179 ------------------------------
 4 files changed, 437 deletions(-)

diff --git a/xen/include/xen/byteorder/big_endian.h b/xen/include/xen/byteorder/big_endian.h
deleted file mode 100644
index 512291c76f..0000000000
--- a/xen/include/xen/byteorder/big_endian.h
+++ /dev/null
@@ -1,95 +0,0 @@
-#ifndef __XEN_BYTEORDER_BIG_ENDIAN_H__
-#define __XEN_BYTEORDER_BIG_ENDIAN_H__
-
-#include <xen/types.h>
-#include <xen/byteorder/swab.h>
-
-#define __constant_cpu_to_le64(x) ((__force __le64)___constant_swab64((x)))
-#define __constant_le64_to_cpu(x) ___constant_swab64((__force uint64_t)(__le64)(x))
-#define __constant_cpu_to_le32(x) ((__force __le32)___constant_swab32((x)))
-#define __constant_le32_to_cpu(x) ___constant_swab32((__force uint32_t)(__le32)(x))
-#define __constant_cpu_to_le16(x) ((__force __le16)___constant_swab16((x)))
-#define __constant_le16_to_cpu(x) ___constant_swab16((__force uint16_t)(__le16)(x))
-#define __constant_cpu_to_be64(x) ((__force __be64)(uint64_t)(x))
-#define __constant_be64_to_cpu(x) ((__force uint64_t)(__be64)(x))
-#define __constant_cpu_to_be32(x) ((__force __be32)(uint32_t)(x))
-#define __constant_be32_to_cpu(x) ((__force uint32_t)(__be32)(x))
-#define __constant_cpu_to_be16(x) ((__force __be16)(uint16_t)(x))
-#define __constant_be16_to_cpu(x) ((__force uint16_t)(__be16)(x))
-#define __cpu_to_le64(x) ((__force __le64)__swab64((x)))
-#define __le64_to_cpu(x) __swab64((__force uint64_t)(__le64)(x))
-#define __cpu_to_le32(x) ((__force __le32)__swab32((x)))
-#define __le32_to_cpu(x) __swab32((__force uint32_t)(__le32)(x))
-#define __cpu_to_le16(x) ((__force __le16)__swab16((x)))
-#define __le16_to_cpu(x) __swab16((__force uint16_t)(__le16)(x))
-#define __cpu_to_be64(x) ((__force __be64)(uint64_t)(x))
-#define __be64_to_cpu(x) ((__force uint64_t)(__be64)(x))
-#define __cpu_to_be32(x) ((__force __be32)(uint32_t)(x))
-#define __be32_to_cpu(x) ((__force uint32_t)(__be32)(x))
-#define __cpu_to_be16(x) ((__force __be16)(uint16_t)(x))
-#define __be16_to_cpu(x) ((__force uint16_t)(__be16)(x))
-
-static inline __le64 __cpu_to_le64p(const uint64_t *p)
-{
-    return (__force __le64)__swab64p(p);
-}
-static inline uint64_t __le64_to_cpup(const __le64 *p)
-{
-    return __swab64p((const uint64_t *)p);
-}
-static inline __le32 __cpu_to_le32p(const uint32_t *p)
-{
-    return (__force __le32)__swab32p(p);
-}
-static inline uint32_t __le32_to_cpup(const __le32 *p)
-{
-    return __swab32p((const uint32_t *)p);
-}
-static inline __le16 __cpu_to_le16p(const uint16_t *p)
-{
-    return (__force __le16)__swab16p(p);
-}
-static inline uint16_t __le16_to_cpup(const __le16 *p)
-{
-    return __swab16p((const uint16_t *)p);
-}
-static inline __be64 __cpu_to_be64p(const uint64_t *p)
-{
-    return (__force __be64)*p;
-}
-static inline uint64_t __be64_to_cpup(const __be64 *p)
-{
-    return (__force uint64_t)*p;
-}
-static inline __be32 __cpu_to_be32p(const uint32_t *p)
-{
-    return (__force __be32)*p;
-}
-static inline uint32_t __be32_to_cpup(const __be32 *p)
-{
-    return (__force uint32_t)*p;
-}
-static inline __be16 __cpu_to_be16p(const uint16_t *p)
-{
-    return (__force __be16)*p;
-}
-static inline uint16_t __be16_to_cpup(const __be16 *p)
-{
-    return (__force uint16_t)*p;
-}
-#define __cpu_to_le64s(x) __swab64s((x))
-#define __le64_to_cpus(x) __swab64s((x))
-#define __cpu_to_le32s(x) __swab32s((x))
-#define __le32_to_cpus(x) __swab32s((x))
-#define __cpu_to_le16s(x) __swab16s((x))
-#define __le16_to_cpus(x) __swab16s((x))
-#define __cpu_to_be64s(x) do {} while (0)
-#define __be64_to_cpus(x) do {} while (0)
-#define __cpu_to_be32s(x) do {} while (0)
-#define __be32_to_cpus(x) do {} while (0)
-#define __cpu_to_be16s(x) do {} while (0)
-#define __be16_to_cpus(x) do {} while (0)
-
-#include <xen/byteorder/generic.h>
-
-#endif /* __XEN_BYTEORDER_BIG_ENDIAN_H__ */
diff --git a/xen/include/xen/byteorder/generic.h b/xen/include/xen/byteorder/generic.h
deleted file mode 100644
index 8a0006b755..0000000000
--- a/xen/include/xen/byteorder/generic.h
+++ /dev/null
@@ -1,68 +0,0 @@
-#ifndef __XEN_BYTEORDER_GENERIC_H__
-#define __XEN_BYTEORDER_GENERIC_H__
-
-/*
- * Generic Byte-reordering support
- *
- * The "... p" macros, like le64_to_cpup, can be used with pointers
- * to unaligned data, but there will be a performance penalty on 
- * some architectures.  Use get_unaligned for unaligned data.
- *
- * The following macros are to be defined by <asm/byteorder.h>:
- *
- * Conversion of XX-bit integers (16- 32- or 64-)
- * between native CPU format and little/big endian format
- * 64-bit stuff only defined for proper architectures
- *     cpu_to_[bl]eXX(__uXX x)
- *     [bl]eXX_to_cpu(__uXX x)
- *
- * The same, but takes a pointer to the value to convert
- *     cpu_to_[bl]eXXp(__uXX x)
- *     [bl]eXX_to_cpup(__uXX x)
- *
- * The same, but change in situ
- *     cpu_to_[bl]eXXs(__uXX x)
- *     [bl]eXX_to_cpus(__uXX x)
- *
- * See asm-foo/byteorder.h for examples of how to provide
- * architecture-optimized versions
- */
-
-#define cpu_to_le64 __cpu_to_le64
-#define le64_to_cpu __le64_to_cpu
-#define cpu_to_le32 __cpu_to_le32
-#define le32_to_cpu __le32_to_cpu
-#define cpu_to_le16 __cpu_to_le16
-#define le16_to_cpu __le16_to_cpu
-#define cpu_to_be64 __cpu_to_be64
-#define be64_to_cpu __be64_to_cpu
-#define cpu_to_be32 __cpu_to_be32
-#define be32_to_cpu __be32_to_cpu
-#define cpu_to_be16 __cpu_to_be16
-#define be16_to_cpu __be16_to_cpu
-#define cpu_to_le64p __cpu_to_le64p
-#define le64_to_cpup __le64_to_cpup
-#define cpu_to_le32p __cpu_to_le32p
-#define le32_to_cpup __le32_to_cpup
-#define cpu_to_le16p __cpu_to_le16p
-#define le16_to_cpup __le16_to_cpup
-#define cpu_to_be64p __cpu_to_be64p
-#define be64_to_cpup __be64_to_cpup
-#define cpu_to_be32p __cpu_to_be32p
-#define be32_to_cpup __be32_to_cpup
-#define cpu_to_be16p __cpu_to_be16p
-#define be16_to_cpup __be16_to_cpup
-#define cpu_to_le64s __cpu_to_le64s
-#define le64_to_cpus __le64_to_cpus
-#define cpu_to_le32s __cpu_to_le32s
-#define le32_to_cpus __le32_to_cpus
-#define cpu_to_le16s __cpu_to_le16s
-#define le16_to_cpus __le16_to_cpus
-#define cpu_to_be64s __cpu_to_be64s
-#define be64_to_cpus __be64_to_cpus
-#define cpu_to_be32s __cpu_to_be32s
-#define be32_to_cpus __be32_to_cpus
-#define cpu_to_be16s __cpu_to_be16s
-#define be16_to_cpus __be16_to_cpus
-
-#endif /* __XEN_BYTEORDER_GENERIC_H__ */
diff --git a/xen/include/xen/byteorder/little_endian.h b/xen/include/xen/byteorder/little_endian.h
deleted file mode 100644
index bd1afc6a67..0000000000
--- a/xen/include/xen/byteorder/little_endian.h
+++ /dev/null
@@ -1,95 +0,0 @@
-#ifndef __XEN_BYTEORDER_LITTLE_ENDIAN_H__
-#define __XEN_BYTEORDER_LITTLE_ENDIAN_H__
-
-#include <xen/types.h>
-#include <xen/byteorder/swab.h>
-
-#define __constant_cpu_to_le64(x) ((__force __le64)(uint64_t)(x))
-#define __constant_le64_to_cpu(x) ((__force uint64_t)(__le64)(x))
-#define __constant_cpu_to_le32(x) ((__force __le32)(uint32_t)(x))
-#define __constant_le32_to_cpu(x) ((__force uint32_t)(__le32)(x))
-#define __constant_cpu_to_le16(x) ((__force __le16)(uint16_t)(x))
-#define __constant_le16_to_cpu(x) ((__force uint16_t)(__le16)(x))
-#define __constant_cpu_to_be64(x) ((__force __be64)___constant_swab64((x)))
-#define __constant_be64_to_cpu(x) ___constant_swab64((__force uint64_t)(__be64)(x))
-#define __constant_cpu_to_be32(x) ((__force __be32)___constant_swab32((x)))
-#define __constant_be32_to_cpu(x) ___constant_swab32((__force uint32_t)(__be32)(x))
-#define __constant_cpu_to_be16(x) ((__force __be16)___constant_swab16((x)))
-#define __constant_be16_to_cpu(x) ___constant_swab16((__force uint16_t)(__be16)(x))
-#define __cpu_to_le64(x) ((__force __le64)(uint64_t)(x))
-#define __le64_to_cpu(x) ((__force uint64_t)(__le64)(x))
-#define __cpu_to_le32(x) ((__force __le32)(uint32_t)(x))
-#define __le32_to_cpu(x) ((__force uint32_t)(__le32)(x))
-#define __cpu_to_le16(x) ((__force __le16)(uint16_t)(x))
-#define __le16_to_cpu(x) ((__force uint16_t)(__le16)(x))
-#define __cpu_to_be64(x) ((__force __be64)__swab64((x)))
-#define __be64_to_cpu(x) __swab64((__force uint64_t)(__be64)(x))
-#define __cpu_to_be32(x) ((__force __be32)__swab32((x)))
-#define __be32_to_cpu(x) __swab32((__force uint32_t)(__be32)(x))
-#define __cpu_to_be16(x) ((__force __be16)__swab16((x)))
-#define __be16_to_cpu(x) __swab16((__force uint16_t)(__be16)(x))
-
-static inline __le64 __cpu_to_le64p(const uint64_t *p)
-{
-    return (__force __le64)*p;
-}
-static inline uint64_t __le64_to_cpup(const __le64 *p)
-{
-    return (__force uint64_t)*p;
-}
-static inline __le32 __cpu_to_le32p(const uint32_t *p)
-{
-    return (__force __le32)*p;
-}
-static inline uint32_t __le32_to_cpup(const __le32 *p)
-{
-    return (__force uint32_t)*p;
-}
-static inline __le16 __cpu_to_le16p(const uint16_t *p)
-{
-    return (__force __le16)*p;
-}
-static inline uint16_t __le16_to_cpup(const __le16 *p)
-{
-    return (__force uint16_t)*p;
-}
-static inline __be64 __cpu_to_be64p(const uint64_t *p)
-{
-    return (__force __be64)__swab64p(p);
-}
-static inline uint64_t __be64_to_cpup(const __be64 *p)
-{
-    return __swab64p((const uint64_t *)p);
-}
-static inline __be32 __cpu_to_be32p(const uint32_t *p)
-{
-    return (__force __be32)__swab32p(p);
-}
-static inline uint32_t __be32_to_cpup(const __be32 *p)
-{
-    return __swab32p((const uint32_t *)p);
-}
-static inline __be16 __cpu_to_be16p(const uint16_t *p)
-{
-    return (__force __be16)__swab16p(p);
-}
-static inline uint16_t __be16_to_cpup(const __be16 *p)
-{
-    return __swab16p((const uint16_t *)p);
-}
-#define __cpu_to_le64s(x) do {} while (0)
-#define __le64_to_cpus(x) do {} while (0)
-#define __cpu_to_le32s(x) do {} while (0)
-#define __le32_to_cpus(x) do {} while (0)
-#define __cpu_to_le16s(x) do {} while (0)
-#define __le16_to_cpus(x) do {} while (0)
-#define __cpu_to_be64s(x) __swab64s((x))
-#define __be64_to_cpus(x) __swab64s((x))
-#define __cpu_to_be32s(x) __swab32s((x))
-#define __be32_to_cpus(x) __swab32s((x))
-#define __cpu_to_be16s(x) __swab16s((x))
-#define __be16_to_cpus(x) __swab16s((x))
-
-#include <xen/byteorder/generic.h>
-
-#endif /* __XEN_BYTEORDER_LITTLE_ENDIAN_H__ */
diff --git a/xen/include/xen/byteorder/swab.h b/xen/include/xen/byteorder/swab.h
deleted file mode 100644
index ffcf1cf800..0000000000
--- a/xen/include/xen/byteorder/swab.h
+++ /dev/null
@@ -1,179 +0,0 @@
-#ifndef __XEN_BYTEORDER_SWAB_H__
-#define __XEN_BYTEORDER_SWAB_H__
-
-/*
- * Byte-swapping, independently from CPU endianness
- *     swabXX[ps]?(foo)
- *
- * Francois-Rene Rideau <fare@tunes.org> 19971205
- *    separated swab functions from cpu_to_XX,
- *    to clean up support for bizarre-endian architectures.
- */
-
-#define ___swab16(x)                                    \
-({                                                      \
-    uint16_t x_ = (x);                                  \
-    (uint16_t)(                                         \
-        (((uint16_t)(x_) & 0x00ffU) << 8) |             \
-        (((uint16_t)(x_) & 0xff00U) >> 8));             \
-})
-
-#define ___swab32(x)                                            \
-({                                                              \
-    uint32_t x_ = (x);                                          \
-    (uint32_t)(                                                 \
-        (((uint32_t)(x_) & 0x000000ffU) << 24) |                \
-        (((uint32_t)(x_) & 0x0000ff00U) <<  8) |                \
-        (((uint32_t)(x_) & 0x00ff0000U) >>  8) |                \
-        (((uint32_t)(x_) & 0xff000000U) >> 24));                \
-})
-
-#define ___swab64(x)                                                       \
-({                                                                         \
-    uint64_t x_ = (x);                                                     \
-    (uint64_t)(                                                            \
-        (((uint64_t)(x_) & 0x00000000000000ffULL) << 56) |                 \
-        (((uint64_t)(x_) & 0x000000000000ff00ULL) << 40) |                 \
-        (((uint64_t)(x_) & 0x0000000000ff0000ULL) << 24) |                 \
-        (((uint64_t)(x_) & 0x00000000ff000000ULL) <<  8) |                 \
-        (((uint64_t)(x_) & 0x000000ff00000000ULL) >>  8) |                 \
-        (((uint64_t)(x_) & 0x0000ff0000000000ULL) >> 24) |                 \
-        (((uint64_t)(x_) & 0x00ff000000000000ULL) >> 40) |                 \
-        (((uint64_t)(x_) & 0xff00000000000000ULL) >> 56));                 \
-})
-
-#define ___constant_swab16(x)                   \
-    ((uint16_t)(                                \
-        (((uint16_t)(x) & 0x00ffU) << 8) |      \
-        (((uint16_t)(x) & 0xff00U) >> 8)))
-#define ___constant_swab32(x)                           \
-    ((uint32_t)(                                        \
-        (((uint32_t)(x) & 0x000000ffU) << 24) |         \
-        (((uint32_t)(x) & 0x0000ff00U) <<  8) |         \
-        (((uint32_t)(x) & 0x00ff0000U) >>  8) |         \
-        (((uint32_t)(x) & 0xff000000U) >> 24)))
-#define ___constant_swab64(x)                                            \
-    ((uint64_t)(                                                         \
-        (((uint64_t)(x) & 0x00000000000000ffULL) << 56) |                \
-        (((uint64_t)(x) & 0x000000000000ff00ULL) << 40) |                \
-        (((uint64_t)(x) & 0x0000000000ff0000ULL) << 24) |                \
-        (((uint64_t)(x) & 0x00000000ff000000ULL) <<  8) |                \
-        (((uint64_t)(x) & 0x000000ff00000000ULL) >>  8) |                \
-        (((uint64_t)(x) & 0x0000ff0000000000ULL) >> 24) |                \
-        (((uint64_t)(x) & 0x00ff000000000000ULL) >> 40) |                \
-        (((uint64_t)(x) & 0xff00000000000000ULL) >> 56)))
-
-/*
- * provide defaults when no architecture-specific optimization is detected
- */
-#ifndef __arch__swab16
-#  define __arch__swab16(x) ___swab16(x)
-#endif
-#ifndef __arch__swab32
-#  define __arch__swab32(x) ___swab32(x)
-#endif
-#ifndef __arch__swab64
-#  define __arch__swab64(x) ___swab64(x)
-#endif
-
-#ifndef __arch__swab16p
-#  define __arch__swab16p(x) __arch__swab16(*(x))
-#endif
-#ifndef __arch__swab32p
-#  define __arch__swab32p(x) __arch__swab32(*(x))
-#endif
-#ifndef __arch__swab64p
-#  define __arch__swab64p(x) __arch__swab64(*(x))
-#endif
-
-#ifndef __arch__swab16s
-#  define __arch__swab16s(x) do { *(x) = __arch__swab16p((x)); } while (0)
-#endif
-#ifndef __arch__swab32s
-#  define __arch__swab32s(x) do { *(x) = __arch__swab32p((x)); } while (0)
-#endif
-#ifndef __arch__swab64s
-#  define __arch__swab64s(x) do { *(x) = __arch__swab64p((x)); } while (0)
-#endif
-
-
-/*
- * Allow constant folding
- */
-#if defined(__GNUC__) && defined(__OPTIMIZE__)
-#  define __swab16(x) \
-(__builtin_constant_p((uint16_t)(x)) ? \
- ___swab16((x)) : \
- __fswab16((x)))
-#  define __swab32(x) \
-(__builtin_constant_p((uint32_t)(x)) ? \
- ___swab32((x)) : \
- __fswab32((x)))
-#  define __swab64(x) \
-(__builtin_constant_p((uint64_t)(x)) ? \
- ___swab64((x)) : \
- __fswab64((x)))
-#else
-#  define __swab16(x) __fswab16(x)
-#  define __swab32(x) __fswab32(x)
-#  define __swab64(x) __fswab64(x)
-#endif /* OPTIMIZE */
-
-
-static inline attr_const uint16_t __fswab16(uint16_t x)
-{
-    return __arch__swab16(x);
-}
-static inline uint16_t __swab16p(const uint16_t *x)
-{
-    return __arch__swab16p(x);
-}
-static inline void __swab16s(uint16_t *addr)
-{
-    __arch__swab16s(addr);
-}
-
-static inline attr_const uint32_t __fswab32(uint32_t x)
-{
-    return __arch__swab32(x);
-}
-static inline uint32_t __swab32p(const uint32_t *x)
-{
-    return __arch__swab32p(x);
-}
-static inline void __swab32s(uint32_t *addr)
-{
-    __arch__swab32s(addr);
-}
-
-#ifdef __BYTEORDER_HAS_U64__
-static inline attr_const uint64_t __fswab64(uint64_t x)
-{
-#  ifdef __SWAB_64_THRU_32__
-    uint32_t h = x >> 32, l = x;
-    return ((uint64_t)__swab32(l) << 32) | __swab32(h);
-#  else
-    return __arch__swab64(x);
-#  endif
-}
-static inline uint64_t __swab64p(const uint64_t *x)
-{
-    return __arch__swab64p(x);
-}
-static inline void __swab64s(uint64_t *addr)
-{
-    __arch__swab64s(addr);
-}
-#endif /* __BYTEORDER_HAS_U64__ */
-
-#define swab16 __swab16
-#define swab32 __swab32
-#define swab64 __swab64
-#define swab16p __swab16p
-#define swab32p __swab32p
-#define swab64p __swab64p
-#define swab16s __swab16s
-#define swab32s __swab32s
-#define swab64s __swab64s
-
-#endif /* __XEN_BYTEORDER_SWAB_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 14:23:25 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 14:23:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959090.1351591 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5mcn-000788-4X; Fri, 18 Apr 2025 14:23:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959090.1351591; Fri, 18 Apr 2025 14:23:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5mcn-000780-25; Fri, 18 Apr 2025 14:23:25 +0000
Received: by outflank-mailman (input) for mailman id 959090;
 Fri, 18 Apr 2025 14: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 1u5mcl-00077i-F7
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 14: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 1u5mcl-00660F-1Q
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14:23:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5mcl-003p3o-1K
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14: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=L7KcthwL+Pvc/HQvddXxqPswn32aEK4+CvMEwkw3kFs=; b=APtCNdOrNqSPpcemLGOIl4H7m7
	Nd3H3KDrExud7dz4nsf+j3SPNHXVevBrP7N7jbU97xJrJo7+XaqcH/rBZf3VqpgdrUpQTCafxRMp7
	Hww2oS1PZwIheA0N/8NUTyKZtpBljO0B8WPw1XN5D3Uch5yMYd60NJc950DasRqEwcsI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] crypto/vmac: Switch to xen/byteswap.h
Message-Id: <E1u5mcl-003p3o-1K@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 14:23:23 +0000

commit 0ffba0ac73e3de1ec426ab8bed83bb0e7c088320
Author:     Lin Liu <lin.liu@citrix.com>
AuthorDate: Mon Oct 18 10:32:39 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    crypto/vmac: Switch to xen/byteswap.h
    
    This file has its own implementation of swap bytes. Clean up
    the code with xen/byteswap.h.
    
    No functional change.
    
    Signed-off-by: Lin Liu <lin.liu@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/crypto/vmac.c | 76 +++----------------------------------------------------
 1 file changed, 3 insertions(+), 73 deletions(-)

diff --git a/xen/crypto/vmac.c b/xen/crypto/vmac.c
index 294dd16a52..acb4e015f5 100644
--- a/xen/crypto/vmac.c
+++ b/xen/crypto/vmac.c
@@ -8,6 +8,7 @@
 
 /* start for Xen */
 #include <xen/init.h>
+#include <xen/byteswap.h>
 #include <xen/types.h>
 #include <xen/lib.h>
 #include <crypto/vmac.h>
@@ -50,7 +51,6 @@ const uint64_t mpoly = UINT64_C(0x1fffffff1fffffff);  /* Poly key mask     */
  * MUL64: 64x64->128-bit multiplication
  * PMUL64: assumes top bits cleared on inputs
  * ADD128: 128x128->128-bit addition
- * GET_REVERSED_64: load and byte-reverse 64-bit word  
  * ----------------------------------------------------------------------- */
 
 /* ----------------------------------------------------------------------- */
@@ -68,22 +68,6 @@ const uint64_t mpoly = UINT64_C(0x1fffffff1fffffff);  /* Poly key mask     */
 
 #define PMUL64 MUL64
 
-#define GET_REVERSED_64(p)                                                \
-    ({uint64_t x;                                                         \
-     asm ("bswapq %0" : "=r" (x) : "0"(*(uint64_t *)(p))); x;})
-
-/* ----------------------------------------------------------------------- */
-#elif (__GNUC__ && __i386__)
-/* ----------------------------------------------------------------------- */
-
-#define GET_REVERSED_64(p)                                                \
-    ({ uint64_t x;                                                        \
-    uint32_t *tp = (uint32_t *)(p);                                       \
-    asm  ("bswap %%edx\n\t"                                               \
-          "bswap %%eax"                                                   \
-    : "=A"(x)                                                             \
-    : "a"(tp[1]), "d"(tp[0]));                                            \
-    x; })
 
 /* ----------------------------------------------------------------------- */
 #elif (__GNUC__ && __ppc64__)
@@ -103,37 +87,6 @@ const uint64_t mpoly = UINT64_C(0x1fffffff1fffffff);  /* Poly key mask     */
 
 #define PMUL64 MUL64
 
-#define GET_REVERSED_64(p)                                                \
-    ({ uint32_t hi, lo, *_p = (uint32_t *)(p);                            \
-       asm volatile ("lwbrx %0, %1, %2" : "=r"(lo) : "b%"(0), "r"(_p) );  \
-       asm volatile ("lwbrx %0, %1, %2" : "=r"(hi) : "b%"(4), "r"(_p) );  \
-       ((uint64_t)hi << 32) | (uint64_t)lo; } )
-
-/* ----------------------------------------------------------------------- */
-#elif (__GNUC__ && (__ppc__ || __PPC__))
-/* ----------------------------------------------------------------------- */
-
-#define GET_REVERSED_64(p)                                                \
-    ({ uint32_t hi, lo, *_p = (uint32_t *)(p);                            \
-       asm volatile ("lwbrx %0, %1, %2" : "=r"(lo) : "b%"(0), "r"(_p) );  \
-       asm volatile ("lwbrx %0, %1, %2" : "=r"(hi) : "b%"(4), "r"(_p) );  \
-       ((uint64_t)hi << 32) | (uint64_t)lo; } )
-
-/* ----------------------------------------------------------------------- */
-#elif (__GNUC__ && (__ARMEL__ || __ARM__))
-/* ----------------------------------------------------------------------- */
-
-#define bswap32(v)                                                        \
-({ uint32_t tmp,out;                                                      \
-    asm volatile(                                                         \
-        "eor    %1, %2, %2, ror #16\n"                                    \
-        "bic    %1, %1, #0x00ff0000\n"                                    \
-        "mov    %0, %2, ror #8\n"                                         \
-        "eor    %0, %0, %1, lsr #8"                                       \
-    : "=r" (out), "=&r" (tmp)                                             \
-    : "r" (v));                                                           \
-    out;})
-
 /* ----------------------------------------------------------------------- */
 #elif _MSC_VER
 /* ----------------------------------------------------------------------- */
@@ -154,11 +107,6 @@ const uint64_t mpoly = UINT64_C(0x1fffffff1fffffff);  /* Poly key mask     */
         (rh) += (ih) + ((rl) < (_il));                               \
     }
 
-#if _MSC_VER >= 1300
-#define GET_REVERSED_64(p) _byteswap_uint64(*(uint64_t *)(p))
-#pragma intrinsic(_byteswap_uint64)
-#endif
-
 #if _MSC_VER >= 1400 && \
     (!defined(__INTEL_COMPILER) || __INTEL_COMPILER >= 1000)
 #define MUL32(i1,i2)    (__emulu((uint32_t)(i1),(uint32_t)(i2)))
@@ -219,24 +167,6 @@ const uint64_t mpoly = UINT64_C(0x1fffffff1fffffff);  /* Poly key mask     */
     }
 #endif
 
-#ifndef GET_REVERSED_64
-#ifndef bswap64
-#ifndef bswap32
-#define bswap32(x)                                                        \
-  ({ uint32_t bsx = (x);                                                  \
-      ((((bsx) & 0xff000000u) >> 24) | (((bsx) & 0x00ff0000u) >>  8) |    \
-       (((bsx) & 0x0000ff00u) <<  8) | (((bsx) & 0x000000ffu) << 24)); })
-#endif
-#define bswap64(x)                                                        \
-     ({ union { uint64_t ll; uint32_t l[2]; } w, r;                       \
-         w.ll = (x);                                                      \
-         r.l[0] = bswap32 (w.l[1]);                                       \
-         r.l[1] = bswap32 (w.l[0]);                                       \
-         r.ll; })
-#endif
-#define GET_REVERSED_64(p) bswap64(*(uint64_t *)(p)) 
-#endif
-
 /* ----------------------------------------------------------------------- */
 
 #if (VMAC_PREFER_BIG_ENDIAN)
@@ -247,9 +177,9 @@ const uint64_t mpoly = UINT64_C(0x1fffffff1fffffff);  /* Poly key mask     */
 
 #if (VMAC_ARCH_BIG_ENDIAN)
 #  define get64BE(ptr) (*(uint64_t *)(ptr))
-#  define get64LE(ptr) GET_REVERSED_64(ptr)
+#  define get64LE(ptr) bswap64(*(uint64_t *)(ptr))
 #else /* assume little-endian */
-#  define get64BE(ptr) GET_REVERSED_64(ptr)
+#  define get64BE(ptr) bswap64(*(uint64_t *)(ptr))
 #  define get64LE(ptr) (*(uint64_t *)(ptr))
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 14:23:35 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 14:23:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959091.1351594 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5mcx-0007BY-7J; Fri, 18 Apr 2025 14:23:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959091.1351594; Fri, 18 Apr 2025 14:23:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5mcx-0007BR-4p; Fri, 18 Apr 2025 14:23:35 +0000
Received: by outflank-mailman (input) for mailman id 959091;
 Fri, 18 Apr 2025 14: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 1u5mcv-0007B1-Id
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 14: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 1u5mcv-00660Y-1m
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14:23:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5mcv-003pIY-1e
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14: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=FuW7H1OGtClHhhwdYY/yJfUH2HwtjNrAb4eSqavglZw=; b=Z/ayNdRCiUB7F9wrI0tjLMCs3W
	NfFrAGuuBarGTPJwYWZwlu2rKoQuUb5c/TdRN/CR2NClZxnbp9YRxbclr2JgnGDKL/3Qd4Mx4dMuq
	lnn+OhrVzDiylQj7cTyf3wIenKpQQ0t8Ngp7c3JfmdpkQS0WEdSbB+bOh4P0zhppQBYE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xsm/flask: Switch {asm -> xen}/byteorder.h
Message-Id: <E1u5mcv-003pIY-1e@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 14:23:33 +0000

commit 108a4cb33967eb967db18eff01511598e959b4a4
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 28 13:02:53 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    xsm/flask: Switch {asm -> xen}/byteorder.h
    
    Sort the includes while at it.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/xsm/flask/ss/avtab.c       | 4 ++--
 xen/xsm/flask/ss/conditional.c | 9 ++++-----
 xen/xsm/flask/ss/ebitmap.c     | 9 ++++-----
 xen/xsm/flask/ss/policydb.c    | 7 +++----
 4 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/xen/xsm/flask/ss/avtab.c b/xen/xsm/flask/ss/avtab.c
index 9761d028d8..2d07917e79 100644
--- a/xen/xsm/flask/ss/avtab.c
+++ b/xen/xsm/flask/ss/avtab.c
@@ -19,11 +19,11 @@
 
 /* Ported to Xen 3.0, George Coker, <gscoker@alpha.ncsc.mil> */
 
+#include <xen/byteorder.h>
+#include <xen/errno.h>
 #include <xen/lib.h>
-#include <asm/byteorder.h>
 #include <xen/types.h>
 #include <xen/xmalloc.h>
-#include <xen/errno.h>
 
 #include "avtab.h"
 #include "policydb.h"
diff --git a/xen/xsm/flask/ss/conditional.c b/xen/xsm/flask/ss/conditional.c
index d314f772b4..a0d2555962 100644
--- a/xen/xsm/flask/ss/conditional.c
+++ b/xen/xsm/flask/ss/conditional.c
@@ -9,15 +9,14 @@
 
 /* Ported to Xen 3.0, George Coker, <gscoker@alpha.ncsc.mil> */
 
-#include <xen/lib.h>
-#include <xen/types.h>
+#include <xen/byteorder.h>
 #include <xen/errno.h>
-#include <xen/string.h>
+#include <xen/lib.h>
 #include <xen/spinlock.h>
+#include <xen/string.h>
+#include <xen/types.h>
 #include <xen/xmalloc.h>
 
-#include <asm/byteorder.h>
-
 #include "security.h"
 #include "conditional.h"
 
diff --git a/xen/xsm/flask/ss/ebitmap.c b/xen/xsm/flask/ss/ebitmap.c
index 1db69d9ad1..1ced81ea02 100644
--- a/xen/xsm/flask/ss/ebitmap.c
+++ b/xen/xsm/flask/ss/ebitmap.c
@@ -10,13 +10,12 @@
 
 /* Ported to Xen 3.0, George Coker, <gscoker@alpha.ncsc.mil> */
 
-#include <xen/lib.h>
-#include <xen/xmalloc.h>
+#include <xen/bitmap.h>
+#include <xen/byteorder.h>
 #include <xen/errno.h>
+#include <xen/lib.h>
 #include <xen/spinlock.h>
-#include <xen/bitmap.h>
-
-#include <asm/byteorder.h>
+#include <xen/xmalloc.h>
 
 #include "ebitmap.h"
 #include "policydb.h"
diff --git a/xen/xsm/flask/ss/policydb.c b/xen/xsm/flask/ss/policydb.c
index 5af45fdc27..165304c133 100644
--- a/xen/xsm/flask/ss/policydb.c
+++ b/xen/xsm/flask/ss/policydb.c
@@ -22,13 +22,12 @@
 
 /* Ported to Xen 3.0, George Coker, <gscoker@alpha.ncsc.mil> */
 
+#include <xen/byteorder.h>
+#include <xen/errno.h>
 #include <xen/lib.h>
+#include <xen/string.h>
 #include <xen/types.h>
 #include <xen/xmalloc.h>
-#include <xen/string.h>
-#include <xen/errno.h>
-
-#include <asm/byteorder.h>
 
 #include <conditional.h>
 #include "security.h"
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 14:23:45 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 14:23:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959093.1351599 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5md7-0007ED-8n; Fri, 18 Apr 2025 14:23:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959093.1351599; Fri, 18 Apr 2025 14:23: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 1u5md7-0007E5-6G; Fri, 18 Apr 2025 14:23:45 +0000
Received: by outflank-mailman (input) for mailman id 959093;
 Fri, 18 Apr 2025 14: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 1u5md5-0007Dk-Lq
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 14: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 1u5md5-00660z-25
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14:23:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5md5-003pUw-1z
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14: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=mDNgHJRtoB/94KtuWlqFcecS2AIiq1qPPo81uY7O5mg=; b=jAbHyQr+Zoi/sw5m5omFAJGXrB
	ILQ/rrwGWvnGGW/VD6NQz4uOSAM2cGdighBtmzlpdmibtPvqzZRm11XpR/AzPc2PA9qErv/shdCrM
	GDn7DCg7k6FCudlyN/WtYVlVRLm/VAPeKmmXxipJKrbffLbmLketjW1Xz6sLAXoAXb/s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/common: Switch {asm -> xen}/byteorder.h
Message-Id: <E1u5md5-003pUw-1z@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 14:23:43 +0000

commit 2ccaaa52b4c58e2725c83e9ab1df225449aca68b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 28 13:06:42 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    xen/common: Switch {asm -> xen}/byteorder.h
    
    Sort the includes.  Drop useless includes of xen/types.h
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/bitmap.c                 | 5 ++---
 xen/common/libelf/libelf-private.h  | 3 ++-
 xen/drivers/char/ehci-dbgp.c        | 4 +++-
 xen/include/xen/bitmap.h            | 2 +-
 xen/include/xen/device_tree.h       | 3 ++-
 xen/include/xen/libfdt/libfdt_env.h | 3 +--
 xen/include/xen/unaligned.h         | 3 +--
 7 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/xen/common/bitmap.c b/xen/common/bitmap.c
index 6c4af09c18..bf1a7fd91e 100644
--- a/xen/common/bitmap.c
+++ b/xen/common/bitmap.c
@@ -5,14 +5,13 @@
  * This source code is licensed under the GNU General Public License,
  * Version 2.  See the file COPYING for more details.
  */
-#include <xen/types.h>
-#include <xen/errno.h>
 #include <xen/bitmap.h>
 #include <xen/bitops.h>
+#include <xen/byteorder.h>
 #include <xen/cpumask.h>
+#include <xen/errno.h>
 #include <xen/guest_access.h>
 #include <xen/lib.h>
-#include <asm/byteorder.h>
 
 /*
  * bitmaps provide an array of bits, implemented using an an
diff --git a/xen/common/libelf/libelf-private.h b/xen/common/libelf/libelf-private.h
index 65417dffc8..e5c9cc1099 100644
--- a/xen/common/libelf/libelf-private.h
+++ b/xen/common/libelf/libelf-private.h
@@ -17,10 +17,11 @@
 
 #ifdef __XEN__
 
+#include <xen/byteorder.h>
 #include <xen/lib.h>
 #include <xen/libelf.h>
 #include <xen/softirq.h>
-#include <asm/byteorder.h>
+
 #include <public/elfnote.h>
 
 /* we would like to use elf->log_callback but we can't because
diff --git a/xen/drivers/char/ehci-dbgp.c b/xen/drivers/char/ehci-dbgp.c
index 1ad3c6bebf..e9cd59b254 100644
--- a/xen/drivers/char/ehci-dbgp.c
+++ b/xen/drivers/char/ehci-dbgp.c
@@ -5,15 +5,17 @@
  * Linux; see the Linux source for authorship and copyrights.
  */
 
+#include <xen/byteorder.h>
 #include <xen/console.h>
 #include <xen/delay.h>
 #include <xen/errno.h>
 #include <xen/param.h>
 #include <xen/pci.h>
 #include <xen/serial.h>
-#include <asm/byteorder.h>
+
 #include <asm/io.h>
 #include <asm/fixmap.h>
+
 #include <public/physdev.h>
 
 /* #define DBGP_DEBUG */
diff --git a/xen/include/xen/bitmap.h b/xen/include/xen/bitmap.h
index 4b642cd420..b5e9cdd3db 100644
--- a/xen/include/xen/bitmap.h
+++ b/xen/include/xen/bitmap.h
@@ -230,7 +230,7 @@ static inline unsigned int bitmap_weight(const unsigned long *src,
 	return __bitmap_weight(src, nbits);
 }
 
-#include <asm/byteorder.h>
+#include <xen/byteorder.h>
 
 #ifdef __LITTLE_ENDIAN
 #define BITMAP_MEM_ALIGNMENT 8
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index 0ff80fda04..6dc1fb5159 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -10,7 +10,8 @@
 #ifndef __XEN_DEVICE_TREE_H__
 #define __XEN_DEVICE_TREE_H__
 
-#include <asm/byteorder.h>
+#include <xen/byteorder.h>
+
 #include <asm/device.h>
 #include <public/xen.h>
 #include <public/device_tree_defs.h>
diff --git a/xen/include/xen/libfdt/libfdt_env.h b/xen/include/xen/libfdt/libfdt_env.h
index 8368787391..04abc6bb68 100644
--- a/xen/include/xen/libfdt/libfdt_env.h
+++ b/xen/include/xen/libfdt/libfdt_env.h
@@ -7,9 +7,8 @@
  * Copyright 2012 Kim Phillips, Freescale Semiconductor.
  */
 
-#include <xen/types.h>
+#include <xen/byteorder.h>
 #include <xen/string.h>
-#include <asm/byteorder.h>
 
 #ifdef __CHECKER__
 #define FDT_FORCE __attribute__((force))
diff --git a/xen/include/xen/unaligned.h b/xen/include/xen/unaligned.h
index 8c8b08338b..e64813ab4b 100644
--- a/xen/include/xen/unaligned.h
+++ b/xen/include/xen/unaligned.h
@@ -3,8 +3,7 @@
 #define __XEN_UNALIGNED_H__
 
 #ifdef __XEN__
-#include <xen/types.h>
-#include <asm/byteorder.h>
+#include <xen/byteorder.h>
 #endif
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 14:23:55 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 14:23:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959094.1351603 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5mdH-0007HJ-AL; Fri, 18 Apr 2025 14:23:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959094.1351603; Fri, 18 Apr 2025 14:23: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 1u5mdH-0007HB-7g; Fri, 18 Apr 2025 14:23:55 +0000
Received: by outflank-mailman (input) for mailman id 959094;
 Fri, 18 Apr 2025 14: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 1u5mdF-0007Gl-RH
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 14: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 1u5mdF-00661h-2e
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14:23:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5mdF-003pi7-2U
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14: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=sTUGms1p/JVmPzb1+HOof0XUeKgrZxEZAlb7HpjK51o=; b=N/2ZSHxTS7dsZXa2dwzQVjJ5rB
	GMeT1zbZVLzTp3PP7R2Pwlyu3rLCH0xhAXlQl6kkvPtC2GSymrCc9KtrI/SO0OOtUYgCWMuWMnttG
	IeofzVXsaqFZSzFGrmq4hPqO6xCmnf7qLo7jygF8XzhAytKv0zgq4WMvGGcXVeoiaGWM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] arm: Remove asm/byteorder.h
Message-Id: <E1u5mdF-003pi7-2U@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 14:23:53 +0000

commit ce3ae8338060f21dcee1146734fe4a666d07d05e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 28 13:11:06 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    arm: Remove asm/byteorder.h
    
    With the common code moved fully onto xen/byteorder.h, clean up the dregs.
    
    Sort includes in some files while swapping over to xen/byteorder.h.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/alternative.c           |  6 +++---
 xen/arch/arm/arm64/livepatch.c       |  2 +-
 xen/arch/arm/include/asm/arm32/io.h  |  3 ++-
 xen/arch/arm/include/asm/arm64/io.h  |  3 ++-
 xen/arch/arm/include/asm/byteorder.h | 14 --------------
 xen/arch/arm/kernel.c                |  2 +-
 xen/arch/arm/vgic/vgic-mmio.c        |  3 ++-
 7 files changed, 11 insertions(+), 22 deletions(-)

diff --git a/xen/arch/arm/alternative.c b/xen/arch/arm/alternative.c
index 2c1af6e7e4..adb9b7d881 100644
--- a/xen/arch/arm/alternative.c
+++ b/xen/arch/arm/alternative.c
@@ -6,18 +6,18 @@
  * Copyright (C) 2014-2016 ARM Ltd.
  */
 
+#include <xen/byteorder.h>
 #include <xen/init.h>
-#include <xen/types.h>
 #include <xen/kernel.h>
 #include <xen/llc-coloring.h>
 #include <xen/mm.h>
-#include <xen/vmap.h>
 #include <xen/smp.h>
 #include <xen/stop_machine.h>
 #include <xen/virtual_region.h>
+#include <xen/vmap.h>
+
 #include <asm/alternative.h>
 #include <asm/atomic.h>
-#include <asm/byteorder.h>
 #include <asm/cpufeature.h>
 #include <asm/insn.h>
 #include <asm/page.h>
diff --git a/xen/arch/arm/arm64/livepatch.c b/xen/arch/arm/arm64/livepatch.c
index 6efe4ec770..e135bd5bf9 100644
--- a/xen/arch/arm/arm64/livepatch.c
+++ b/xen/arch/arm/arm64/livepatch.c
@@ -3,6 +3,7 @@
  */
 
 #include <xen/bitops.h>
+#include <xen/byteorder.h>
 #include <xen/errno.h>
 #include <xen/lib.h>
 #include <xen/livepatch_elf.h>
@@ -11,7 +12,6 @@
 #include <xen/vmap.h>
 
 #include <asm/bitops.h>
-#include <asm/byteorder.h>
 #include <asm/insn.h>
 #include <asm/livepatch.h>
 
diff --git a/xen/arch/arm/include/asm/arm32/io.h b/xen/arch/arm/include/asm/arm32/io.h
index 782b564809..fb0425e629 100644
--- a/xen/arch/arm/include/asm/arm32/io.h
+++ b/xen/arch/arm/include/asm/arm32/io.h
@@ -21,8 +21,9 @@
 #ifndef _ARM_ARM32_IO_H
 #define _ARM_ARM32_IO_H
 
+#include <xen/byteorder.h>
+
 #include <asm/system.h>
-#include <asm/byteorder.h>
 
 static inline void __raw_writeb(u8 val, volatile void __iomem *addr)
 {
diff --git a/xen/arch/arm/include/asm/arm64/io.h b/xen/arch/arm/include/asm/arm64/io.h
index 2e2ab24f78..7d59598777 100644
--- a/xen/arch/arm/include/asm/arm64/io.h
+++ b/xen/arch/arm/include/asm/arm64/io.h
@@ -20,8 +20,9 @@
 #ifndef _ARM_ARM64_IO_H
 #define _ARM_ARM64_IO_H
 
+#include <xen/byteorder.h>
+
 #include <asm/system.h>
-#include <asm/byteorder.h>
 #include <asm/alternative.h>
 
 /*
diff --git a/xen/arch/arm/include/asm/byteorder.h b/xen/arch/arm/include/asm/byteorder.h
deleted file mode 100644
index 7f1419c45a..0000000000
--- a/xen/arch/arm/include/asm/byteorder.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef __ASM_ARM_BYTEORDER_H__
-#define __ASM_ARM_BYTEORDER_H__
-
-#include <xen/byteorder.h>
-
-#endif /* __ASM_ARM_BYTEORDER_H__ */
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
index 6eaf9e2b06..2647812e8e 100644
--- a/xen/arch/arm/kernel.c
+++ b/xen/arch/arm/kernel.c
@@ -4,6 +4,7 @@
  *
  * Copyright (C) 2011 Citrix Systems, Inc.
  */
+#include <xen/byteorder.h>
 #include <xen/domain_page.h>
 #include <xen/errno.h>
 #include <xen/guest_access.h>
@@ -15,7 +16,6 @@
 #include <xen/sched.h>
 #include <xen/vmap.h>
 
-#include <asm/byteorder.h>
 #include <asm/kernel.h>
 #include <asm/setup.h>
 
diff --git a/xen/arch/arm/vgic/vgic-mmio.c b/xen/arch/arm/vgic/vgic-mmio.c
index b4ba34cfc3..d2bcb32cd7 100644
--- a/xen/arch/arm/vgic/vgic-mmio.c
+++ b/xen/arch/arm/vgic/vgic-mmio.c
@@ -14,10 +14,11 @@
 
 #include <xen/bitops.h>
 #include <xen/bsearch.h>
+#include <xen/byteorder.h>
 #include <xen/lib.h>
 #include <xen/sched.h>
+
 #include <asm/new_vgic.h>
-#include <asm/byteorder.h>
 
 #include "vgic.h"
 #include "vgic-mmio.h"
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 14:24:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 14:24:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959097.1351608 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5mdR-0007Jz-CH; Fri, 18 Apr 2025 14:24:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959097.1351608; Fri, 18 Apr 2025 14:24: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 1u5mdR-0007Jr-95; Fri, 18 Apr 2025 14:24:05 +0000
Received: by outflank-mailman (input) for mailman id 959097;
 Fri, 18 Apr 2025 14:24: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 1u5mdP-0007Jc-Ur
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 14: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 1u5mdP-00662H-30
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14:24:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5mdP-003q95-2v
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14: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=R/Mk77Dd+ap/2d4PpcccwWY6yYCNIDFLthaUFJd1aR4=; b=JazGzczJW0CtEx+MdTw/3d0c41
	xgsLpXQfGMfRqeYxAsxQlZ+EeEfxmkLvDV+/nnAxp2rmudTCFgNSTHkaMiLdJEmFQRSxAb5CGLfct
	2YHPdRhPqCxiDpSjAeAWTmeo137yTtdeVCaYPne5I3wN96asOaPlPFmfrm9DsUQSd07g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] ppc: Drop asm/byteorder.h
Message-Id: <E1u5mdP-003q95-2v@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 14:24:03 +0000

commit acec467875cd84155e5e885944466950a649ff85
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 28 13:10:58 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    ppc: Drop asm/byteorder.h
    
    With the common code moved fully onto xen/byteorder.h, clean up the dregs.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/ppc/include/asm/byteorder.h | 6 ------
 xen/arch/ppc/include/asm/page.h      | 4 +---
 xen/arch/ppc/mm-radix.c              | 2 +-
 3 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/xen/arch/ppc/include/asm/byteorder.h b/xen/arch/ppc/include/asm/byteorder.h
deleted file mode 100644
index 8df6adbf0d..0000000000
--- a/xen/arch/ppc/include/asm/byteorder.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _ASM_PPC_BYTEORDER_H
-#define _ASM_PPC_BYTEORDER_H
-
-#include <xen/byteorder.h>
-
-#endif /* _ASM_PPC_BYTEORDER_H */
diff --git a/xen/arch/ppc/include/asm/page.h b/xen/arch/ppc/include/asm/page.h
index 6d4cd2611c..c6160afcfd 100644
--- a/xen/arch/ppc/include/asm/page.h
+++ b/xen/arch/ppc/include/asm/page.h
@@ -3,9 +3,7 @@
 #define _ASM_PPC_PAGE_H
 
 #include <xen/bitops.h>
-#include <xen/types.h>
-
-#include <asm/byteorder.h>
+#include <xen/byteorder.h>
 
 #define PDE_VALID     PPC_BIT(0)
 #define PDE_NLB_MASK  0x1ffffffffffffe0UL
diff --git a/xen/arch/ppc/mm-radix.c b/xen/arch/ppc/mm-radix.c
index 24232f3907..9a00ae416a 100644
--- a/xen/arch/ppc/mm-radix.c
+++ b/xen/arch/ppc/mm-radix.c
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 #include <xen/bitops.h>
+#include <xen/byteorder.h>
 #include <xen/init.h>
 #include <xen/kernel.h>
 #include <xen/mm.h>
@@ -7,7 +8,6 @@
 #include <xen/types.h>
 #include <xen/lib.h>
 
-#include <asm/byteorder.h>
 #include <asm/early_printk.h>
 #include <asm/page.h>
 #include <asm/processor.h>
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 14:24:15 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 14:24:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959099.1351611 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5mdb-0007Mf-D8; Fri, 18 Apr 2025 14:24:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959099.1351611; Fri, 18 Apr 2025 14:24: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 1u5mdb-0007MX-AS; Fri, 18 Apr 2025 14:24:15 +0000
Received: by outflank-mailman (input) for mailman id 959099;
 Fri, 18 Apr 2025 14:24: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 1u5mda-0007MK-2h
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 14:24: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 1u5mda-00662d-0A
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14:24:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5mda-003qdv-01
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14:24: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=cC0pYuLJRlir+hlco0h+xLSd+DIqJWNSVU8/xt6zGDY=; b=er3YPLgmUEpDs0r9Nf+GAzp6Hx
	wu8RCVDeoFB4u3H1D6bz3wN0iSD1w5GOErFzz7Ief7ufOU8WStxLSmGmckMAGoinel+IOP2yVzTlB
	RZLYlqecQiwIsMfhD48euHldSoyVgovDep83aLNAIwFcqSygnfPfcVO3Uob3tqAcgvdc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] riscv: Remove asm/byteorder.h
Message-Id: <E1u5mda-003qdv-01@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 14:24:14 +0000

commit 7aed4daa38ddf0b505eb107565c89ab06b121fb7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 28 11:50:16 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    riscv: Remove asm/byteorder.h
    
    With the common code moved fully onto xen/byteorder.h, clean up the dregs.
    
    The use of byteorder.h in io.h appears to have been copy&paste from ARM.  It's
    not needed, but macros and types are.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/riscv/include/asm/byteorder.h | 14 --------------
 xen/arch/riscv/include/asm/io.h        |  3 ++-
 2 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/xen/arch/riscv/include/asm/byteorder.h b/xen/arch/riscv/include/asm/byteorder.h
deleted file mode 100644
index a32bca02df..0000000000
--- a/xen/arch/riscv/include/asm/byteorder.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef ASM__RISCV__BYTEORDER_H
-#define ASM__RISCV__BYTEORDER_H
-
-#include <xen/byteorder.h>
-
-#endif /* ASM__RISCV__BYTEORDER_H */
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/xen/arch/riscv/include/asm/io.h b/xen/arch/riscv/include/asm/io.h
index 55f329dde3..8bab4ffa03 100644
--- a/xen/arch/riscv/include/asm/io.h
+++ b/xen/arch/riscv/include/asm/io.h
@@ -38,7 +38,8 @@
 #ifndef ASM__RISCV__IO_H
 #define ASM__RISCV__IO_H
 
-#include <asm/byteorder.h>
+#include <xen/macros.h>
+#include <xen/types.h>
 
 /*
  * The RISC-V ISA doesn't yet specify how to query or modify PMAs, so we can't
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 14:24:26 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 14:24:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959101.1351616 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5mdm-0007PT-Eb; Fri, 18 Apr 2025 14:24:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959101.1351616; Fri, 18 Apr 2025 14:24: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 1u5mdm-0007PL-Br; Fri, 18 Apr 2025 14:24:26 +0000
Received: by outflank-mailman (input) for mailman id 959101;
 Fri, 18 Apr 2025 14:24: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 1u5mdk-0007Oz-Gh
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 14:24: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 1u5mdk-006631-1a
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14:24:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5mdk-003rCD-1D
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14:24: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=tAE1mjX47CmZ4vC9U0fSErEsUQX9DDg2WlpvzwyKc3c=; b=R4tFcxnfnlTsuLw6lHP1j+n4gJ
	ftxap+R1lknjZ2zFsfVfIageuxgvN6HnzLkBsx81vwvzvQ5Iu62liadKGpgmfy4uWb7j8/GjoQcfW
	Hj6gvON77EaSXdBxSM7hqTz5D8UVlbuAT+cfglSUl6sNaLCDdosJFvKtw/mc8u9/1Yd0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: Drop asm/byteorder.h
Message-Id: <E1u5mdk-003rCD-1D@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 14:24:24 +0000

commit 209ab249bd93c2932bf02307aa51dd062a7c3ef6
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 28 11:19:23 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    x86: Drop asm/byteorder.h
    
    With the common code moved fully onto xen/byteorder.h, clean up the dregs.
    
    It turns out that msi.h has not needed byteorder.h since the use of
    __{BIG,LITTLE}_ENDIAN_BITFIELD was dropped in commit d58f3941ce3f ("x86/MSI:
    use standard C types in structures/unions").
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/byteorder.h | 6 ------
 xen/arch/x86/include/asm/msi.h       | 1 -
 2 files changed, 7 deletions(-)

diff --git a/xen/arch/x86/include/asm/byteorder.h b/xen/arch/x86/include/asm/byteorder.h
deleted file mode 100644
index 3524a6cee7..0000000000
--- a/xen/arch/x86/include/asm/byteorder.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __ASM_X86_BYTEORDER_H__
-#define __ASM_X86_BYTEORDER_H__
-
-#include <xen/byteorder.h>
-
-#endif /* __ASM_X86_BYTEORDER_H__ */
diff --git a/xen/arch/x86/include/asm/msi.h b/xen/arch/x86/include/asm/msi.h
index 975d0f26b3..00059d4a3a 100644
--- a/xen/arch/x86/include/asm/msi.h
+++ b/xen/arch/x86/include/asm/msi.h
@@ -3,7 +3,6 @@
 
 #include <xen/cpumask.h>
 #include <xen/pci.h>
-#include <asm/byteorder.h>
 #include <asm/hvm/vmx/vmcs.h>
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 14:24:36 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 14:24:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959102.1351619 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5mdw-0007TX-GM; Fri, 18 Apr 2025 14:24:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959102.1351619; Fri, 18 Apr 2025 14:24: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 1u5mdw-0007TP-DH; Fri, 18 Apr 2025 14:24:36 +0000
Received: by outflank-mailman (input) for mailman id 959102;
 Fri, 18 Apr 2025 14:24: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 1u5mdu-0007SP-U5
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 14:24: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 1u5mdu-00663J-2v
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14:24:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5mdu-003rh5-2g
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 14:24: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=zvamEd3q12Airdbx7IXyVBZzz+g4F8bymcqJTp3s8zE=; b=kcpT4QgaI/deQwyUWF+kdauvBX
	yf3+IY73PddYNha7dkR1bJZfEshJ5oQPKyKbpeJxe3h+4HlW0rZr83nztEyB9qW8AuUMaNkBOAO8G
	3vdULwm8ZQyykZPp191EcaYIsibko4G3eU5VWFMBXKAnDRsA8uGiP4KbiNgHIm98xvPE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] vmx: Don't open-code vmresume/vmlaunch instructions
Message-Id: <E1u5mdu-003rh5-2g@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 14:24:34 +0000

commit 64cf7a80a17a017a6b88ea17c7f490e42baefcca
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Thu Apr 17 14:24:44 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    vmx: Don't open-code vmresume/vmlaunch instructions
    
    binutils 2.25 has support for assembling vmresume/vmlaunch
    instructions, so we don't need to open-code the byte sequences
    for these opcodes anymore.
    
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/vmx/entry.S | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/entry.S b/xen/arch/x86/hvm/vmx/entry.S
index 6aaeb28a5b..2bfee715b3 100644
--- a/xen/arch/x86/hvm/vmx/entry.S
+++ b/xen/arch/x86/hvm/vmx/entry.S
@@ -21,9 +21,6 @@
 #include <asm/asm_defns.h>
 #include <asm/page.h>
 
-#define VMRESUME     .byte 0x0f,0x01,0xc3
-#define VMLAUNCH     .byte 0x0f,0x01,0xc2
-
 FUNC(vmx_asm_vmexit_handler)
         SAVE_ALL
 
@@ -166,11 +163,11 @@ UNLIKELY_END(realmode)
         jns  .Lvmx_launch
 
 /*.Lvmx_resume:*/
-        VMRESUME
+        vmresume
         jmp  .Lvmx_vmentry_fail
 
 .Lvmx_launch:
-        VMLAUNCH
+        vmlaunch
 
 .Lvmx_vmentry_fail:
         sti
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 15:55:10 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 15:55:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959233.1351643 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o3X-0008JR-4U; Fri, 18 Apr 2025 15:55:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959233.1351643; Fri, 18 Apr 2025 15:55:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o3X-0008JJ-1x; Fri, 18 Apr 2025 15:55:07 +0000
Received: by outflank-mailman (input) for mailman id 959233;
 Fri, 18 Apr 2025 15:55: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 1u5o3V-0008JC-O5
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 15:55: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 1u5o3V-006Aa3-1n
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:55:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o3V-007GPa-15
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:55: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=8Ym3mjzgrWmyE6mi6h6YuGZdCG4F7KbW/qbbvzqytvY=; b=y4XpEVKVEWKNW9ngYUQS2wyqpq
	7KD54KLc0k3Pz7HG+0AYIpq0c/GsQLPxLHQ5g48Xrd/n0S+0hPmdZJrKsCbXV4xUqekDezt+eAcoU
	Z17SVPwd0Ofo3iFUWxNswEfvsVHld5r7WsSZuj3h1QEcz34dz61/GMpgWIrqMAv1qUM4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: Implement common byte{order,swap}.h
Message-Id: <E1u5o3V-007GPa-15@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 15:55:05 +0000

commit f6784ea2f967f0bacaad83a0e6a86a648e5d2d65
Author:     Lin Liu <lin.liu@citrix.com>
AuthorDate: Mon May 9 01:47:10 2022 -0400
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    xen: Implement common byte{order,swap}.h
    
    The current swab??() infrastructure is unnecessarily complicated, and can be
    replaced entirely with compiler builtins.
    
    All supported compilers provide __BYTE_ORDER__ and __builtin_bswap??().
    
    Nothing in Xen cares about the values of __{BIG,LITTLE}_ENDIAN; just that one
    of them is defined.  Therefore, centralise their definitions in xen/config.h
    
    Signed-off-by: Lin Liu <lin.liu@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/xen/byteorder.h               | 44 +++++++++++++++++++++++++++++++
 xen/include/xen/byteorder/big_endian.h    |  7 -----
 xen/include/xen/byteorder/little_endian.h |  7 -----
 xen/include/xen/byteswap.h                | 15 +++++++++++
 xen/include/xen/config.h                  |  8 ++++++
 5 files changed, 67 insertions(+), 14 deletions(-)

diff --git a/xen/include/xen/byteorder.h b/xen/include/xen/byteorder.h
new file mode 100644
index 0000000000..2b9b970444
--- /dev/null
+++ b/xen/include/xen/byteorder.h
@@ -0,0 +1,44 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#ifndef XEN_BYTEORDER_H
+#define XEN_BYTEORDER_H
+
+#include <xen/byteswap.h>
+#include <xen/stdint.h>
+
+#if defined(__LITTLE_ENDIAN)
+
+# define cpu_to_le64(x) ((uint64_t)(x))
+# define le64_to_cpu(x) ((uint64_t)(x))
+# define cpu_to_le32(x) ((uint32_t)(x))
+# define le32_to_cpu(x) ((uint32_t)(x))
+# define cpu_to_le16(x) ((uint16_t)(x))
+# define le16_to_cpu(x) ((uint16_t)(x))
+
+# define cpu_to_be64(x) bswap64(x)
+# define be64_to_cpu(x) bswap64(x)
+# define cpu_to_be32(x) bswap32(x)
+# define be32_to_cpu(x) bswap32(x)
+# define cpu_to_be16(x) bswap16(x)
+# define be16_to_cpu(x) bswap16(x)
+
+#elif defined(__BIG_ENDIAN)
+
+# define cpu_to_le64(x) bswap64(x)
+# define le64_to_cpu(x) bswap64(x)
+# define cpu_to_le32(x) bswap32(x)
+# define le32_to_cpu(x) bswap32(x)
+# define cpu_to_le16(x) bswap16(x)
+# define le16_to_cpu(x) bswap16(x)
+
+# define cpu_to_be64(x) ((uint64_t)(x))
+# define be64_to_cpu(x) ((uint64_t)(x))
+# define cpu_to_be32(x) ((uint32_t)(x))
+# define be32_to_cpu(x) ((uint32_t)(x))
+# define cpu_to_be16(x) ((uint16_t)(x))
+# define be16_to_cpu(x) ((uint16_t)(x))
+
+#else
+# error Unknown Endianness
+#endif /* __*_ENDIAN */
+
+#endif /* XEN_BYTEORDER_H */
diff --git a/xen/include/xen/byteorder/big_endian.h b/xen/include/xen/byteorder/big_endian.h
index ce395a17f6..512291c76f 100644
--- a/xen/include/xen/byteorder/big_endian.h
+++ b/xen/include/xen/byteorder/big_endian.h
@@ -1,13 +1,6 @@
 #ifndef __XEN_BYTEORDER_BIG_ENDIAN_H__
 #define __XEN_BYTEORDER_BIG_ENDIAN_H__
 
-#ifndef __BIG_ENDIAN
-#define __BIG_ENDIAN 4321
-#endif
-#ifndef __BIG_ENDIAN_BITFIELD
-#define __BIG_ENDIAN_BITFIELD
-#endif
-
 #include <xen/types.h>
 #include <xen/byteorder/swab.h>
 
diff --git a/xen/include/xen/byteorder/little_endian.h b/xen/include/xen/byteorder/little_endian.h
index 8b118afba5..bd1afc6a67 100644
--- a/xen/include/xen/byteorder/little_endian.h
+++ b/xen/include/xen/byteorder/little_endian.h
@@ -1,13 +1,6 @@
 #ifndef __XEN_BYTEORDER_LITTLE_ENDIAN_H__
 #define __XEN_BYTEORDER_LITTLE_ENDIAN_H__
 
-#ifndef __LITTLE_ENDIAN
-#define __LITTLE_ENDIAN 1234
-#endif
-#ifndef __LITTLE_ENDIAN_BITFIELD
-#define __LITTLE_ENDIAN_BITFIELD
-#endif
-
 #include <xen/types.h>
 #include <xen/byteorder/swab.h>
 
diff --git a/xen/include/xen/byteswap.h b/xen/include/xen/byteswap.h
new file mode 100644
index 0000000000..46d93f88ea
--- /dev/null
+++ b/xen/include/xen/byteswap.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#ifndef XEN_BYTESWAP_H
+#define XEN_BYTESWAP_H
+
+#define bswap16(x) __builtin_bswap16(x)
+#define bswap32(x) __builtin_bswap32(x)
+#define bswap64(x) __builtin_bswap64(x)
+
+#if BITS_PER_LONG == 64
+# define bswapl(x) bswap64(x)
+#elif BITS_PER_LONG == 32
+# define bswapl(x) bswap32(x)
+#endif
+
+#endif /* XEN_BYTESWAP_H */
diff --git a/xen/include/xen/config.h b/xen/include/xen/config.h
index 7d43159efb..1d7195066c 100644
--- a/xen/include/xen/config.h
+++ b/xen/include/xen/config.h
@@ -108,4 +108,12 @@
 /* It is assumed that sizeof(void *) == __alignof(void *) */
 #define POINTER_ALIGN   __SIZEOF_POINTER__
 
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+# define __LITTLE_ENDIAN
+# define __LITTLE_ENDIAN_BITFIELD
+#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+# define __BIG_ENDIAN
+# define __BIG_ENDIAN_BITFIELD
+#endif
+
 #endif /* __XEN_CONFIG_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 15:55:17 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 15:55:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959234.1351647 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o3h-0008LS-5v; Fri, 18 Apr 2025 15:55:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959234.1351647; Fri, 18 Apr 2025 15:55:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o3h-0008LK-3H; Fri, 18 Apr 2025 15:55:17 +0000
Received: by outflank-mailman (input) for mailman id 959234;
 Fri, 18 Apr 2025 15:55:16 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u5o3g-0008L4-58
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 15:55:16 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o3g-006AaI-0P
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:55:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o3g-007HFI-04
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:55:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aEuuikJ8VTWet0oiJQLftzzJoDP2AHBwTeCb0bZ+dCQ=; b=Kgamp8enqQ0VUNbaYpLbSms6wH
	Oe1dgtn5+/pjU3ZZTEAxr14nhVx9ARWzxLpFTHGr6hhcrJUpGxb6+7sVl9Xc0a6dU5V9/gFZyO9ki
	vq5ZHana8QwuCA0c7l4ODHvabL9priV1h3Mevkn6WG/1UOGZGvGo/EIpkdDkQvBhsNrE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] drivers/smmu-v3: Fix impending MISRA R20.6 violation
Message-Id: <E1u5o3g-007HFI-04@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 15:55:16 +0000

commit 7b55401529f9c4f5bfbc3232df941a9b6dc324d5
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Apr 16 11:54:04 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    drivers/smmu-v3: Fix impending MISRA R20.6 violation
    
    cpu_to_le64() is about to become a macro, at which point the #ifdef in the
    middle of it becomes undefined behaviour.
    
    Use a local variable to prepare strtab, where the #ifdef is fine to use.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/drivers/passthrough/arm/smmu-v3.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/arm/smmu-v3.c b/xen/drivers/passthrough/arm/smmu-v3.c
index cee5724022..df16235057 100644
--- a/xen/drivers/passthrough/arm/smmu-v3.c
+++ b/xen/drivers/passthrough/arm/smmu-v3.c
@@ -722,15 +722,17 @@ static void arm_smmu_write_strtab_ent(struct arm_smmu_master *master, u32 sid,
 	}
 
 	if (s2_cfg) {
-		BUG_ON(ste_live);
-		dst[2] = cpu_to_le64(
+		u64 strtab =
 			 FIELD_PREP(STRTAB_STE_2_S2VMID, s2_cfg->vmid) |
 			 FIELD_PREP(STRTAB_STE_2_VTCR, s2_cfg->vtcr) |
 #ifdef __BIG_ENDIAN
 			 STRTAB_STE_2_S2ENDI |
 #endif
 			 STRTAB_STE_2_S2PTW | STRTAB_STE_2_S2AA64 |
-			 STRTAB_STE_2_S2R);
+			 STRTAB_STE_2_S2R;
+
+		BUG_ON(ste_live);
+		dst[2] = cpu_to_le64(strtab);
 
 		dst[3] = cpu_to_le64(s2_cfg->vttbr & STRTAB_STE_3_S2TTB_MASK);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 15:55:27 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 15:55:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959235.1351651 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o3r-0008OO-7F; Fri, 18 Apr 2025 15:55:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959235.1351651; Fri, 18 Apr 2025 15:55:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o3r-0008OF-4c; Fri, 18 Apr 2025 15:55:27 +0000
Received: by outflank-mailman (input) for mailman id 959235;
 Fri, 18 Apr 2025 15:55:26 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u5o3q-0008O4-9C
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 15:55:26 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o3q-006Aaf-0m
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:55:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o3q-007HmE-0f
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:55:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NkU8wYq/MjzfQaIb/dHaI0Zws3JY/jUnjn5pMuNrhIo=; b=P+y4Yly45WrT252Y3LQhMqABcs
	92aHnAcLKnEJLjyp6ThgqtIRm8PQv3LSDrAbKjD0WE1HC538Lv47ZNXDO0cVX76eFLmja2tUbc4D5
	dGFgWae3w4c1Sb441Q0R5tF447flCnd9LVRCO2Z/Q2fEDmy7ipGfl6MtO7QfPU91LMsc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/lib: Switch to xen/byteorder.h
Message-Id: <E1u5o3q-007HmE-0f@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 15:55:26 +0000

commit 9aaae6cb4df2a4a98147ca7b49a6e97fc3bbb9ad
Author:     Lin Liu <lin.liu@citrix.com>
AuthorDate: Wed Oct 20 04:29:46 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    xen/lib: Switch to xen/byteorder.h
    
    In divmod.c, additionally swap xen/lib.h for xen/macros.h as only ABS() is
    needed.
    
    In find-next-bit.c, ext2 has nothing to do with this logic.  It was a local
    modification when the logic was imported from Linux, because Xen didn't have a
    suitable helper at the time.
    
    The new infrastructure does have a suitable primitive, so use it.
    
    No functional change.
    
    Signed-off-by: Lin Liu <lin.liu@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/lib/divmod.c        |  4 ++--
 xen/lib/find-next-bit.c | 39 +++++++--------------------------------
 2 files changed, 9 insertions(+), 34 deletions(-)

diff --git a/xen/lib/divmod.c b/xen/lib/divmod.c
index 0377d62130..063e867a81 100644
--- a/xen/lib/divmod.c
+++ b/xen/lib/divmod.c
@@ -1,6 +1,6 @@
-#include <xen/lib.h>
+#include <xen/byteorder.h>
+#include <xen/macros.h>
 #include <xen/types.h>
-#include <asm/byteorder.h>
 
 /*
  * A couple of 64 bit operations ported from FreeBSD.
diff --git a/xen/lib/find-next-bit.c b/xen/lib/find-next-bit.c
index 761b027398..9b8d7814f2 100644
--- a/xen/lib/find-next-bit.c
+++ b/xen/lib/find-next-bit.c
@@ -9,8 +9,7 @@
  * 2 of the License, or (at your option) any later version.
  */
 #include <xen/bitops.h>
-
-#include <asm/byteorder.h>
+#include <xen/byteorder.h>
 
 #define __ffs(x) (ffsl(x) - 1)
 #define ffz(x) __ffs(~(x))
@@ -164,30 +163,6 @@ EXPORT_SYMBOL(find_first_zero_bit);
 
 #ifdef __BIG_ENDIAN
 
-/* include/linux/byteorder does not support "unsigned long" type */
-static inline unsigned long ext2_swabp(const unsigned long * x)
-{
-#if BITS_PER_LONG == 64
-	return (unsigned long) __swab64p((u64 *) x);
-#elif BITS_PER_LONG == 32
-	return (unsigned long) __swab32p((u32 *) x);
-#else
-#error BITS_PER_LONG not defined
-#endif
-}
-
-/* include/linux/byteorder doesn't support "unsigned long" type */
-static inline unsigned long ext2_swab(const unsigned long y)
-{
-#if BITS_PER_LONG == 64
-	return (unsigned long) __swab64((u64) y);
-#elif BITS_PER_LONG == 32
-	return (unsigned long) __swab32((u32) y);
-#else
-#error BITS_PER_LONG not defined
-#endif
-}
-
 #ifndef find_next_zero_bit_le
 unsigned long find_next_zero_bit_le(const void *addr, unsigned
 		long size, unsigned long offset)
@@ -202,7 +177,7 @@ unsigned long find_next_zero_bit_le(const void *addr, unsigned
 	size -= result;
 	offset &= (BITS_PER_LONG - 1UL);
 	if (offset) {
-		tmp = ext2_swabp(p++);
+		tmp = bswapl(*p++);
 		tmp |= (~0UL >> (BITS_PER_LONG - offset));
 		if (size < BITS_PER_LONG)
 			goto found_first;
@@ -220,7 +195,7 @@ unsigned long find_next_zero_bit_le(const void *addr, unsigned
 	}
 	if (!size)
 		return result;
-	tmp = ext2_swabp(p);
+	tmp = bswapl(*p);
 found_first:
 	tmp |= ~0UL << size;
 	if (tmp == ~0UL)	/* Are any bits zero? */
@@ -229,7 +204,7 @@ found_middle:
 	return result + ffz(tmp);
 
 found_middle_swap:
-	return result + ffz(ext2_swab(tmp));
+	return result + ffz(bswapl(tmp));
 }
 EXPORT_SYMBOL(find_next_zero_bit_le);
 #endif
@@ -248,7 +223,7 @@ unsigned long find_next_bit_le(const void *addr, unsigned
 	size -= result;
 	offset &= (BITS_PER_LONG - 1UL);
 	if (offset) {
-		tmp = ext2_swabp(p++);
+		tmp = bswapl(*p++);
 		tmp &= (~0UL << offset);
 		if (size < BITS_PER_LONG)
 			goto found_first;
@@ -267,7 +242,7 @@ unsigned long find_next_bit_le(const void *addr, unsigned
 	}
 	if (!size)
 		return result;
-	tmp = ext2_swabp(p);
+	tmp = bswapl(*p);
 found_first:
 	tmp &= (~0UL >> (BITS_PER_LONG - size));
 	if (tmp == 0UL)		/* Are any bits set? */
@@ -276,7 +251,7 @@ found_middle:
 	return result + __ffs(tmp);
 
 found_middle_swap:
-	return result + __ffs(ext2_swab(tmp));
+	return result + __ffs(bswapl(tmp));
 }
 EXPORT_SYMBOL(find_next_bit_le);
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 15:55:38 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 15:55:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959236.1351654 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o42-0008Qx-8X; Fri, 18 Apr 2025 15:55:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959236.1351654; Fri, 18 Apr 2025 15:55:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o42-0008Qq-63; Fri, 18 Apr 2025 15:55:38 +0000
Received: by outflank-mailman (input) for mailman id 959236;
 Fri, 18 Apr 2025 15:55:36 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u5o40-0008QX-Fl
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 15:55:36 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o40-006Aas-1U
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:55:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o40-007IR1-1K
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:55:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=i0VeGmYC4soXYk2yfeusM8iwX4pt2TN8ssUUKDY+994=; b=btZvIjPo9Y7fWEnZZmgZYYx/Bl
	Sq5D/PXKjiE8mY03QRd1rgers/KtfwrpBvmCHASvBLR0HZjVMeUfJG2YY6ZeydNcvGtwTdDRACVOF
	1CJeNSUaqNWvFel3PjQ3Omha7JMwphqtSssbF1zKCOXxK/7uo4Cq8z54zippMB2JdoO0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/device-tree: Remove use of *_to_cpup() helpers
Message-Id: <E1u5o40-007IR1-1K@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 15:55:36 +0000

commit f689c56076695a65ef3d57dbc27e2ee033824c45
Author:     Lin Liu <lin.liu@citrix.com>
AuthorDate: Thu Oct 21 03:52:39 2021 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    xen/device-tree: Remove use of *_to_cpup() helpers
    
    These wrappers simply hide a deference, which adds to the cognitive complexity
    of reading the code.  As such, they're not going to be included in the new
    byteswap infrastructure.
    
    No functional change.
    
    Signed-off-by: Lin Liu <lin.liu@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/common/device-tree/device-tree.c | 44 ++++++++++++++++++------------------
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/xen/common/device-tree/device-tree.c b/xen/common/device-tree/device-tree.c
index e8f810b2fe..90fee2ba03 100644
--- a/xen/common/device-tree/device-tree.c
+++ b/xen/common/device-tree/device-tree.c
@@ -173,7 +173,7 @@ bool dt_property_read_u32(const struct dt_device_node *np,
     if ( !val || len < sizeof(*out_value) )
         return 0;
 
-    *out_value = be32_to_cpup(val);
+    *out_value = be32_to_cpu(*val);
 
     return 1;
 }
@@ -266,7 +266,7 @@ int dt_property_read_variable_u32_array(const struct dt_device_node *np,
 
     count = sz;
     while ( count-- )
-        *out_values++ = be32_to_cpup(val++);
+        *out_values++ = be32_to_cpu(*val++);
 
     return sz;
 }
@@ -493,7 +493,7 @@ static int __dt_n_addr_cells(const struct dt_device_node *np, bool parent)
 
         ip = dt_get_property(np, "#address-cells", NULL);
         if ( ip )
-            return be32_to_cpup(ip);
+            return be32_to_cpu(*ip);
     } while ( np->parent );
     /* No #address-cells property for the root node */
     return DT_ROOT_NODE_ADDR_CELLS_DEFAULT;
@@ -510,7 +510,7 @@ static int __dt_n_size_cells(const struct dt_device_node *np, bool parent)
 
         ip = dt_get_property(np, "#size-cells", NULL);
         if ( ip )
-            return be32_to_cpup(ip);
+            return be32_to_cpu(*ip);
     } while ( np->parent );
     /* No #address-cells property for the root node */
     return DT_ROOT_NODE_SIZE_CELLS_DEFAULT;
@@ -643,7 +643,7 @@ static void dt_bus_pci_count_cells(const struct dt_device_node *np,
 static unsigned int dt_bus_pci_get_flags(const __be32 *addr)
 {
     unsigned int flags = 0;
-    u32 w = be32_to_cpup(addr);
+    u32 w = be32_to_cpu(*addr);
 
     switch((w >> 24) & 0x03) {
     case 0x01:
@@ -1096,7 +1096,7 @@ dt_irq_find_parent(const struct dt_device_node *child)
         if ( parp == NULL )
             p = dt_get_parent(child);
         else
-            p = dt_find_node_by_phandle(be32_to_cpup(parp));
+            p = dt_find_node_by_phandle(be32_to_cpu(*parp));
         child = p;
     } while ( p && dt_get_property(p, "#interrupt-cells", NULL) == NULL );
 
@@ -1129,7 +1129,7 @@ unsigned int dt_number_of_irq(const struct dt_device_node *device)
     intlen /= sizeof(*intspec);
 
     dt_dprintk(" using 'interrupts' property\n");
-    dt_dprintk(" intspec=%d intlen=%d\n", be32_to_cpup(intspec), intlen);
+    dt_dprintk(" intspec=%d intlen=%d\n", be32_to_cpu(*intspec), intlen);
 
     /* Look for the interrupt parent. */
     p = dt_irq_find_parent(device);
@@ -1260,7 +1260,7 @@ int dt_for_each_irq_map(const struct dt_device_node *dev,
         imaplen -= addrsize + intsize;
 
         /* Get the interrupt parent */
-        ipar = dt_find_node_by_phandle(be32_to_cpup(imap));
+        ipar = dt_find_node_by_phandle(be32_to_cpu(*imap));
         imap++;
         --imaplen;
 
@@ -1377,8 +1377,8 @@ static int dt_irq_map_raw(const struct dt_device_node *parent,
     int match, i;
 
     dt_dprintk("dt_irq_map_raw: par=%s,intspec=[0x%08x 0x%08x...],ointsize=%d\n",
-               parent->full_name, be32_to_cpup(intspec),
-               be32_to_cpup(intspec + 1), ointsize);
+               parent->full_name, be32_to_cpu(*intspec),
+               be32_to_cpu(*(intspec+1)), ointsize);
 
     ipar = parent;
 
@@ -1490,7 +1490,7 @@ static int dt_irq_map_raw(const struct dt_device_node *parent,
             dt_dprintk(" -> match=%d (imaplen=%d)\n", match, imaplen);
 
             /* Get the interrupt parent */
-            newpar = dt_find_node_by_phandle(be32_to_cpup(imap));
+            newpar = dt_find_node_by_phandle(be32_to_cpu(*imap));
             imap++;
             --imaplen;
 
@@ -1584,7 +1584,7 @@ int dt_device_get_raw_irq(const struct dt_device_node *device,
     intlen /= sizeof(*intspec);
 
     dt_dprintk(" using 'interrupts' property\n");
-    dt_dprintk(" intspec=%d intlen=%d\n", be32_to_cpup(intspec), intlen);
+    dt_dprintk(" intspec=%d intlen=%d\n", be32_to_cpu(*intspec), intlen);
 
     /* Look for the interrupt parent. */
     p = dt_irq_find_parent(device);
@@ -1695,7 +1695,7 @@ static int __dt_parse_phandle_with_args(const struct dt_device_node *np,
          * If phandle is 0, then it is an empty entry with no
          * arguments.  Skip forward to the next entry.
          * */
-        phandle = be32_to_cpup(list++);
+        phandle = be32_to_cpu(*list++);
         if ( phandle )
         {
             /*
@@ -1764,7 +1764,7 @@ static int __dt_parse_phandle_with_args(const struct dt_device_node *np,
                 out_args->np = node;
                 out_args->args_count = count;
                 for ( i = 0; i < count; i++ )
-                    out_args->args[i] = be32_to_cpup(list++);
+                    out_args->args[i] = be32_to_cpu(*list++);
             }
 
             /* Found it! return success */
@@ -1845,7 +1845,7 @@ static unsigned long unflatten_dt_node(const void *fdt,
     int has_name = 0;
     int new_format = 0;
 
-    tag = be32_to_cpup((__be32 *)(*p));
+    tag = be32_to_cpu(*(__be32 *)(*p));
     if ( tag != FDT_BEGIN_NODE )
     {
         printk(XENLOG_WARNING "Weird tag at start of node: %x\n", tag);
@@ -1938,7 +1938,7 @@ static unsigned long unflatten_dt_node(const void *fdt,
         u32 sz, noff;
         const char *pname;
 
-        tag = be32_to_cpup((__be32 *)(*p));
+        tag = be32_to_cpu(*(__be32 *)(*p));
         if ( tag == FDT_NOP )
         {
             *p += 4;
@@ -1947,8 +1947,8 @@ static unsigned long unflatten_dt_node(const void *fdt,
         if ( tag != FDT_PROP )
             break;
         *p += 4;
-        sz = be32_to_cpup((__be32 *)(*p));
-        noff = be32_to_cpup((__be32 *)((*p) + 4));
+        sz = be32_to_cpu(*(__be32 *)(*p));
+        noff = be32_to_cpu(*(__be32 *)((*p) + 4));
         *p += 8;
         if ( fdt_version(fdt) < 0x10 )
             *p = ROUNDUP(*p, sz >= 8 ? 8 : 4);
@@ -1975,13 +1975,13 @@ static unsigned long unflatten_dt_node(const void *fdt,
                  (strcmp(pname, "linux,phandle") == 0) )
             {
                 if ( np->phandle == 0 )
-                    np->phandle = be32_to_cpup((__be32*)*p);
+                    np->phandle = be32_to_cpu(*(__be32*)*p);
             }
             /* And we process the "ibm,phandle" property
              * used in pSeries dynamic device tree
              * stuff */
             if ( strcmp(pname, "ibm,phandle") == 0 )
-                np->phandle = be32_to_cpup((__be32 *)*p);
+                np->phandle = be32_to_cpu(*(__be32 *)*p);
             pp->name = pname;
             pp->length = sz;
             pp->value = (void *)*p;
@@ -2053,7 +2053,7 @@ static unsigned long unflatten_dt_node(const void *fdt,
             *p += 4;
         else
             mem = unflatten_dt_node(fdt, mem, p, np, allnextpp, fpsize);
-        tag = be32_to_cpup((__be32 *)(*p));
+        tag = be32_to_cpu(*(__be32 *)(*p));
     }
     if ( tag != FDT_END_NODE )
     {
@@ -2099,7 +2099,7 @@ int unflatten_device_tree(const void *fdt, struct dt_device_node **mynodes)
     /* Second pass, do actual unflattening */
     start = ((unsigned long)fdt) + fdt_off_dt_struct(fdt);
     unflatten_dt_node(fdt, mem, &start, NULL, &allnextp, 0);
-    if ( be32_to_cpup((__be32 *)start) != FDT_END )
+    if ( be32_to_cpu(*(__be32 *)start) != FDT_END )
     {
         printk(XENLOG_ERR "Weird tag at end of tree: %08x\n",
                   *((u32 *)start));
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 15:55:48 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 15:55:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959237.1351659 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o4C-0008Ta-AM; Fri, 18 Apr 2025 15:55:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959237.1351659; Fri, 18 Apr 2025 15:55:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o4C-0008TS-7b; Fri, 18 Apr 2025 15:55:48 +0000
Received: by outflank-mailman (input) for mailman id 959237;
 Fri, 18 Apr 2025 15:55:46 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u5o4A-0008TI-J7
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 15:55:46 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o4A-006Ab8-1p
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:55:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o4A-007Ikg-1j
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:55:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0S62vrG3sDMq+xXjqcMgcSDRpq1rjinmoVeNbhoqoLc=; b=e8PxRG1lIvqyzzJqFIyPlkECFc
	8isxd3eLbJ540UX3K5jEux80k2NSE7vCzGaLhXeMdkak/aj7m1LleQU99MWGEkx7+0XhaRvKauUL6
	KFp0aOrPdi0yEj2PxzJiJd36sW9g8KZJsDOr/MJIAA67LU1Wy3+o2zSJUy8gAMO9uKdk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/decompressors: Remove use of *_to_cpup() helpers
Message-Id: <E1u5o4A-007Ikg-1j@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 15:55:46 +0000

commit 60dcff871e34fd788bffccfcd5a936f7984d0a69
Author:     Lin Liu <lin.liu@citrix.com>
AuthorDate: Thu Oct 21 02:52:39 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    xen/decompressors: Remove use of *_to_cpup() helpers
    
    These wrappers simply hide a deference, which adds to the cognitive complexity
    of reading the code.  As such, they're not going to be included in the new
    byteswap infrastructure.
    
    No functional change.
    
    Signed-off-by: Lin Liu <lin.liu@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 tools/libs/guest/xg_dom_decompress_lz4.c          | 10 ++++++++--
 tools/libs/guest/xg_dom_decompress_unsafe_lzo1x.c | 19 ++-----------------
 tools/libs/guest/xg_dom_decompress_unsafe_xz.c    | 15 ++++++++-------
 xen/common/lz4/defs.h                             |  8 ++++++--
 xen/common/unlzo.c                                | 16 ++++++++++++----
 xen/common/xz/private.h                           | 16 +++++++++++-----
 6 files changed, 47 insertions(+), 37 deletions(-)

diff --git a/tools/libs/guest/xg_dom_decompress_lz4.c b/tools/libs/guest/xg_dom_decompress_lz4.c
index b26cce3ec5..53ef0bf328 100644
--- a/tools/libs/guest/xg_dom_decompress_lz4.c
+++ b/tools/libs/guest/xg_dom_decompress_lz4.c
@@ -3,6 +3,8 @@
 #include <inttypes.h>
 #include <stdint.h>
 
+#include INCLUDE_ENDIAN_H
+
 #define XG_NEED_UNALIGNED
 #include "xg_private.h"
 #include "xg_dom_decompress.h"
@@ -17,9 +19,13 @@ typedef uint64_t u64;
 #define likely(a) a
 #define unlikely(a) a
 
-static inline uint_fast16_t le16_to_cpup(const unsigned char *buf)
+static inline uint16_t le16_to_cpu(uint16_t v)
 {
-    return buf[0] | (buf[1] << 8);
+#if BYTE_ORDER == BIG_ENDIAN
+    return __builtin_bswap16(v);
+#else
+    return v;
+#endif
 }
 
 #include "../../xen/include/xen/lz4.h"
diff --git a/tools/libs/guest/xg_dom_decompress_unsafe_lzo1x.c b/tools/libs/guest/xg_dom_decompress_unsafe_lzo1x.c
index e58c1b95ed..ca2f37d915 100644
--- a/tools/libs/guest/xg_dom_decompress_unsafe_lzo1x.c
+++ b/tools/libs/guest/xg_dom_decompress_unsafe_lzo1x.c
@@ -16,25 +16,10 @@ typedef uint64_t u64;
 #define noinline
 #define unlikely(a) a
 
-static inline u16 be16_to_cpup(const u16 *p)
+static inline uint16_t be16_to_cpu(const uint16_t v)
 {
-	u16 v = *p;
 #if BYTE_ORDER == LITTLE_ENDIAN
-	return (((v & 0x00ffU) << 8) |
-                ((v & 0xff00U) >> 8));
-#else
-	return v;
-#endif
-}
-
-static inline u32 be32_to_cpup(const u32 *p)
-{
-	u32 v = *p;
-#if BYTE_ORDER == LITTLE_ENDIAN
-	return (((v & 0x000000ffUL) << 24) |
-                ((v & 0x0000ff00UL) <<  8) |
-                ((v & 0x00ff0000UL) >>  8) |
-                ((v & 0xff000000UL) >> 24));
+	return __builtin_bswap16(v);
 #else
 	return v;
 #endif
diff --git a/tools/libs/guest/xg_dom_decompress_unsafe_xz.c b/tools/libs/guest/xg_dom_decompress_unsafe_xz.c
index 80eed912dd..1f52875340 100644
--- a/tools/libs/guest/xg_dom_decompress_unsafe_xz.c
+++ b/tools/libs/guest/xg_dom_decompress_unsafe_xz.c
@@ -16,21 +16,22 @@ typedef uint16_t u16;
 typedef uint32_t u32;
 typedef uint32_t __le32;
 
-static inline u32 cpu_to_le32(const u32 v)
+static inline uint32_t cpu_to_le32(const uint32_t v)
 {
 #if BYTE_ORDER == BIG_ENDIAN
-	return (((v & 0x000000ffUL) << 24) |
-	        ((v & 0x0000ff00UL) <<  8) |
-	        ((v & 0x00ff0000UL) >>  8) |
-	        ((v & 0xff000000UL) >> 24));
+	return __builtin_bswap32(v);
 #else
 	return v;
 #endif
 }
 
-static inline u32 le32_to_cpup(const u32 *p)
+static inline uint32_t le32_to_cpu(const uint32_t p)
 {
-	return cpu_to_le32(*p);
+#if BYTE_ORDER == BIG_ENDIAN
+	return __builtin_bswap32(v);
+#else
+	return v;
+#endif
 }
 
 #define __force
diff --git a/xen/common/lz4/defs.h b/xen/common/lz4/defs.h
index ecfbf07f83..46ec467080 100644
--- a/xen/common/lz4/defs.h
+++ b/xen/common/lz4/defs.h
@@ -16,9 +16,13 @@
 #include <xen/unaligned.h>
 #else
 
-static inline u16 get_unaligned_le16(const void *p)
+static inline uint16_t get_unaligned_le16(const void *p)
 {
-	return le16_to_cpup(p);
+	uint16_t v;
+
+	memcpy(&v, p, sizeof(v));
+
+	return le16_to_cpu(v);
 }
 
 #endif
diff --git a/xen/common/unlzo.c b/xen/common/unlzo.c
index acb8dff600..9022c8f47d 100644
--- a/xen/common/unlzo.c
+++ b/xen/common/unlzo.c
@@ -37,14 +37,22 @@
 #include <xen/unaligned.h>
 #else
 
-static inline u16 get_unaligned_be16(const void *p)
+static inline uint16_t get_unaligned_be16(const void *p)
 {
-	return be16_to_cpup(p);
+	uint16_t v;
+
+	memcpy(&v, p, sizeof(v));
+
+	return be16_to_cpu(v);
 }
 
-static inline u32 get_unaligned_be32(const void *p)
+static inline uint32_t get_unaligned_be32(const void *p)
 {
-	return be32_to_cpup(p);
+	uint32_t v;
+
+	memcpy(&v, p, sizeof(v));
+
+	return be32_to_cpu(v);
 }
 
 #endif
diff --git a/xen/common/xz/private.h b/xen/common/xz/private.h
index 2299705378..d70b2ea6dc 100644
--- a/xen/common/xz/private.h
+++ b/xen/common/xz/private.h
@@ -16,19 +16,25 @@
 #include <xen/unaligned.h>
 #else
 
-static inline u32 get_unaligned_le32(const void *p)
+static inline uint32_t get_unaligned_le32(const void *p)
 {
-	return le32_to_cpup(p);
+	uint32_t v;
+
+	memcpy(&v, p, sizeof(v));
+
+	return le32_to_cpu(v);
 }
 
-static inline void put_unaligned_le32(u32 val, void *p)
+static inline void put_unaligned_le32(uint32_t val, void *p)
 {
-	*(__force __le32*)p = cpu_to_le32(val);
+	uint32_t v = cpu_to_le32(val);
+
+	memcpy(p, &v, sizeof(v));
 }
 
 #endif
 
-#define get_le32(p) le32_to_cpup((const uint32_t *)(p))
+#define get_le32(p) le32_to_cpu(*(const uint32_t *)(p))
 
 #define false 0
 #define true 1
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 15:55:58 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 15:55:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959238.1351663 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o4M-000050-D8; Fri, 18 Apr 2025 15:55:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959238.1351663; Fri, 18 Apr 2025 15:55:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o4M-00004r-AO; Fri, 18 Apr 2025 15:55:58 +0000
Received: by outflank-mailman (input) for mailman id 959238;
 Fri, 18 Apr 2025 15:55:56 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u5o4K-0008WM-RY
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 15:55:56 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o4K-006Abj-2d
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:55:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o4K-007JNB-2P
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:55:56 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=N2d03q//Zktqla5L/ZyQybBE96MbE4Gu2B+eAE4EEO0=; b=4K/8ttilUrlfQax1jmE4KgohH8
	XQ7x3T+Ydeb6LPaARrhDjlTG+g6UOIBNDHU3gQYAxQCprd9+04jPkTZWL4QX/RyD4vSSkcf9+bqaf
	L/bGMPJVO92g7FSF/KIuDA/qZ4dyBk2wYhnlViOj19l7VrRsHsHYUoIkitxVoPD9rpKQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arch: Switch to new byteorder infrastructure
Message-Id: <E1u5o4K-007JNB-2P@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 15:55:56 +0000

commit 958581014b6fc35ebdc060940e2622960c4d553c
Author:     Lin Liu <lin.liu@citrix.com>
AuthorDate: Mon May 9 06:47:10 2022 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    xen/arch: Switch to new byteorder infrastructure
    
    This needs to be done in several steps, because of common vs arch issues.
    Start by using the new common infrastructure inside the arch infrastructure.
    
    libelf-private.h is awkward, and the only thing in Xen using swab??()
    directly.  It needs updating at the same time.
    
    Signed-off-by: Lin Liu <lin.liu@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/arm/include/asm/byteorder.h   |  4 +---
 xen/arch/ppc/include/asm/byteorder.h   |  8 +-------
 xen/arch/riscv/include/asm/byteorder.h |  4 +---
 xen/arch/x86/include/asm/byteorder.h   | 25 +------------------------
 xen/common/libelf/libelf-private.h     |  6 +++---
 5 files changed, 7 insertions(+), 40 deletions(-)

diff --git a/xen/arch/arm/include/asm/byteorder.h b/xen/arch/arm/include/asm/byteorder.h
index 9c712c4788..7f1419c45a 100644
--- a/xen/arch/arm/include/asm/byteorder.h
+++ b/xen/arch/arm/include/asm/byteorder.h
@@ -1,9 +1,7 @@
 #ifndef __ASM_ARM_BYTEORDER_H__
 #define __ASM_ARM_BYTEORDER_H__
 
-#define __BYTEORDER_HAS_U64__
-
-#include <xen/byteorder/little_endian.h>
+#include <xen/byteorder.h>
 
 #endif /* __ASM_ARM_BYTEORDER_H__ */
 /*
diff --git a/xen/arch/ppc/include/asm/byteorder.h b/xen/arch/ppc/include/asm/byteorder.h
index 2b5f6b9f63..8df6adbf0d 100644
--- a/xen/arch/ppc/include/asm/byteorder.h
+++ b/xen/arch/ppc/include/asm/byteorder.h
@@ -1,12 +1,6 @@
 #ifndef _ASM_PPC_BYTEORDER_H
 #define _ASM_PPC_BYTEORDER_H
 
-#define __arch__swab16 __builtin_bswap16
-#define __arch__swab32 __builtin_bswap32
-#define __arch__swab64 __builtin_bswap64
-
-#define __BYTEORDER_HAS_U64__
-
-#include <xen/byteorder/little_endian.h>
+#include <xen/byteorder.h>
 
 #endif /* _ASM_PPC_BYTEORDER_H */
diff --git a/xen/arch/riscv/include/asm/byteorder.h b/xen/arch/riscv/include/asm/byteorder.h
index 8ca65e1b33..a32bca02df 100644
--- a/xen/arch/riscv/include/asm/byteorder.h
+++ b/xen/arch/riscv/include/asm/byteorder.h
@@ -1,9 +1,7 @@
 #ifndef ASM__RISCV__BYTEORDER_H
 #define ASM__RISCV__BYTEORDER_H
 
-#define __BYTEORDER_HAS_U64__
-
-#include <xen/byteorder/little_endian.h>
+#include <xen/byteorder.h>
 
 #endif /* ASM__RISCV__BYTEORDER_H */
 /*
diff --git a/xen/arch/x86/include/asm/byteorder.h b/xen/arch/x86/include/asm/byteorder.h
index 44c240376d..3524a6cee7 100644
--- a/xen/arch/x86/include/asm/byteorder.h
+++ b/xen/arch/x86/include/asm/byteorder.h
@@ -1,29 +1,6 @@
 #ifndef __ASM_X86_BYTEORDER_H__
 #define __ASM_X86_BYTEORDER_H__
 
-#include <xen/types.h>
-#include <xen/compiler.h>
-
-static inline attr_const uint32_t ___arch__swab32(uint32_t x)
-{
-    asm("bswap %0" : "=r" (x) : "0" (x));
-    return x;
-}
-
-static inline attr_const uint64_t ___arch__swab64(uint64_t x)
-{ 
-    asm ( "bswap %0" : "+r" (x) );
-    return x;
-} 
-
-/* Do not define swab16.  Gcc is smart enough to recognize "C" version and
-   convert it into rotation or exhange.  */
-
-#define __arch__swab64(x) ___arch__swab64(x)
-#define __arch__swab32(x) ___arch__swab32(x)
-
-#define __BYTEORDER_HAS_U64__
-
-#include <xen/byteorder/little_endian.h>
+#include <xen/byteorder.h>
 
 #endif /* __ASM_X86_BYTEORDER_H__ */
diff --git a/xen/common/libelf/libelf-private.h b/xen/common/libelf/libelf-private.h
index 197d7a7623..65417dffc8 100644
--- a/xen/common/libelf/libelf-private.h
+++ b/xen/common/libelf/libelf-private.h
@@ -31,9 +31,9 @@
    printk(fmt, ## args )
 
 #define strtoull(str, end, base) simple_strtoull(str, end, base)
-#define bswap_16(x) swab16(x)
-#define bswap_32(x) swab32(x)
-#define bswap_64(x) swab64(x)
+#define bswap_16(x) bswap16(x)
+#define bswap_32(x) bswap32(x)
+#define bswap_64(x) bswap64(x)
 
 #else /* !__XEN__ */
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 15:56:08 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 15:56:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959239.1351667 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o4W-00008Q-EW; Fri, 18 Apr 2025 15:56:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959239.1351667; Fri, 18 Apr 2025 15:56:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o4W-00008H-Bz; Fri, 18 Apr 2025 15:56:08 +0000
Received: by outflank-mailman (input) for mailman id 959239;
 Fri, 18 Apr 2025 15:56:07 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u5o4U-00007s-VQ
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 15:56:06 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o4U-006Ac9-33
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:56:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o4U-007Jwg-2u
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:56:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5g/V+qc1bsPPZAUCJLYk6182t0/OyFx6XPy18CTgM9c=; b=weC2BGagdwqEda5uEkjH8aDDXw
	ch3BRiK30A6+ZlfgfKWmRY0HyeX6CTcYGQFHTZIxmiRcEowmNiyu0o9UQtsrfVTVUSmxDIDDhSd+f
	Bw8LY121JPbr+kB0TXvEGvSEA1H3BG8U4J4zcmjl/ewIP4AXlvFyq1QKMzP9N8YM0Uto=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/decompressors: Use new byteorder infrastructure
Message-Id: <E1u5o4U-007Jwg-2u@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 15:56:06 +0000

commit 3e32b4d9742507acb1351d6269c70e636af1b724
Author:     Lin Liu <lin.liu@citrix.com>
AuthorDate: Fri Nov 5 04:15:29 2021 -0400
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    xen/decompressors: Use new byteorder infrastructure
    
    unaligned.h already includes byteorder.h, so most can simply be dropped.
    
    No functional change.
    
    Signed-off-by: Lin Liu <lin.liu@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 tools/libs/guest/xg_dom_decompress_unsafe_zstd.c | 3 +--
 xen/common/lz4/defs.h                            | 1 -
 xen/common/lzo.c                                 | 1 -
 xen/common/unlzo.c                               | 1 -
 xen/common/xz/private.h                          | 1 -
 5 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/tools/libs/guest/xg_dom_decompress_unsafe_zstd.c b/tools/libs/guest/xg_dom_decompress_unsafe_zstd.c
index ff45732a36..319816a390 100644
--- a/tools/libs/guest/xg_dom_decompress_unsafe_zstd.c
+++ b/tools/libs/guest/xg_dom_decompress_unsafe_zstd.c
@@ -30,9 +30,8 @@ typedef uint64_t __be64;
 
 #undef ERROR
 
-#define __BYTEORDER_HAS_U64__
 #define __TYPES_H__ /* xen/types.h guard */
-#include "../../xen/include/xen/byteorder/little_endian.h"
+#include "../../xen/include/xen/byteorder.h"
 #include "../../xen/include/xen/unaligned.h"
 #include "../../xen/include/xen/xxhash.h"
 #include "../../xen/lib/xxhash64.c"
diff --git a/xen/common/lz4/defs.h b/xen/common/lz4/defs.h
index 46ec467080..9e66ab9579 100644
--- a/xen/common/lz4/defs.h
+++ b/xen/common/lz4/defs.h
@@ -12,7 +12,6 @@
 #define COMMON_LZ4_DEFS_H
 
 #ifdef __XEN__
-#include <asm/byteorder.h>
 #include <xen/unaligned.h>
 #else
 
diff --git a/xen/common/lzo.c b/xen/common/lzo.c
index 07b4017812..0393ec5c44 100644
--- a/xen/common/lzo.c
+++ b/xen/common/lzo.c
@@ -68,7 +68,6 @@
 
 #ifdef __XEN__
 #include <xen/lib.h>
-#include <asm/byteorder.h>
 #include <xen/unaligned.h>
 #else
 #define get_unaligned_le16(_p) (*(u16 *)(_p))
diff --git a/xen/common/unlzo.c b/xen/common/unlzo.c
index 9022c8f47d..8d64db7278 100644
--- a/xen/common/unlzo.c
+++ b/xen/common/unlzo.c
@@ -33,7 +33,6 @@
 #include <xen/lzo.h>
 
 #ifdef __XEN__
-#include <asm/byteorder.h>
 #include <xen/unaligned.h>
 #else
 
diff --git a/xen/common/xz/private.h b/xen/common/xz/private.h
index d70b2ea6dc..0130104e80 100644
--- a/xen/common/xz/private.h
+++ b/xen/common/xz/private.h
@@ -12,7 +12,6 @@
 
 #ifdef __XEN__
 #include <xen/kernel.h>
-#include <asm/byteorder.h>
 #include <xen/unaligned.h>
 #else
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 15:56:18 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 15:56:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959240.1351671 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o4g-0000B2-Fv; Fri, 18 Apr 2025 15:56:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959240.1351671; Fri, 18 Apr 2025 15:56:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o4g-0000Au-DN; Fri, 18 Apr 2025 15:56:18 +0000
Received: by outflank-mailman (input) for mailman id 959240;
 Fri, 18 Apr 2025 15:56:17 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u5o4f-0000Am-8E
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 15:56:17 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o4f-006AcX-0j
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:56:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o4f-007KPw-0U
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:56:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=I6K069lruc8l/lKPbVdK9isNB/rwYnP/ReoxBwL8mwA=; b=UgwKsWW545UIjvDhjQOvMM/3Yw
	xMTqe+bR1vyJiRWY11NZA6UNQXERyqce3+R75+g5skRrC+9vDssYypGOJjmmYKu/Q1bYVm7uHrxcY
	WROAlkeltEvdTLc48FC/xcwvlkeycBgruUiWasRD3rAmVgaKeytO/q9umLKPLNU7oQcg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: Remove old byteorder infrastructure
Message-Id: <E1u5o4f-007KPw-0U@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 15:56:17 +0000

commit de68c123ff73c5ac99fb10116de377c9107e5603
Author:     Lin Liu <lin.liu@citrix.com>
AuthorDate: Thu Oct 21 02:54:19 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    xen: Remove old byteorder infrastructure
    
    It is no longer used.
    
    Signed-off-by: Lin Liu <lin.liu@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/xen/byteorder/big_endian.h    |  95 ----------------
 xen/include/xen/byteorder/generic.h       |  68 ------------
 xen/include/xen/byteorder/little_endian.h |  95 ----------------
 xen/include/xen/byteorder/swab.h          | 179 ------------------------------
 4 files changed, 437 deletions(-)

diff --git a/xen/include/xen/byteorder/big_endian.h b/xen/include/xen/byteorder/big_endian.h
deleted file mode 100644
index 512291c76f..0000000000
--- a/xen/include/xen/byteorder/big_endian.h
+++ /dev/null
@@ -1,95 +0,0 @@
-#ifndef __XEN_BYTEORDER_BIG_ENDIAN_H__
-#define __XEN_BYTEORDER_BIG_ENDIAN_H__
-
-#include <xen/types.h>
-#include <xen/byteorder/swab.h>
-
-#define __constant_cpu_to_le64(x) ((__force __le64)___constant_swab64((x)))
-#define __constant_le64_to_cpu(x) ___constant_swab64((__force uint64_t)(__le64)(x))
-#define __constant_cpu_to_le32(x) ((__force __le32)___constant_swab32((x)))
-#define __constant_le32_to_cpu(x) ___constant_swab32((__force uint32_t)(__le32)(x))
-#define __constant_cpu_to_le16(x) ((__force __le16)___constant_swab16((x)))
-#define __constant_le16_to_cpu(x) ___constant_swab16((__force uint16_t)(__le16)(x))
-#define __constant_cpu_to_be64(x) ((__force __be64)(uint64_t)(x))
-#define __constant_be64_to_cpu(x) ((__force uint64_t)(__be64)(x))
-#define __constant_cpu_to_be32(x) ((__force __be32)(uint32_t)(x))
-#define __constant_be32_to_cpu(x) ((__force uint32_t)(__be32)(x))
-#define __constant_cpu_to_be16(x) ((__force __be16)(uint16_t)(x))
-#define __constant_be16_to_cpu(x) ((__force uint16_t)(__be16)(x))
-#define __cpu_to_le64(x) ((__force __le64)__swab64((x)))
-#define __le64_to_cpu(x) __swab64((__force uint64_t)(__le64)(x))
-#define __cpu_to_le32(x) ((__force __le32)__swab32((x)))
-#define __le32_to_cpu(x) __swab32((__force uint32_t)(__le32)(x))
-#define __cpu_to_le16(x) ((__force __le16)__swab16((x)))
-#define __le16_to_cpu(x) __swab16((__force uint16_t)(__le16)(x))
-#define __cpu_to_be64(x) ((__force __be64)(uint64_t)(x))
-#define __be64_to_cpu(x) ((__force uint64_t)(__be64)(x))
-#define __cpu_to_be32(x) ((__force __be32)(uint32_t)(x))
-#define __be32_to_cpu(x) ((__force uint32_t)(__be32)(x))
-#define __cpu_to_be16(x) ((__force __be16)(uint16_t)(x))
-#define __be16_to_cpu(x) ((__force uint16_t)(__be16)(x))
-
-static inline __le64 __cpu_to_le64p(const uint64_t *p)
-{
-    return (__force __le64)__swab64p(p);
-}
-static inline uint64_t __le64_to_cpup(const __le64 *p)
-{
-    return __swab64p((const uint64_t *)p);
-}
-static inline __le32 __cpu_to_le32p(const uint32_t *p)
-{
-    return (__force __le32)__swab32p(p);
-}
-static inline uint32_t __le32_to_cpup(const __le32 *p)
-{
-    return __swab32p((const uint32_t *)p);
-}
-static inline __le16 __cpu_to_le16p(const uint16_t *p)
-{
-    return (__force __le16)__swab16p(p);
-}
-static inline uint16_t __le16_to_cpup(const __le16 *p)
-{
-    return __swab16p((const uint16_t *)p);
-}
-static inline __be64 __cpu_to_be64p(const uint64_t *p)
-{
-    return (__force __be64)*p;
-}
-static inline uint64_t __be64_to_cpup(const __be64 *p)
-{
-    return (__force uint64_t)*p;
-}
-static inline __be32 __cpu_to_be32p(const uint32_t *p)
-{
-    return (__force __be32)*p;
-}
-static inline uint32_t __be32_to_cpup(const __be32 *p)
-{
-    return (__force uint32_t)*p;
-}
-static inline __be16 __cpu_to_be16p(const uint16_t *p)
-{
-    return (__force __be16)*p;
-}
-static inline uint16_t __be16_to_cpup(const __be16 *p)
-{
-    return (__force uint16_t)*p;
-}
-#define __cpu_to_le64s(x) __swab64s((x))
-#define __le64_to_cpus(x) __swab64s((x))
-#define __cpu_to_le32s(x) __swab32s((x))
-#define __le32_to_cpus(x) __swab32s((x))
-#define __cpu_to_le16s(x) __swab16s((x))
-#define __le16_to_cpus(x) __swab16s((x))
-#define __cpu_to_be64s(x) do {} while (0)
-#define __be64_to_cpus(x) do {} while (0)
-#define __cpu_to_be32s(x) do {} while (0)
-#define __be32_to_cpus(x) do {} while (0)
-#define __cpu_to_be16s(x) do {} while (0)
-#define __be16_to_cpus(x) do {} while (0)
-
-#include <xen/byteorder/generic.h>
-
-#endif /* __XEN_BYTEORDER_BIG_ENDIAN_H__ */
diff --git a/xen/include/xen/byteorder/generic.h b/xen/include/xen/byteorder/generic.h
deleted file mode 100644
index 8a0006b755..0000000000
--- a/xen/include/xen/byteorder/generic.h
+++ /dev/null
@@ -1,68 +0,0 @@
-#ifndef __XEN_BYTEORDER_GENERIC_H__
-#define __XEN_BYTEORDER_GENERIC_H__
-
-/*
- * Generic Byte-reordering support
- *
- * The "... p" macros, like le64_to_cpup, can be used with pointers
- * to unaligned data, but there will be a performance penalty on 
- * some architectures.  Use get_unaligned for unaligned data.
- *
- * The following macros are to be defined by <asm/byteorder.h>:
- *
- * Conversion of XX-bit integers (16- 32- or 64-)
- * between native CPU format and little/big endian format
- * 64-bit stuff only defined for proper architectures
- *     cpu_to_[bl]eXX(__uXX x)
- *     [bl]eXX_to_cpu(__uXX x)
- *
- * The same, but takes a pointer to the value to convert
- *     cpu_to_[bl]eXXp(__uXX x)
- *     [bl]eXX_to_cpup(__uXX x)
- *
- * The same, but change in situ
- *     cpu_to_[bl]eXXs(__uXX x)
- *     [bl]eXX_to_cpus(__uXX x)
- *
- * See asm-foo/byteorder.h for examples of how to provide
- * architecture-optimized versions
- */
-
-#define cpu_to_le64 __cpu_to_le64
-#define le64_to_cpu __le64_to_cpu
-#define cpu_to_le32 __cpu_to_le32
-#define le32_to_cpu __le32_to_cpu
-#define cpu_to_le16 __cpu_to_le16
-#define le16_to_cpu __le16_to_cpu
-#define cpu_to_be64 __cpu_to_be64
-#define be64_to_cpu __be64_to_cpu
-#define cpu_to_be32 __cpu_to_be32
-#define be32_to_cpu __be32_to_cpu
-#define cpu_to_be16 __cpu_to_be16
-#define be16_to_cpu __be16_to_cpu
-#define cpu_to_le64p __cpu_to_le64p
-#define le64_to_cpup __le64_to_cpup
-#define cpu_to_le32p __cpu_to_le32p
-#define le32_to_cpup __le32_to_cpup
-#define cpu_to_le16p __cpu_to_le16p
-#define le16_to_cpup __le16_to_cpup
-#define cpu_to_be64p __cpu_to_be64p
-#define be64_to_cpup __be64_to_cpup
-#define cpu_to_be32p __cpu_to_be32p
-#define be32_to_cpup __be32_to_cpup
-#define cpu_to_be16p __cpu_to_be16p
-#define be16_to_cpup __be16_to_cpup
-#define cpu_to_le64s __cpu_to_le64s
-#define le64_to_cpus __le64_to_cpus
-#define cpu_to_le32s __cpu_to_le32s
-#define le32_to_cpus __le32_to_cpus
-#define cpu_to_le16s __cpu_to_le16s
-#define le16_to_cpus __le16_to_cpus
-#define cpu_to_be64s __cpu_to_be64s
-#define be64_to_cpus __be64_to_cpus
-#define cpu_to_be32s __cpu_to_be32s
-#define be32_to_cpus __be32_to_cpus
-#define cpu_to_be16s __cpu_to_be16s
-#define be16_to_cpus __be16_to_cpus
-
-#endif /* __XEN_BYTEORDER_GENERIC_H__ */
diff --git a/xen/include/xen/byteorder/little_endian.h b/xen/include/xen/byteorder/little_endian.h
deleted file mode 100644
index bd1afc6a67..0000000000
--- a/xen/include/xen/byteorder/little_endian.h
+++ /dev/null
@@ -1,95 +0,0 @@
-#ifndef __XEN_BYTEORDER_LITTLE_ENDIAN_H__
-#define __XEN_BYTEORDER_LITTLE_ENDIAN_H__
-
-#include <xen/types.h>
-#include <xen/byteorder/swab.h>
-
-#define __constant_cpu_to_le64(x) ((__force __le64)(uint64_t)(x))
-#define __constant_le64_to_cpu(x) ((__force uint64_t)(__le64)(x))
-#define __constant_cpu_to_le32(x) ((__force __le32)(uint32_t)(x))
-#define __constant_le32_to_cpu(x) ((__force uint32_t)(__le32)(x))
-#define __constant_cpu_to_le16(x) ((__force __le16)(uint16_t)(x))
-#define __constant_le16_to_cpu(x) ((__force uint16_t)(__le16)(x))
-#define __constant_cpu_to_be64(x) ((__force __be64)___constant_swab64((x)))
-#define __constant_be64_to_cpu(x) ___constant_swab64((__force uint64_t)(__be64)(x))
-#define __constant_cpu_to_be32(x) ((__force __be32)___constant_swab32((x)))
-#define __constant_be32_to_cpu(x) ___constant_swab32((__force uint32_t)(__be32)(x))
-#define __constant_cpu_to_be16(x) ((__force __be16)___constant_swab16((x)))
-#define __constant_be16_to_cpu(x) ___constant_swab16((__force uint16_t)(__be16)(x))
-#define __cpu_to_le64(x) ((__force __le64)(uint64_t)(x))
-#define __le64_to_cpu(x) ((__force uint64_t)(__le64)(x))
-#define __cpu_to_le32(x) ((__force __le32)(uint32_t)(x))
-#define __le32_to_cpu(x) ((__force uint32_t)(__le32)(x))
-#define __cpu_to_le16(x) ((__force __le16)(uint16_t)(x))
-#define __le16_to_cpu(x) ((__force uint16_t)(__le16)(x))
-#define __cpu_to_be64(x) ((__force __be64)__swab64((x)))
-#define __be64_to_cpu(x) __swab64((__force uint64_t)(__be64)(x))
-#define __cpu_to_be32(x) ((__force __be32)__swab32((x)))
-#define __be32_to_cpu(x) __swab32((__force uint32_t)(__be32)(x))
-#define __cpu_to_be16(x) ((__force __be16)__swab16((x)))
-#define __be16_to_cpu(x) __swab16((__force uint16_t)(__be16)(x))
-
-static inline __le64 __cpu_to_le64p(const uint64_t *p)
-{
-    return (__force __le64)*p;
-}
-static inline uint64_t __le64_to_cpup(const __le64 *p)
-{
-    return (__force uint64_t)*p;
-}
-static inline __le32 __cpu_to_le32p(const uint32_t *p)
-{
-    return (__force __le32)*p;
-}
-static inline uint32_t __le32_to_cpup(const __le32 *p)
-{
-    return (__force uint32_t)*p;
-}
-static inline __le16 __cpu_to_le16p(const uint16_t *p)
-{
-    return (__force __le16)*p;
-}
-static inline uint16_t __le16_to_cpup(const __le16 *p)
-{
-    return (__force uint16_t)*p;
-}
-static inline __be64 __cpu_to_be64p(const uint64_t *p)
-{
-    return (__force __be64)__swab64p(p);
-}
-static inline uint64_t __be64_to_cpup(const __be64 *p)
-{
-    return __swab64p((const uint64_t *)p);
-}
-static inline __be32 __cpu_to_be32p(const uint32_t *p)
-{
-    return (__force __be32)__swab32p(p);
-}
-static inline uint32_t __be32_to_cpup(const __be32 *p)
-{
-    return __swab32p((const uint32_t *)p);
-}
-static inline __be16 __cpu_to_be16p(const uint16_t *p)
-{
-    return (__force __be16)__swab16p(p);
-}
-static inline uint16_t __be16_to_cpup(const __be16 *p)
-{
-    return __swab16p((const uint16_t *)p);
-}
-#define __cpu_to_le64s(x) do {} while (0)
-#define __le64_to_cpus(x) do {} while (0)
-#define __cpu_to_le32s(x) do {} while (0)
-#define __le32_to_cpus(x) do {} while (0)
-#define __cpu_to_le16s(x) do {} while (0)
-#define __le16_to_cpus(x) do {} while (0)
-#define __cpu_to_be64s(x) __swab64s((x))
-#define __be64_to_cpus(x) __swab64s((x))
-#define __cpu_to_be32s(x) __swab32s((x))
-#define __be32_to_cpus(x) __swab32s((x))
-#define __cpu_to_be16s(x) __swab16s((x))
-#define __be16_to_cpus(x) __swab16s((x))
-
-#include <xen/byteorder/generic.h>
-
-#endif /* __XEN_BYTEORDER_LITTLE_ENDIAN_H__ */
diff --git a/xen/include/xen/byteorder/swab.h b/xen/include/xen/byteorder/swab.h
deleted file mode 100644
index ffcf1cf800..0000000000
--- a/xen/include/xen/byteorder/swab.h
+++ /dev/null
@@ -1,179 +0,0 @@
-#ifndef __XEN_BYTEORDER_SWAB_H__
-#define __XEN_BYTEORDER_SWAB_H__
-
-/*
- * Byte-swapping, independently from CPU endianness
- *     swabXX[ps]?(foo)
- *
- * Francois-Rene Rideau <fare@tunes.org> 19971205
- *    separated swab functions from cpu_to_XX,
- *    to clean up support for bizarre-endian architectures.
- */
-
-#define ___swab16(x)                                    \
-({                                                      \
-    uint16_t x_ = (x);                                  \
-    (uint16_t)(                                         \
-        (((uint16_t)(x_) & 0x00ffU) << 8) |             \
-        (((uint16_t)(x_) & 0xff00U) >> 8));             \
-})
-
-#define ___swab32(x)                                            \
-({                                                              \
-    uint32_t x_ = (x);                                          \
-    (uint32_t)(                                                 \
-        (((uint32_t)(x_) & 0x000000ffU) << 24) |                \
-        (((uint32_t)(x_) & 0x0000ff00U) <<  8) |                \
-        (((uint32_t)(x_) & 0x00ff0000U) >>  8) |                \
-        (((uint32_t)(x_) & 0xff000000U) >> 24));                \
-})
-
-#define ___swab64(x)                                                       \
-({                                                                         \
-    uint64_t x_ = (x);                                                     \
-    (uint64_t)(                                                            \
-        (((uint64_t)(x_) & 0x00000000000000ffULL) << 56) |                 \
-        (((uint64_t)(x_) & 0x000000000000ff00ULL) << 40) |                 \
-        (((uint64_t)(x_) & 0x0000000000ff0000ULL) << 24) |                 \
-        (((uint64_t)(x_) & 0x00000000ff000000ULL) <<  8) |                 \
-        (((uint64_t)(x_) & 0x000000ff00000000ULL) >>  8) |                 \
-        (((uint64_t)(x_) & 0x0000ff0000000000ULL) >> 24) |                 \
-        (((uint64_t)(x_) & 0x00ff000000000000ULL) >> 40) |                 \
-        (((uint64_t)(x_) & 0xff00000000000000ULL) >> 56));                 \
-})
-
-#define ___constant_swab16(x)                   \
-    ((uint16_t)(                                \
-        (((uint16_t)(x) & 0x00ffU) << 8) |      \
-        (((uint16_t)(x) & 0xff00U) >> 8)))
-#define ___constant_swab32(x)                           \
-    ((uint32_t)(                                        \
-        (((uint32_t)(x) & 0x000000ffU) << 24) |         \
-        (((uint32_t)(x) & 0x0000ff00U) <<  8) |         \
-        (((uint32_t)(x) & 0x00ff0000U) >>  8) |         \
-        (((uint32_t)(x) & 0xff000000U) >> 24)))
-#define ___constant_swab64(x)                                            \
-    ((uint64_t)(                                                         \
-        (((uint64_t)(x) & 0x00000000000000ffULL) << 56) |                \
-        (((uint64_t)(x) & 0x000000000000ff00ULL) << 40) |                \
-        (((uint64_t)(x) & 0x0000000000ff0000ULL) << 24) |                \
-        (((uint64_t)(x) & 0x00000000ff000000ULL) <<  8) |                \
-        (((uint64_t)(x) & 0x000000ff00000000ULL) >>  8) |                \
-        (((uint64_t)(x) & 0x0000ff0000000000ULL) >> 24) |                \
-        (((uint64_t)(x) & 0x00ff000000000000ULL) >> 40) |                \
-        (((uint64_t)(x) & 0xff00000000000000ULL) >> 56)))
-
-/*
- * provide defaults when no architecture-specific optimization is detected
- */
-#ifndef __arch__swab16
-#  define __arch__swab16(x) ___swab16(x)
-#endif
-#ifndef __arch__swab32
-#  define __arch__swab32(x) ___swab32(x)
-#endif
-#ifndef __arch__swab64
-#  define __arch__swab64(x) ___swab64(x)
-#endif
-
-#ifndef __arch__swab16p
-#  define __arch__swab16p(x) __arch__swab16(*(x))
-#endif
-#ifndef __arch__swab32p
-#  define __arch__swab32p(x) __arch__swab32(*(x))
-#endif
-#ifndef __arch__swab64p
-#  define __arch__swab64p(x) __arch__swab64(*(x))
-#endif
-
-#ifndef __arch__swab16s
-#  define __arch__swab16s(x) do { *(x) = __arch__swab16p((x)); } while (0)
-#endif
-#ifndef __arch__swab32s
-#  define __arch__swab32s(x) do { *(x) = __arch__swab32p((x)); } while (0)
-#endif
-#ifndef __arch__swab64s
-#  define __arch__swab64s(x) do { *(x) = __arch__swab64p((x)); } while (0)
-#endif
-
-
-/*
- * Allow constant folding
- */
-#if defined(__GNUC__) && defined(__OPTIMIZE__)
-#  define __swab16(x) \
-(__builtin_constant_p((uint16_t)(x)) ? \
- ___swab16((x)) : \
- __fswab16((x)))
-#  define __swab32(x) \
-(__builtin_constant_p((uint32_t)(x)) ? \
- ___swab32((x)) : \
- __fswab32((x)))
-#  define __swab64(x) \
-(__builtin_constant_p((uint64_t)(x)) ? \
- ___swab64((x)) : \
- __fswab64((x)))
-#else
-#  define __swab16(x) __fswab16(x)
-#  define __swab32(x) __fswab32(x)
-#  define __swab64(x) __fswab64(x)
-#endif /* OPTIMIZE */
-
-
-static inline attr_const uint16_t __fswab16(uint16_t x)
-{
-    return __arch__swab16(x);
-}
-static inline uint16_t __swab16p(const uint16_t *x)
-{
-    return __arch__swab16p(x);
-}
-static inline void __swab16s(uint16_t *addr)
-{
-    __arch__swab16s(addr);
-}
-
-static inline attr_const uint32_t __fswab32(uint32_t x)
-{
-    return __arch__swab32(x);
-}
-static inline uint32_t __swab32p(const uint32_t *x)
-{
-    return __arch__swab32p(x);
-}
-static inline void __swab32s(uint32_t *addr)
-{
-    __arch__swab32s(addr);
-}
-
-#ifdef __BYTEORDER_HAS_U64__
-static inline attr_const uint64_t __fswab64(uint64_t x)
-{
-#  ifdef __SWAB_64_THRU_32__
-    uint32_t h = x >> 32, l = x;
-    return ((uint64_t)__swab32(l) << 32) | __swab32(h);
-#  else
-    return __arch__swab64(x);
-#  endif
-}
-static inline uint64_t __swab64p(const uint64_t *x)
-{
-    return __arch__swab64p(x);
-}
-static inline void __swab64s(uint64_t *addr)
-{
-    __arch__swab64s(addr);
-}
-#endif /* __BYTEORDER_HAS_U64__ */
-
-#define swab16 __swab16
-#define swab32 __swab32
-#define swab64 __swab64
-#define swab16p __swab16p
-#define swab32p __swab32p
-#define swab64p __swab64p
-#define swab16s __swab16s
-#define swab32s __swab32s
-#define swab64s __swab64s
-
-#endif /* __XEN_BYTEORDER_SWAB_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 15:56:29 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 15:56:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959241.1351675 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o4r-0000E3-Hv; Fri, 18 Apr 2025 15:56:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959241.1351675; Fri, 18 Apr 2025 15:56:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o4r-0000Dv-Et; Fri, 18 Apr 2025 15:56:29 +0000
Received: by outflank-mailman (input) for mailman id 959241;
 Fri, 18 Apr 2025 15:56:27 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u5o4p-0000Dd-H4
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 15:56:27 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o4p-006Acq-1c
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:56:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o4p-007Kp1-1Q
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:56:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mXd9wNw/dwL785+Rz9Ui1UbC8WRxuII4GhM0TqTvnIs=; b=eCPxSf7hQIcTnFDhyYfpRutkSE
	uydOu3MlsAwpDTs5tDzH8qlZRNZs5a6b9cFby1PQJju1C3wxB9vA+VQQIelAtx1yn+8U3dRk+0ZMo
	hKwRjW31Z6d2CSjFSGJvv5ggQnNytcDvOCzxN+imTmUR5cKiJ8EyYK9WYblcgK2e6yyE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] crypto/vmac: Switch to xen/byteswap.h
Message-Id: <E1u5o4p-007Kp1-1Q@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 15:56:27 +0000

commit 0ffba0ac73e3de1ec426ab8bed83bb0e7c088320
Author:     Lin Liu <lin.liu@citrix.com>
AuthorDate: Mon Oct 18 10:32:39 2021 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    crypto/vmac: Switch to xen/byteswap.h
    
    This file has its own implementation of swap bytes. Clean up
    the code with xen/byteswap.h.
    
    No functional change.
    
    Signed-off-by: Lin Liu <lin.liu@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/crypto/vmac.c | 76 +++----------------------------------------------------
 1 file changed, 3 insertions(+), 73 deletions(-)

diff --git a/xen/crypto/vmac.c b/xen/crypto/vmac.c
index 294dd16a52..acb4e015f5 100644
--- a/xen/crypto/vmac.c
+++ b/xen/crypto/vmac.c
@@ -8,6 +8,7 @@
 
 /* start for Xen */
 #include <xen/init.h>
+#include <xen/byteswap.h>
 #include <xen/types.h>
 #include <xen/lib.h>
 #include <crypto/vmac.h>
@@ -50,7 +51,6 @@ const uint64_t mpoly = UINT64_C(0x1fffffff1fffffff);  /* Poly key mask     */
  * MUL64: 64x64->128-bit multiplication
  * PMUL64: assumes top bits cleared on inputs
  * ADD128: 128x128->128-bit addition
- * GET_REVERSED_64: load and byte-reverse 64-bit word  
  * ----------------------------------------------------------------------- */
 
 /* ----------------------------------------------------------------------- */
@@ -68,22 +68,6 @@ const uint64_t mpoly = UINT64_C(0x1fffffff1fffffff);  /* Poly key mask     */
 
 #define PMUL64 MUL64
 
-#define GET_REVERSED_64(p)                                                \
-    ({uint64_t x;                                                         \
-     asm ("bswapq %0" : "=r" (x) : "0"(*(uint64_t *)(p))); x;})
-
-/* ----------------------------------------------------------------------- */
-#elif (__GNUC__ && __i386__)
-/* ----------------------------------------------------------------------- */
-
-#define GET_REVERSED_64(p)                                                \
-    ({ uint64_t x;                                                        \
-    uint32_t *tp = (uint32_t *)(p);                                       \
-    asm  ("bswap %%edx\n\t"                                               \
-          "bswap %%eax"                                                   \
-    : "=A"(x)                                                             \
-    : "a"(tp[1]), "d"(tp[0]));                                            \
-    x; })
 
 /* ----------------------------------------------------------------------- */
 #elif (__GNUC__ && __ppc64__)
@@ -103,37 +87,6 @@ const uint64_t mpoly = UINT64_C(0x1fffffff1fffffff);  /* Poly key mask     */
 
 #define PMUL64 MUL64
 
-#define GET_REVERSED_64(p)                                                \
-    ({ uint32_t hi, lo, *_p = (uint32_t *)(p);                            \
-       asm volatile ("lwbrx %0, %1, %2" : "=r"(lo) : "b%"(0), "r"(_p) );  \
-       asm volatile ("lwbrx %0, %1, %2" : "=r"(hi) : "b%"(4), "r"(_p) );  \
-       ((uint64_t)hi << 32) | (uint64_t)lo; } )
-
-/* ----------------------------------------------------------------------- */
-#elif (__GNUC__ && (__ppc__ || __PPC__))
-/* ----------------------------------------------------------------------- */
-
-#define GET_REVERSED_64(p)                                                \
-    ({ uint32_t hi, lo, *_p = (uint32_t *)(p);                            \
-       asm volatile ("lwbrx %0, %1, %2" : "=r"(lo) : "b%"(0), "r"(_p) );  \
-       asm volatile ("lwbrx %0, %1, %2" : "=r"(hi) : "b%"(4), "r"(_p) );  \
-       ((uint64_t)hi << 32) | (uint64_t)lo; } )
-
-/* ----------------------------------------------------------------------- */
-#elif (__GNUC__ && (__ARMEL__ || __ARM__))
-/* ----------------------------------------------------------------------- */
-
-#define bswap32(v)                                                        \
-({ uint32_t tmp,out;                                                      \
-    asm volatile(                                                         \
-        "eor    %1, %2, %2, ror #16\n"                                    \
-        "bic    %1, %1, #0x00ff0000\n"                                    \
-        "mov    %0, %2, ror #8\n"                                         \
-        "eor    %0, %0, %1, lsr #8"                                       \
-    : "=r" (out), "=&r" (tmp)                                             \
-    : "r" (v));                                                           \
-    out;})
-
 /* ----------------------------------------------------------------------- */
 #elif _MSC_VER
 /* ----------------------------------------------------------------------- */
@@ -154,11 +107,6 @@ const uint64_t mpoly = UINT64_C(0x1fffffff1fffffff);  /* Poly key mask     */
         (rh) += (ih) + ((rl) < (_il));                               \
     }
 
-#if _MSC_VER >= 1300
-#define GET_REVERSED_64(p) _byteswap_uint64(*(uint64_t *)(p))
-#pragma intrinsic(_byteswap_uint64)
-#endif
-
 #if _MSC_VER >= 1400 && \
     (!defined(__INTEL_COMPILER) || __INTEL_COMPILER >= 1000)
 #define MUL32(i1,i2)    (__emulu((uint32_t)(i1),(uint32_t)(i2)))
@@ -219,24 +167,6 @@ const uint64_t mpoly = UINT64_C(0x1fffffff1fffffff);  /* Poly key mask     */
     }
 #endif
 
-#ifndef GET_REVERSED_64
-#ifndef bswap64
-#ifndef bswap32
-#define bswap32(x)                                                        \
-  ({ uint32_t bsx = (x);                                                  \
-      ((((bsx) & 0xff000000u) >> 24) | (((bsx) & 0x00ff0000u) >>  8) |    \
-       (((bsx) & 0x0000ff00u) <<  8) | (((bsx) & 0x000000ffu) << 24)); })
-#endif
-#define bswap64(x)                                                        \
-     ({ union { uint64_t ll; uint32_t l[2]; } w, r;                       \
-         w.ll = (x);                                                      \
-         r.l[0] = bswap32 (w.l[1]);                                       \
-         r.l[1] = bswap32 (w.l[0]);                                       \
-         r.ll; })
-#endif
-#define GET_REVERSED_64(p) bswap64(*(uint64_t *)(p)) 
-#endif
-
 /* ----------------------------------------------------------------------- */
 
 #if (VMAC_PREFER_BIG_ENDIAN)
@@ -247,9 +177,9 @@ const uint64_t mpoly = UINT64_C(0x1fffffff1fffffff);  /* Poly key mask     */
 
 #if (VMAC_ARCH_BIG_ENDIAN)
 #  define get64BE(ptr) (*(uint64_t *)(ptr))
-#  define get64LE(ptr) GET_REVERSED_64(ptr)
+#  define get64LE(ptr) bswap64(*(uint64_t *)(ptr))
 #else /* assume little-endian */
-#  define get64BE(ptr) GET_REVERSED_64(ptr)
+#  define get64BE(ptr) bswap64(*(uint64_t *)(ptr))
 #  define get64LE(ptr) (*(uint64_t *)(ptr))
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 15:56:39 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 15:56:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959242.1351679 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o51-0000HK-KT; Fri, 18 Apr 2025 15:56:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959242.1351679; Fri, 18 Apr 2025 15:56:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o51-0000HC-Hg; Fri, 18 Apr 2025 15:56:39 +0000
Received: by outflank-mailman (input) for mailman id 959242;
 Fri, 18 Apr 2025 15:56:37 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u5o4z-0000Gy-Lj
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 15:56:37 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o4z-006AdA-25
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:56:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o4z-007LMg-20
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:56:37 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=X3YQ2h0Fdbhma9uZ/APOy9uCK5S89ePlcUgr62CgUdI=; b=bZs4zawMqa8yKBgn0LMUjVasEJ
	y8kXbGFMQDujCZpEXNxorMYBEuOfQa7gmVAmNAGm2aMG8TaiDkfZaeuvzd31S/RNcWbW2P2czrpZh
	OF/K8jIb5n6PVVuxM/J7CMWtqHibDKxgAQFkLvIxtCzSjApCHeV9HapVX1DAxPfax3z4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xsm/flask: Switch {asm -> xen}/byteorder.h
Message-Id: <E1u5o4z-007LMg-20@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 15:56:37 +0000

commit 108a4cb33967eb967db18eff01511598e959b4a4
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 28 13:02:53 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    xsm/flask: Switch {asm -> xen}/byteorder.h
    
    Sort the includes while at it.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/xsm/flask/ss/avtab.c       | 4 ++--
 xen/xsm/flask/ss/conditional.c | 9 ++++-----
 xen/xsm/flask/ss/ebitmap.c     | 9 ++++-----
 xen/xsm/flask/ss/policydb.c    | 7 +++----
 4 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/xen/xsm/flask/ss/avtab.c b/xen/xsm/flask/ss/avtab.c
index 9761d028d8..2d07917e79 100644
--- a/xen/xsm/flask/ss/avtab.c
+++ b/xen/xsm/flask/ss/avtab.c
@@ -19,11 +19,11 @@
 
 /* Ported to Xen 3.0, George Coker, <gscoker@alpha.ncsc.mil> */
 
+#include <xen/byteorder.h>
+#include <xen/errno.h>
 #include <xen/lib.h>
-#include <asm/byteorder.h>
 #include <xen/types.h>
 #include <xen/xmalloc.h>
-#include <xen/errno.h>
 
 #include "avtab.h"
 #include "policydb.h"
diff --git a/xen/xsm/flask/ss/conditional.c b/xen/xsm/flask/ss/conditional.c
index d314f772b4..a0d2555962 100644
--- a/xen/xsm/flask/ss/conditional.c
+++ b/xen/xsm/flask/ss/conditional.c
@@ -9,15 +9,14 @@
 
 /* Ported to Xen 3.0, George Coker, <gscoker@alpha.ncsc.mil> */
 
-#include <xen/lib.h>
-#include <xen/types.h>
+#include <xen/byteorder.h>
 #include <xen/errno.h>
-#include <xen/string.h>
+#include <xen/lib.h>
 #include <xen/spinlock.h>
+#include <xen/string.h>
+#include <xen/types.h>
 #include <xen/xmalloc.h>
 
-#include <asm/byteorder.h>
-
 #include "security.h"
 #include "conditional.h"
 
diff --git a/xen/xsm/flask/ss/ebitmap.c b/xen/xsm/flask/ss/ebitmap.c
index 1db69d9ad1..1ced81ea02 100644
--- a/xen/xsm/flask/ss/ebitmap.c
+++ b/xen/xsm/flask/ss/ebitmap.c
@@ -10,13 +10,12 @@
 
 /* Ported to Xen 3.0, George Coker, <gscoker@alpha.ncsc.mil> */
 
-#include <xen/lib.h>
-#include <xen/xmalloc.h>
+#include <xen/bitmap.h>
+#include <xen/byteorder.h>
 #include <xen/errno.h>
+#include <xen/lib.h>
 #include <xen/spinlock.h>
-#include <xen/bitmap.h>
-
-#include <asm/byteorder.h>
+#include <xen/xmalloc.h>
 
 #include "ebitmap.h"
 #include "policydb.h"
diff --git a/xen/xsm/flask/ss/policydb.c b/xen/xsm/flask/ss/policydb.c
index 5af45fdc27..165304c133 100644
--- a/xen/xsm/flask/ss/policydb.c
+++ b/xen/xsm/flask/ss/policydb.c
@@ -22,13 +22,12 @@
 
 /* Ported to Xen 3.0, George Coker, <gscoker@alpha.ncsc.mil> */
 
+#include <xen/byteorder.h>
+#include <xen/errno.h>
 #include <xen/lib.h>
+#include <xen/string.h>
 #include <xen/types.h>
 #include <xen/xmalloc.h>
-#include <xen/string.h>
-#include <xen/errno.h>
-
-#include <asm/byteorder.h>
 
 #include <conditional.h>
 #include "security.h"
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 15:56:49 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 15:56:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959243.1351683 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o5B-0000KA-Lj; Fri, 18 Apr 2025 15:56:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959243.1351683; Fri, 18 Apr 2025 15:56:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o5B-0000K3-J1; Fri, 18 Apr 2025 15:56:49 +0000
Received: by outflank-mailman (input) for mailman id 959243;
 Fri, 18 Apr 2025 15:56:47 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u5o59-0000Jj-Pj
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 15:56:47 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o59-006Ae6-2U
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:56:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o59-007LqU-2O
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:56:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=15AEQ5AXBPFMUG743DW5BB4Gwwn4UboMC7wcsb9o38M=; b=17ASTBWZX1v+Nzh7adT6a0L9AA
	BegvIw0sGa+ikmRvBwAQrq1SOKRHRspVmlJB48Y+rmazy0NzH2DcC31rci5jORNgCyiXRz7eZsBe8
	7k3AGLCFOKM3Xx64rK4LQ9XdSxqxd5CQtOYbJsLdoIC+HMKCvZiMNkCg24zIkk4JkPGw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/common: Switch {asm -> xen}/byteorder.h
Message-Id: <E1u5o59-007LqU-2O@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 15:56:47 +0000

commit 2ccaaa52b4c58e2725c83e9ab1df225449aca68b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 28 13:06:42 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    xen/common: Switch {asm -> xen}/byteorder.h
    
    Sort the includes.  Drop useless includes of xen/types.h
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/bitmap.c                 | 5 ++---
 xen/common/libelf/libelf-private.h  | 3 ++-
 xen/drivers/char/ehci-dbgp.c        | 4 +++-
 xen/include/xen/bitmap.h            | 2 +-
 xen/include/xen/device_tree.h       | 3 ++-
 xen/include/xen/libfdt/libfdt_env.h | 3 +--
 xen/include/xen/unaligned.h         | 3 +--
 7 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/xen/common/bitmap.c b/xen/common/bitmap.c
index 6c4af09c18..bf1a7fd91e 100644
--- a/xen/common/bitmap.c
+++ b/xen/common/bitmap.c
@@ -5,14 +5,13 @@
  * This source code is licensed under the GNU General Public License,
  * Version 2.  See the file COPYING for more details.
  */
-#include <xen/types.h>
-#include <xen/errno.h>
 #include <xen/bitmap.h>
 #include <xen/bitops.h>
+#include <xen/byteorder.h>
 #include <xen/cpumask.h>
+#include <xen/errno.h>
 #include <xen/guest_access.h>
 #include <xen/lib.h>
-#include <asm/byteorder.h>
 
 /*
  * bitmaps provide an array of bits, implemented using an an
diff --git a/xen/common/libelf/libelf-private.h b/xen/common/libelf/libelf-private.h
index 65417dffc8..e5c9cc1099 100644
--- a/xen/common/libelf/libelf-private.h
+++ b/xen/common/libelf/libelf-private.h
@@ -17,10 +17,11 @@
 
 #ifdef __XEN__
 
+#include <xen/byteorder.h>
 #include <xen/lib.h>
 #include <xen/libelf.h>
 #include <xen/softirq.h>
-#include <asm/byteorder.h>
+
 #include <public/elfnote.h>
 
 /* we would like to use elf->log_callback but we can't because
diff --git a/xen/drivers/char/ehci-dbgp.c b/xen/drivers/char/ehci-dbgp.c
index 1ad3c6bebf..e9cd59b254 100644
--- a/xen/drivers/char/ehci-dbgp.c
+++ b/xen/drivers/char/ehci-dbgp.c
@@ -5,15 +5,17 @@
  * Linux; see the Linux source for authorship and copyrights.
  */
 
+#include <xen/byteorder.h>
 #include <xen/console.h>
 #include <xen/delay.h>
 #include <xen/errno.h>
 #include <xen/param.h>
 #include <xen/pci.h>
 #include <xen/serial.h>
-#include <asm/byteorder.h>
+
 #include <asm/io.h>
 #include <asm/fixmap.h>
+
 #include <public/physdev.h>
 
 /* #define DBGP_DEBUG */
diff --git a/xen/include/xen/bitmap.h b/xen/include/xen/bitmap.h
index 4b642cd420..b5e9cdd3db 100644
--- a/xen/include/xen/bitmap.h
+++ b/xen/include/xen/bitmap.h
@@ -230,7 +230,7 @@ static inline unsigned int bitmap_weight(const unsigned long *src,
 	return __bitmap_weight(src, nbits);
 }
 
-#include <asm/byteorder.h>
+#include <xen/byteorder.h>
 
 #ifdef __LITTLE_ENDIAN
 #define BITMAP_MEM_ALIGNMENT 8
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index 0ff80fda04..6dc1fb5159 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -10,7 +10,8 @@
 #ifndef __XEN_DEVICE_TREE_H__
 #define __XEN_DEVICE_TREE_H__
 
-#include <asm/byteorder.h>
+#include <xen/byteorder.h>
+
 #include <asm/device.h>
 #include <public/xen.h>
 #include <public/device_tree_defs.h>
diff --git a/xen/include/xen/libfdt/libfdt_env.h b/xen/include/xen/libfdt/libfdt_env.h
index 8368787391..04abc6bb68 100644
--- a/xen/include/xen/libfdt/libfdt_env.h
+++ b/xen/include/xen/libfdt/libfdt_env.h
@@ -7,9 +7,8 @@
  * Copyright 2012 Kim Phillips, Freescale Semiconductor.
  */
 
-#include <xen/types.h>
+#include <xen/byteorder.h>
 #include <xen/string.h>
-#include <asm/byteorder.h>
 
 #ifdef __CHECKER__
 #define FDT_FORCE __attribute__((force))
diff --git a/xen/include/xen/unaligned.h b/xen/include/xen/unaligned.h
index 8c8b08338b..e64813ab4b 100644
--- a/xen/include/xen/unaligned.h
+++ b/xen/include/xen/unaligned.h
@@ -3,8 +3,7 @@
 #define __XEN_UNALIGNED_H__
 
 #ifdef __XEN__
-#include <xen/types.h>
-#include <asm/byteorder.h>
+#include <xen/byteorder.h>
 #endif
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 15:56:59 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 15:56:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959244.1351687 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o5L-0000Mw-NI; Fri, 18 Apr 2025 15:56:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959244.1351687; Fri, 18 Apr 2025 15:56:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o5L-0000Mq-Kb; Fri, 18 Apr 2025 15:56:59 +0000
Received: by outflank-mailman (input) for mailman id 959244;
 Fri, 18 Apr 2025 15:56:57 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u5o5J-0000Mb-ST
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 15:56:57 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o5J-006AiQ-2l
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:56:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o5J-007MID-2f
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:56:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9Ui5oaQYTOBjNCK+RRrYXm3kmleZcBPvJcYO8LFcuyk=; b=K/7JtNpZ3dpIv1NB/RfVTk8rh9
	WfSeUGpRHrF69McL2PMyXOMgGUI1X4rM9giYKctzvftPrkXB1/DgPMEKvdhWhxCBBUHCsyXyn+Xf4
	gaTduGjKrW+mq/OavhYx5YtpxB3EcSFkeCjCbvafrYY6/vm5H03w4kyRHxPnqJFyAGNk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm: Remove asm/byteorder.h
Message-Id: <E1u5o5J-007MID-2f@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 15:56:57 +0000

commit ce3ae8338060f21dcee1146734fe4a666d07d05e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 28 13:11:06 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    arm: Remove asm/byteorder.h
    
    With the common code moved fully onto xen/byteorder.h, clean up the dregs.
    
    Sort includes in some files while swapping over to xen/byteorder.h.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/alternative.c           |  6 +++---
 xen/arch/arm/arm64/livepatch.c       |  2 +-
 xen/arch/arm/include/asm/arm32/io.h  |  3 ++-
 xen/arch/arm/include/asm/arm64/io.h  |  3 ++-
 xen/arch/arm/include/asm/byteorder.h | 14 --------------
 xen/arch/arm/kernel.c                |  2 +-
 xen/arch/arm/vgic/vgic-mmio.c        |  3 ++-
 7 files changed, 11 insertions(+), 22 deletions(-)

diff --git a/xen/arch/arm/alternative.c b/xen/arch/arm/alternative.c
index 2c1af6e7e4..adb9b7d881 100644
--- a/xen/arch/arm/alternative.c
+++ b/xen/arch/arm/alternative.c
@@ -6,18 +6,18 @@
  * Copyright (C) 2014-2016 ARM Ltd.
  */
 
+#include <xen/byteorder.h>
 #include <xen/init.h>
-#include <xen/types.h>
 #include <xen/kernel.h>
 #include <xen/llc-coloring.h>
 #include <xen/mm.h>
-#include <xen/vmap.h>
 #include <xen/smp.h>
 #include <xen/stop_machine.h>
 #include <xen/virtual_region.h>
+#include <xen/vmap.h>
+
 #include <asm/alternative.h>
 #include <asm/atomic.h>
-#include <asm/byteorder.h>
 #include <asm/cpufeature.h>
 #include <asm/insn.h>
 #include <asm/page.h>
diff --git a/xen/arch/arm/arm64/livepatch.c b/xen/arch/arm/arm64/livepatch.c
index 6efe4ec770..e135bd5bf9 100644
--- a/xen/arch/arm/arm64/livepatch.c
+++ b/xen/arch/arm/arm64/livepatch.c
@@ -3,6 +3,7 @@
  */
 
 #include <xen/bitops.h>
+#include <xen/byteorder.h>
 #include <xen/errno.h>
 #include <xen/lib.h>
 #include <xen/livepatch_elf.h>
@@ -11,7 +12,6 @@
 #include <xen/vmap.h>
 
 #include <asm/bitops.h>
-#include <asm/byteorder.h>
 #include <asm/insn.h>
 #include <asm/livepatch.h>
 
diff --git a/xen/arch/arm/include/asm/arm32/io.h b/xen/arch/arm/include/asm/arm32/io.h
index 782b564809..fb0425e629 100644
--- a/xen/arch/arm/include/asm/arm32/io.h
+++ b/xen/arch/arm/include/asm/arm32/io.h
@@ -21,8 +21,9 @@
 #ifndef _ARM_ARM32_IO_H
 #define _ARM_ARM32_IO_H
 
+#include <xen/byteorder.h>
+
 #include <asm/system.h>
-#include <asm/byteorder.h>
 
 static inline void __raw_writeb(u8 val, volatile void __iomem *addr)
 {
diff --git a/xen/arch/arm/include/asm/arm64/io.h b/xen/arch/arm/include/asm/arm64/io.h
index 2e2ab24f78..7d59598777 100644
--- a/xen/arch/arm/include/asm/arm64/io.h
+++ b/xen/arch/arm/include/asm/arm64/io.h
@@ -20,8 +20,9 @@
 #ifndef _ARM_ARM64_IO_H
 #define _ARM_ARM64_IO_H
 
+#include <xen/byteorder.h>
+
 #include <asm/system.h>
-#include <asm/byteorder.h>
 #include <asm/alternative.h>
 
 /*
diff --git a/xen/arch/arm/include/asm/byteorder.h b/xen/arch/arm/include/asm/byteorder.h
deleted file mode 100644
index 7f1419c45a..0000000000
--- a/xen/arch/arm/include/asm/byteorder.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef __ASM_ARM_BYTEORDER_H__
-#define __ASM_ARM_BYTEORDER_H__
-
-#include <xen/byteorder.h>
-
-#endif /* __ASM_ARM_BYTEORDER_H__ */
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
index 6eaf9e2b06..2647812e8e 100644
--- a/xen/arch/arm/kernel.c
+++ b/xen/arch/arm/kernel.c
@@ -4,6 +4,7 @@
  *
  * Copyright (C) 2011 Citrix Systems, Inc.
  */
+#include <xen/byteorder.h>
 #include <xen/domain_page.h>
 #include <xen/errno.h>
 #include <xen/guest_access.h>
@@ -15,7 +16,6 @@
 #include <xen/sched.h>
 #include <xen/vmap.h>
 
-#include <asm/byteorder.h>
 #include <asm/kernel.h>
 #include <asm/setup.h>
 
diff --git a/xen/arch/arm/vgic/vgic-mmio.c b/xen/arch/arm/vgic/vgic-mmio.c
index b4ba34cfc3..d2bcb32cd7 100644
--- a/xen/arch/arm/vgic/vgic-mmio.c
+++ b/xen/arch/arm/vgic/vgic-mmio.c
@@ -14,10 +14,11 @@
 
 #include <xen/bitops.h>
 #include <xen/bsearch.h>
+#include <xen/byteorder.h>
 #include <xen/lib.h>
 #include <xen/sched.h>
+
 #include <asm/new_vgic.h>
-#include <asm/byteorder.h>
 
 #include "vgic.h"
 #include "vgic-mmio.h"
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 15:57:09 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 15:57:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959245.1351691 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o5V-0000Pg-Oh; Fri, 18 Apr 2025 15:57:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959245.1351691; Fri, 18 Apr 2025 15:57:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o5V-0000PY-M2; Fri, 18 Apr 2025 15:57:09 +0000
Received: by outflank-mailman (input) for mailman id 959245;
 Fri, 18 Apr 2025 15:57:08 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u5o5U-0000PL-3z
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 15:57:08 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o5U-006Aj5-0J
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:57:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o5U-007Mgi-03
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:57:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=iK5+KzY0KsKob9iNpRMycI6qa3G+7V5Ay8LoN7da7qc=; b=zf2x14lJWTWc5/hcNH7zMy6nTQ
	Mc4EArYrZKtdOIpP30HHvr0SQYJlPH+JCCXASHvjfIvq3xoQoZtaK6nR9SJMniK9VbDF6HX25tWcW
	QCQ6+LJPVL3VfIabSgURBfd2A0++Y1WVCSgSOkuTzOKH9Im4GOoR8+KFPTPvV2jLWfMg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] ppc: Drop asm/byteorder.h
Message-Id: <E1u5o5U-007Mgi-03@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 15:57:08 +0000

commit acec467875cd84155e5e885944466950a649ff85
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 28 13:10:58 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    ppc: Drop asm/byteorder.h
    
    With the common code moved fully onto xen/byteorder.h, clean up the dregs.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/ppc/include/asm/byteorder.h | 6 ------
 xen/arch/ppc/include/asm/page.h      | 4 +---
 xen/arch/ppc/mm-radix.c              | 2 +-
 3 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/xen/arch/ppc/include/asm/byteorder.h b/xen/arch/ppc/include/asm/byteorder.h
deleted file mode 100644
index 8df6adbf0d..0000000000
--- a/xen/arch/ppc/include/asm/byteorder.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _ASM_PPC_BYTEORDER_H
-#define _ASM_PPC_BYTEORDER_H
-
-#include <xen/byteorder.h>
-
-#endif /* _ASM_PPC_BYTEORDER_H */
diff --git a/xen/arch/ppc/include/asm/page.h b/xen/arch/ppc/include/asm/page.h
index 6d4cd2611c..c6160afcfd 100644
--- a/xen/arch/ppc/include/asm/page.h
+++ b/xen/arch/ppc/include/asm/page.h
@@ -3,9 +3,7 @@
 #define _ASM_PPC_PAGE_H
 
 #include <xen/bitops.h>
-#include <xen/types.h>
-
-#include <asm/byteorder.h>
+#include <xen/byteorder.h>
 
 #define PDE_VALID     PPC_BIT(0)
 #define PDE_NLB_MASK  0x1ffffffffffffe0UL
diff --git a/xen/arch/ppc/mm-radix.c b/xen/arch/ppc/mm-radix.c
index 24232f3907..9a00ae416a 100644
--- a/xen/arch/ppc/mm-radix.c
+++ b/xen/arch/ppc/mm-radix.c
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 #include <xen/bitops.h>
+#include <xen/byteorder.h>
 #include <xen/init.h>
 #include <xen/kernel.h>
 #include <xen/mm.h>
@@ -7,7 +8,6 @@
 #include <xen/types.h>
 #include <xen/lib.h>
 
-#include <asm/byteorder.h>
 #include <asm/early_printk.h>
 #include <asm/page.h>
 #include <asm/processor.h>
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 15:57:19 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 15:57:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959246.1351695 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o5f-0000SF-QB; Fri, 18 Apr 2025 15:57:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959246.1351695; Fri, 18 Apr 2025 15:57:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o5f-0000S7-NP; Fri, 18 Apr 2025 15:57:19 +0000
Received: by outflank-mailman (input) for mailman id 959246;
 Fri, 18 Apr 2025 15:57:18 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u5o5e-0000Rp-8y
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 15:57:18 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o5e-006AjU-0o
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:57:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o5e-007NEB-0i
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:57:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZeYD52fEqfCo5HsBVqFQ7dDwQj55Wi8Ngx5FDh/cFAA=; b=6UQLZG2TF3c2mkFQ5Twtu+q7Ur
	8ONhqMmDtY6oPJktbh2l78ibQTiGJY6tf2mbi0P4505LqtOuw8qigI22aKyaXKzF8n3W6eFsMXLy6
	4i8F0K0hW6w0b0fbjYausX5myRlGmxhx3Tw1xk/RI6Iqtuzj5phzetL8UNvqHg1b672s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] riscv: Remove asm/byteorder.h
Message-Id: <E1u5o5e-007NEB-0i@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 15:57:18 +0000

commit 7aed4daa38ddf0b505eb107565c89ab06b121fb7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 28 11:50:16 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    riscv: Remove asm/byteorder.h
    
    With the common code moved fully onto xen/byteorder.h, clean up the dregs.
    
    The use of byteorder.h in io.h appears to have been copy&paste from ARM.  It's
    not needed, but macros and types are.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/riscv/include/asm/byteorder.h | 14 --------------
 xen/arch/riscv/include/asm/io.h        |  3 ++-
 2 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/xen/arch/riscv/include/asm/byteorder.h b/xen/arch/riscv/include/asm/byteorder.h
deleted file mode 100644
index a32bca02df..0000000000
--- a/xen/arch/riscv/include/asm/byteorder.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef ASM__RISCV__BYTEORDER_H
-#define ASM__RISCV__BYTEORDER_H
-
-#include <xen/byteorder.h>
-
-#endif /* ASM__RISCV__BYTEORDER_H */
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/xen/arch/riscv/include/asm/io.h b/xen/arch/riscv/include/asm/io.h
index 55f329dde3..8bab4ffa03 100644
--- a/xen/arch/riscv/include/asm/io.h
+++ b/xen/arch/riscv/include/asm/io.h
@@ -38,7 +38,8 @@
 #ifndef ASM__RISCV__IO_H
 #define ASM__RISCV__IO_H
 
-#include <asm/byteorder.h>
+#include <xen/macros.h>
+#include <xen/types.h>
 
 /*
  * The RISC-V ISA doesn't yet specify how to query or modify PMAs, so we can't
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 15:57:29 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 15:57:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959247.1351699 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o5p-0000Uj-RT; Fri, 18 Apr 2025 15:57:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959247.1351699; Fri, 18 Apr 2025 15:57:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o5p-0000Uc-Ol; Fri, 18 Apr 2025 15:57:29 +0000
Received: by outflank-mailman (input) for mailman id 959247;
 Fri, 18 Apr 2025 15:57:28 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u5o5o-0000UQ-DM
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 15:57:28 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o5o-006Ajj-1F
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:57:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o5o-007NpH-18
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:57:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vzDaLrMjiINioIPIVRthyKwILsyssfITAu1NcKlc8VM=; b=p38U9fAr/6WmPCL1f/OaxjH10U
	YEc3WueNuBajowwyZCGJwnUzBha1QDORXCKQ7v0tLnHG7XItm6AutpyNhfbj8ZZdFGbWJtv06Zi3E
	FD/u0aQORGEuefuBMcgZBYIKp/NTM3LqfGLZaCm4i6E9d0PEj6sli8M4gXFPcCDRFiqE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: Drop asm/byteorder.h
Message-Id: <E1u5o5o-007NpH-18@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 15:57:28 +0000

commit 209ab249bd93c2932bf02307aa51dd062a7c3ef6
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 28 11:19:23 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    x86: Drop asm/byteorder.h
    
    With the common code moved fully onto xen/byteorder.h, clean up the dregs.
    
    It turns out that msi.h has not needed byteorder.h since the use of
    __{BIG,LITTLE}_ENDIAN_BITFIELD was dropped in commit d58f3941ce3f ("x86/MSI:
    use standard C types in structures/unions").
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/byteorder.h | 6 ------
 xen/arch/x86/include/asm/msi.h       | 1 -
 2 files changed, 7 deletions(-)

diff --git a/xen/arch/x86/include/asm/byteorder.h b/xen/arch/x86/include/asm/byteorder.h
deleted file mode 100644
index 3524a6cee7..0000000000
--- a/xen/arch/x86/include/asm/byteorder.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __ASM_X86_BYTEORDER_H__
-#define __ASM_X86_BYTEORDER_H__
-
-#include <xen/byteorder.h>
-
-#endif /* __ASM_X86_BYTEORDER_H__ */
diff --git a/xen/arch/x86/include/asm/msi.h b/xen/arch/x86/include/asm/msi.h
index 975d0f26b3..00059d4a3a 100644
--- a/xen/arch/x86/include/asm/msi.h
+++ b/xen/arch/x86/include/asm/msi.h
@@ -3,7 +3,6 @@
 
 #include <xen/cpumask.h>
 #include <xen/pci.h>
-#include <asm/byteorder.h>
 #include <asm/hvm/vmx/vmcs.h>
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 15:57:39 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 15:57:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959248.1351704 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o5z-0000XI-U0; Fri, 18 Apr 2025 15:57:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959248.1351704; Fri, 18 Apr 2025 15:57:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5o5z-0000XA-QE; Fri, 18 Apr 2025 15:57:39 +0000
Received: by outflank-mailman (input) for mailman id 959248;
 Fri, 18 Apr 2025 15:57:38 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u5o5y-0000Wv-GG
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 15:57:38 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o5y-006Ak6-1W
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:57:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5o5y-007ORb-1Q
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 15:57:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nvt2PlDRPKJdiDw+7abKbdX1P8csmqbod1ea79TGaao=; b=tdzZJCMemFSObD309DMmsdFpAL
	UeK4ViSp4oJAQN9G698TA8PIuhMl/qZT14lGD5vlXPjW5ObLET7tpnQ6DoBcgCN1dOO+qjhyMR8uU
	XsEqtV3YJDIO2RFVHkQbx+2E3Qd9qg9IhlfZkJsc7eHfGHFziae7s4ZMqz0daQPXeyww=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] vmx: Don't open-code vmresume/vmlaunch instructions
Message-Id: <E1u5o5y-007ORb-1Q@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 15:57:38 +0000

commit 64cf7a80a17a017a6b88ea17c7f490e42baefcca
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Thu Apr 17 14:24:44 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 18 15:16:12 2025 +0100

    vmx: Don't open-code vmresume/vmlaunch instructions
    
    binutils 2.25 has support for assembling vmresume/vmlaunch
    instructions, so we don't need to open-code the byte sequences
    for these opcodes anymore.
    
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/vmx/entry.S | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/entry.S b/xen/arch/x86/hvm/vmx/entry.S
index 6aaeb28a5b..2bfee715b3 100644
--- a/xen/arch/x86/hvm/vmx/entry.S
+++ b/xen/arch/x86/hvm/vmx/entry.S
@@ -21,9 +21,6 @@
 #include <asm/asm_defns.h>
 #include <asm/page.h>
 
-#define VMRESUME     .byte 0x0f,0x01,0xc3
-#define VMLAUNCH     .byte 0x0f,0x01,0xc2
-
 FUNC(vmx_asm_vmexit_handler)
         SAVE_ALL
 
@@ -166,11 +163,11 @@ UNLIKELY_END(realmode)
         jns  .Lvmx_launch
 
 /*.Lvmx_resume:*/
-        VMRESUME
+        vmresume
         jmp  .Lvmx_vmentry_fail
 
 .Lvmx_launch:
-        VMLAUNCH
+        vmlaunch
 
 .Lvmx_vmentry_fail:
         sti
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 20:44:10 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 20:44:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959393.1351736 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5sZA-0001Bn-Da; Fri, 18 Apr 2025 20:44:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959393.1351736; Fri, 18 Apr 2025 20: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 1u5sZA-0001Bf-Av; Fri, 18 Apr 2025 20:44:04 +0000
Received: by outflank-mailman (input) for mailman id 959393;
 Fri, 18 Apr 2025 20: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 1u5sZ8-0001BZ-O3
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 20: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 1u5sZ8-006NYC-1s
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 20:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5sZ8-00ChoD-1h
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 20: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=3Fc/SPwPWDTC+Aso+51eaH1wMkTzJMxqpfp4Ky/wJaQ=; b=l7kjrxr+5/imquTArfIFpzuIM/
	nfITs6NGE8Dx8/yctKTie58KEpmcmkXMn8rHBD2aVWpEJzK0EM5q5qDZR/+n+QROO97UN+CMDzDyg
	yatNwCmLYyvnRyy7ChoIm+vYxhELyTpAbPCa2gcbQMcP6ljbavypTHWbODpcQJ1w3iOc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: introduce hardware domain create flag
Message-Id: <E1u5sZ8-00ChoD-1h@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 20:44:02 +0000

commit b959f3b820f5998e0894c2944ccc95727b71987a
Author:     Daniel P. Smith <dpsmith@apertussolutions.com>
AuthorDate: Wed Apr 16 17:29:05 2025 -0400
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Fri Apr 18 13:41:25 2025 -0700

    xen: introduce hardware domain create flag
    
    Add and use a new internal create domain flag to specify the hardware
    domain.  This removes the hardcoding of domid 0 as the hardware domain.
    
    This allows more flexibility with domain creation.
    
    The assignment of d->cdf is moved later so CDF_hardware is added for the
    late_hwdom case.  Also old_hwdom has the flag removed to reflect the
    change.
    
    Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/domain_build.c |  2 +-
 xen/arch/x86/setup.c        |  3 ++-
 xen/common/domain.c         | 19 +++++++++++++++----
 xen/include/xen/domain.h    |  2 ++
 4 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 634333cdde..b8f282ff10 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -2369,7 +2369,7 @@ void __init create_dom0(void)
         .max_maptrack_frames = -1,
         .grant_opts = XEN_DOMCTL_GRANT_version(opt_gnttab_max_version),
     };
-    unsigned int flags = CDF_privileged;
+    unsigned int flags = CDF_privileged | CDF_hardware;
     int rc;
 
     /* The vGIC for DOM0 is exactly emulating the hardware GIC */
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 3c257f0bad..24b36c1a59 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1011,7 +1011,8 @@ static struct domain *__init create_dom0(struct boot_info *bi)
 
     /* Create initial domain.  Not d0 for pvshim. */
     bd->domid = get_initial_domain_id();
-    d = domain_create(bd->domid, &dom0_cfg, pv_shim ? 0 : CDF_privileged);
+    d = domain_create(bd->domid, &dom0_cfg,
+                      pv_shim ? 0 : CDF_privileged | CDF_hardware);
     if ( IS_ERR(d) )
         panic("Error creating d%u: %ld\n", bd->domid, PTR_ERR(d));
 
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 585fd726a9..abf1969e60 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -804,9 +804,6 @@ struct domain *domain_create(domid_t domid,
     d->domain_id = domid;
     d->unique_id = get_unique_id();
 
-    /* Holding CDF_* internal flags. */
-    d->cdf = flags;
-
     /* Debug sanity. */
     ASSERT(is_system_domain(d) ? config == NULL : config != NULL);
 
@@ -820,15 +817,25 @@ struct domain *domain_create(domid_t domid,
     d->is_privileged = flags & CDF_privileged;
 
     /* Sort out our idea of is_hardware_domain(). */
-    if ( domid == 0 || domid == hardware_domid )
+    if ( (flags & CDF_hardware) || domid == hardware_domid )
     {
         if ( hardware_domid < 0 || hardware_domid >= DOMID_FIRST_RESERVED )
             panic("The value of hardware_dom must be a valid domain ID\n");
 
+        /* late_hwdom is only allowed for dom0. */
+        if ( hardware_domain && hardware_domain->domain_id )
+            return ERR_PTR(-EINVAL);
+
         old_hwdom = hardware_domain;
         hardware_domain = d;
+        flags |= CDF_hardware;
+        if ( old_hwdom )
+            old_hwdom->cdf &= ~CDF_hardware;
     }
 
+    /* Holding CDF_* internal flags. */
+    d->cdf = flags;
+
     TRACE_TIME(TRC_DOM0_DOM_ADD, d->domain_id);
 
     lock_profile_register_struct(LOCKPROF_TYPE_PERDOM, d, domid);
@@ -973,7 +980,11 @@ struct domain *domain_create(domid_t domid,
 
     d->is_dying = DOMDYING_dead;
     if ( hardware_domain == d )
+    {
+        if ( old_hwdom )
+            old_hwdom->cdf |= CDF_hardware;
         hardware_domain = old_hwdom;
+    }
     atomic_set(&d->refcnt, DOMAIN_DESTROYED);
 
     sched_destroy_domain(d);
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index a34daa7d10..e10baf2615 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -53,6 +53,8 @@ domid_t get_initial_domain_id(void);
 #else
 #define CDF_staticmem            0
 #endif
+/* This is the hardware domain.  Only 1 allowed. */
+#define CDF_hardware             (1U << 3)
 
 #define is_domain_direct_mapped(d) ((d)->cdf & CDF_directmap)
 #define is_domain_using_staticmem(d) ((d)->cdf & CDF_staticmem)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 20:44:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 20:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959394.1351740 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5sZK-0001DH-FB; Fri, 18 Apr 2025 20:44:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959394.1351740; Fri, 18 Apr 2025 20: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 1u5sZK-0001D9-CL; Fri, 18 Apr 2025 20:44:14 +0000
Received: by outflank-mailman (input) for mailman id 959394;
 Fri, 18 Apr 2025 20: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 1u5sZI-0001Cx-N9
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 20: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 1u5sZI-006NYe-2C
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 20:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5sZI-00Chqv-25
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 20: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=f7Bam2P5VEjejlOYFbXPjKrsOgPGpu4XyGj6YHAq9PU=; b=KXMxyCSK9pdsX3RG2BmT/Zr++3
	wVat1PoDbb/mZD05h2Ppjw6UAs8fjVopg0ORkSGZHoJmRZFomjNuZaJh8+l5vCzlu1yqUUNxfN2M6
	WnLHJzb0dmIJUT4ghKWJuh1pVQyvpz65jwXSFOnUDC+x30evi8VJ4GV5ItNqILBvkYZU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: dom0less hwdom construction
Message-Id: <E1u5sZI-00Chqv-25@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 20:44:12 +0000

commit 52cb53f1816a2c92aedbdf857065e3e2e2d99099
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Wed Apr 16 17:29:06 2025 -0400
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Fri Apr 18 13:41:29 2025 -0700

    xen/arm: dom0less hwdom construction
    
    When creating a hardware domain, have the dom0less code call
    construct_hwdom() which is shared with the dom0 code.  The hardware
    domain requires building that best matches the dom0 build path.  Re-use
    it to keep them in sync.
    
    The device tree node of the dom0less config is now passed into
    construct_hwdom().  dom0 uses /chosen for process_shm while a hwdom will
    use the value from its dom0less device tree node.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/dom0less-build.c           | 57 +++++++++++++++++++--------------
 xen/arch/arm/domain_build.c             |  7 ++--
 xen/arch/arm/include/asm/domain_build.h |  3 +-
 3 files changed, 39 insertions(+), 28 deletions(-)

diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index bd15563750..7bc6a6c4d7 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -929,36 +929,45 @@ static int __init construct_domU(struct domain *d,
     /* type must be set before allocate memory */
     d->arch.type = kinfo.type;
 #endif
-    if ( !dt_find_property(node, "xen,static-mem", NULL) )
-        allocate_memory(d, &kinfo);
-    else if ( !is_domain_direct_mapped(d) )
-        allocate_static_memory(d, &kinfo, node);
-    else
-        assign_static_memory_11(d, &kinfo, node);
-
-    rc = process_shm(d, &kinfo, node);
-    if ( rc < 0 )
-        return rc;
-
-    /*
-     * Base address and irq number are needed when creating vpl011 device
-     * tree node in prepare_dtb_domU, so initialization on related variables
-     * shall be done first.
-     */
-    if ( kinfo.vpl011 )
+    if ( is_hardware_domain(d) )
     {
-        rc = domain_vpl011_init(d, NULL);
+        rc = construct_hwdom(&kinfo, node);
         if ( rc < 0 )
             return rc;
     }
+    else
+    {
+        if ( !dt_find_property(node, "xen,static-mem", NULL) )
+            allocate_memory(d, &kinfo);
+        else if ( !is_domain_direct_mapped(d) )
+            allocate_static_memory(d, &kinfo, node);
+        else
+            assign_static_memory_11(d, &kinfo, node);
 
-    rc = prepare_dtb_domU(d, &kinfo);
-    if ( rc < 0 )
-        return rc;
+        rc = process_shm(d, &kinfo, node);
+        if ( rc < 0 )
+            return rc;
 
-    rc = construct_domain(d, &kinfo);
-    if ( rc < 0 )
-        return rc;
+        /*
+         * Base address and irq number are needed when creating vpl011 device
+         * tree node in prepare_dtb_domU, so initialization on related variables
+         * shall be done first.
+         */
+        if ( kinfo.vpl011 )
+        {
+            rc = domain_vpl011_init(d, NULL);
+            if ( rc < 0 )
+                return rc;
+        }
+
+        rc = prepare_dtb_domU(d, &kinfo);
+        if ( rc < 0 )
+            return rc;
+
+        rc = construct_domain(d, &kinfo);
+        if ( rc < 0 )
+            return rc;
+    }
 
     domain_vcpu_affinity(d, node);
 
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index b8f282ff10..0a329f9f5e 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -2305,10 +2305,11 @@ static int __init construct_dom0(struct domain *d)
     if ( rc < 0 )
         return rc;
 
-    return construct_hwdom(&kinfo);
+    return construct_hwdom(&kinfo, NULL);
 }
 
-int __init construct_hwdom(struct kernel_info *kinfo)
+int __init construct_hwdom(struct kernel_info *kinfo,
+                           const struct dt_device_node *node)
 {
     struct domain *d = kinfo->d;
     int rc;
@@ -2327,7 +2328,7 @@ int __init construct_hwdom(struct kernel_info *kinfo)
 
     if ( acpi_disabled )
     {
-        rc = process_shm(d, kinfo, NULL);
+        rc = process_shm(d, kinfo, node);
         if ( rc < 0 )
             return rc;
     }
diff --git a/xen/arch/arm/include/asm/domain_build.h b/xen/arch/arm/include/asm/domain_build.h
index 134290853c..17619c875d 100644
--- a/xen/arch/arm/include/asm/domain_build.h
+++ b/xen/arch/arm/include/asm/domain_build.h
@@ -13,7 +13,8 @@ bool allocate_bank_memory(struct kernel_info *kinfo, gfn_t sgfn,
                           paddr_t tot_size);
 void allocate_memory(struct domain *d, struct kernel_info *kinfo);
 int construct_domain(struct domain *d, struct kernel_info *kinfo);
-int construct_hwdom(struct kernel_info *kinfo);
+int construct_hwdom(struct kernel_info *kinfo,
+                    const struct dt_device_node *node);
 int domain_fdt_begin_node(void *fdt, const char *name, uint64_t unit);
 int make_chosen_node(const struct kernel_info *kinfo);
 int make_cpus_node(const struct domain *d, void *fdt);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 20:44:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 20:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959395.1351745 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5sZU-0001Fr-GY; Fri, 18 Apr 2025 20:44:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959395.1351745; Fri, 18 Apr 2025 20: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 1u5sZU-0001Fj-Dl; Fri, 18 Apr 2025 20:44:24 +0000
Received: by outflank-mailman (input) for mailman id 959395;
 Fri, 18 Apr 2025 20: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 1u5sZS-0001FQ-Q2
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 20: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 1u5sZS-006NZ5-2V
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 20:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5sZS-00Chzg-2N
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 20: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=U0rg15asGqbCG+9ZtFWIlb974JdHxYVNLV4v0LKS1/I=; b=W+rufOrKV34u9E6ZarzbFK0Cb/
	j77TSNksFfvbruCxEc5hrHMbNAsl5YDQsEn+WqlrhJmiWcMK4zczEm7d64JWutfmodh+3ZGbG9Qj8
	0w2HhwRNSxn/3FdQLeovPeFAZGp1l9GgGjcMEOsoV5ileSRs42rQ4uHe2Q8cwshkIOHI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: dom0less delay xenstore initialization
Message-Id: <E1u5sZS-00Chzg-2N@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 20:44:22 +0000

commit 379a23677e1af54abc473fbe782b563967099296
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Wed Apr 16 17:29:07 2025 -0400
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Fri Apr 18 13:41:29 2025 -0700

    xen/arm: dom0less delay xenstore initialization
    
    To allocate the xenstore event channel and initialize the grant table
    entry, the xenstore domid is neeed.  A dom0 is created before the domUs,
    so it is normally available through hardware_domain.  With capabilities
    and dom0less, the xenstore domain may not be created first.
    
    Keep the population of the page and HVM_PARAM_STORE_PFN in the normal
    domain construction, but delay event channel creation and grant seeding
    to after all domUs are created.  HVM_PARAM_STORE_PFN now serves as
    indication to setup xenstore since the device tree is no longer
    immediately available.  0 means no xenstore.  ~0ULL means legacy so only
    the event channel needs setup, and any other value means to seed the
    page.
    
    dom0 needs to set xs_domid when it is serving as the xenstore domain.
    
    The domain running xenstored needs to be the handler for VIRQ_DOM_EXC,
    so set that as well - it otherwise defaults to hardware domain.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/dom0less-build.c             | 67 ++++++++++++++++++++++---------
 xen/arch/arm/domain_build.c               |  2 +
 xen/arch/arm/include/asm/dom0less-build.h |  2 +
 3 files changed, 53 insertions(+), 18 deletions(-)

diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index 7bc6a6c4d7..bb8cc3be43 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -20,6 +20,15 @@
 #include <asm/static-memory.h>
 #include <asm/static-shmem.h>
 
+static domid_t __initdata xs_domid = DOMID_INVALID;
+static bool __initdata need_xenstore;
+
+void __init set_xs_domain(struct domain *d)
+{
+    xs_domid = d->domain_id;
+    set_global_virq_handler(d, VIRQ_DOM_EXC);
+}
+
 bool __init is_dom0less_mode(void)
 {
     struct bootmodules *mods = &bootinfo.modules;
@@ -679,7 +688,7 @@ static int __init alloc_xenstore_evtchn(struct domain *d)
     int rc;
 
     alloc.dom = d->domain_id;
-    alloc.remote_dom = hardware_domain->domain_id;
+    alloc.remote_dom = xs_domid;
     rc = evtchn_alloc_unbound(&alloc, 0);
     if ( rc )
     {
@@ -745,16 +754,10 @@ static int __init alloc_xenstore_params(struct kernel_info *kinfo)
     struct domain *d = kinfo->d;
     int rc = 0;
 
-    if ( kinfo->dom0less_feature & (DOM0LESS_XENSTORE | DOM0LESS_XS_LEGACY) )
-    {
-        ASSERT(hardware_domain);
-        rc = alloc_xenstore_evtchn(d);
-        if ( rc < 0 )
-            return rc;
+    if ( (kinfo->dom0less_feature & (DOM0LESS_XENSTORE | DOM0LESS_XS_LEGACY))
+                                 == (DOM0LESS_XENSTORE | DOM0LESS_XS_LEGACY) )
         d->arch.hvm.params[HVM_PARAM_STORE_PFN] = ~0ULL;
-    }
-
-    if ( kinfo->dom0less_feature & DOM0LESS_XENSTORE )
+    else if ( kinfo->dom0less_feature & DOM0LESS_XENSTORE )
     {
         rc = alloc_xenstore_page(d);
         if ( rc < 0 )
@@ -764,6 +767,30 @@ static int __init alloc_xenstore_params(struct kernel_info *kinfo)
     return rc;
 }
 
+static void __init initialize_domU_xenstore(void)
+{
+    struct domain *d;
+
+    if ( xs_domid == DOMID_INVALID )
+        return;
+
+    for_each_domain( d )
+    {
+        uint64_t gfn = d->arch.hvm.params[HVM_PARAM_STORE_PFN];
+        int rc;
+
+        if ( gfn == 0 )
+            continue;
+
+        if ( is_xenstore_domain(d) )
+            continue;
+
+        rc = alloc_xenstore_evtchn(d);
+        if ( rc < 0 )
+            panic("%pd: Failed to allocate xenstore_evtchn\n", d);
+    }
+}
+
 static void __init domain_vcpu_affinity(struct domain *d,
                                         const struct dt_device_node *node)
 {
@@ -899,17 +926,13 @@ static int __init construct_domU(struct domain *d,
          rc == -ENODATA ||
          (rc == 0 && !strcmp(dom0less_enhanced, "enabled")) )
     {
-        if ( hardware_domain )
-            kinfo.dom0less_feature = DOM0LESS_ENHANCED;
-        else
-            panic("At the moment, Xenstore support requires dom0 to be present\n");
+        need_xenstore = true;
+        kinfo.dom0less_feature = DOM0LESS_ENHANCED;
     }
     else if ( rc == 0 && !strcmp(dom0less_enhanced, "legacy") )
     {
-        if ( hardware_domain )
-            kinfo.dom0less_feature = DOM0LESS_ENHANCED_LEGACY;
-        else
-            panic("At the moment, Xenstore support requires dom0 to be present\n");
+        need_xenstore = true;
+        kinfo.dom0less_feature = DOM0LESS_ENHANCED_LEGACY;
     }
     else if ( rc == 0 && !strcmp(dom0less_enhanced, "no-xenstore") )
         kinfo.dom0less_feature = DOM0LESS_ENHANCED_NO_XS;
@@ -1156,7 +1179,15 @@ void __init create_domUs(void)
         if ( rc )
             panic("Could not set up domain %s (rc = %d)\n",
                   dt_node_name(node), rc);
+
+        if ( d_cfg.flags & XEN_DOMCTL_CDF_xs_domain )
+            set_xs_domain(d);
     }
+
+    if ( need_xenstore && xs_domid == DOMID_INVALID )
+        panic("xenstore requested, but xenstore domain not present\n");
+
+    initialize_domU_xenstore();
 }
 
 /*
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 0a329f9f5e..270a6b97e4 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -2408,6 +2408,8 @@ void __init create_dom0(void)
     rc = construct_dom0(dom0);
     if ( rc )
         panic("Could not set up DOM0 guest OS (rc = %d)\n", rc);
+
+    set_xs_domain(dom0);
 }
 
 /*
diff --git a/xen/arch/arm/include/asm/dom0less-build.h b/xen/arch/arm/include/asm/dom0less-build.h
index 5864944bda..b0e41a1954 100644
--- a/xen/arch/arm/include/asm/dom0less-build.h
+++ b/xen/arch/arm/include/asm/dom0less-build.h
@@ -9,6 +9,7 @@
 
 void create_domUs(void);
 bool is_dom0less_mode(void);
+void set_xs_domain(struct domain *d);
 
 #else /* !CONFIG_DOM0LESS_BOOT */
 
@@ -17,6 +18,7 @@ static inline bool is_dom0less_mode(void)
 {
     return false;
 }
+static inline void set_xs_domain(struct domain *d) {}
 
 #endif /* CONFIG_DOM0LESS_BOOT */
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 20:44:34 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 20:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959396.1351749 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5sZe-0001IL-I1; Fri, 18 Apr 2025 20:44:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959396.1351749; Fri, 18 Apr 2025 20: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 1u5sZe-0001ID-FA; Fri, 18 Apr 2025 20:44:34 +0000
Received: by outflank-mailman (input) for mailman id 959396;
 Fri, 18 Apr 2025 20: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 1u5sZc-0001Hw-TA
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 20: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 1u5sZc-006NZW-2o
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 20:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5sZc-00Ci4K-2h
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 20: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=Ric9E8QjPMfuUShplOVCqTG2fzejePwHekYpYiTfDkg=; b=tbBSkO0PcHxJHxEeXGZXKIE9YA
	PVcIFen2yXBM+ByjP+JakFWzSi4DKYTXJ6IQPlIf4seLIJficUtBcs17HIAhNXUyGA6YwGsIlnRsB
	y1a+bTfxqdU9rGmdNEgB0onn+ZxD/BngLhgsHr3Gt5ghMnKgpRuy/6OnOOMZP8j+aqWk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: dom0less seed xenstore grant table entry
Message-Id: <E1u5sZc-00Ci4K-2h@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 20:44:32 +0000

commit 7fc8120a2a857b43087c316d38e010da2d1cacf2
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Wed Apr 16 17:29:08 2025 -0400
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Fri Apr 18 13:41:29 2025 -0700

    xen/arm: dom0less seed xenstore grant table entry
    
    xenstored maps other domains' xenstore pages.  Currently this relies on
    init-dom0less or xl to seed the grants from Dom0.  With split
    hardware/control/xenstore domains, this is problematic since we don't
    want the hardware domain to be able to map other domains' resources
    without their permission.  Instead have the hypervisor seed the grant
    table entry for every dom0less domain.  The grant is then accessible as
    normal.
    
    C xenstored uses grants, so it can map the xenstore pages from a
    non-dom0 xenstore domain.  OCaml xenstored uses foreign mappings, so it
    can only run from a privileged domain (dom0).
    
    Add a define to indicate the late alloc xsentore PFN, to better indicate
    what is being checked.  Use UINT64_MAX instead of ~0ULL as the HVM_PARAM
    field is a uint64_t.  UINT64_MAX is not defined, so add it.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/dom0less-build.c | 10 +++++++++-
 xen/common/grant_table.c      | 14 ++++++++++++++
 xen/include/xen/grant_table.h |  4 ++++
 xen/include/xen/types.h       |  1 +
 4 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index bb8cc3be43..188ef40b52 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -20,6 +20,8 @@
 #include <asm/static-memory.h>
 #include <asm/static-shmem.h>
 
+#define XENSTORE_PFN_LATE_ALLOC UINT64_MAX
+
 static domid_t __initdata xs_domid = DOMID_INVALID;
 static bool __initdata need_xenstore;
 
@@ -756,7 +758,7 @@ static int __init alloc_xenstore_params(struct kernel_info *kinfo)
 
     if ( (kinfo->dom0less_feature & (DOM0LESS_XENSTORE | DOM0LESS_XS_LEGACY))
                                  == (DOM0LESS_XENSTORE | DOM0LESS_XS_LEGACY) )
-        d->arch.hvm.params[HVM_PARAM_STORE_PFN] = ~0ULL;
+        d->arch.hvm.params[HVM_PARAM_STORE_PFN] = XENSTORE_PFN_LATE_ALLOC;
     else if ( kinfo->dom0less_feature & DOM0LESS_XENSTORE )
     {
         rc = alloc_xenstore_page(d);
@@ -788,6 +790,12 @@ static void __init initialize_domU_xenstore(void)
         rc = alloc_xenstore_evtchn(d);
         if ( rc < 0 )
             panic("%pd: Failed to allocate xenstore_evtchn\n", d);
+
+        if ( gfn != XENSTORE_PFN_LATE_ALLOC && IS_ENABLED(CONFIG_GRANT_TABLE) )
+        {
+            ASSERT(gfn < UINT32_MAX);
+            gnttab_seed_entry(d, GNTTAB_RESERVED_XENSTORE, xs_domid, gfn);
+        }
     }
 }
 
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 6c77867f8c..e75ff98aff 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -4346,6 +4346,20 @@ static void gnttab_usage_print(struct domain *rd)
         printk("no active grant table entries\n");
 }
 
+#ifdef CONFIG_DOM0LESS_BOOT
+void __init gnttab_seed_entry(const struct domain *d, unsigned int idx,
+                              domid_t be_domid, uint32_t frame)
+{
+    const struct grant_table *gt = d->grant_table;
+
+    ASSERT(!d->creation_finished);
+    ASSERT(gt->gt_version == 1);
+    shared_entry_v1(gt, idx).flags = GTF_permit_access;
+    shared_entry_v1(gt, idx).domid = be_domid;
+    shared_entry_v1(gt, idx).frame = frame;
+}
+#endif
+
 static void cf_check gnttab_usage_print_all(unsigned char key)
 {
     struct domain *d;
diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h
index 50edfecfb6..297d7669e9 100644
--- a/xen/include/xen/grant_table.h
+++ b/xen/include/xen/grant_table.h
@@ -33,6 +33,10 @@
 
 struct grant_table;
 
+/* Seed a gnttab entry for Hyperlaunch/dom0less. */
+void gnttab_seed_entry(const struct domain *d, unsigned int idx,
+                       domid_t be_domid, uint32_t frame);
+
 #ifdef CONFIG_GRANT_TABLE
 
 extern unsigned int opt_gnttab_max_version;
diff --git a/xen/include/xen/types.h b/xen/include/xen/types.h
index e8d419b954..73ddccbbd5 100644
--- a/xen/include/xen/types.h
+++ b/xen/include/xen/types.h
@@ -44,6 +44,7 @@ typedef __UINTPTR_TYPE__ uintptr_t;
 #define UINT8_MAX       (255)
 #define UINT16_MAX      (65535)
 #define UINT32_MAX      (4294967295U)
+#define UINT64_MAX      (18446744073709551615ULL)
 
 #define INT_MAX         ((int)(~0U>>1))
 #define INT_MIN         (-INT_MAX - 1)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 20:44:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 20:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959397.1351752 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5sZo-0001L2-JS; Fri, 18 Apr 2025 20:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959397.1351752; Fri, 18 Apr 2025 20: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 1u5sZo-0001Ku-GW; Fri, 18 Apr 2025 20:44:44 +0000
Received: by outflank-mailman (input) for mailman id 959397;
 Fri, 18 Apr 2025 20: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 1u5sZn-0001Ki-0c
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 20:44:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5sZm-006NZy-3B
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 20:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5sZm-00CiFy-2z
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 20: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=ETXvSQdsWj02h+XyZq0DOvRo+Bfj2icSfojBc3AsscU=; b=LXuBKXfJc/kFr6IVE8vwU+0LbF
	fMe7OF6QuRm7Qgun8P639QbHmp0OPigePMTk2BhHPrWa9e66zFrYp36KmAVYxwvk8VyEqKKiC2yFm
	2R+ANqXH7MNekJiG6ZbgvKtJFQH6kpMyxQ8Kl3DKji4r8XZJhplMad2W14PU7hXO/tIE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/init-dom0less: Only seed legacy xenstore grants
Message-Id: <E1u5sZm-00CiFy-2z@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 20:44:42 +0000

commit 375c4837ee10d481254e8910b873a6ce03cfd742
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Wed Apr 16 17:29:09 2025 -0400
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Fri Apr 18 13:41:29 2025 -0700

    tools/init-dom0less: Only seed legacy xenstore grants
    
    The hardware domain is unable to seed a control domain, but we want the
    control domain to use xenstore.  Rely on the hypervisor to seed dom0less
    grant table entries for Xenstore, so this seeding is unnecessary.
    
    However, that only works for the new xenstore late init.  The legacy
    protocol which uses init-dom0less to populate the page still needs to
    seed the grant.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 tools/helpers/init-dom0less.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/helpers/init-dom0less.c b/tools/helpers/init-dom0less.c
index 17579fe2e8..91edf17b6c 100644
--- a/tools/helpers/init-dom0less.c
+++ b/tools/helpers/init-dom0less.c
@@ -286,12 +286,12 @@ static int init_domain(struct xs_handle *xsh,
                 xenstore_pfn);
         if (rc < 0)
             return rc;
-    }
 
-    rc = xc_dom_gnttab_seed(xch, info->domid, true,
-                            (xen_pfn_t)-1, xenstore_pfn, 0, 0);
-    if (rc)
-        err(1, "xc_dom_gnttab_seed");
+        rc = xc_dom_gnttab_seed(xch, info->domid, true,
+                                (xen_pfn_t)-1, xenstore_pfn, 0, 0);
+        if (rc)
+               err(1, "xc_dom_gnttab_seed");
+    }
 
     libxl_uuid_generate(&uuid);
     xc_domain_sethandle(xch, info->domid, libxl_uuid_bytearray(&uuid));
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 20:44:53 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 20:44:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959398.1351757 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5sZx-0001Pf-M6; Fri, 18 Apr 2025 20:44:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959398.1351757; Fri, 18 Apr 2025 20:44:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5sZx-0001PX-JS; Fri, 18 Apr 2025 20:44:53 +0000
Received: by outflank-mailman (input) for mailman id 959398;
 Fri, 18 Apr 2025 20: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 1u5sZx-0001PO-3G
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 20: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 1u5sZx-006NaL-0E
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 20:44:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5sZx-00CiJx-07
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 20: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=5RJ8KIXCdwRtvMSLnPrlzDjJqeNDiHbxuPbtrQQSm9A=; b=4VyXwcckVFpbjWlAhZ6uZC++EQ
	i/WLFdu/nAFBGYJKBpTWr0pFOdqFww5jib+pZCiCsZgMhkpcLOiQRuwsuOcISfLGGQjA/zmbe9c+l
	yTZX9RxlOdUOHvGpyun3xsgChgKZMt6G4FK+QTkeMjhUEGdDCJnSfLlFlmyY/2whMNY4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: dom0less use has_dtb local variable
Message-Id: <E1u5sZx-00CiJx-07@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 20:44:53 +0000

commit 00eee5a0e07921edf7e7fe560ade52e75cab8172
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Wed Apr 16 17:29:10 2025 -0400
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Fri Apr 18 13:41:29 2025 -0700

    xen/arm: dom0less use has_dtb local variable
    
    Store the result of finding a "multiboot,device-tree" node.  This will
    simplity adding hardware domain checks.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/dom0less-build.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index 188ef40b52..50d2d3e4e4 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -1033,6 +1033,7 @@ void __init create_domUs(void)
             .grant_opts = XEN_DOMCTL_GRANT_version(opt_gnttab_max_version),
         };
         unsigned int flags = 0U;
+        bool has_dtb = false;
         uint32_t val;
         int rc;
 
@@ -1067,9 +1068,10 @@ void __init create_domUs(void)
              !strcmp(dom0less_iommu, "enabled") )
             iommu = true;
 
-        if ( iommu_enabled &&
-             (iommu || dt_find_compatible_node(node, NULL,
-                                               "multiboot,device-tree")) )
+        if ( dt_find_compatible_node(node, NULL, "multiboot,device-tree") )
+            has_dtb = true;
+
+        if ( iommu_enabled && (iommu || has_dtb) )
             d_cfg.flags |= XEN_DOMCTL_CDF_iommu;
 
         if ( !dt_property_read_u32(node, "nr_spis", &d_cfg.arch.nr_spis) )
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 20:45:03 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 20:45:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959399.1351761 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5sa7-0001S5-NO; Fri, 18 Apr 2025 20:45:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959399.1351761; Fri, 18 Apr 2025 20:45:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5sa7-0001Ry-Kt; Fri, 18 Apr 2025 20:45:03 +0000
Received: by outflank-mailman (input) for mailman id 959399;
 Fri, 18 Apr 2025 20: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 1u5sa7-0001Rr-60
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 20: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 1u5sa7-006NbK-0V
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 20:45:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5sa7-00CiRM-0P
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 20: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=tVxWvosuSXtrjvBaF55xVCpYTa1alX0jaHdm6RPVqT4=; b=sNFmtReaTez2l9wysDA5dvWIDV
	TaW3Lwf1PK9XTWadgl8NZUH4LQyOQ5V6UFOiEktFavWd4LLZO8t/rt+cgSw7RZqp7FreWJflstLTP
	mc2XJC/lvq5Zx0TR1o6SsZfpECuBOiOqaMCnPLaCgTNoEfuNPVQ6ZIJvUQOAdK8O/7dY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: Add capabilities to dom0less
Message-Id: <E1u5sa7-00CiRM-0P@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 20:45:03 +0000

commit df68a4cb7ed9418f0c5af56a717714b5280737e4
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Wed Apr 16 17:29:11 2025 -0400
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Fri Apr 18 13:41:29 2025 -0700

    xen/arm: Add capabilities to dom0less
    
    Add a capabilities property to dom0less to allow building a
    disaggregated system.  Only a single hardware domain and single xenstore
    domain can be specified.  Multiple control domains are possible.
    
    Introduce bootfdt.h to contain these constants.
    
    When using the hardware or xenstore capabilities, adjust the grant and
    event channel limits similar to dom0.
    
    For a hardware domain, disallow specifying "vpl011", "nr_spis",
    "multiboot,device-tree" and "passthrough" nodes.  Also, require an IOMMU
    when not direct-mapped,
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 docs/misc/arm/device-tree/booting.txt | 11 +++++++
 xen/arch/arm/dom0less-build.c         | 57 +++++++++++++++++++++++++++++++++--
 xen/arch/arm/domain.c                 |  3 +-
 xen/include/public/bootfdt.h          | 31 +++++++++++++++++++
 4 files changed, 98 insertions(+), 4 deletions(-)

diff --git a/docs/misc/arm/device-tree/booting.txt b/docs/misc/arm/device-tree/booting.txt
index ac781c9cc8..59fa96a82e 100644
--- a/docs/misc/arm/device-tree/booting.txt
+++ b/docs/misc/arm/device-tree/booting.txt
@@ -167,6 +167,17 @@ with the following properties:
     Refer to docs/misc/cache_coloring.rst for syntax. This option is applicable
     only to Arm64 guests.
 
+- capabilities
+    Optional.  A 32-bit integer representing a bit field of domain capabilities
+    for a disaggregated system.  A traditional dom0 has all of these
+    capabilities, and a domU has none of them.
+
+    0x1 DOMAIN_CAPS_CONTROL  - A privileged, control domain
+    0x2 DOMAIN_CAPS_HARDWARE - The hardware domain - there can be only 1
+    0x4 DOMAIN_CAPS_XENSTORE - The xenstore domain - there can be only 1
+
+    The default is no capabilities.
+
 - vpl011
 
     An empty property to enable/disable a virtual pl011 for the guest to
diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index 50d2d3e4e4..a356fc94fc 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -12,11 +12,13 @@
 #include <xen/sizes.h>
 #include <xen/vmap.h>
 
+#include <public/bootfdt.h>
 #include <public/io/xs_wire.h>
 
 #include <asm/arm64/sve.h>
 #include <asm/dom0less-build.h>
 #include <asm/domain_build.h>
+#include <asm/grant_table.h>
 #include <asm/static-memory.h>
 #include <asm/static-shmem.h>
 
@@ -928,6 +930,8 @@ static int __init construct_domU(struct domain *d,
            d->max_vcpus, mem);
 
     kinfo.vpl011 = dt_property_read_bool(node, "vpl011");
+    if ( kinfo.vpl011 && is_hardware_domain(d) )
+        panic("hardware domain cannot specify vpl011\n");
 
     rc = dt_property_read_string(node, "xen,enhanced", &dom0less_enhanced);
     if ( rc == -EILSEQ ||
@@ -1043,6 +1047,37 @@ void __init create_domUs(void)
         if ( (max_init_domid + 1) >= DOMID_FIRST_RESERVED )
             panic("No more domain IDs available\n");
 
+        if ( dt_property_read_u32(node, "capabilities", &val) )
+        {
+            if ( val & ~DOMAIN_CAPS_MASK )
+                panic("Invalid capabilities (%"PRIx32")\n", val);
+
+            if ( val & DOMAIN_CAPS_CONTROL )
+                flags |= CDF_privileged;
+
+            if ( val & DOMAIN_CAPS_HARDWARE )
+            {
+                if ( hardware_domain )
+                    panic("Only 1 hardware domain can be specified! (%pd)\n",
+                           hardware_domain);
+
+                d_cfg.max_grant_frames = gnttab_dom0_frames();
+                d_cfg.max_evtchn_port = -1;
+                flags |= CDF_hardware;
+                iommu = true;
+            }
+
+            if ( val & DOMAIN_CAPS_XENSTORE )
+            {
+                if ( xs_domid != DOMID_INVALID )
+                    panic("Only 1 xenstore domain can be specified! (%u)\n",
+                          xs_domid);
+
+                d_cfg.flags |= XEN_DOMCTL_CDF_xs_domain;
+                d_cfg.max_evtchn_port = -1;
+            }
+        }
+
         if ( dt_find_property(node, "xen,static-mem", NULL) )
         {
             if ( llc_coloring_enabled )
@@ -1064,12 +1099,26 @@ void __init create_domUs(void)
             panic("Missing property 'cpus' for domain %s\n",
                   dt_node_name(node));
 
-        if ( !dt_property_read_string(node, "passthrough", &dom0less_iommu) &&
-             !strcmp(dom0less_iommu, "enabled") )
-            iommu = true;
+        if ( !dt_property_read_string(node, "passthrough", &dom0less_iommu) )
+        {
+            if ( flags & CDF_hardware )
+                panic("Don't specify passthrough for hardware domain\n");
+
+            if ( !strcmp(dom0less_iommu, "enabled") )
+                iommu = true;
+        }
+
+        if ( (flags & CDF_hardware) && !(flags & CDF_directmap) &&
+             !iommu_enabled )
+            panic("non-direct mapped hardware domain requires iommu\n");
 
         if ( dt_find_compatible_node(node, NULL, "multiboot,device-tree") )
+        {
+            if ( flags & CDF_hardware )
+                panic("\"multiboot,device-tree\" incompatible with hardware domain\n");
+
             has_dtb = true;
+        }
 
         if ( iommu_enabled && (iommu || has_dtb) )
             d_cfg.flags |= XEN_DOMCTL_CDF_iommu;
@@ -1106,6 +1155,8 @@ void __init create_domUs(void)
                 d_cfg.arch.nr_spis = MAX(d_cfg.arch.nr_spis,
                                          vpl011_virq - 32 + 1);
         }
+        else if ( flags & CDF_hardware )
+            panic("nr_spis cannot be specified for hardware domain\n");
 
         /* Get the optional property domain-cpupool */
         cpupool_node = dt_parse_phandle(node, "domain-cpupool", 0);
diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 3ba959f866..dc4b4e84c1 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -608,7 +608,8 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
 {
     unsigned int max_vcpus;
     unsigned int flags_required = (XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap);
-    unsigned int flags_optional = (XEN_DOMCTL_CDF_iommu | XEN_DOMCTL_CDF_vpmu);
+    unsigned int flags_optional = (XEN_DOMCTL_CDF_iommu | XEN_DOMCTL_CDF_vpmu |
+                                   XEN_DOMCTL_CDF_xs_domain );
     unsigned int sve_vl_bits = sve_decode_vl(config->arch.sve_vl);
 
     if ( (config->flags & ~flags_optional) != flags_required )
diff --git a/xen/include/public/bootfdt.h b/xen/include/public/bootfdt.h
new file mode 100644
index 0000000000..86c46b42a9
--- /dev/null
+++ b/xen/include/public/bootfdt.h
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Xen Device Tree boot information
+ *
+ * Information for configuring Xen domains created at boot time.
+ */
+
+#ifndef __XEN_PUBLIC_BOOTFDT_H__
+#define __XEN_PUBLIC_BOOTFDT_H__
+
+/*
+ * Domain Capabilities specified in the "capabilities" property.  Use of
+ * this property allows splitting up the monolithic dom0 into separate,
+ * less privileged components.  A regular domU has no capabilities
+ * (which is the default if nothing is specified).  A traditional dom0
+ * has all three capabilities.
+ */
+
+/* Control/Privileged domain capable of affecting other domains. */
+#define DOMAIN_CAPS_CONTROL  (1U << 0)
+/*
+ * Hardware domain controlling physical hardware.  Typically providing
+ * backends to other domains.
+ */
+#define DOMAIN_CAPS_HARDWARE (1U << 1)
+/* Xenstore domain. */
+#define DOMAIN_CAPS_XENSTORE (1U << 2)
+#define DOMAIN_CAPS_MASK     (DOMAIN_CAPS_CONTROL | DOMAIN_CAPS_HARDWARE | \
+                              DOMAIN_CAPS_XENSTORE)
+
+#endif /* __XEN_PUBLIC_BOOTFDT_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 22:11:34 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 22:11:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959492.1351825 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5tvn-0000xE-0N; Fri, 18 Apr 2025 22:11:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959492.1351825; Fri, 18 Apr 2025 22:11:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5tvm-0000x6-U6; Fri, 18 Apr 2025 22:11:30 +0000
Received: by outflank-mailman (input) for mailman id 959492;
 Fri, 18 Apr 2025 22:11:30 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u5tvl-0000x0-VL
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 22:11:29 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5tvl-006T0k-1y
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 22:11:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5tvZ-00GoCQ-2U
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 22:11:29 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gDH47290xWW6LCI7XV5VpcYpo+CY3peNNgrndKQDrw0=; b=WJx8Rsi8aIGBOAcuDY1CK+y1TK
	lXVUBRrdCGbmbjbjr1yQlxj8BkWBGXasejZmEbUB9o0q4++NrUPrVd8tGgYwCUkwTBczE9lRQavxF
	mgfNwb9Ioo1nZnSLMzsdTii3aHbJ/0kEFhOZLbuBFQYAiGPaeHCxZLjYeIIDAlfMHvv4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: introduce hardware domain create flag
Message-Id: <E1u5tvZ-00GoCQ-2U@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 22:11:17 +0000

commit b959f3b820f5998e0894c2944ccc95727b71987a
Author:     Daniel P. Smith <dpsmith@apertussolutions.com>
AuthorDate: Wed Apr 16 17:29:05 2025 -0400
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Fri Apr 18 13:41:25 2025 -0700

    xen: introduce hardware domain create flag
    
    Add and use a new internal create domain flag to specify the hardware
    domain.  This removes the hardcoding of domid 0 as the hardware domain.
    
    This allows more flexibility with domain creation.
    
    The assignment of d->cdf is moved later so CDF_hardware is added for the
    late_hwdom case.  Also old_hwdom has the flag removed to reflect the
    change.
    
    Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/domain_build.c |  2 +-
 xen/arch/x86/setup.c        |  3 ++-
 xen/common/domain.c         | 19 +++++++++++++++----
 xen/include/xen/domain.h    |  2 ++
 4 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 634333cdde..b8f282ff10 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -2369,7 +2369,7 @@ void __init create_dom0(void)
         .max_maptrack_frames = -1,
         .grant_opts = XEN_DOMCTL_GRANT_version(opt_gnttab_max_version),
     };
-    unsigned int flags = CDF_privileged;
+    unsigned int flags = CDF_privileged | CDF_hardware;
     int rc;
 
     /* The vGIC for DOM0 is exactly emulating the hardware GIC */
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 3c257f0bad..24b36c1a59 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1011,7 +1011,8 @@ static struct domain *__init create_dom0(struct boot_info *bi)
 
     /* Create initial domain.  Not d0 for pvshim. */
     bd->domid = get_initial_domain_id();
-    d = domain_create(bd->domid, &dom0_cfg, pv_shim ? 0 : CDF_privileged);
+    d = domain_create(bd->domid, &dom0_cfg,
+                      pv_shim ? 0 : CDF_privileged | CDF_hardware);
     if ( IS_ERR(d) )
         panic("Error creating d%u: %ld\n", bd->domid, PTR_ERR(d));
 
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 585fd726a9..abf1969e60 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -804,9 +804,6 @@ struct domain *domain_create(domid_t domid,
     d->domain_id = domid;
     d->unique_id = get_unique_id();
 
-    /* Holding CDF_* internal flags. */
-    d->cdf = flags;
-
     /* Debug sanity. */
     ASSERT(is_system_domain(d) ? config == NULL : config != NULL);
 
@@ -820,15 +817,25 @@ struct domain *domain_create(domid_t domid,
     d->is_privileged = flags & CDF_privileged;
 
     /* Sort out our idea of is_hardware_domain(). */
-    if ( domid == 0 || domid == hardware_domid )
+    if ( (flags & CDF_hardware) || domid == hardware_domid )
     {
         if ( hardware_domid < 0 || hardware_domid >= DOMID_FIRST_RESERVED )
             panic("The value of hardware_dom must be a valid domain ID\n");
 
+        /* late_hwdom is only allowed for dom0. */
+        if ( hardware_domain && hardware_domain->domain_id )
+            return ERR_PTR(-EINVAL);
+
         old_hwdom = hardware_domain;
         hardware_domain = d;
+        flags |= CDF_hardware;
+        if ( old_hwdom )
+            old_hwdom->cdf &= ~CDF_hardware;
     }
 
+    /* Holding CDF_* internal flags. */
+    d->cdf = flags;
+
     TRACE_TIME(TRC_DOM0_DOM_ADD, d->domain_id);
 
     lock_profile_register_struct(LOCKPROF_TYPE_PERDOM, d, domid);
@@ -973,7 +980,11 @@ struct domain *domain_create(domid_t domid,
 
     d->is_dying = DOMDYING_dead;
     if ( hardware_domain == d )
+    {
+        if ( old_hwdom )
+            old_hwdom->cdf |= CDF_hardware;
         hardware_domain = old_hwdom;
+    }
     atomic_set(&d->refcnt, DOMAIN_DESTROYED);
 
     sched_destroy_domain(d);
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index a34daa7d10..e10baf2615 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -53,6 +53,8 @@ domid_t get_initial_domain_id(void);
 #else
 #define CDF_staticmem            0
 #endif
+/* This is the hardware domain.  Only 1 allowed. */
+#define CDF_hardware             (1U << 3)
 
 #define is_domain_direct_mapped(d) ((d)->cdf & CDF_directmap)
 #define is_domain_using_staticmem(d) ((d)->cdf & CDF_staticmem)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 22:11:42 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 22:11:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959494.1351839 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5tvy-0001ED-8R; Fri, 18 Apr 2025 22:11:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959494.1351839; Fri, 18 Apr 2025 22:11: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 1u5tvy-0001E5-5q; Fri, 18 Apr 2025 22:11:42 +0000
Received: by outflank-mailman (input) for mailman id 959494;
 Fri, 18 Apr 2025 22:11:41 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u5tvx-0001Db-1V
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 22:11:41 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5tvx-006T0r-03
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 22:11:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5tvw-00GpRQ-2c
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 22:11:40 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7xS/Mrd+agg1iMVMCwqJjaYUyjqHIPgbfw+R9cM+1sY=; b=G3nBgwVBx0nLCH5lEHsStRn0qE
	KMEG/KRW3XwNDnGMRMS97alIMkOAjC4aD2ottNRS/ZrvrjwSoZQ/+ikhz5p3wP9QBbWQdndcKVqA1
	aylI0r3jbujFfU7C5GL5XE1KusuFrmoDNzCNJPKbmxKNoww0antgomofv5q3aHzi3rIY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: dom0less hwdom construction
Message-Id: <E1u5tvw-00GpRQ-2c@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 22:11:40 +0000

commit 52cb53f1816a2c92aedbdf857065e3e2e2d99099
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Wed Apr 16 17:29:06 2025 -0400
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Fri Apr 18 13:41:29 2025 -0700

    xen/arm: dom0less hwdom construction
    
    When creating a hardware domain, have the dom0less code call
    construct_hwdom() which is shared with the dom0 code.  The hardware
    domain requires building that best matches the dom0 build path.  Re-use
    it to keep them in sync.
    
    The device tree node of the dom0less config is now passed into
    construct_hwdom().  dom0 uses /chosen for process_shm while a hwdom will
    use the value from its dom0less device tree node.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/dom0less-build.c           | 57 +++++++++++++++++++--------------
 xen/arch/arm/domain_build.c             |  7 ++--
 xen/arch/arm/include/asm/domain_build.h |  3 +-
 3 files changed, 39 insertions(+), 28 deletions(-)

diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index bd15563750..7bc6a6c4d7 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -929,36 +929,45 @@ static int __init construct_domU(struct domain *d,
     /* type must be set before allocate memory */
     d->arch.type = kinfo.type;
 #endif
-    if ( !dt_find_property(node, "xen,static-mem", NULL) )
-        allocate_memory(d, &kinfo);
-    else if ( !is_domain_direct_mapped(d) )
-        allocate_static_memory(d, &kinfo, node);
-    else
-        assign_static_memory_11(d, &kinfo, node);
-
-    rc = process_shm(d, &kinfo, node);
-    if ( rc < 0 )
-        return rc;
-
-    /*
-     * Base address and irq number are needed when creating vpl011 device
-     * tree node in prepare_dtb_domU, so initialization on related variables
-     * shall be done first.
-     */
-    if ( kinfo.vpl011 )
+    if ( is_hardware_domain(d) )
     {
-        rc = domain_vpl011_init(d, NULL);
+        rc = construct_hwdom(&kinfo, node);
         if ( rc < 0 )
             return rc;
     }
+    else
+    {
+        if ( !dt_find_property(node, "xen,static-mem", NULL) )
+            allocate_memory(d, &kinfo);
+        else if ( !is_domain_direct_mapped(d) )
+            allocate_static_memory(d, &kinfo, node);
+        else
+            assign_static_memory_11(d, &kinfo, node);
 
-    rc = prepare_dtb_domU(d, &kinfo);
-    if ( rc < 0 )
-        return rc;
+        rc = process_shm(d, &kinfo, node);
+        if ( rc < 0 )
+            return rc;
 
-    rc = construct_domain(d, &kinfo);
-    if ( rc < 0 )
-        return rc;
+        /*
+         * Base address and irq number are needed when creating vpl011 device
+         * tree node in prepare_dtb_domU, so initialization on related variables
+         * shall be done first.
+         */
+        if ( kinfo.vpl011 )
+        {
+            rc = domain_vpl011_init(d, NULL);
+            if ( rc < 0 )
+                return rc;
+        }
+
+        rc = prepare_dtb_domU(d, &kinfo);
+        if ( rc < 0 )
+            return rc;
+
+        rc = construct_domain(d, &kinfo);
+        if ( rc < 0 )
+            return rc;
+    }
 
     domain_vcpu_affinity(d, node);
 
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index b8f282ff10..0a329f9f5e 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -2305,10 +2305,11 @@ static int __init construct_dom0(struct domain *d)
     if ( rc < 0 )
         return rc;
 
-    return construct_hwdom(&kinfo);
+    return construct_hwdom(&kinfo, NULL);
 }
 
-int __init construct_hwdom(struct kernel_info *kinfo)
+int __init construct_hwdom(struct kernel_info *kinfo,
+                           const struct dt_device_node *node)
 {
     struct domain *d = kinfo->d;
     int rc;
@@ -2327,7 +2328,7 @@ int __init construct_hwdom(struct kernel_info *kinfo)
 
     if ( acpi_disabled )
     {
-        rc = process_shm(d, kinfo, NULL);
+        rc = process_shm(d, kinfo, node);
         if ( rc < 0 )
             return rc;
     }
diff --git a/xen/arch/arm/include/asm/domain_build.h b/xen/arch/arm/include/asm/domain_build.h
index 134290853c..17619c875d 100644
--- a/xen/arch/arm/include/asm/domain_build.h
+++ b/xen/arch/arm/include/asm/domain_build.h
@@ -13,7 +13,8 @@ bool allocate_bank_memory(struct kernel_info *kinfo, gfn_t sgfn,
                           paddr_t tot_size);
 void allocate_memory(struct domain *d, struct kernel_info *kinfo);
 int construct_domain(struct domain *d, struct kernel_info *kinfo);
-int construct_hwdom(struct kernel_info *kinfo);
+int construct_hwdom(struct kernel_info *kinfo,
+                    const struct dt_device_node *node);
 int domain_fdt_begin_node(void *fdt, const char *name, uint64_t unit);
 int make_chosen_node(const struct kernel_info *kinfo);
 int make_cpus_node(const struct domain *d, void *fdt);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 22:11:54 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 22:11:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959495.1351842 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5twA-0001Np-A3; Fri, 18 Apr 2025 22:11:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959495.1351842; Fri, 18 Apr 2025 22: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 1u5twA-0001Ni-7E; Fri, 18 Apr 2025 22:11:54 +0000
Received: by outflank-mailman (input) for mailman id 959495;
 Fri, 18 Apr 2025 22: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 1u5tw8-0001KE-It
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 22: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 1u5tw8-006T0x-1n
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 22:11:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5tw8-00Gq6i-0X
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 22: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=z7LipYYgR6rCvqgf71Y08dszgh/jClSu+18wZQ8fgZY=; b=4kP9xqgedXzNSetakAPNoLUjMx
	wLn58XVH6sC8oqKRY4AN4z4e80xf9q11ToDP+dtltKuz1ZBuj18qKHrmcCKKRLXl157Xpmc0VrsuI
	pEdvaLac9MrpD+htvKx3cFzJ3ws9IA+yuXBg2qTPJXBFrzz6gTLxNkoLsIWv5MIxJ5xQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: dom0less delay xenstore initialization
Message-Id: <E1u5tw8-00Gq6i-0X@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 22:11:52 +0000

commit 379a23677e1af54abc473fbe782b563967099296
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Wed Apr 16 17:29:07 2025 -0400
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Fri Apr 18 13:41:29 2025 -0700

    xen/arm: dom0less delay xenstore initialization
    
    To allocate the xenstore event channel and initialize the grant table
    entry, the xenstore domid is neeed.  A dom0 is created before the domUs,
    so it is normally available through hardware_domain.  With capabilities
    and dom0less, the xenstore domain may not be created first.
    
    Keep the population of the page and HVM_PARAM_STORE_PFN in the normal
    domain construction, but delay event channel creation and grant seeding
    to after all domUs are created.  HVM_PARAM_STORE_PFN now serves as
    indication to setup xenstore since the device tree is no longer
    immediately available.  0 means no xenstore.  ~0ULL means legacy so only
    the event channel needs setup, and any other value means to seed the
    page.
    
    dom0 needs to set xs_domid when it is serving as the xenstore domain.
    
    The domain running xenstored needs to be the handler for VIRQ_DOM_EXC,
    so set that as well - it otherwise defaults to hardware domain.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/dom0less-build.c             | 67 ++++++++++++++++++++++---------
 xen/arch/arm/domain_build.c               |  2 +
 xen/arch/arm/include/asm/dom0less-build.h |  2 +
 3 files changed, 53 insertions(+), 18 deletions(-)

diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index 7bc6a6c4d7..bb8cc3be43 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -20,6 +20,15 @@
 #include <asm/static-memory.h>
 #include <asm/static-shmem.h>
 
+static domid_t __initdata xs_domid = DOMID_INVALID;
+static bool __initdata need_xenstore;
+
+void __init set_xs_domain(struct domain *d)
+{
+    xs_domid = d->domain_id;
+    set_global_virq_handler(d, VIRQ_DOM_EXC);
+}
+
 bool __init is_dom0less_mode(void)
 {
     struct bootmodules *mods = &bootinfo.modules;
@@ -679,7 +688,7 @@ static int __init alloc_xenstore_evtchn(struct domain *d)
     int rc;
 
     alloc.dom = d->domain_id;
-    alloc.remote_dom = hardware_domain->domain_id;
+    alloc.remote_dom = xs_domid;
     rc = evtchn_alloc_unbound(&alloc, 0);
     if ( rc )
     {
@@ -745,16 +754,10 @@ static int __init alloc_xenstore_params(struct kernel_info *kinfo)
     struct domain *d = kinfo->d;
     int rc = 0;
 
-    if ( kinfo->dom0less_feature & (DOM0LESS_XENSTORE | DOM0LESS_XS_LEGACY) )
-    {
-        ASSERT(hardware_domain);
-        rc = alloc_xenstore_evtchn(d);
-        if ( rc < 0 )
-            return rc;
+    if ( (kinfo->dom0less_feature & (DOM0LESS_XENSTORE | DOM0LESS_XS_LEGACY))
+                                 == (DOM0LESS_XENSTORE | DOM0LESS_XS_LEGACY) )
         d->arch.hvm.params[HVM_PARAM_STORE_PFN] = ~0ULL;
-    }
-
-    if ( kinfo->dom0less_feature & DOM0LESS_XENSTORE )
+    else if ( kinfo->dom0less_feature & DOM0LESS_XENSTORE )
     {
         rc = alloc_xenstore_page(d);
         if ( rc < 0 )
@@ -764,6 +767,30 @@ static int __init alloc_xenstore_params(struct kernel_info *kinfo)
     return rc;
 }
 
+static void __init initialize_domU_xenstore(void)
+{
+    struct domain *d;
+
+    if ( xs_domid == DOMID_INVALID )
+        return;
+
+    for_each_domain( d )
+    {
+        uint64_t gfn = d->arch.hvm.params[HVM_PARAM_STORE_PFN];
+        int rc;
+
+        if ( gfn == 0 )
+            continue;
+
+        if ( is_xenstore_domain(d) )
+            continue;
+
+        rc = alloc_xenstore_evtchn(d);
+        if ( rc < 0 )
+            panic("%pd: Failed to allocate xenstore_evtchn\n", d);
+    }
+}
+
 static void __init domain_vcpu_affinity(struct domain *d,
                                         const struct dt_device_node *node)
 {
@@ -899,17 +926,13 @@ static int __init construct_domU(struct domain *d,
          rc == -ENODATA ||
          (rc == 0 && !strcmp(dom0less_enhanced, "enabled")) )
     {
-        if ( hardware_domain )
-            kinfo.dom0less_feature = DOM0LESS_ENHANCED;
-        else
-            panic("At the moment, Xenstore support requires dom0 to be present\n");
+        need_xenstore = true;
+        kinfo.dom0less_feature = DOM0LESS_ENHANCED;
     }
     else if ( rc == 0 && !strcmp(dom0less_enhanced, "legacy") )
     {
-        if ( hardware_domain )
-            kinfo.dom0less_feature = DOM0LESS_ENHANCED_LEGACY;
-        else
-            panic("At the moment, Xenstore support requires dom0 to be present\n");
+        need_xenstore = true;
+        kinfo.dom0less_feature = DOM0LESS_ENHANCED_LEGACY;
     }
     else if ( rc == 0 && !strcmp(dom0less_enhanced, "no-xenstore") )
         kinfo.dom0less_feature = DOM0LESS_ENHANCED_NO_XS;
@@ -1156,7 +1179,15 @@ void __init create_domUs(void)
         if ( rc )
             panic("Could not set up domain %s (rc = %d)\n",
                   dt_node_name(node), rc);
+
+        if ( d_cfg.flags & XEN_DOMCTL_CDF_xs_domain )
+            set_xs_domain(d);
     }
+
+    if ( need_xenstore && xs_domid == DOMID_INVALID )
+        panic("xenstore requested, but xenstore domain not present\n");
+
+    initialize_domU_xenstore();
 }
 
 /*
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 0a329f9f5e..270a6b97e4 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -2408,6 +2408,8 @@ void __init create_dom0(void)
     rc = construct_dom0(dom0);
     if ( rc )
         panic("Could not set up DOM0 guest OS (rc = %d)\n", rc);
+
+    set_xs_domain(dom0);
 }
 
 /*
diff --git a/xen/arch/arm/include/asm/dom0less-build.h b/xen/arch/arm/include/asm/dom0less-build.h
index 5864944bda..b0e41a1954 100644
--- a/xen/arch/arm/include/asm/dom0less-build.h
+++ b/xen/arch/arm/include/asm/dom0less-build.h
@@ -9,6 +9,7 @@
 
 void create_domUs(void);
 bool is_dom0less_mode(void);
+void set_xs_domain(struct domain *d);
 
 #else /* !CONFIG_DOM0LESS_BOOT */
 
@@ -17,6 +18,7 @@ static inline bool is_dom0less_mode(void)
 {
     return false;
 }
+static inline void set_xs_domain(struct domain *d) {}
 
 #endif /* CONFIG_DOM0LESS_BOOT */
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 22:12:18 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 22:12:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959506.1351847 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5twY-0001Yq-DZ; Fri, 18 Apr 2025 22:12:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959506.1351847; Fri, 18 Apr 2025 22:12:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5twY-0001Yi-An; Fri, 18 Apr 2025 22:12:18 +0000
Received: by outflank-mailman (input) for mailman id 959506;
 Fri, 18 Apr 2025 22:12:16 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u5twW-0001YW-DT
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 22:12:16 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5twW-006T1j-1F
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 22:12:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5twJ-00GqbP-10
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 22:12:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=VwwkbeAQOW0Z1cstaVPEqFHTRJ3oKuXKIqS/1zBPIDo=; b=Bk6uTytaN85hs4GN5a9jbDkUru
	ExQJp/BSP3eiyfNFWqfXjklTUPPCmO5aQ07utN4AIy1xoZCqjYxA6a9TpnyyefKdN0n9rdDtpO8b2
	aPX0FROzgvmLk89ydz5ehn1ZFE3PgjCUvW+JcyJxue4O+DVvM0fo62GYOCtOAXJfteM0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: dom0less seed xenstore grant table entry
Message-Id: <E1u5twJ-00GqbP-10@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 22:12:03 +0000

commit 7fc8120a2a857b43087c316d38e010da2d1cacf2
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Wed Apr 16 17:29:08 2025 -0400
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Fri Apr 18 13:41:29 2025 -0700

    xen/arm: dom0less seed xenstore grant table entry
    
    xenstored maps other domains' xenstore pages.  Currently this relies on
    init-dom0less or xl to seed the grants from Dom0.  With split
    hardware/control/xenstore domains, this is problematic since we don't
    want the hardware domain to be able to map other domains' resources
    without their permission.  Instead have the hypervisor seed the grant
    table entry for every dom0less domain.  The grant is then accessible as
    normal.
    
    C xenstored uses grants, so it can map the xenstore pages from a
    non-dom0 xenstore domain.  OCaml xenstored uses foreign mappings, so it
    can only run from a privileged domain (dom0).
    
    Add a define to indicate the late alloc xsentore PFN, to better indicate
    what is being checked.  Use UINT64_MAX instead of ~0ULL as the HVM_PARAM
    field is a uint64_t.  UINT64_MAX is not defined, so add it.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/dom0less-build.c | 10 +++++++++-
 xen/common/grant_table.c      | 14 ++++++++++++++
 xen/include/xen/grant_table.h |  4 ++++
 xen/include/xen/types.h       |  1 +
 4 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index bb8cc3be43..188ef40b52 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -20,6 +20,8 @@
 #include <asm/static-memory.h>
 #include <asm/static-shmem.h>
 
+#define XENSTORE_PFN_LATE_ALLOC UINT64_MAX
+
 static domid_t __initdata xs_domid = DOMID_INVALID;
 static bool __initdata need_xenstore;
 
@@ -756,7 +758,7 @@ static int __init alloc_xenstore_params(struct kernel_info *kinfo)
 
     if ( (kinfo->dom0less_feature & (DOM0LESS_XENSTORE | DOM0LESS_XS_LEGACY))
                                  == (DOM0LESS_XENSTORE | DOM0LESS_XS_LEGACY) )
-        d->arch.hvm.params[HVM_PARAM_STORE_PFN] = ~0ULL;
+        d->arch.hvm.params[HVM_PARAM_STORE_PFN] = XENSTORE_PFN_LATE_ALLOC;
     else if ( kinfo->dom0less_feature & DOM0LESS_XENSTORE )
     {
         rc = alloc_xenstore_page(d);
@@ -788,6 +790,12 @@ static void __init initialize_domU_xenstore(void)
         rc = alloc_xenstore_evtchn(d);
         if ( rc < 0 )
             panic("%pd: Failed to allocate xenstore_evtchn\n", d);
+
+        if ( gfn != XENSTORE_PFN_LATE_ALLOC && IS_ENABLED(CONFIG_GRANT_TABLE) )
+        {
+            ASSERT(gfn < UINT32_MAX);
+            gnttab_seed_entry(d, GNTTAB_RESERVED_XENSTORE, xs_domid, gfn);
+        }
     }
 }
 
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 6c77867f8c..e75ff98aff 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -4346,6 +4346,20 @@ static void gnttab_usage_print(struct domain *rd)
         printk("no active grant table entries\n");
 }
 
+#ifdef CONFIG_DOM0LESS_BOOT
+void __init gnttab_seed_entry(const struct domain *d, unsigned int idx,
+                              domid_t be_domid, uint32_t frame)
+{
+    const struct grant_table *gt = d->grant_table;
+
+    ASSERT(!d->creation_finished);
+    ASSERT(gt->gt_version == 1);
+    shared_entry_v1(gt, idx).flags = GTF_permit_access;
+    shared_entry_v1(gt, idx).domid = be_domid;
+    shared_entry_v1(gt, idx).frame = frame;
+}
+#endif
+
 static void cf_check gnttab_usage_print_all(unsigned char key)
 {
     struct domain *d;
diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h
index 50edfecfb6..297d7669e9 100644
--- a/xen/include/xen/grant_table.h
+++ b/xen/include/xen/grant_table.h
@@ -33,6 +33,10 @@
 
 struct grant_table;
 
+/* Seed a gnttab entry for Hyperlaunch/dom0less. */
+void gnttab_seed_entry(const struct domain *d, unsigned int idx,
+                       domid_t be_domid, uint32_t frame);
+
 #ifdef CONFIG_GRANT_TABLE
 
 extern unsigned int opt_gnttab_max_version;
diff --git a/xen/include/xen/types.h b/xen/include/xen/types.h
index e8d419b954..73ddccbbd5 100644
--- a/xen/include/xen/types.h
+++ b/xen/include/xen/types.h
@@ -44,6 +44,7 @@ typedef __UINTPTR_TYPE__ uintptr_t;
 #define UINT8_MAX       (255)
 #define UINT16_MAX      (65535)
 #define UINT32_MAX      (4294967295U)
+#define UINT64_MAX      (18446744073709551615ULL)
 
 #define INT_MAX         ((int)(~0U>>1))
 #define INT_MIN         (-INT_MAX - 1)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 22:12:29 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 22:12:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959507.1351851 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5twj-0001bZ-F3; Fri, 18 Apr 2025 22:12:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959507.1351851; Fri, 18 Apr 2025 22:12:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5twj-0001bS-CJ; Fri, 18 Apr 2025 22:12:29 +0000
Received: by outflank-mailman (input) for mailman id 959507;
 Fri, 18 Apr 2025 22:12:27 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u5twh-0001b3-F3
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 22:12:27 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5twh-006T1p-1P
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 22:12:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5twh-00Grfu-0r
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 22:12:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MdnHkd6VhUMx9u8p5KXsZMRa0z3NaaBbF0FRJhzp02E=; b=oOs55QLmJjAWefAwCTa78dA0I2
	tw4dI/zl84ypB6uQ3SKPPADZlSmcr6pBZVgPSbsG6XmZ3BlTlvgcu+HRN+4ePmq9ywrmyhidZPzFM
	nbvZMm1TgBVZfWd6/+TOneLl0UtyRbfO+4IbdkWJBEi3CnMSQLevg02zYlmX8dHRGiio=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/init-dom0less: Only seed legacy xenstore grants
Message-Id: <E1u5twh-00Grfu-0r@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 22:12:27 +0000

commit 375c4837ee10d481254e8910b873a6ce03cfd742
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Wed Apr 16 17:29:09 2025 -0400
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Fri Apr 18 13:41:29 2025 -0700

    tools/init-dom0less: Only seed legacy xenstore grants
    
    The hardware domain is unable to seed a control domain, but we want the
    control domain to use xenstore.  Rely on the hypervisor to seed dom0less
    grant table entries for Xenstore, so this seeding is unnecessary.
    
    However, that only works for the new xenstore late init.  The legacy
    protocol which uses init-dom0less to populate the page still needs to
    seed the grant.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 tools/helpers/init-dom0less.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/helpers/init-dom0less.c b/tools/helpers/init-dom0less.c
index 17579fe2e8..91edf17b6c 100644
--- a/tools/helpers/init-dom0less.c
+++ b/tools/helpers/init-dom0less.c
@@ -286,12 +286,12 @@ static int init_domain(struct xs_handle *xsh,
                 xenstore_pfn);
         if (rc < 0)
             return rc;
-    }
 
-    rc = xc_dom_gnttab_seed(xch, info->domid, true,
-                            (xen_pfn_t)-1, xenstore_pfn, 0, 0);
-    if (rc)
-        err(1, "xc_dom_gnttab_seed");
+        rc = xc_dom_gnttab_seed(xch, info->domid, true,
+                                (xen_pfn_t)-1, xenstore_pfn, 0, 0);
+        if (rc)
+               err(1, "xc_dom_gnttab_seed");
+    }
 
     libxl_uuid_generate(&uuid);
     xc_domain_sethandle(xch, info->domid, libxl_uuid_bytearray(&uuid));
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 22:12:39 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 22:12:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959508.1351855 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5twt-0001eZ-GM; Fri, 18 Apr 2025 22:12:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959508.1351855; Fri, 18 Apr 2025 22:12:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5twt-0001eQ-Dn; Fri, 18 Apr 2025 22:12:39 +0000
Received: by outflank-mailman (input) for mailman id 959508;
 Fri, 18 Apr 2025 22:12:38 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u5tws-0001e0-8k
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 22:12:38 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5tws-006T1z-0m
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 22:12:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5tws-00GsDJ-0B
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 22:12:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=irIbMFk8AVt4lnQVUhiAGjIFCdZXbmW+KuTDcK+4Xng=; b=uujo4MK454tCSUxhR2iqACOlk4
	fKvelrjTs/Vjst8AKjGAvP8TUEeRnNDzDfGKswfgCZ1fd4VVNLIkDDQO8Cfg76iVfoZ8bHvbWTu0g
	TsF38FcR5xkKsgSKNBlPHlRfoV0325u+B99lBrU+7QC85xUkIVEZn1y0SvnKsGEqJ7y8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: dom0less use has_dtb local variable
Message-Id: <E1u5tws-00GsDJ-0B@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 22:12:38 +0000

commit 00eee5a0e07921edf7e7fe560ade52e75cab8172
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Wed Apr 16 17:29:10 2025 -0400
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Fri Apr 18 13:41:29 2025 -0700

    xen/arm: dom0less use has_dtb local variable
    
    Store the result of finding a "multiboot,device-tree" node.  This will
    simplity adding hardware domain checks.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/dom0less-build.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index 188ef40b52..50d2d3e4e4 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -1033,6 +1033,7 @@ void __init create_domUs(void)
             .grant_opts = XEN_DOMCTL_GRANT_version(opt_gnttab_max_version),
         };
         unsigned int flags = 0U;
+        bool has_dtb = false;
         uint32_t val;
         int rc;
 
@@ -1067,9 +1068,10 @@ void __init create_domUs(void)
              !strcmp(dom0less_iommu, "enabled") )
             iommu = true;
 
-        if ( iommu_enabled &&
-             (iommu || dt_find_compatible_node(node, NULL,
-                                               "multiboot,device-tree")) )
+        if ( dt_find_compatible_node(node, NULL, "multiboot,device-tree") )
+            has_dtb = true;
+
+        if ( iommu_enabled && (iommu || has_dtb) )
             d_cfg.flags |= XEN_DOMCTL_CDF_iommu;
 
         if ( !dt_property_read_u32(node, "nr_spis", &d_cfg.arch.nr_spis) )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 18 22:12:50 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Apr 2025 22:12:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.959510.1351858 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5tx4-0001hZ-Hl; Fri, 18 Apr 2025 22:12:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 959510.1351858; Fri, 18 Apr 2025 22:12:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u5tx4-0001hS-FD; Fri, 18 Apr 2025 22:12:50 +0000
Received: by outflank-mailman (input) for mailman id 959510;
 Fri, 18 Apr 2025 22:12:48 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u5tx2-0001gz-US
 for xen-changelog@lists.xenproject.org; Fri, 18 Apr 2025 22:12:48 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5tx2-006T2G-2x
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 22:12:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u5tx2-00GseQ-2b
 for xen-changelog@lists.xenproject.org;
 Fri, 18 Apr 2025 22:12:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=e003ih3VKqB5pW7uEdxUDn38b8tMfvZPmAqJ/zkhRcI=; b=oKfb98zqwEqrfi8N72rTeN1vns
	9Px+CDCq1+zri9ci79HgiiTE5FmE/4pjUDpVfmShc7okqBcNFOhlsQfkEi7hPE7XQX+6c4Ix5t/kF
	J+uYH5kk/1Q1AzccpwMiz8JAXjAJZZ5CwWh7Wbfy6/Mt7I2PRlbVR9WAYpQIPaC3mTJA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Add capabilities to dom0less
Message-Id: <E1u5tx2-00GseQ-2b@xenbits.xenproject.org>
Date: Fri, 18 Apr 2025 22:12:48 +0000

commit df68a4cb7ed9418f0c5af56a717714b5280737e4
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Wed Apr 16 17:29:11 2025 -0400
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Fri Apr 18 13:41:29 2025 -0700

    xen/arm: Add capabilities to dom0less
    
    Add a capabilities property to dom0less to allow building a
    disaggregated system.  Only a single hardware domain and single xenstore
    domain can be specified.  Multiple control domains are possible.
    
    Introduce bootfdt.h to contain these constants.
    
    When using the hardware or xenstore capabilities, adjust the grant and
    event channel limits similar to dom0.
    
    For a hardware domain, disallow specifying "vpl011", "nr_spis",
    "multiboot,device-tree" and "passthrough" nodes.  Also, require an IOMMU
    when not direct-mapped,
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 docs/misc/arm/device-tree/booting.txt | 11 +++++++
 xen/arch/arm/dom0less-build.c         | 57 +++++++++++++++++++++++++++++++++--
 xen/arch/arm/domain.c                 |  3 +-
 xen/include/public/bootfdt.h          | 31 +++++++++++++++++++
 4 files changed, 98 insertions(+), 4 deletions(-)

diff --git a/docs/misc/arm/device-tree/booting.txt b/docs/misc/arm/device-tree/booting.txt
index ac781c9cc8..59fa96a82e 100644
--- a/docs/misc/arm/device-tree/booting.txt
+++ b/docs/misc/arm/device-tree/booting.txt
@@ -167,6 +167,17 @@ with the following properties:
     Refer to docs/misc/cache_coloring.rst for syntax. This option is applicable
     only to Arm64 guests.
 
+- capabilities
+    Optional.  A 32-bit integer representing a bit field of domain capabilities
+    for a disaggregated system.  A traditional dom0 has all of these
+    capabilities, and a domU has none of them.
+
+    0x1 DOMAIN_CAPS_CONTROL  - A privileged, control domain
+    0x2 DOMAIN_CAPS_HARDWARE - The hardware domain - there can be only 1
+    0x4 DOMAIN_CAPS_XENSTORE - The xenstore domain - there can be only 1
+
+    The default is no capabilities.
+
 - vpl011
 
     An empty property to enable/disable a virtual pl011 for the guest to
diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index 50d2d3e4e4..a356fc94fc 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -12,11 +12,13 @@
 #include <xen/sizes.h>
 #include <xen/vmap.h>
 
+#include <public/bootfdt.h>
 #include <public/io/xs_wire.h>
 
 #include <asm/arm64/sve.h>
 #include <asm/dom0less-build.h>
 #include <asm/domain_build.h>
+#include <asm/grant_table.h>
 #include <asm/static-memory.h>
 #include <asm/static-shmem.h>
 
@@ -928,6 +930,8 @@ static int __init construct_domU(struct domain *d,
            d->max_vcpus, mem);
 
     kinfo.vpl011 = dt_property_read_bool(node, "vpl011");
+    if ( kinfo.vpl011 && is_hardware_domain(d) )
+        panic("hardware domain cannot specify vpl011\n");
 
     rc = dt_property_read_string(node, "xen,enhanced", &dom0less_enhanced);
     if ( rc == -EILSEQ ||
@@ -1043,6 +1047,37 @@ void __init create_domUs(void)
         if ( (max_init_domid + 1) >= DOMID_FIRST_RESERVED )
             panic("No more domain IDs available\n");
 
+        if ( dt_property_read_u32(node, "capabilities", &val) )
+        {
+            if ( val & ~DOMAIN_CAPS_MASK )
+                panic("Invalid capabilities (%"PRIx32")\n", val);
+
+            if ( val & DOMAIN_CAPS_CONTROL )
+                flags |= CDF_privileged;
+
+            if ( val & DOMAIN_CAPS_HARDWARE )
+            {
+                if ( hardware_domain )
+                    panic("Only 1 hardware domain can be specified! (%pd)\n",
+                           hardware_domain);
+
+                d_cfg.max_grant_frames = gnttab_dom0_frames();
+                d_cfg.max_evtchn_port = -1;
+                flags |= CDF_hardware;
+                iommu = true;
+            }
+
+            if ( val & DOMAIN_CAPS_XENSTORE )
+            {
+                if ( xs_domid != DOMID_INVALID )
+                    panic("Only 1 xenstore domain can be specified! (%u)\n",
+                          xs_domid);
+
+                d_cfg.flags |= XEN_DOMCTL_CDF_xs_domain;
+                d_cfg.max_evtchn_port = -1;
+            }
+        }
+
         if ( dt_find_property(node, "xen,static-mem", NULL) )
         {
             if ( llc_coloring_enabled )
@@ -1064,12 +1099,26 @@ void __init create_domUs(void)
             panic("Missing property 'cpus' for domain %s\n",
                   dt_node_name(node));
 
-        if ( !dt_property_read_string(node, "passthrough", &dom0less_iommu) &&
-             !strcmp(dom0less_iommu, "enabled") )
-            iommu = true;
+        if ( !dt_property_read_string(node, "passthrough", &dom0less_iommu) )
+        {
+            if ( flags & CDF_hardware )
+                panic("Don't specify passthrough for hardware domain\n");
+
+            if ( !strcmp(dom0less_iommu, "enabled") )
+                iommu = true;
+        }
+
+        if ( (flags & CDF_hardware) && !(flags & CDF_directmap) &&
+             !iommu_enabled )
+            panic("non-direct mapped hardware domain requires iommu\n");
 
         if ( dt_find_compatible_node(node, NULL, "multiboot,device-tree") )
+        {
+            if ( flags & CDF_hardware )
+                panic("\"multiboot,device-tree\" incompatible with hardware domain\n");
+
             has_dtb = true;
+        }
 
         if ( iommu_enabled && (iommu || has_dtb) )
             d_cfg.flags |= XEN_DOMCTL_CDF_iommu;
@@ -1106,6 +1155,8 @@ void __init create_domUs(void)
                 d_cfg.arch.nr_spis = MAX(d_cfg.arch.nr_spis,
                                          vpl011_virq - 32 + 1);
         }
+        else if ( flags & CDF_hardware )
+            panic("nr_spis cannot be specified for hardware domain\n");
 
         /* Get the optional property domain-cpupool */
         cpupool_node = dt_parse_phandle(node, "domain-cpupool", 0);
diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 3ba959f866..dc4b4e84c1 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -608,7 +608,8 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
 {
     unsigned int max_vcpus;
     unsigned int flags_required = (XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap);
-    unsigned int flags_optional = (XEN_DOMCTL_CDF_iommu | XEN_DOMCTL_CDF_vpmu);
+    unsigned int flags_optional = (XEN_DOMCTL_CDF_iommu | XEN_DOMCTL_CDF_vpmu |
+                                   XEN_DOMCTL_CDF_xs_domain );
     unsigned int sve_vl_bits = sve_decode_vl(config->arch.sve_vl);
 
     if ( (config->flags & ~flags_optional) != flags_required )
diff --git a/xen/include/public/bootfdt.h b/xen/include/public/bootfdt.h
new file mode 100644
index 0000000000..86c46b42a9
--- /dev/null
+++ b/xen/include/public/bootfdt.h
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Xen Device Tree boot information
+ *
+ * Information for configuring Xen domains created at boot time.
+ */
+
+#ifndef __XEN_PUBLIC_BOOTFDT_H__
+#define __XEN_PUBLIC_BOOTFDT_H__
+
+/*
+ * Domain Capabilities specified in the "capabilities" property.  Use of
+ * this property allows splitting up the monolithic dom0 into separate,
+ * less privileged components.  A regular domU has no capabilities
+ * (which is the default if nothing is specified).  A traditional dom0
+ * has all three capabilities.
+ */
+
+/* Control/Privileged domain capable of affecting other domains. */
+#define DOMAIN_CAPS_CONTROL  (1U << 0)
+/*
+ * Hardware domain controlling physical hardware.  Typically providing
+ * backends to other domains.
+ */
+#define DOMAIN_CAPS_HARDWARE (1U << 1)
+/* Xenstore domain. */
+#define DOMAIN_CAPS_XENSTORE (1U << 2)
+#define DOMAIN_CAPS_MASK     (DOMAIN_CAPS_CONTROL | DOMAIN_CAPS_HARDWARE | \
+                              DOMAIN_CAPS_XENSTORE)
+
+#endif /* __XEN_PUBLIC_BOOTFDT_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 22 00:44:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Apr 2025 00:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.961636.1353003 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u71k3-0003rK-5K; Tue, 22 Apr 2025 00:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 961636.1353003; Tue, 22 Apr 2025 00: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 1u71k3-0003rC-2B; Tue, 22 Apr 2025 00:44:03 +0000
Received: by outflank-mailman (input) for mailman id 961636;
 Tue, 22 Apr 2025 00: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 1u71k1-0003r6-TZ
 for xen-changelog@lists.xenproject.org; Tue, 22 Apr 2025 00: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 1u71k1-00D3IU-1f
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 00:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u71k1-003xDR-1U
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 00: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=FiqB5tmfoLP4OySdXKsHtTIf+5PIb7qDqdJ8aMznUto=; b=4fSlQkDWdr0U5NKf3qCaMv8n8O
	cVXsrY+iJJVbPH+vxrvl6k9QI5oyIYxTjWtjOjhEAcu9Rk6WM4vlB+nLMfXZ5bKP+mvaJC/DwMwtL
	pwb1YKSD79YvL2h5tgjQPXKtcD18y+pslmeHSzrpVOjmJlyingVy0qZ2ouG2sowtPkUE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] iommu/arm: Add iommu_dt_xlate()
Message-Id: <E1u71k1-003xDR-1U@xenbits.xenproject.org>
Date: Tue, 22 Apr 2025 00:44:01 +0000

commit b8f43b71dad07a4878d0ee3061fd963429a04727
Author:     Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
AuthorDate: Fri Mar 14 13:34:50 2025 +0000
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Mon Apr 21 17:37:41 2025 -0700

    iommu/arm: Add iommu_dt_xlate()
    
    Move code for processing DT IOMMU specifier to a separate helper.
    This helper will be re-used for adding PCI devices by the subsequent
    patches as we will need exact the same actions for processing
    DT PCI-IOMMU specifier.
    
    Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/drivers/passthrough/device_tree.c | 42 ++++++++++++++++++++++-------------
 1 file changed, 27 insertions(+), 15 deletions(-)

diff --git a/xen/drivers/passthrough/device_tree.c b/xen/drivers/passthrough/device_tree.c
index 075fb25a37..4a1971c3fc 100644
--- a/xen/drivers/passthrough/device_tree.c
+++ b/xen/drivers/passthrough/device_tree.c
@@ -137,6 +137,30 @@ int iommu_release_dt_devices(struct domain *d)
     return 0;
 }
 
+static int iommu_dt_xlate(struct device *dev,
+                          const struct dt_phandle_args *iommu_spec,
+                          const struct iommu_ops *ops)
+{
+    int rc;
+
+    if ( !ops->dt_xlate )
+        return -EINVAL;
+
+    if ( !dt_device_is_available(iommu_spec->np) )
+        return 1;
+
+    rc = iommu_fwspec_init(dev, &iommu_spec->np->dev);
+    if ( rc )
+        return rc;
+
+    /*
+     * Provide DT IOMMU specifier which describes the IOMMU master
+     * interfaces of that device (device IDs, etc) to the driver.
+     * The driver is responsible to decide how to interpret them.
+     */
+    return ops->dt_xlate(dev, iommu_spec);
+}
+
 int iommu_remove_dt_device(struct dt_device_node *np)
 {
     const struct iommu_ops *ops = iommu_get_ops();
@@ -215,27 +239,15 @@ int iommu_add_dt_device(struct dt_device_node *np)
     {
         /*
          * The driver which supports generic IOMMU DT bindings must have
-         * these callback implemented.
+         * this callback implemented.
          */
-        if ( !ops->add_device || !ops->dt_xlate )
+        if ( !ops->add_device )
         {
             rc = -EINVAL;
             goto fail;
         }
 
-        if ( !dt_device_is_available(iommu_spec.np) )
-            break;
-
-        rc = iommu_fwspec_init(dev, &iommu_spec.np->dev);
-        if ( rc )
-            break;
-
-        /*
-         * Provide DT IOMMU specifier which describes the IOMMU master
-         * interfaces of that device (device IDs, etc) to the driver.
-         * The driver is responsible to decide how to interpret them.
-         */
-        rc = ops->dt_xlate(dev, &iommu_spec);
+        rc = iommu_dt_xlate(dev, &iommu_spec, ops);
         if ( rc )
             break;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 22 06:44:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Apr 2025 06:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.961684.1353027 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u77MQ-0004dp-FE; Tue, 22 Apr 2025 06:44:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 961684.1353027; Tue, 22 Apr 2025 06: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 1u77MQ-0004dh-CI; Tue, 22 Apr 2025 06:44:02 +0000
Received: by outflank-mailman (input) for mailman id 961684;
 Tue, 22 Apr 2025 06: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 1u77MP-0004db-Si
 for xen-changelog@lists.xenproject.org; Tue, 22 Apr 2025 06: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 1u77MP-00EjGA-26
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 06:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u77MP-00GHb0-1o
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 06: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=dP7X3/z7NSEfrp3UzYl2uUqbNR1LNX8qjlJKSN6IL5U=; b=Ejx72u9qQvaNOBJSBKW4vEBlhx
	n6nRXedETOAI43bVgFshiOkE4TvpPlcKNIlxTING4KEs3ftnGFE3gdPVRlAA8fLFv6p6TwA/rjPrC
	osGq9b06EQztUOOASIYVItKDmmnCNF7cyJB9Tl+AuCXSdKJ9IBnn5uf2fN7ucIwVANLg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] iommu/arm: Add iommu_dt_xlate()
Message-Id: <E1u77MP-00GHb0-1o@xenbits.xenproject.org>
Date: Tue, 22 Apr 2025 06:44:01 +0000

commit b8f43b71dad07a4878d0ee3061fd963429a04727
Author:     Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
AuthorDate: Fri Mar 14 13:34:50 2025 +0000
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Mon Apr 21 17:37:41 2025 -0700

    iommu/arm: Add iommu_dt_xlate()
    
    Move code for processing DT IOMMU specifier to a separate helper.
    This helper will be re-used for adding PCI devices by the subsequent
    patches as we will need exact the same actions for processing
    DT PCI-IOMMU specifier.
    
    Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/drivers/passthrough/device_tree.c | 42 ++++++++++++++++++++++-------------
 1 file changed, 27 insertions(+), 15 deletions(-)

diff --git a/xen/drivers/passthrough/device_tree.c b/xen/drivers/passthrough/device_tree.c
index 075fb25a37..4a1971c3fc 100644
--- a/xen/drivers/passthrough/device_tree.c
+++ b/xen/drivers/passthrough/device_tree.c
@@ -137,6 +137,30 @@ int iommu_release_dt_devices(struct domain *d)
     return 0;
 }
 
+static int iommu_dt_xlate(struct device *dev,
+                          const struct dt_phandle_args *iommu_spec,
+                          const struct iommu_ops *ops)
+{
+    int rc;
+
+    if ( !ops->dt_xlate )
+        return -EINVAL;
+
+    if ( !dt_device_is_available(iommu_spec->np) )
+        return 1;
+
+    rc = iommu_fwspec_init(dev, &iommu_spec->np->dev);
+    if ( rc )
+        return rc;
+
+    /*
+     * Provide DT IOMMU specifier which describes the IOMMU master
+     * interfaces of that device (device IDs, etc) to the driver.
+     * The driver is responsible to decide how to interpret them.
+     */
+    return ops->dt_xlate(dev, iommu_spec);
+}
+
 int iommu_remove_dt_device(struct dt_device_node *np)
 {
     const struct iommu_ops *ops = iommu_get_ops();
@@ -215,27 +239,15 @@ int iommu_add_dt_device(struct dt_device_node *np)
     {
         /*
          * The driver which supports generic IOMMU DT bindings must have
-         * these callback implemented.
+         * this callback implemented.
          */
-        if ( !ops->add_device || !ops->dt_xlate )
+        if ( !ops->add_device )
         {
             rc = -EINVAL;
             goto fail;
         }
 
-        if ( !dt_device_is_available(iommu_spec.np) )
-            break;
-
-        rc = iommu_fwspec_init(dev, &iommu_spec.np->dev);
-        if ( rc )
-            break;
-
-        /*
-         * Provide DT IOMMU specifier which describes the IOMMU master
-         * interfaces of that device (device IDs, etc) to the driver.
-         * The driver is responsible to decide how to interpret them.
-         */
-        rc = ops->dt_xlate(dev, &iommu_spec);
+        rc = iommu_dt_xlate(dev, &iommu_spec, ops);
         if ( rc )
             break;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 22 09:33:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Apr 2025 09:33:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.962369.1353561 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u79zy-0006vp-94; Tue, 22 Apr 2025 09:33:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 962369.1353561; Tue, 22 Apr 2025 09:33:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u79zy-0006vh-6a; Tue, 22 Apr 2025 09:33:02 +0000
Received: by outflank-mailman (input) for mailman id 962369;
 Tue, 22 Apr 2025 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 1u79zx-0006vX-TK
 for xen-changelog@lists.xenproject.org; Tue, 22 Apr 2025 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 1u79zx-00EoL2-2X
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 09:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u79zx-002fFU-2I
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 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=vYnHt2xZ7xOBFn90E9FPBZG8lO9QR0Tvr8Bsd3rgSao=; b=xyccUPLTtivh+Y7T6TP/HznwqI
	RAsi3sFilB9yV4jRmVqOVrfa4Qdf/PTVMOkiVmcd7X9mxxqjWzfd8oxetB2JNSSMhEinbb4xlo192
	JpD0Ynhl6AbIwNkMklG2b8ugHs/BwLFxPvKPTIl7AivSs2atRo3sK4hvSbLkQoj7bd1g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] vpci/msix: use host msix table address
Message-Id: <E1u79zx-002fFU-2I@xenbits.xenproject.org>
Date: Tue, 22 Apr 2025 09:33:01 +0000

commit d98df4c531adc5effe28489ca9cb865a27d2f85f
Author:     Stewart Hildebrand <stewart.hildebrand@amd.com>
AuthorDate: Tue Apr 22 11:21:54 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 22 11:21:54 2025 +0200

    vpci/msix: use host msix table address
    
    Introduce vmsix_table_host_{addr,base} returning the host physical MSI-X
    table address and base. Use them in update_entry() and get_table().
    
    Remove stale comment.
    
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/vpci/msix.c | 14 ++++----------
 xen/include/xen/vpci.h  | 13 +++++++++++++
 2 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index 6bd8c55bb4..f3804ce047 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -57,8 +57,8 @@ static void update_entry(struct vpci_msix_entry *entry,
     }
 
     rc = vpci_msix_arch_enable_entry(entry, pdev,
-                                     vmsix_table_base(pdev->vpci,
-                                                      VPCI_MSIX_TABLE));
+                                     vmsix_table_host_base(pdev->vpci,
+                                                           VPCI_MSIX_TABLE));
     if ( rc )
     {
         gprintk(XENLOG_WARNING, "%pp: unable to enable entry %u: %d\n",
@@ -218,14 +218,14 @@ static void __iomem *get_table(const struct vpci *vpci, unsigned int slot)
         addr = vmsix_table_size(vpci, VPCI_MSIX_TABLE);
         fallthrough;
     case VPCI_MSIX_TBL_HEAD:
-        addr += vmsix_table_addr(vpci, VPCI_MSIX_TABLE);
+        addr += vmsix_table_host_addr(vpci, VPCI_MSIX_TABLE);
         break;
 
     case VPCI_MSIX_PBA_TAIL:
         addr = vmsix_table_size(vpci, VPCI_MSIX_PBA);
         fallthrough;
     case VPCI_MSIX_PBA_HEAD:
-        addr += vmsix_table_addr(vpci, VPCI_MSIX_PBA);
+        addr += vmsix_table_host_addr(vpci, VPCI_MSIX_PBA);
         break;
 
     default:
@@ -242,12 +242,6 @@ static unsigned int get_slot(const struct vpci *vpci, unsigned long addr)
 {
     unsigned long pfn = PFN_DOWN(addr);
 
-    /*
-     * The logic below relies on having the tables identity mapped to the guest
-     * address space, or for the `addr` parameter to be translated into its
-     * host physical memory address equivalent.
-     */
-
     if ( pfn == PFN_DOWN(vmsix_table_addr(vpci, VPCI_MSIX_TABLE)) )
         return VPCI_MSIX_TBL_HEAD;
     if ( pfn == PFN_DOWN(vmsix_table_addr(vpci, VPCI_MSIX_TABLE) +
diff --git a/xen/include/xen/vpci.h b/xen/include/xen/vpci.h
index 807401b2ea..475981cb81 100644
--- a/xen/include/xen/vpci.h
+++ b/xen/include/xen/vpci.h
@@ -231,6 +231,19 @@ int vpci_msix_arch_print(const struct vpci_msix *msix);
  * Helper functions to fetch MSIX related data. They are used by both the
  * emulated MSIX code and the BAR handlers.
  */
+static inline paddr_t vmsix_table_host_base(const struct vpci *vpci,
+                                            unsigned int nr)
+{
+    return vpci->header.bars[vpci->msix->tables[nr] & PCI_MSIX_BIRMASK].addr;
+}
+
+static inline paddr_t vmsix_table_host_addr(const struct vpci *vpci,
+                                            unsigned int nr)
+{
+    return vmsix_table_host_base(vpci, nr) +
+           (vpci->msix->tables[nr] & ~PCI_MSIX_BIRMASK);
+}
+
 static inline paddr_t vmsix_table_base(const struct vpci *vpci, unsigned int nr)
 {
     return vpci->header.bars[vpci->msix->tables[nr] &
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 22 09:33:12 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Apr 2025 09:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.962370.1353565 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7A08-000725-Aw; Tue, 22 Apr 2025 09:33:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 962370.1353565; Tue, 22 Apr 2025 09:33:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7A08-00071x-83; Tue, 22 Apr 2025 09:33:12 +0000
Received: by outflank-mailman (input) for mailman id 962370;
 Tue, 22 Apr 2025 09:33:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u7A07-00070O-Tr
 for xen-changelog@lists.xenproject.org; Tue, 22 Apr 2025 09:33:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7A07-00EoLP-2p
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 09:33:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7A07-002fO8-2i
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 09:33:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=al7+DfLrhgI8CD+wtfFQbiB0pPX69qSfuxGNaq+1OtI=; b=NCLJF3/mfLhZfa8KhtspR7Vvv+
	lL8XMFwJZpqLecgHVu2fbZkeqLV9wZ3KlilUepVtJajsuukT0LVkoQ7VNkaDe152PJnv6rLPOiLHc
	hbM63rB6g1F6vQfAbf7fWQ376WTgshzq9/4C4/YzGR/ADapJQh7QSztXVU37wvbWiO/0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] Arm: rename smp_clear_cpu_maps()
Message-Id: <E1u7A07-002fO8-2i@xenbits.xenproject.org>
Date: Tue, 22 Apr 2025 09:33:11 +0000

commit 8d31a735bc4d65db2d267aa48e5bb62b7bd4739b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 22 11:23:41 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 22 11:23:41 2025 +0200

    Arm: rename smp_clear_cpu_maps()
    
    The function has lost all clearing operations. Use the commonly
    available name (declared in xen/smp.h), that x86 also uses. This then
    also addresses a Misra C:2012 rule 8.6 violation (not really covered
    by the deviation we have).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/smp.h | 1 -
 xen/arch/arm/setup.c           | 2 +-
 xen/arch/arm/smpboot.c         | 3 +--
 3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/include/asm/smp.h b/xen/arch/arm/include/asm/smp.h
index 8f765ed12a..f5c829e229 100644
--- a/xen/arch/arm/include/asm/smp.h
+++ b/xen/arch/arm/include/asm/smp.h
@@ -29,7 +29,6 @@ int cpu_up_send_sgi(int cpu);
 extern void init_secondary(void);
 
 extern void smp_init_cpus(void);
-extern void smp_clear_cpu_maps (void);
 extern unsigned int smp_get_max_cpus(void);
 
 #define cpu_physical_id(cpu) cpu_logical_map(cpu)
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 07703a15e1..10b46d0684 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -317,7 +317,7 @@ void asmlinkage __init start_xen(unsigned long fdt_paddr)
     /* Initialize traps early allow us to get backtrace when an error occurred */
     init_traps();
 
-    smp_clear_cpu_maps();
+    smp_prepare_boot_cpu();
 
     device_tree_flattened = early_fdt_map(fdt_paddr);
     if ( !device_tree_flattened )
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index cbde4ae351..73de7503e9 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -107,8 +107,7 @@ static void remove_cpu_sibling_map(int cpu)
     free_cpumask_var(per_cpu(cpu_core_mask, cpu));
 }
 
-void __init
-smp_clear_cpu_maps (void)
+void __init smp_prepare_boot_cpu(void)
 {
     cpumask_set_cpu(0, &cpu_online_map);
     cpumask_set_cpu(0, &cpu_possible_map);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 22 09:33:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Apr 2025 09:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.962371.1353569 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7A0J-00076W-C3; Tue, 22 Apr 2025 09:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 962371.1353569; Tue, 22 Apr 2025 09:33:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7A0J-00076O-9S; Tue, 22 Apr 2025 09:33:23 +0000
Received: by outflank-mailman (input) for mailman id 962371;
 Tue, 22 Apr 2025 09:33:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u7A0I-00076E-0r
 for xen-changelog@lists.xenproject.org; Tue, 22 Apr 2025 09:33:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7A0H-00EoLT-3D
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 09:33:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7A0H-002fUR-32
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 09:33: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=a5mO6EQ/VU4Xc8+yeLH+4QdAfZCzxBwEuKLHOhDDNtc=; b=wSiP+Wl5R4t9s76/GaiE8YH7LG
	WQl3zKl2nPpf1WdGlAL+/YVxw/Gf+A7TuegeUAjJUohtNNWa1H73qO8+B3xGn26NtrhQJDatZVwC9
	onJdEsOvh/mJfXqzAQJALC236DPga+fiQSd84/Xj297lX4jg3agjQj9F+B6SvklBgpuI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86emul: also clip repetition count for STOS
Message-Id: <E1u7A0H-002fUR-32@xenbits.xenproject.org>
Date: Tue, 22 Apr 2025 09:33:21 +0000

commit 8c5636b6c87777e6c2e4ffae28bffe1cfc189bfd
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 22 11:24:20 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 22 11:24:20 2025 +0200

    x86emul: also clip repetition count for STOS
    
    Like MOVS, INS, and OUTS, STOS also has a special purpose hook, where
    the hook function may legitimately have the same expectation as to the
    request not straddling address space start/end.
    
    Fixes: 5dfe4aa4eeb6 ("x86_emulate: Do not request emulation of REP instructions beyond the")
    Reported-by: Fabian Specht <f.specht@tum.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/x86_emulate/x86_emulate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 55d36b9a26..8e14ebb35b 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -2221,7 +2221,7 @@ x86_emulate(
 
         dst.bytes = src.bytes;
         dst.mem.seg = x86_seg_es;
-        dst.mem.off = truncate_ea(_regs.r(di));
+        dst.mem.off = truncate_ea_and_reps(_regs.r(di), nr_reps, dst.bytes);
         if ( (nr_reps == 1) || !ops->rep_stos ||
              ((rc = ops->rep_stos(&src.val,
                                   dst.mem.seg, dst.mem.off, dst.bytes,
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 22 09:33:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Apr 2025 09:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.962372.1353573 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7A0T-0007Co-De; Tue, 22 Apr 2025 09:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 962372.1353573; Tue, 22 Apr 2025 09: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 1u7A0T-0007Cf-Ap; Tue, 22 Apr 2025 09:33:33 +0000
Received: by outflank-mailman (input) for mailman id 962372;
 Tue, 22 Apr 2025 09: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 1u7A0S-0007CS-3n
 for xen-changelog@lists.xenproject.org; Tue, 22 Apr 2025 09: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 1u7A0S-00EoLX-0I
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 09:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7A0S-002ff4-0A
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 09: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=ABe7MtANF8GM05F3PQUDMk6fweYet4R79XE0xsQ/Xpo=; b=Bowj8RvXJ/rhTqf1+bA31wrj1k
	KFXaQKm+vn/+kD60M+4YqAozCbFu6EC6qu4B9qn0D2TBHjQO6yT7Ff+xGvK+XpDr8VoDCJJGG1fpV
	x/BFCF/IWpYY85JUc5iMrubAXWNQPUkSwOUbkMwEUY20BOrsTI9NRDDIEG0bs3hiXQOo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/boot: add cmdline to struct boot_domain
Message-Id: <E1u7A0S-002ff4-0A@xenbits.xenproject.org>
Date: Tue, 22 Apr 2025 09:33:32 +0000

commit 142f0a43a15af0a2f527c7cffe145eb587f14ff0
Author:     Daniel P. Smith <dpsmith@apertussolutions.com>
AuthorDate: Tue Apr 22 11:24:57 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 22 11:24:57 2025 +0200

    x86/boot: add cmdline to struct boot_domain
    
    Add a container for the "cooked" command line for a domain. This
    provides for the backing memory to be directly associated with the
    domain being constructed.  This is done in anticipation that the domain
    construction path may need to be invoked multiple times, thus ensuring
    each instance had a distinct memory allocation.
    
    Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Signed-off-by: Alejandro Vallejo <agarciav@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Denis Mukhin <dmukhin@ford.com>
---
 xen/arch/x86/hvm/dom0_build.c          | 31 ++++++++++-----------
 xen/arch/x86/include/asm/boot-domain.h |  1 +
 xen/arch/x86/pv/dom0_build.c           |  4 +--
 xen/arch/x86/setup.c                   | 51 ++++++++++++++++++++++++++--------
 4 files changed, 57 insertions(+), 30 deletions(-)

diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index 2a094b3145..a038e58c11 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -653,7 +653,7 @@ static int __init pvh_load_kernel(
     void *image_start = image_base + image->headroom;
     unsigned long image_len = image->size;
     unsigned long initrd_len = initrd ? initrd->size : 0;
-    const char *cmdline = image->cmdline_pa ? __va(image->cmdline_pa) : NULL;
+    size_t cmdline_len = bd->cmdline ? strlen(bd->cmdline) + 1 : 0;
     const char *initrd_cmdline = NULL;
     struct elf_binary elf;
     struct elf_dom_parms parms;
@@ -736,8 +736,7 @@ static int __init pvh_load_kernel(
             initrd = NULL;
     }
 
-    if ( cmdline )
-        extra_space += elf_round_up(&elf, strlen(cmdline) + 1);
+    extra_space += elf_round_up(&elf, cmdline_len);
 
     last_addr = find_memory(d, &elf, extra_space);
     if ( last_addr == INVALID_PADDR )
@@ -778,21 +777,21 @@ static int __init pvh_load_kernel(
     /* Free temporary buffers. */
     free_boot_modules();
 
-    if ( cmdline != NULL )
+    rc = hvm_copy_to_guest_phys(last_addr, bd->cmdline, cmdline_len, v);
+    if ( rc )
     {
-        rc = hvm_copy_to_guest_phys(last_addr, cmdline, strlen(cmdline) + 1, v);
-        if ( rc )
-        {
-            printk("Unable to copy guest command line\n");
-            return rc;
-        }
-        start_info.cmdline_paddr = last_addr;
-        /*
-         * Round up to 32/64 bits (depending on the guest kernel bitness) so
-         * the modlist/start_info is aligned.
-         */
-        last_addr += elf_round_up(&elf, strlen(cmdline) + 1);
+        printk("Unable to copy guest command line\n");
+        return rc;
     }
+
+    start_info.cmdline_paddr = cmdline_len ? last_addr : 0;
+
+    /*
+     * Round up to 32/64 bits (depending on the guest kernel bitness) so
+     * the modlist/start_info is aligned.
+     */
+    last_addr += elf_round_up(&elf, cmdline_len);
+
     if ( initrd != NULL )
     {
         rc = hvm_copy_to_guest_phys(last_addr, &mod, sizeof(mod), v);
diff --git a/xen/arch/x86/include/asm/boot-domain.h b/xen/arch/x86/include/asm/boot-domain.h
index fcbedda0f0..d7c6042e25 100644
--- a/xen/arch/x86/include/asm/boot-domain.h
+++ b/xen/arch/x86/include/asm/boot-domain.h
@@ -15,6 +15,7 @@ struct boot_domain {
 
     struct boot_module *kernel;
     struct boot_module *module;
+    const char *cmdline;
 
     struct domain *d;
 };
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index b485eea05f..e1b78d47c2 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -972,8 +972,8 @@ static int __init dom0_construct(const struct boot_domain *bd)
     }
 
     memset(si->cmd_line, 0, sizeof(si->cmd_line));
-    if ( image->cmdline_pa )
-        strlcpy((char *)si->cmd_line, __va(image->cmdline_pa), sizeof(si->cmd_line));
+    if ( bd->cmdline )
+        strlcpy((char *)si->cmd_line, bd->cmdline, sizeof(si->cmd_line));
 
 #ifdef CONFIG_VIDEO
     if ( !pv_shim && fill_console_start_info((void *)(si + 1)) )
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 24b36c1a59..cf1ea040dd 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -978,10 +978,30 @@ static unsigned int __init copy_bios_e820(struct e820entry *map, unsigned int li
     return n;
 }
 
-static struct domain *__init create_dom0(struct boot_info *bi)
+static size_t __init domain_cmdline_size(const struct boot_info *bi,
+                                         const struct boot_domain *bd)
 {
-    static char __initdata cmdline[MAX_GUEST_CMDLINE];
+    size_t s = bi->kextra ? strlen(bi->kextra) : 0;
+
+    s += bd->kernel->cmdline_pa ? strlen(__va(bd->kernel->cmdline_pa)) : 0;
 
+    if ( s == 0 )
+        return s;
+
+    /*
+     * Certain parameters from the Xen command line may be added to the dom0
+     * command line. Add additional space for the possible cases along with one
+     * extra char to hold \0.
+     */
+    s += strlen(" noapic") + strlen(" acpi=") + sizeof(acpi_param) + 1;
+
+    return s;
+}
+
+static struct domain *__init create_dom0(struct boot_info *bi)
+{
+    char *cmdline = NULL;
+    size_t cmdline_size;
     struct xen_domctl_createdomain dom0_cfg = {
         .flags = IS_ENABLED(CONFIG_TBOOT) ? XEN_DOMCTL_CDF_s3_integrity : 0,
         .max_evtchn_port = -1,
@@ -1021,20 +1041,24 @@ static struct domain *__init create_dom0(struct boot_info *bi)
     if ( alloc_dom0_vcpu0(d) == NULL )
         panic("Error creating %pdv0\n", d);
 
-    /* Grab the DOM0 command line. */
-    if ( bd->kernel->cmdline_pa || bi->kextra )
+    cmdline_size = domain_cmdline_size(bi, bd);
+    if ( cmdline_size )
     {
+        if ( !(cmdline = xzalloc_array(char, cmdline_size)) )
+            panic("Error allocating cmdline buffer for %pd\n", d);
+
         if ( bd->kernel->cmdline_pa )
-            safe_strcpy(cmdline,
-                        cmdline_cook(__va(bd->kernel->cmdline_pa), bi->loader));
+            strlcpy(cmdline,
+                    cmdline_cook(__va(bd->kernel->cmdline_pa), bi->loader),
+                    cmdline_size);
 
         if ( bi->kextra )
             /* kextra always includes exactly one leading space. */
-            safe_strcat(cmdline, bi->kextra);
+            strlcat(cmdline, bi->kextra, cmdline_size);
 
         /* Append any extra parameters. */
         if ( skip_ioapic_setup && !strstr(cmdline, "noapic") )
-            safe_strcat(cmdline, " noapic");
+            strlcat(cmdline, " noapic", cmdline_size);
 
         if ( (strlen(acpi_param) == 0) && acpi_disabled )
         {
@@ -1044,17 +1068,20 @@ static struct domain *__init create_dom0(struct boot_info *bi)
 
         if ( (strlen(acpi_param) != 0) && !strstr(cmdline, "acpi=") )
         {
-            safe_strcat(cmdline, " acpi=");
-            safe_strcat(cmdline, acpi_param);
+            strlcat(cmdline, " acpi=", cmdline_size);
+            strlcat(cmdline, acpi_param, cmdline_size);
         }
-
-        bd->kernel->cmdline_pa = __pa(cmdline);
+        bd->kernel->cmdline_pa = 0;
+        bd->cmdline = cmdline;
     }
 
     bd->d = d;
     if ( construct_dom0(bd) != 0 )
         panic("Could not construct domain 0\n");
 
+    bd->cmdline = NULL;
+    xfree(cmdline);
+
     return d;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 22 09:33:43 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Apr 2025 09:33:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.962373.1353577 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7A0d-0007IL-Gf; Tue, 22 Apr 2025 09:33:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 962373.1353577; Tue, 22 Apr 2025 09: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 1u7A0d-0007IE-Du; Tue, 22 Apr 2025 09:33:43 +0000
Received: by outflank-mailman (input) for mailman id 962373;
 Tue, 22 Apr 2025 09: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 1u7A0c-0007I5-6b
 for xen-changelog@lists.xenproject.org; Tue, 22 Apr 2025 09: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 1u7A0c-00EoLe-0Z
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 09:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7A0c-002fjF-0S
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 09: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=/uGv5j+wQmZ4GXIfeoerTYg7Jt7DYPDSQZgF+MQXQvk=; b=xWFCWMg5TP/Hlyhqa6TwepMYkA
	O5Nw2/jUwUlD37rQjAPbgWBVNbP8bKWPW5RVPlf6+FUTVpMsPnMunZpMaec86e8di9+W6FtTYovNM
	FJWkXJ4S2fYgySIquqfv599PUJclIyLMLCJz7K3ZSsT/fFWViNi/V/nBxhK25+bgZeXQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] compat/memory: avoid UB shifts in XENMEM_exchange handling
Message-Id: <E1u7A0c-002fjF-0S@xenbits.xenproject.org>
Date: Tue, 22 Apr 2025 09:33:42 +0000

commit 560c51be8f6a88cde43c0a7c8be60158b5725982
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 22 11:25:23 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 22 11:25:23 2025 +0200

    compat/memory: avoid UB shifts in XENMEM_exchange handling
    
    Add an early basic check, yielding the same error code as the more
    thorough one the main handler would produce.
    
    Fixes: b8a7efe8528a ("Enable compatibility mode operation for HYPERVISOR_memory_op")
    Reported-by: Manuel Andreas <manuel.andreas@tum.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/compat/memory.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c
index 45e5fb0e5d..2ec3a3a1db 100644
--- a/xen/common/compat/memory.c
+++ b/xen/common/compat/memory.c
@@ -161,6 +161,11 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
             if ( copy_from_guest(&cmp.xchg, arg, 1) )
                 return -EFAULT;
 
+            /* Early coarse check, as max_order() isn't available here. */
+            if ( cmp.xchg.in.extent_order >= BITS_PER_INT ||
+                 cmp.xchg.out.extent_order >= BITS_PER_INT )
+                return -EPERM;
+
             order_delta = cmp.xchg.out.extent_order - cmp.xchg.in.extent_order;
             /* Various sanity checks. */
             if ( (cmp.xchg.nr_exchanged > cmp.xchg.in.nr_extents) ||
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 22 09:33:53 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Apr 2025 09:33:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.962374.1353582 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7A0n-0007OF-ID; Tue, 22 Apr 2025 09:33:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 962374.1353582; Tue, 22 Apr 2025 09: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 1u7A0n-0007O5-FS; Tue, 22 Apr 2025 09:33:53 +0000
Received: by outflank-mailman (input) for mailman id 962374;
 Tue, 22 Apr 2025 09: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 1u7A0m-0007Ne-9k
 for xen-changelog@lists.xenproject.org; Tue, 22 Apr 2025 09: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 1u7A0m-00EoLk-0q
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 09:33:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7A0m-002frn-0k
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 09: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=IiZYKp28g5HruuCz3QWg9iu2AldCbAEFMX+hfFL0ka4=; b=4AkNknKcKZxgwJ/f8nOXMiB+QK
	1eaECf9KbLJhbYkFO7SgB34gnHjYYkWGZIh77znJqXzd4+2VJfEDvxD9Pa/nQY1YZ2mck368o2NUm
	QZOL5gNo4v5QM+Y2hWhVVCXhvQxiq280R4JSgfdhXohTg6+UERpAzUszJyv6KyXT+e0M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xenstored: Remove setjmp.h
Message-Id: <E1u7A0m-002frn-0k@xenbits.xenproject.org>
Date: Tue, 22 Apr 2025 09:33:52 +0000

commit 1163d45b566d62014824607fe103061dca0e6749
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Tue Apr 22 11:25:48 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 22 11:25:48 2025 +0200

    xenstored: Remove setjmp.h
    
    Use of setjmp/longjmp as removed in 2006, but the include remained.
    Remove it now.
    
    Fixes: 1bac3b49cdd4 ("Import the current version of talloc from the Samba 3 source base")
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 tools/xenstored/core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/xenstored/core.c b/tools/xenstored/core.c
index bada1ad9a2..37e4dd5a5b 100644
--- a/tools/xenstored/core.c
+++ b/tools/xenstored/core.c
@@ -35,7 +35,6 @@
 #include <getopt.h>
 #include <signal.h>
 #include <assert.h>
-#include <setjmp.h>
 
 #include <xenevtchn.h>
 #include <xen-tools/xenstore-common.h>
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 22 10:33:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Apr 2025 10:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.962424.1353626 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7Aw3-0007lt-GJ; Tue, 22 Apr 2025 10:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 962424.1353626; Tue, 22 Apr 2025 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 1u7Aw3-0007lj-DK; Tue, 22 Apr 2025 10:33:03 +0000
Received: by outflank-mailman (input) for mailman id 962424;
 Tue, 22 Apr 2025 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 1u7Aw2-0007kG-9s
 for xen-changelog@lists.xenproject.org; Tue, 22 Apr 2025 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 1u7Aw1-00Eq4X-37
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 10:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7Aw1-003Oio-2q
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 10: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=AjQP/tt76eRZM31IDr3CtVNQThluaIkwHq/P4JLfT+I=; b=kvN8hLhsfwDpUw+iizBiiiXmwj
	pkTLjlicqiWgvCcbKzp7uvyISLIAjPb3SgWvJIGQatApCDRgg3QIoV5cbf9ta1Fx/xJuXMaWGWnsF
	4WyhPkCTfSxhYubWTR4Tj1qo6tGxWRIOBBYLFN+ae5XuHcPsU26B8edh7+ESc0fXe8JA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] vpci/msix: use host msix table address
Message-Id: <E1u7Aw1-003Oio-2q@xenbits.xenproject.org>
Date: Tue, 22 Apr 2025 10:33:01 +0000

commit d98df4c531adc5effe28489ca9cb865a27d2f85f
Author:     Stewart Hildebrand <stewart.hildebrand@amd.com>
AuthorDate: Tue Apr 22 11:21:54 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 22 11:21:54 2025 +0200

    vpci/msix: use host msix table address
    
    Introduce vmsix_table_host_{addr,base} returning the host physical MSI-X
    table address and base. Use them in update_entry() and get_table().
    
    Remove stale comment.
    
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/vpci/msix.c | 14 ++++----------
 xen/include/xen/vpci.h  | 13 +++++++++++++
 2 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index 6bd8c55bb4..f3804ce047 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -57,8 +57,8 @@ static void update_entry(struct vpci_msix_entry *entry,
     }
 
     rc = vpci_msix_arch_enable_entry(entry, pdev,
-                                     vmsix_table_base(pdev->vpci,
-                                                      VPCI_MSIX_TABLE));
+                                     vmsix_table_host_base(pdev->vpci,
+                                                           VPCI_MSIX_TABLE));
     if ( rc )
     {
         gprintk(XENLOG_WARNING, "%pp: unable to enable entry %u: %d\n",
@@ -218,14 +218,14 @@ static void __iomem *get_table(const struct vpci *vpci, unsigned int slot)
         addr = vmsix_table_size(vpci, VPCI_MSIX_TABLE);
         fallthrough;
     case VPCI_MSIX_TBL_HEAD:
-        addr += vmsix_table_addr(vpci, VPCI_MSIX_TABLE);
+        addr += vmsix_table_host_addr(vpci, VPCI_MSIX_TABLE);
         break;
 
     case VPCI_MSIX_PBA_TAIL:
         addr = vmsix_table_size(vpci, VPCI_MSIX_PBA);
         fallthrough;
     case VPCI_MSIX_PBA_HEAD:
-        addr += vmsix_table_addr(vpci, VPCI_MSIX_PBA);
+        addr += vmsix_table_host_addr(vpci, VPCI_MSIX_PBA);
         break;
 
     default:
@@ -242,12 +242,6 @@ static unsigned int get_slot(const struct vpci *vpci, unsigned long addr)
 {
     unsigned long pfn = PFN_DOWN(addr);
 
-    /*
-     * The logic below relies on having the tables identity mapped to the guest
-     * address space, or for the `addr` parameter to be translated into its
-     * host physical memory address equivalent.
-     */
-
     if ( pfn == PFN_DOWN(vmsix_table_addr(vpci, VPCI_MSIX_TABLE)) )
         return VPCI_MSIX_TBL_HEAD;
     if ( pfn == PFN_DOWN(vmsix_table_addr(vpci, VPCI_MSIX_TABLE) +
diff --git a/xen/include/xen/vpci.h b/xen/include/xen/vpci.h
index 807401b2ea..475981cb81 100644
--- a/xen/include/xen/vpci.h
+++ b/xen/include/xen/vpci.h
@@ -231,6 +231,19 @@ int vpci_msix_arch_print(const struct vpci_msix *msix);
  * Helper functions to fetch MSIX related data. They are used by both the
  * emulated MSIX code and the BAR handlers.
  */
+static inline paddr_t vmsix_table_host_base(const struct vpci *vpci,
+                                            unsigned int nr)
+{
+    return vpci->header.bars[vpci->msix->tables[nr] & PCI_MSIX_BIRMASK].addr;
+}
+
+static inline paddr_t vmsix_table_host_addr(const struct vpci *vpci,
+                                            unsigned int nr)
+{
+    return vmsix_table_host_base(vpci, nr) +
+           (vpci->msix->tables[nr] & ~PCI_MSIX_BIRMASK);
+}
+
 static inline paddr_t vmsix_table_base(const struct vpci *vpci, unsigned int nr)
 {
     return vpci->header.bars[vpci->msix->tables[nr] &
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 22 10:33:12 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Apr 2025 10:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.962425.1353629 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7AwC-0007on-HM; Tue, 22 Apr 2025 10:33:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 962425.1353629; Tue, 22 Apr 2025 10: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 1u7AwC-0007of-Eg; Tue, 22 Apr 2025 10:33:12 +0000
Received: by outflank-mailman (input) for mailman id 962425;
 Tue, 22 Apr 2025 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 1u7AwC-0007oX-3P
 for xen-changelog@lists.xenproject.org; Tue, 22 Apr 2025 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 1u7AwC-00Eq55-0C
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 10:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7AwC-003Oqy-04
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 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=l/xBgrjocqNKJgT/49VtOWVqaCBoSDmR5tAEqr3+YcU=; b=KvfKjC/VfRD1vM+UZDyTkbp9lY
	llj/VgCk8XEYrjAkVXMgDQQmgyAIjvBBH23l56QmroRyrLNDm0pFHSC4zNP6MsJmxRRSt4Spzs6U4
	Wzv4fjFmWAw3hWik50G2BKTqesaXq3hGnpzvsT1n73IRFJTa4i3kCy/97eXLUKhePkvM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Arm: rename smp_clear_cpu_maps()
Message-Id: <E1u7AwC-003Oqy-04@xenbits.xenproject.org>
Date: Tue, 22 Apr 2025 10:33:12 +0000

commit 8d31a735bc4d65db2d267aa48e5bb62b7bd4739b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 22 11:23:41 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 22 11:23:41 2025 +0200

    Arm: rename smp_clear_cpu_maps()
    
    The function has lost all clearing operations. Use the commonly
    available name (declared in xen/smp.h), that x86 also uses. This then
    also addresses a Misra C:2012 rule 8.6 violation (not really covered
    by the deviation we have).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/smp.h | 1 -
 xen/arch/arm/setup.c           | 2 +-
 xen/arch/arm/smpboot.c         | 3 +--
 3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/include/asm/smp.h b/xen/arch/arm/include/asm/smp.h
index 8f765ed12a..f5c829e229 100644
--- a/xen/arch/arm/include/asm/smp.h
+++ b/xen/arch/arm/include/asm/smp.h
@@ -29,7 +29,6 @@ int cpu_up_send_sgi(int cpu);
 extern void init_secondary(void);
 
 extern void smp_init_cpus(void);
-extern void smp_clear_cpu_maps (void);
 extern unsigned int smp_get_max_cpus(void);
 
 #define cpu_physical_id(cpu) cpu_logical_map(cpu)
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 07703a15e1..10b46d0684 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -317,7 +317,7 @@ void asmlinkage __init start_xen(unsigned long fdt_paddr)
     /* Initialize traps early allow us to get backtrace when an error occurred */
     init_traps();
 
-    smp_clear_cpu_maps();
+    smp_prepare_boot_cpu();
 
     device_tree_flattened = early_fdt_map(fdt_paddr);
     if ( !device_tree_flattened )
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index cbde4ae351..73de7503e9 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -107,8 +107,7 @@ static void remove_cpu_sibling_map(int cpu)
     free_cpumask_var(per_cpu(cpu_core_mask, cpu));
 }
 
-void __init
-smp_clear_cpu_maps (void)
+void __init smp_prepare_boot_cpu(void)
 {
     cpumask_set_cpu(0, &cpu_online_map);
     cpumask_set_cpu(0, &cpu_possible_map);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 22 10:33:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Apr 2025 10:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.962426.1353635 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7AwN-0007u5-K5; Tue, 22 Apr 2025 10:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 962426.1353635; Tue, 22 Apr 2025 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 1u7AwN-0007tv-G6; Tue, 22 Apr 2025 10:33:23 +0000
Received: by outflank-mailman (input) for mailman id 962426;
 Tue, 22 Apr 2025 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 1u7AwM-0007sT-6h
 for xen-changelog@lists.xenproject.org; Tue, 22 Apr 2025 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 1u7AwM-00Eq5B-0X
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 10:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7AwM-003Ozc-0P
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 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=mLp8cfUwO6SzFY8RHi1BBErIpsH9OVPfpWtw+HxsUtc=; b=KH6a20cXj8Hl5SZBoVVuWy0Jqv
	gX2ktRk6RW5H30Qgz0tNWYwqRDWKcVn7Xd9bFQWFrm6+6kmLiyOPqxf7gtxMMRYEpH3h1nZ562X2B
	AWUFJmfObO4tUNpjlATaLQQC+gDg+CrKucn0ln9ESREedB00swUITI5t0/AuLObXpEhI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86emul: also clip repetition count for STOS
Message-Id: <E1u7AwM-003Ozc-0P@xenbits.xenproject.org>
Date: Tue, 22 Apr 2025 10:33:22 +0000

commit 8c5636b6c87777e6c2e4ffae28bffe1cfc189bfd
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 22 11:24:20 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 22 11:24:20 2025 +0200

    x86emul: also clip repetition count for STOS
    
    Like MOVS, INS, and OUTS, STOS also has a special purpose hook, where
    the hook function may legitimately have the same expectation as to the
    request not straddling address space start/end.
    
    Fixes: 5dfe4aa4eeb6 ("x86_emulate: Do not request emulation of REP instructions beyond the")
    Reported-by: Fabian Specht <f.specht@tum.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/x86_emulate/x86_emulate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 55d36b9a26..8e14ebb35b 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -2221,7 +2221,7 @@ x86_emulate(
 
         dst.bytes = src.bytes;
         dst.mem.seg = x86_seg_es;
-        dst.mem.off = truncate_ea(_regs.r(di));
+        dst.mem.off = truncate_ea_and_reps(_regs.r(di), nr_reps, dst.bytes);
         if ( (nr_reps == 1) || !ops->rep_stos ||
              ((rc = ops->rep_stos(&src.val,
                                   dst.mem.seg, dst.mem.off, dst.bytes,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 22 10:33:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Apr 2025 10:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.962427.1353636 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7AwX-0007xp-K8; Tue, 22 Apr 2025 10:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 962427.1353636; Tue, 22 Apr 2025 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 1u7AwX-0007xg-HU; Tue, 22 Apr 2025 10:33:33 +0000
Received: by outflank-mailman (input) for mailman id 962427;
 Tue, 22 Apr 2025 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 1u7AwW-0007xQ-B9
 for xen-changelog@lists.xenproject.org; Tue, 22 Apr 2025 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 1u7AwW-00Eq5I-11
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 10:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7AwW-003P9d-0k
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 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=H0yKJ9rDIWY5l/lnYsfqHLXjk8//vrnZvUL7WQD2a3U=; b=UkIsUwoRlByQah4FgoBYKiV3fD
	V/Cl/F/IHb1OP7mvQEYx4etXo3nXBSPoF3hKaAf/CjgqX75oF4EycRNwGgr9c4QroWDAibmAxBjmY
	WtTlOd4Egty4Ak+wUlmliucigcF7Yl4mizpHgWoQ72jk98HaLMC0nCK2G34bbpzitAOw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/boot: add cmdline to struct boot_domain
Message-Id: <E1u7AwW-003P9d-0k@xenbits.xenproject.org>
Date: Tue, 22 Apr 2025 10:33:32 +0000

commit 142f0a43a15af0a2f527c7cffe145eb587f14ff0
Author:     Daniel P. Smith <dpsmith@apertussolutions.com>
AuthorDate: Tue Apr 22 11:24:57 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 22 11:24:57 2025 +0200

    x86/boot: add cmdline to struct boot_domain
    
    Add a container for the "cooked" command line for a domain. This
    provides for the backing memory to be directly associated with the
    domain being constructed.  This is done in anticipation that the domain
    construction path may need to be invoked multiple times, thus ensuring
    each instance had a distinct memory allocation.
    
    Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Signed-off-by: Alejandro Vallejo <agarciav@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Denis Mukhin <dmukhin@ford.com>
---
 xen/arch/x86/hvm/dom0_build.c          | 31 ++++++++++-----------
 xen/arch/x86/include/asm/boot-domain.h |  1 +
 xen/arch/x86/pv/dom0_build.c           |  4 +--
 xen/arch/x86/setup.c                   | 51 ++++++++++++++++++++++++++--------
 4 files changed, 57 insertions(+), 30 deletions(-)

diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index 2a094b3145..a038e58c11 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -653,7 +653,7 @@ static int __init pvh_load_kernel(
     void *image_start = image_base + image->headroom;
     unsigned long image_len = image->size;
     unsigned long initrd_len = initrd ? initrd->size : 0;
-    const char *cmdline = image->cmdline_pa ? __va(image->cmdline_pa) : NULL;
+    size_t cmdline_len = bd->cmdline ? strlen(bd->cmdline) + 1 : 0;
     const char *initrd_cmdline = NULL;
     struct elf_binary elf;
     struct elf_dom_parms parms;
@@ -736,8 +736,7 @@ static int __init pvh_load_kernel(
             initrd = NULL;
     }
 
-    if ( cmdline )
-        extra_space += elf_round_up(&elf, strlen(cmdline) + 1);
+    extra_space += elf_round_up(&elf, cmdline_len);
 
     last_addr = find_memory(d, &elf, extra_space);
     if ( last_addr == INVALID_PADDR )
@@ -778,21 +777,21 @@ static int __init pvh_load_kernel(
     /* Free temporary buffers. */
     free_boot_modules();
 
-    if ( cmdline != NULL )
+    rc = hvm_copy_to_guest_phys(last_addr, bd->cmdline, cmdline_len, v);
+    if ( rc )
     {
-        rc = hvm_copy_to_guest_phys(last_addr, cmdline, strlen(cmdline) + 1, v);
-        if ( rc )
-        {
-            printk("Unable to copy guest command line\n");
-            return rc;
-        }
-        start_info.cmdline_paddr = last_addr;
-        /*
-         * Round up to 32/64 bits (depending on the guest kernel bitness) so
-         * the modlist/start_info is aligned.
-         */
-        last_addr += elf_round_up(&elf, strlen(cmdline) + 1);
+        printk("Unable to copy guest command line\n");
+        return rc;
     }
+
+    start_info.cmdline_paddr = cmdline_len ? last_addr : 0;
+
+    /*
+     * Round up to 32/64 bits (depending on the guest kernel bitness) so
+     * the modlist/start_info is aligned.
+     */
+    last_addr += elf_round_up(&elf, cmdline_len);
+
     if ( initrd != NULL )
     {
         rc = hvm_copy_to_guest_phys(last_addr, &mod, sizeof(mod), v);
diff --git a/xen/arch/x86/include/asm/boot-domain.h b/xen/arch/x86/include/asm/boot-domain.h
index fcbedda0f0..d7c6042e25 100644
--- a/xen/arch/x86/include/asm/boot-domain.h
+++ b/xen/arch/x86/include/asm/boot-domain.h
@@ -15,6 +15,7 @@ struct boot_domain {
 
     struct boot_module *kernel;
     struct boot_module *module;
+    const char *cmdline;
 
     struct domain *d;
 };
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index b485eea05f..e1b78d47c2 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -972,8 +972,8 @@ static int __init dom0_construct(const struct boot_domain *bd)
     }
 
     memset(si->cmd_line, 0, sizeof(si->cmd_line));
-    if ( image->cmdline_pa )
-        strlcpy((char *)si->cmd_line, __va(image->cmdline_pa), sizeof(si->cmd_line));
+    if ( bd->cmdline )
+        strlcpy((char *)si->cmd_line, bd->cmdline, sizeof(si->cmd_line));
 
 #ifdef CONFIG_VIDEO
     if ( !pv_shim && fill_console_start_info((void *)(si + 1)) )
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 24b36c1a59..cf1ea040dd 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -978,10 +978,30 @@ static unsigned int __init copy_bios_e820(struct e820entry *map, unsigned int li
     return n;
 }
 
-static struct domain *__init create_dom0(struct boot_info *bi)
+static size_t __init domain_cmdline_size(const struct boot_info *bi,
+                                         const struct boot_domain *bd)
 {
-    static char __initdata cmdline[MAX_GUEST_CMDLINE];
+    size_t s = bi->kextra ? strlen(bi->kextra) : 0;
+
+    s += bd->kernel->cmdline_pa ? strlen(__va(bd->kernel->cmdline_pa)) : 0;
 
+    if ( s == 0 )
+        return s;
+
+    /*
+     * Certain parameters from the Xen command line may be added to the dom0
+     * command line. Add additional space for the possible cases along with one
+     * extra char to hold \0.
+     */
+    s += strlen(" noapic") + strlen(" acpi=") + sizeof(acpi_param) + 1;
+
+    return s;
+}
+
+static struct domain *__init create_dom0(struct boot_info *bi)
+{
+    char *cmdline = NULL;
+    size_t cmdline_size;
     struct xen_domctl_createdomain dom0_cfg = {
         .flags = IS_ENABLED(CONFIG_TBOOT) ? XEN_DOMCTL_CDF_s3_integrity : 0,
         .max_evtchn_port = -1,
@@ -1021,20 +1041,24 @@ static struct domain *__init create_dom0(struct boot_info *bi)
     if ( alloc_dom0_vcpu0(d) == NULL )
         panic("Error creating %pdv0\n", d);
 
-    /* Grab the DOM0 command line. */
-    if ( bd->kernel->cmdline_pa || bi->kextra )
+    cmdline_size = domain_cmdline_size(bi, bd);
+    if ( cmdline_size )
     {
+        if ( !(cmdline = xzalloc_array(char, cmdline_size)) )
+            panic("Error allocating cmdline buffer for %pd\n", d);
+
         if ( bd->kernel->cmdline_pa )
-            safe_strcpy(cmdline,
-                        cmdline_cook(__va(bd->kernel->cmdline_pa), bi->loader));
+            strlcpy(cmdline,
+                    cmdline_cook(__va(bd->kernel->cmdline_pa), bi->loader),
+                    cmdline_size);
 
         if ( bi->kextra )
             /* kextra always includes exactly one leading space. */
-            safe_strcat(cmdline, bi->kextra);
+            strlcat(cmdline, bi->kextra, cmdline_size);
 
         /* Append any extra parameters. */
         if ( skip_ioapic_setup && !strstr(cmdline, "noapic") )
-            safe_strcat(cmdline, " noapic");
+            strlcat(cmdline, " noapic", cmdline_size);
 
         if ( (strlen(acpi_param) == 0) && acpi_disabled )
         {
@@ -1044,17 +1068,20 @@ static struct domain *__init create_dom0(struct boot_info *bi)
 
         if ( (strlen(acpi_param) != 0) && !strstr(cmdline, "acpi=") )
         {
-            safe_strcat(cmdline, " acpi=");
-            safe_strcat(cmdline, acpi_param);
+            strlcat(cmdline, " acpi=", cmdline_size);
+            strlcat(cmdline, acpi_param, cmdline_size);
         }
-
-        bd->kernel->cmdline_pa = __pa(cmdline);
+        bd->kernel->cmdline_pa = 0;
+        bd->cmdline = cmdline;
     }
 
     bd->d = d;
     if ( construct_dom0(bd) != 0 )
         panic("Could not construct domain 0\n");
 
+    bd->cmdline = NULL;
+    xfree(cmdline);
+
     return d;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 22 10:33:43 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Apr 2025 10:33:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.962428.1353641 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7Awh-000834-LN; Tue, 22 Apr 2025 10:33:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 962428.1353641; Tue, 22 Apr 2025 10: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 1u7Awh-00082u-It; Tue, 22 Apr 2025 10:33:43 +0000
Received: by outflank-mailman (input) for mailman id 962428;
 Tue, 22 Apr 2025 10:33:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u7Awg-00082k-EZ
 for xen-changelog@lists.xenproject.org; Tue, 22 Apr 2025 10:33:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7Awg-00Eq5Q-1M
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 10:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7Awg-003PFH-1B
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 10:33:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/se7OaBrjOTFh04DJ97CeTdBfxxlVihWneTngT4V6oY=; b=tBlpaeW9b0Fsgtzktwew79b4Wm
	7+NP1sfM0Iz6ZYYHabWcvm3M83e2x/PI1zr4fuxtpSfuJVcYCB3aDlk8YEjXqshcTXmX1Rdtu222v
	me+f/NoZobIMu2R26xnSdlQDfMVwMUNk1Q3NPnlNdaYHHDivw541wPtQt4LkxAIp/E0s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] compat/memory: avoid UB shifts in XENMEM_exchange handling
Message-Id: <E1u7Awg-003PFH-1B@xenbits.xenproject.org>
Date: Tue, 22 Apr 2025 10:33:42 +0000

commit 560c51be8f6a88cde43c0a7c8be60158b5725982
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 22 11:25:23 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 22 11:25:23 2025 +0200

    compat/memory: avoid UB shifts in XENMEM_exchange handling
    
    Add an early basic check, yielding the same error code as the more
    thorough one the main handler would produce.
    
    Fixes: b8a7efe8528a ("Enable compatibility mode operation for HYPERVISOR_memory_op")
    Reported-by: Manuel Andreas <manuel.andreas@tum.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/compat/memory.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c
index 45e5fb0e5d..2ec3a3a1db 100644
--- a/xen/common/compat/memory.c
+++ b/xen/common/compat/memory.c
@@ -161,6 +161,11 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
             if ( copy_from_guest(&cmp.xchg, arg, 1) )
                 return -EFAULT;
 
+            /* Early coarse check, as max_order() isn't available here. */
+            if ( cmp.xchg.in.extent_order >= BITS_PER_INT ||
+                 cmp.xchg.out.extent_order >= BITS_PER_INT )
+                return -EPERM;
+
             order_delta = cmp.xchg.out.extent_order - cmp.xchg.in.extent_order;
             /* Various sanity checks. */
             if ( (cmp.xchg.nr_exchanged > cmp.xchg.in.nr_extents) ||
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 22 10:33:53 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Apr 2025 10:33:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.962430.1353645 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7Awr-00087u-O7; Tue, 22 Apr 2025 10:33:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 962430.1353645; Tue, 22 Apr 2025 10: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 1u7Awr-00087m-LX; Tue, 22 Apr 2025 10:33:53 +0000
Received: by outflank-mailman (input) for mailman id 962430;
 Tue, 22 Apr 2025 10: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 1u7Awq-00087X-I2
 for xen-changelog@lists.xenproject.org; Tue, 22 Apr 2025 10:33:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7Awq-00Eq5V-1i
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 10:33:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7Awq-003PKm-1b
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 10:33:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yqUNHfl7ycKJZigv31gu7tlmnnRDAiajkgvKmt0b1lI=; b=6MnxgnmS5UailrSTV3kASs0hw0
	gVxsFpv5CpCgXrE2cAWddXolfj4AeUDuNPGsUVqi9hSzBLNlKwqQYru4KGtsAYt7cBhNkbZbgjigX
	xrKPvLzWez31uJ9FiEBfB+BiQXaQ9YgvU/xquJV51rENPiOs70Z+fUyOS974g2tTDd0I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xenstored: Remove setjmp.h
Message-Id: <E1u7Awq-003PKm-1b@xenbits.xenproject.org>
Date: Tue, 22 Apr 2025 10:33:52 +0000

commit 1163d45b566d62014824607fe103061dca0e6749
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Tue Apr 22 11:25:48 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 22 11:25:48 2025 +0200

    xenstored: Remove setjmp.h
    
    Use of setjmp/longjmp as removed in 2006, but the include remained.
    Remove it now.
    
    Fixes: 1bac3b49cdd4 ("Import the current version of talloc from the Samba 3 source base")
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 tools/xenstored/core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/xenstored/core.c b/tools/xenstored/core.c
index bada1ad9a2..37e4dd5a5b 100644
--- a/tools/xenstored/core.c
+++ b/tools/xenstored/core.c
@@ -35,7 +35,6 @@
 #include <getopt.h>
 #include <signal.h>
 #include <assert.h>
-#include <setjmp.h>
 
 #include <xenevtchn.h>
 #include <xen-tools/xenstore-common.h>
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 22 16:33:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Apr 2025 16:33:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.963345.1354340 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7GYR-0003V2-6Y; Tue, 22 Apr 2025 16:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 963345.1354340; Tue, 22 Apr 2025 16:33:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7GYR-0003Uu-3H; Tue, 22 Apr 2025 16:33:03 +0000
Received: by outflank-mailman (input) for mailman id 963345;
 Tue, 22 Apr 2025 16: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 1u7GYQ-0003Uo-66
 for xen-changelog@lists.xenproject.org; Tue, 22 Apr 2025 16: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 1u7GYQ-00F02O-07
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 16:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7GYP-00GlGi-3C
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 16:33:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=slXI8iqSY0Jbb+/4rFLM3zlEqZLInjTqfX+a7vjaX3Y=; b=u9qUV1qGos5suyIavG/MQ2ojLr
	gx3uYR9PQQYcRZAtKTbYqr2n6BfrBsulP4zJGzqj96+yEExrFPWdl36PokvhdPeqSlYHtIrkRnhti
	Mw775egDECLtql0TpQC+PCeapoB1UdjGvBlQVldAtjijIPPfB2hFG4lzMQqNdW56NQLQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: Drop CONFIG_CC_HAS_UBSAN
Message-Id: <E1u7GYP-00GlGi-3C@xenbits.xenproject.org>
Date: Tue, 22 Apr 2025 16:33:01 +0000

commit c249be1de9c6e67e41ee614afb0e41d0ef0ab4d1
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 22 12:35:54 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 22 15:47:48 2025 +0100

    xen: Drop CONFIG_CC_HAS_UBSAN
    
    All supported toolchains now have it.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/Kconfig       | 4 ----
 xen/Kconfig.debug | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/xen/Kconfig b/xen/Kconfig
index 2128f0ccfc..72fdb83760 100644
--- a/xen/Kconfig
+++ b/xen/Kconfig
@@ -37,10 +37,6 @@ config CC_HAS_VISIBILITY_ATTRIBUTE
 config CC_SPLIT_SECTIONS
 	bool
 
-# Compiler supports -fsanitize=undefined
-config CC_HAS_UBSAN
-	def_bool $(cc-option,-fsanitize=undefined)
-
 # Set code alignment.
 #
 # Allow setting on a boolean basis, and then convert such selection to an
diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug
index f7cc5ffaab..c4a8d86912 100644
--- a/xen/Kconfig.debug
+++ b/xen/Kconfig.debug
@@ -98,7 +98,7 @@ config SCRUB_DEBUG
 
 config UBSAN
 	bool "Undefined behaviour sanitizer"
-	depends on HAS_UBSAN && CC_HAS_UBSAN
+	depends on HAS_UBSAN
 	help
 	  Enable undefined behaviour sanitizer. It uses compiler to insert code
 	  snippets so that undefined behaviours in C are detected during runtime.
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 22 16:33:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Apr 2025 16:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.963346.1354342 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7GYb-0003Zi-79; Tue, 22 Apr 2025 16:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 963346.1354342; Tue, 22 Apr 2025 16:33:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7GYb-0003Zb-4k; Tue, 22 Apr 2025 16:33:13 +0000
Received: by outflank-mailman (input) for mailman id 963346;
 Tue, 22 Apr 2025 16:33:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u7GYa-0003YD-5N
 for xen-changelog@lists.xenproject.org; Tue, 22 Apr 2025 16:33:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7GYa-00F02S-0S
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 16:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7GYa-00GlMy-0I
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 16: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=QcAgSXaNkWHWe/4LgZXwBsdWuy1jvjyVfLKaBIb0nCA=; b=Jng1Cb3wwt1zyenJWMnCT40Hys
	dg//ZhMAoiQH8pQpjYY62Y3jpa30eMLTUQG2x11B5hZQIvBt7QE6JXSZNvd7W7hUzKlAt0JFBUxP6
	JfxBIbmzdRPUbnZnMKdZoUCWpfV8phYmTRLTJxg3sMzpnIEb1SNYeoNIFA8zer4e6Ovc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: Drop CONFIG_CC_HAS_VISIBILITY_ATTRIBUTE
Message-Id: <E1u7GYa-00GlMy-0I@xenbits.xenproject.org>
Date: Tue, 22 Apr 2025 16:33:12 +0000

commit b3502246d19d01711d7b28379111763353634460
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 22 12:36:01 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 22 15:47:48 2025 +0100

    xen: Drop CONFIG_CC_HAS_VISIBILITY_ATTRIBUTE
    
    All supported toolchains now have it.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/Kconfig                | 4 ----
 xen/include/xen/compiler.h | 2 --
 2 files changed, 6 deletions(-)

diff --git a/xen/Kconfig b/xen/Kconfig
index 72fdb83760..ae1c401a98 100644
--- a/xen/Kconfig
+++ b/xen/Kconfig
@@ -29,10 +29,6 @@ config LD_IS_GNU
 config LD_IS_LLVM
 	def_bool $(success,$(LD) --version | head -n 1 | grep -q "^LLD")
 
-# -fvisibility=hidden reduces -fpic cost, if it's available
-config CC_HAS_VISIBILITY_ATTRIBUTE
-	def_bool $(cc-option,-fvisibility=hidden)
-
 # Use -f{function,data}-sections compiler parameters
 config CC_SPLIT_SECTIONS
 	bool
diff --git a/xen/include/xen/compiler.h b/xen/include/xen/compiler.h
index 38b8fa3d38..c68fab1891 100644
--- a/xen/include/xen/compiler.h
+++ b/xen/include/xen/compiler.h
@@ -17,10 +17,8 @@
 
 #endif /* Compiler checks. */
 
-#ifdef CONFIG_CC_HAS_VISIBILITY_ATTRIBUTE
 /* Results in more efficient PIC code (no indirections through GOT or PLT). */
 #pragma GCC visibility push(hidden)
-#endif
 
 #define barrier()     __asm__ __volatile__("": : :"memory")
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 22 16:33:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Apr 2025 16:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.963347.1354347 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7GYl-0003dx-8m; Tue, 22 Apr 2025 16:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 963347.1354347; Tue, 22 Apr 2025 16:33:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7GYl-0003dp-69; Tue, 22 Apr 2025 16:33:23 +0000
Received: by outflank-mailman (input) for mailman id 963347;
 Tue, 22 Apr 2025 16:33:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u7GYk-0003dc-9s
 for xen-changelog@lists.xenproject.org; Tue, 22 Apr 2025 16:33:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7GYk-00F02p-0q
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 16:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7GYk-00GlVR-0c
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 16:33:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NXqoh0ihYhJRWVqZGxd3Dt5B3gM4bY8hN8dNn330vaM=; b=yyqxG2cBQjhWpI57OxoECySZph
	qBwlrv8ciOzfWMShxzHLury5y6tVGOu0X9Qvp0mkkcbqQWqAtZYgGYESM5lVAltjudPDng/XMVoNk
	ykH4jXWppsfh2EQA6LkDTx60igvdYX3Y6bKCYpcxiM5fvtYejpa5n1CQ4bQiDsNEee4Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/AMD: Convert rdmsr_amd_safe() to use asm goto()
Message-Id: <E1u7GYk-00GlVR-0c@xenbits.xenproject.org>
Date: Tue, 22 Apr 2025 16:33:22 +0000

commit 2fdeed237249f365b42cac7039e1ae6c7b1b60db
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Apr 7 16:10:57 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 22 15:47:48 2025 +0100

    x86/AMD: Convert rdmsr_amd_safe() to use asm goto()
    
    Unlike the WRMSR side, we can't use asm goto() unconditionally, because our
    toolchain baseline doesn't support asm goto with outputs.
    
    However, the code generation improvements are substantial enough to warrant
    the duplicate implementations.
    
    Detect support, and use asm goto() when available.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/Kconfig            | 14 ++++++++++++++
 xen/arch/x86/cpu/amd.c | 13 +++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/xen/Kconfig b/xen/Kconfig
index ae1c401a98..486b36b843 100644
--- a/xen/Kconfig
+++ b/xen/Kconfig
@@ -33,6 +33,20 @@ config LD_IS_LLVM
 config CC_SPLIT_SECTIONS
 	bool
 
+# Fixed in GCC 14, 13.3, 12.4 and 11.5
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113921
+config GCC_ASM_GOTO_OUTPUT_BROKEN
+	bool
+	depends on CC_IS_GCC
+	default y if GCC_VERSION < 110500
+	default y if GCC_VERSION >= 120000 && GCC_VERSION < 120400
+	default y if GCC_VERSION >= 130000 && GCC_VERSION < 130300
+
+config CC_HAS_ASM_GOTO_OUTPUT
+	def_bool y
+	depends on !GCC_ASM_GOTO_OUTPUT_BROKEN
+	depends on $(success,echo 'int foo(int x) { asm goto ("": "=r"(x) ::: bar); return x; bar: return 0; }' | $(CC) -x c - -c -o /dev/null)
+
 # Set code alignment.
 #
 # Allow setting on a boolean basis, and then convert such selection to an
diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index ce4e1df710..37d67dd15c 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -59,6 +59,18 @@ static bool __read_mostly fam17_c6_disabled;
 static inline int rdmsr_amd_safe(unsigned int msr, unsigned int *lo,
 				 unsigned int *hi)
 {
+#ifdef CONFIG_CC_HAS_ASM_GOTO_OUTPUT
+    asm goto ( "1: rdmsr\n\t"
+               _ASM_EXTABLE(1b, %l[fault])
+               : "=a" (*lo), "=d" (*hi)
+               : "c" (msr), "D" (0x9c5a203a)
+               :
+               : fault );
+    return 0;
+
+ fault:
+    return -EFAULT;
+#else
 	int err;
 
 	asm volatile("1: rdmsr\n2:\n"
@@ -71,6 +83,7 @@ static inline int rdmsr_amd_safe(unsigned int msr, unsigned int *lo,
 		     : "c" (msr), "D" (0x9c5a203a), "2" (0), "i" (-EFAULT));
 
 	return err;
+#endif
 }
 
 static inline int wrmsr_amd_safe(unsigned int msr, unsigned int lo,
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 22 16:33:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Apr 2025 16:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.963348.1354352 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7GYv-0003il-AR; Tue, 22 Apr 2025 16:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 963348.1354352; Tue, 22 Apr 2025 16: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 1u7GYv-0003id-7c; Tue, 22 Apr 2025 16:33:33 +0000
Received: by outflank-mailman (input) for mailman id 963348;
 Tue, 22 Apr 2025 16:33:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u7GYu-0003iS-CC
 for xen-changelog@lists.xenproject.org; Tue, 22 Apr 2025 16:33:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7GYu-00F02w-18
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 16:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7GYu-00GlZd-10
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 16:33:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pfjPt0ihbuRaU1br6R+FlqJzdyyodBMTfC6OEGDaeyc=; b=Qu6vek0vO2ehIjO/xdTQd7/1FX
	Oi0xqisOW8rQU/s4kfzijxNP1WGSEz1I/FrCeBeluhuEAT/2dZ5yv+fh2bQ2kmsR1pnboI4cHyxkq
	UdGFcJWYKexoGt0Zz6ZB8VLNITOAMdo8n75Irh8WADz+83STxr3oNCtpUGPNxLx3xvgs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/alternative: Clean up headers
Message-Id: <E1u7GYu-00GlZd-10@xenbits.xenproject.org>
Date: Tue, 22 Apr 2025 16:33:32 +0000

commit 85663be75ece4835859403b5195c2d07dafca880
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Apr 21 16:31:17 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 22 15:47:48 2025 +0100

    x86/alternative: Clean up headers
    
    alternative.h doesn't need lib.h now that macros.h exists.  Futhermore, STR()
    is already the prevailing style, so convert the final __stringify() to drop
    stringify.h 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/alternative.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/include/asm/alternative.h b/xen/arch/x86/include/asm/alternative.h
index 38472fb58e..7326ad9428 100644
--- a/xen/arch/x86/include/asm/alternative.h
+++ b/xen/arch/x86/include/asm/alternative.h
@@ -4,8 +4,10 @@
 #ifdef __ASSEMBLY__
 #include <asm/alternative-asm.h>
 #else
-#include <xen/lib.h>
-#include <xen/stringify.h>
+
+#include <xen/macros.h>
+#include <xen/types.h>
+
 #include <asm/asm-macros.h>
 #include <asm/cpufeatureset.h>
 
@@ -65,7 +67,7 @@ extern void alternative_branches(void);
         " .endif\n"                                                     \
         " .long .LXEN%=_orig_s - .\n"             /* label           */ \
         " .long " alt_repl_s(num)" - .\n"         /* new instruction */ \
-        " .word " __stringify(feature) "\n"       /* feature bit     */ \
+        " .word " STR(feature) "\n"               /* feature bit     */ \
         " .byte " alt_orig_len "\n"               /* source len      */ \
         " .byte " alt_repl_len(num) "\n"          /* replacement len */ \
         " .byte " alt_pad_len "\n"                /* padding len     */ \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 22 17:00:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Apr 2025 17:00:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.963349.1354356 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7Gya-0003Oq-65; Tue, 22 Apr 2025 17:00:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 963349.1354356; Tue, 22 Apr 2025 17:00: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 1u7Gya-0003OH-2m; Tue, 22 Apr 2025 17:00:04 +0000
Received: by outflank-mailman (input) for mailman id 963349;
 Tue, 22 Apr 2025 17: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 1u7GyY-000332-GI
 for xen-changelog@lists.xenproject.org; Tue, 22 Apr 2025 17: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 1u7GyY-00F0jN-1C
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 17:00:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7GyY-00H72s-12
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 17: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=31yIYR+oKpkCOB0eNU0Yp+8plkBbPR9vx/zdRHsNxFg=; b=OmN7SiZhXdlXd1pu+RV1ZFMD3M
	b6R/v6u1S4nKAUTwGM7o1gMd/qshG79EPLwXqrmkzPAsZmmoJGlfN6Ec/hYzWIhgFEvvC7XtZS1+I
	Dckpofi7OI2vLQXgjL8hRy/DE/s+qwOJRn8nJ4pY63skW1DaJhYULH6DYptzd21aRYJg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: Drop CONFIG_CC_HAS_UBSAN
Message-Id: <E1u7GyY-00H72s-12@xenbits.xenproject.org>
Date: Tue, 22 Apr 2025 17:00:02 +0000

commit c249be1de9c6e67e41ee614afb0e41d0ef0ab4d1
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 22 12:35:54 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 22 15:47:48 2025 +0100

    xen: Drop CONFIG_CC_HAS_UBSAN
    
    All supported toolchains now have it.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/Kconfig       | 4 ----
 xen/Kconfig.debug | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/xen/Kconfig b/xen/Kconfig
index 2128f0ccfc..72fdb83760 100644
--- a/xen/Kconfig
+++ b/xen/Kconfig
@@ -37,10 +37,6 @@ config CC_HAS_VISIBILITY_ATTRIBUTE
 config CC_SPLIT_SECTIONS
 	bool
 
-# Compiler supports -fsanitize=undefined
-config CC_HAS_UBSAN
-	def_bool $(cc-option,-fsanitize=undefined)
-
 # Set code alignment.
 #
 # Allow setting on a boolean basis, and then convert such selection to an
diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug
index f7cc5ffaab..c4a8d86912 100644
--- a/xen/Kconfig.debug
+++ b/xen/Kconfig.debug
@@ -98,7 +98,7 @@ config SCRUB_DEBUG
 
 config UBSAN
 	bool "Undefined behaviour sanitizer"
-	depends on HAS_UBSAN && CC_HAS_UBSAN
+	depends on HAS_UBSAN
 	help
 	  Enable undefined behaviour sanitizer. It uses compiler to insert code
 	  snippets so that undefined behaviours in C are detected during runtime.
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 22 17:00:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Apr 2025 17:00:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.963350.1354359 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7Gyk-0003qi-6v; Tue, 22 Apr 2025 17:00:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 963350.1354359; Tue, 22 Apr 2025 17:00: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 1u7Gyk-0003qa-48; Tue, 22 Apr 2025 17:00:14 +0000
Received: by outflank-mailman (input) for mailman id 963350;
 Tue, 22 Apr 2025 17: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 1u7Gyi-0003qP-G3
 for xen-changelog@lists.xenproject.org; Tue, 22 Apr 2025 17: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 1u7Gyi-00F0jR-1V
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 17:00:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7Gyi-00H79B-1N
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 17:00:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Hn5RG/hxM9p0vUYPhuhfQL8YiG0jEUPdldNaYXpVaHs=; b=bKU0tWMSyBpi+Z4E9rPemO4Cuc
	XcNtLxRb8bbt7GE66z1BjQOqeDkNNNbKnnPMqI1V4QgM3HhbitsjaMr4XmJDtnULp7UMxvMiEU9Wf
	TywUIFaU1WdVgBW2GwwAm/HRYypEcsq/B7JNUAsB5ltLpkEt1z0a0GNr0P8VIjgtZYIk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: Drop CONFIG_CC_HAS_VISIBILITY_ATTRIBUTE
Message-Id: <E1u7Gyi-00H79B-1N@xenbits.xenproject.org>
Date: Tue, 22 Apr 2025 17:00:12 +0000

commit b3502246d19d01711d7b28379111763353634460
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 22 12:36:01 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 22 15:47:48 2025 +0100

    xen: Drop CONFIG_CC_HAS_VISIBILITY_ATTRIBUTE
    
    All supported toolchains now have it.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/Kconfig                | 4 ----
 xen/include/xen/compiler.h | 2 --
 2 files changed, 6 deletions(-)

diff --git a/xen/Kconfig b/xen/Kconfig
index 72fdb83760..ae1c401a98 100644
--- a/xen/Kconfig
+++ b/xen/Kconfig
@@ -29,10 +29,6 @@ config LD_IS_GNU
 config LD_IS_LLVM
 	def_bool $(success,$(LD) --version | head -n 1 | grep -q "^LLD")
 
-# -fvisibility=hidden reduces -fpic cost, if it's available
-config CC_HAS_VISIBILITY_ATTRIBUTE
-	def_bool $(cc-option,-fvisibility=hidden)
-
 # Use -f{function,data}-sections compiler parameters
 config CC_SPLIT_SECTIONS
 	bool
diff --git a/xen/include/xen/compiler.h b/xen/include/xen/compiler.h
index 38b8fa3d38..c68fab1891 100644
--- a/xen/include/xen/compiler.h
+++ b/xen/include/xen/compiler.h
@@ -17,10 +17,8 @@
 
 #endif /* Compiler checks. */
 
-#ifdef CONFIG_CC_HAS_VISIBILITY_ATTRIBUTE
 /* Results in more efficient PIC code (no indirections through GOT or PLT). */
 #pragma GCC visibility push(hidden)
-#endif
 
 #define barrier()     __asm__ __volatile__("": : :"memory")
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 22 17:00:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Apr 2025 17:00:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.963351.1354363 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7Gyu-0003tA-86; Tue, 22 Apr 2025 17:00:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 963351.1354363; Tue, 22 Apr 2025 17:00: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 1u7Gyu-0003t2-5W; Tue, 22 Apr 2025 17:00:24 +0000
Received: by outflank-mailman (input) for mailman id 963351;
 Tue, 22 Apr 2025 17: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 1u7Gys-0003sp-JA
 for xen-changelog@lists.xenproject.org; Tue, 22 Apr 2025 17: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 1u7Gys-00F0jl-1n
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 17:00:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7Gys-00H7GS-1g
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 17: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=Ru8A83waIfS5SVA+jy4BJU9VgUFVmcg7AOopppNibp4=; b=Oqt8yDQJS4KXC9P5mZNrwOB6v9
	fzPgFD4DwYZlJDUSustkY3vALuSqbYrEiT5jMnLIiT/onpEX3DGsPu51M1xeUMIN2gX5Ey4yvtcIY
	oKX3vrfkBt4ximOL0g1Aj6kQLjOGoyznTdC9404GLHqmBjnq6Fuj3H84gjcOPGVkSt7o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/AMD: Convert rdmsr_amd_safe() to use asm goto()
Message-Id: <E1u7Gys-00H7GS-1g@xenbits.xenproject.org>
Date: Tue, 22 Apr 2025 17:00:22 +0000

commit 2fdeed237249f365b42cac7039e1ae6c7b1b60db
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Apr 7 16:10:57 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 22 15:47:48 2025 +0100

    x86/AMD: Convert rdmsr_amd_safe() to use asm goto()
    
    Unlike the WRMSR side, we can't use asm goto() unconditionally, because our
    toolchain baseline doesn't support asm goto with outputs.
    
    However, the code generation improvements are substantial enough to warrant
    the duplicate implementations.
    
    Detect support, and use asm goto() when available.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/Kconfig            | 14 ++++++++++++++
 xen/arch/x86/cpu/amd.c | 13 +++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/xen/Kconfig b/xen/Kconfig
index ae1c401a98..486b36b843 100644
--- a/xen/Kconfig
+++ b/xen/Kconfig
@@ -33,6 +33,20 @@ config LD_IS_LLVM
 config CC_SPLIT_SECTIONS
 	bool
 
+# Fixed in GCC 14, 13.3, 12.4 and 11.5
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113921
+config GCC_ASM_GOTO_OUTPUT_BROKEN
+	bool
+	depends on CC_IS_GCC
+	default y if GCC_VERSION < 110500
+	default y if GCC_VERSION >= 120000 && GCC_VERSION < 120400
+	default y if GCC_VERSION >= 130000 && GCC_VERSION < 130300
+
+config CC_HAS_ASM_GOTO_OUTPUT
+	def_bool y
+	depends on !GCC_ASM_GOTO_OUTPUT_BROKEN
+	depends on $(success,echo 'int foo(int x) { asm goto ("": "=r"(x) ::: bar); return x; bar: return 0; }' | $(CC) -x c - -c -o /dev/null)
+
 # Set code alignment.
 #
 # Allow setting on a boolean basis, and then convert such selection to an
diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index ce4e1df710..37d67dd15c 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -59,6 +59,18 @@ static bool __read_mostly fam17_c6_disabled;
 static inline int rdmsr_amd_safe(unsigned int msr, unsigned int *lo,
 				 unsigned int *hi)
 {
+#ifdef CONFIG_CC_HAS_ASM_GOTO_OUTPUT
+    asm goto ( "1: rdmsr\n\t"
+               _ASM_EXTABLE(1b, %l[fault])
+               : "=a" (*lo), "=d" (*hi)
+               : "c" (msr), "D" (0x9c5a203a)
+               :
+               : fault );
+    return 0;
+
+ fault:
+    return -EFAULT;
+#else
 	int err;
 
 	asm volatile("1: rdmsr\n2:\n"
@@ -71,6 +83,7 @@ static inline int rdmsr_amd_safe(unsigned int msr, unsigned int *lo,
 		     : "c" (msr), "D" (0x9c5a203a), "2" (0), "i" (-EFAULT));
 
 	return err;
+#endif
 }
 
 static inline int wrmsr_amd_safe(unsigned int msr, unsigned int lo,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 22 17:00:34 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Apr 2025 17:00:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.963352.1354368 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7Gz4-0003vj-Ad; Tue, 22 Apr 2025 17:00:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 963352.1354368; Tue, 22 Apr 2025 17:00: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 1u7Gz4-0003vb-6t; Tue, 22 Apr 2025 17:00:34 +0000
Received: by outflank-mailman (input) for mailman id 963352;
 Tue, 22 Apr 2025 17: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 1u7Gz2-0003vO-M4
 for xen-changelog@lists.xenproject.org; Tue, 22 Apr 2025 17: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 1u7Gz2-00F0jp-26
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 17:00:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7Gz2-00H7RC-1z
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 17: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=M0WmlLWAIXlm5t+FoD4VZ0/4dkwtlaT9nLwu3R6AGXY=; b=45/y8lPRmInOlbkLXKmuWCeA7v
	8YkQhcwIsSg208GDi083KFT5QCBP+snMadNkgVXLD7mA4TAFGqeNFjYaiXezfiEM7Eiy4Q1UNipLh
	G6xIXmA+0VJt7Fs/LbHxiuOJCXYZMLzPsMlo7/1/OB3RJN+PpoX+9+Bz7Xq3FqtqVGAw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/alternative: Clean up headers
Message-Id: <E1u7Gz2-00H7RC-1z@xenbits.xenproject.org>
Date: Tue, 22 Apr 2025 17:00:32 +0000

commit 85663be75ece4835859403b5195c2d07dafca880
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Apr 21 16:31:17 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 22 15:47:48 2025 +0100

    x86/alternative: Clean up headers
    
    alternative.h doesn't need lib.h now that macros.h exists.  Futhermore, STR()
    is already the prevailing style, so convert the final __stringify() to drop
    stringify.h 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/alternative.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/include/asm/alternative.h b/xen/arch/x86/include/asm/alternative.h
index 38472fb58e..7326ad9428 100644
--- a/xen/arch/x86/include/asm/alternative.h
+++ b/xen/arch/x86/include/asm/alternative.h
@@ -4,8 +4,10 @@
 #ifdef __ASSEMBLY__
 #include <asm/alternative-asm.h>
 #else
-#include <xen/lib.h>
-#include <xen/stringify.h>
+
+#include <xen/macros.h>
+#include <xen/types.h>
+
 #include <asm/asm-macros.h>
 #include <asm/cpufeatureset.h>
 
@@ -65,7 +67,7 @@ extern void alternative_branches(void);
         " .endif\n"                                                     \
         " .long .LXEN%=_orig_s - .\n"             /* label           */ \
         " .long " alt_repl_s(num)" - .\n"         /* new instruction */ \
-        " .word " __stringify(feature) "\n"       /* feature bit     */ \
+        " .word " STR(feature) "\n"               /* feature bit     */ \
         " .byte " alt_orig_len "\n"               /* source len      */ \
         " .byte " alt_repl_len(num) "\n"          /* replacement len */ \
         " .byte " alt_pad_len "\n"                /* padding len     */ \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 22 20:55:08 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Apr 2025 20:55:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.963631.1354585 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7Ke0-0002vk-3E; Tue, 22 Apr 2025 20:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 963631.1354585; Tue, 22 Apr 2025 20: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 1u7Ke0-0002vd-0c; Tue, 22 Apr 2025 20:55:04 +0000
Received: by outflank-mailman (input) for mailman id 963631;
 Tue, 22 Apr 2025 20:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u7Kdy-0002vT-L9
 for xen-changelog@lists.xenproject.org; Tue, 22 Apr 2025 20:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7Kdy-00F6uA-1D
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 20:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7Kdy-001vSv-0r
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 20:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Os6SizkZSwAk7C8/nXZ1hKCtXJgqovese9TpA6W/jgk=; b=T86Rnb5gwC7F3XzGT5X45NwRFi
	vj0Xu8huxsgZSw4HPiLC57KdlUrmhxoG54Ko6RCd5XOdXoZZRX3563x28pqXuDkAfBVB7Frg3Jihm
	g/UpSOvEE7f6vWuQFryYFnlk1p17KFGD6HwJlCvohKwJ797Q1SA/vQ2iNdBoSSPv+ojQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: unify x86 XTF test runner
Message-Id: <E1u7Kdy-001vSv-0r@xenbits.xenproject.org>
Date: Tue, 22 Apr 2025 20:55:02 +0000

commit a22f80e7585d424cc40ce0e52233b35146845b94
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Tue Apr 22 16:18:48 2025 +0000
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Apr 22 13:07:12 2025 -0700

    CI: unify x86 XTF test runner
    
    Add test runner script qemu-xtf.sh which is allows any XTF x86 test to be
    easily executed. Test runner is invoked from the qemu-smoke* jobs with the
    hardcoded parameters.
    
    Each x86 XTF job lead time is reduced a bit since only the test-related code
    is built, not the entire XTF project.
    
    Add .gitignore to avoid committing test artifacts by mistake.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/gitlab-ci/test.yaml                     |   8 +-
 automation/scripts/.gitignore                      |   3 +
 .../scripts/include/configs/xtf-x86-64-config      |   0
 automation/scripts/include/xtf-runner              | 131 +++++++++++++++++++++
 automation/scripts/include/xtf-x86-64              |  31 +++++
 automation/scripts/qemu-smoke-x86-64.sh            |  26 ----
 automation/scripts/qemu-xtf.sh                     |  28 +++++
 7 files changed, 197 insertions(+), 30 deletions(-)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 5ce445b78f..3adc841335 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -659,28 +659,28 @@ qemu-alpine-x86_64-gcc:
 qemu-smoke-x86-64-gcc:
   extends: .qemu-smoke-x86-64
   script:
-    - ./automation/scripts/qemu-smoke-x86-64.sh pv 2>&1 | tee ${LOGFILE}
+    - ./automation/scripts/qemu-xtf.sh x86-64 pv64 example 2>&1 | tee ${LOGFILE}
   needs:
     - debian-12-x86_64-gcc-debug
 
 qemu-smoke-x86-64-clang:
   extends: .qemu-smoke-x86-64
   script:
-    - ./automation/scripts/qemu-smoke-x86-64.sh pv 2>&1 | tee ${LOGFILE}
+    - ./automation/scripts/qemu-xtf.sh x86-64 pv64 example 2>&1 | tee ${LOGFILE}
   needs:
     - debian-12-x86_64-clang-debug
 
 qemu-smoke-x86-64-gcc-pvh:
   extends: .qemu-smoke-x86-64
   script:
-    - ./automation/scripts/qemu-smoke-x86-64.sh pvh 2>&1 | tee ${LOGFILE}
+    - ./automation/scripts/qemu-xtf.sh x86-64 hvm64 example 2>&1 | tee ${LOGFILE}
   needs:
     - debian-12-x86_64-gcc-debug
 
 qemu-smoke-x86-64-clang-pvh:
   extends: .qemu-smoke-x86-64
   script:
-    - ./automation/scripts/qemu-smoke-x86-64.sh pvh 2>&1 | tee ${LOGFILE}
+    - ./automation/scripts/qemu-xtf.sh x86-64 hvm64 example 2>&1 | tee ${LOGFILE}
   needs:
     - debian-12-x86_64-clang-debug
 
diff --git a/automation/scripts/.gitignore b/automation/scripts/.gitignore
new file mode 100644
index 0000000000..310a577bef
--- /dev/null
+++ b/automation/scripts/.gitignore
@@ -0,0 +1,3 @@
+/binaries/
+/smoke.serial
+/xtf-*/
diff --git a/automation/scripts/include/configs/xtf-x86-64-config b/automation/scripts/include/configs/xtf-x86-64-config
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/automation/scripts/include/xtf-runner b/automation/scripts/include/xtf-runner
new file mode 100644
index 0000000000..320eb65dc8
--- /dev/null
+++ b/automation/scripts/include/xtf-runner
@@ -0,0 +1,131 @@
+#!/bin/bash
+#
+# XTF test utilities.
+#
+# Environment variables:
+#   BOOT_MSG: Expected boot message
+#   FW_PREFIX: Firmware images path including '/' at the end
+#   PASSED: XTF test printout in case of a pass
+#   QEMU_PREFIX: QEMU path including '/' at the end
+#   TEST_LOG: Output log file
+#   UBOOT_CMD: U-Boot command line
+#   WORKDIR: Test working directory
+#   XEN_BINARY: Xen binary location
+#   XEN_CONSOLE: Xen console device name
+#   XTF_SRC_CONFIG: XTF config file
+#   XTF_SRC_BRANCH: XTF branch
+#   XTF_SRC_URI: XTF source code URI
+
+# Output log file
+TEST_LOG="${TEST_LOG:-${XEN_ROOT}/smoke.serial}"
+# XTF test printout in case of a pass
+PASSED="${PASSED:-Test result: SUCCESS}"
+# Expected boot message
+BOOT_MSG="${BOOT_MSG:-Latest ChangeSet: }"
+# Test working directory
+WORKDIR="${WORKDIR:-${XEN_ROOT}/binaries}"
+# XTF source code
+XTF_SRC_CONFIG="${XTF_SRC_CONFIG:-include/configs/xtf-${ARCH}-config}"
+
+function die()
+{
+    set +x
+    echo "FATAL: $*" >&2
+    exit 1
+}
+
+# Build an XTF test binary.
+# $1 Test variant.
+# $2 Test name.
+function xtf_build_binary()
+{
+    local xtf_variant=$1
+    local xtf_name=$2
+    local xtf_dir="xtf-${ARCH}"
+
+    # Crude check for local testing
+    if [ ! -d ${xtf_dir} ]; then
+        git clone ${XTF_SRC_URI} ${xtf_dir} -b ${XTF_SRC_BRANCH}
+    fi
+
+    make \
+        -C ${xtf_dir} \
+        -j$(nproc) \
+        $(tr '\n' ' ' < ${XTF_SRC_CONFIG}) \
+        TESTS=tests/${xtf_name}
+
+    export XTF_NAME="${xtf_name}"
+    export XTF_VARIANT="${xtf_variant}"
+    export XTF_WORKDIR="$(readlink -f ${xtf_dir})"
+    export XTF_BINARY="${XTF_WORKDIR}/tests/${xtf_name}/test-${xtf_variant}-${xtf_name}"
+}
+
+# Build Xen command line for running an XTF test.
+# $1 Test variant.
+# $2 Test name.
+function xtf_build_cmdline()
+{
+    local xtf_variant=$1
+    local xtf_name=$2
+    declare -a cmdline=()
+
+    cmdline+=("${XEN_CMDLINE}")
+
+    # NB: OK to have hvm64, which is x86-only variant
+    if [[ $xtf_variant == "hvm64" ]]; then
+        cmdline+=("dom0-iommu=none dom0=pvh")
+    fi
+
+    export XEN_CMDLINE="${cmdline[@]}"
+}
+
+# Build an XTF test environment.
+# $1 Test variant.
+# $2 Test name.
+function xtf_build_test()
+{
+    local v=$1
+    local xtf_name=$2
+    local xtf_variant=""
+
+    for x in ${XTF_SRC_VARIANTS}; do
+        if [[ "${x}" == "${v}" ]]; then
+            xtf_variant=${v}
+            break
+        fi
+    done
+    if [[ -z $xtf_variant ]]; then
+        die "unsupported test variant '$1', supported variants: ${XTF_SRC_VARIANTS}"
+    fi
+
+    xtf_build_binary ${xtf_variant} ${xtf_name}
+    xtf_build_cmdline ${xtf_variant} ${xtf_name}
+}
+
+# Execute an XTF test.
+function xtf_run_test()
+{
+    rm -f ${TEST_LOG}
+    export BOOT_MSG PASSED TEST_CMD TEST_LOG UBOOT_CMD
+    ./console.exp | sed 's/\r\+$//'
+}
+
+# Setup environment and run an XTF test.
+# $1 Test variant.
+# $2 Test name.
+function xtf_test()
+{
+    # Out: FW_*, QEMU_*, XEN_{BINARY,CONSOLE}, XTF_SRC_*
+    xtf_arch_prepare
+
+    # In: XTF_SRC_*
+    # OUt: XTF_{BINARY,NAME,VARIANT,WORKDIR} and XEN_CMDLINE
+    xtf_build_test $@
+
+    # In: FW_*, QEMU_*, XTF_*, XEN_*
+    # Out: BOOT_MSG, PASSED, TEST_{CMD,LOG}, UBOOT_CMD
+    xtf_arch_setup
+
+    # In: BOOT_MSG, PASSED, TEST_{CMD,LOG}, UBOOT_CMD
+    xtf_run_test
+}
diff --git a/automation/scripts/include/xtf-x86-64 b/automation/scripts/include/xtf-x86-64
new file mode 100644
index 0000000000..b1b0cc201e
--- /dev/null
+++ b/automation/scripts/include/xtf-x86-64
@@ -0,0 +1,31 @@
+#!/bin/bash
+#
+# XTF test utilities (x86_64).
+#
+
+# Arch-specific environment overrides.
+function xtf_arch_prepare()
+{
+    export FW_PREFIX="${FW_PREFIX:-}"
+    export QEMU_PREFIX="${QEMU_PREFIX:-}"
+    export XEN_BINARY="${XEN_BINARY:-${WORKDIR}/xen}"
+    export XEN_CMDLINE="${XEN_CMDLINE:-loglvl=all noreboot console_timestamps=boot console=com1}"
+    export XTF_SRC_BRANCH="${XTF_SRC_BRANCH:-master}"
+    export XTF_SRC_URI="${XTF_SRC_URI:-https://xenbits.xen.org/git-http/xtf.git}"
+    export XTF_SRC_VARIANTS="hvm64 pv64"
+}
+
+# Perform arch-specific XTF environment setup.
+function xtf_arch_setup()
+{
+    export TEST_CMD="${QEMU_PREFIX}qemu-system-x86_64 \
+        -no-reboot \
+        -nographic \
+        -monitor none \
+        -serial stdio \
+        -m 512 \
+        -kernel ${XEN_BINARY} \
+        -initrd ${XTF_BINARY} \
+        -append \"${XEN_CMDLINE}\" \
+    "
+}
diff --git a/automation/scripts/qemu-smoke-x86-64.sh b/automation/scripts/qemu-smoke-x86-64.sh
deleted file mode 100755
index da0c26cc2f..0000000000
--- a/automation/scripts/qemu-smoke-x86-64.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/bash
-
-set -ex -o pipefail
-
-# variant should be either pv or pvh
-variant=$1
-
-# Clone and build XTF
-git clone https://xenbits.xen.org/git-http/xtf.git
-cd xtf && make -j$(nproc) && cd -
-
-case $variant in
-    pvh) k=test-hvm64-example    extra="dom0-iommu=none dom0=pvh" ;;
-    *)   k=test-pv64-example     extra= ;;
-esac
-
-rm -f smoke.serial
-export TEST_CMD="qemu-system-x86_64 -nographic -kernel binaries/xen \
-        -initrd xtf/tests/example/$k \
-        -append \"loglvl=all console=com1 noreboot console_timestamps=boot $extra\" \
-        -m 512 -monitor none -serial stdio"
-
-export TEST_LOG="smoke.serial"
-export PASSED="Test result: SUCCESS"
-
-./automation/scripts/console.exp | sed 's/\r\+$//'
diff --git a/automation/scripts/qemu-xtf.sh b/automation/scripts/qemu-xtf.sh
new file mode 100755
index 0000000000..55c221b36d
--- /dev/null
+++ b/automation/scripts/qemu-xtf.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+#
+# XTF test runner (QEMU).
+#
+
+set -e -o pipefail
+
+if [ $# -lt 3 ]; then
+    echo "Usage: $(basename $0) ARCH XTF-VARIANT XTF-NAME"
+    exit 0
+fi
+
+export ARCH="$1"
+shift
+
+set -x
+
+export XEN_ROOT="${PWD}"
+cd $(dirname $0)
+
+source include/xtf-runner
+
+if [ ! -f "include/xtf-${ARCH}" ]; then
+    die "unsupported architecture '${ARCH}'"
+fi
+source include/xtf-${ARCH}
+
+xtf_test $@
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 22 20:55:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Apr 2025 20:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.963633.1354589 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7Ke9-0002yA-4s; Tue, 22 Apr 2025 20:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 963633.1354589; Tue, 22 Apr 2025 20: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 1u7Ke9-0002y3-2B; Tue, 22 Apr 2025 20:55:13 +0000
Received: by outflank-mailman (input) for mailman id 963633;
 Tue, 22 Apr 2025 20: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 1u7Ke8-0002xv-GT
 for xen-changelog@lists.xenproject.org; Tue, 22 Apr 2025 20: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 1u7Ke8-00F6uO-1X
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 20:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7Ke8-001vVy-1P
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 20: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=KvcAq9dtfB6hFbJ6geMPtqlZZUXQ0/Pk/pNO+N0MrH4=; b=FgV/SgvFCfTCPfRSgRITq2ZVSh
	lARxkaFwpZPCOFp4RTnzWUKHWPddBTygFq+Amx6jOoDBM/1sbgsbYcXR4kpD4UXFenivCmeGIwVCP
	0TKhH+qmPSeHXWBZbw/5Kz71JHtSWf9WPYSNUDZAs8d+ew/npgcmdXQg+SkWx6wrYwzc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: switch x86 EFI smoke test runner to qemu-xtf.sh
Message-Id: <E1u7Ke8-001vVy-1P@xenbits.xenproject.org>
Date: Tue, 22 Apr 2025 20:55:12 +0000

commit 23041e72d98265e23218d7a2d97f89bb7cb862e9
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Tue Apr 22 16:18:53 2025 +0000
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Apr 22 13:07:12 2025 -0700

    CI: switch x86 EFI smoke test runner to qemu-xtf.sh
    
    Use qemu-xtf.sh for qemu-smoke-x86-64-gcc-efi job.
    
    Lead time is reduced a bit since not all XTF code base is built, just the
    required test.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/gitlab-ci/test.yaml                     |  2 +-
 .../scripts/include/configs/xtf-x86-64-efi-config  |  0
 automation/scripts/include/xtf-x86-64-efi          | 52 ++++++++++++++++++++++
 automation/scripts/qemu-smoke-x86-64-efi.sh        | 43 ------------------
 4 files changed, 53 insertions(+), 44 deletions(-)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 3adc841335..1d89575b24 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -687,7 +687,7 @@ qemu-smoke-x86-64-clang-pvh:
 qemu-smoke-x86-64-gcc-efi:
   extends: .qemu-smoke-x86-64
   script:
-    - ./automation/scripts/qemu-smoke-x86-64-efi.sh pv 2>&1 | tee ${LOGFILE}
+    - ./automation/scripts/qemu-xtf.sh x86-64-efi pv64 example 2>&1 | tee ${LOGFILE}
   needs:
     - debian-12-x86_64-gcc-debug
 
diff --git a/automation/scripts/include/configs/xtf-x86-64-efi-config b/automation/scripts/include/configs/xtf-x86-64-efi-config
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/automation/scripts/include/xtf-x86-64-efi b/automation/scripts/include/xtf-x86-64-efi
new file mode 100644
index 0000000000..e0d821b3f6
--- /dev/null
+++ b/automation/scripts/include/xtf-x86-64-efi
@@ -0,0 +1,52 @@
+#!/bin/bash
+#
+# XTF test utilities (x86_64, EFI).
+#
+
+# Arch-specific environment overrides.
+function xtf_arch_prepare()
+{
+    export FW_PREFIX="${FW_PREFIX:-/usr/share/OVMF/}"
+    export QEMU_PREFIX="${QEMU_PREFIX:-}"
+    export XEN_BINARY="${XEN_BINARY:-${WORKDIR}/xen.efi}"
+    export XEN_CMDLINE="${XEN_CMDLINE:-loglvl=all noreboot console_timestamps=boot console=com1}"
+    export XTF_SRC_BRANCH="${XTF_SRC_BRANCH:-master}"
+    export XTF_SRC_URI="${XTF_SRC_URI:-https://xenbits.xen.org/git-http/xtf.git}"
+    export XTF_SRC_VARIANTS="hvm64 pv64"
+}
+
+# Perform arch-specific XTF environment setup.
+function xtf_arch_setup()
+{
+    local esp_dir="${WORKDIR}/boot-esp"
+    local efi_dir="${esp_dir}/EFI/BOOT"
+
+    # Generate EFI boot environment
+    mkdir -p ${efi_dir}
+    cp ${XEN_BINARY} ${efi_dir}/BOOTX64.EFI
+    cp ${XTF_BINARY} ${efi_dir}/kernel
+
+    cat > ${efi_dir}/BOOTX64.cfg <<EOF
+[global]
+default=test
+
+[test]
+options=${XEN_CMDLINE}
+kernel=kernel
+EOF
+
+    # NB: OVMF_CODE.fd is read-only, no need to copy
+    cp ${FW_PREFIX}OVMF_VARS.fd ${WORKDIR}
+
+    export TEST_CMD="${QEMU_PREFIX}qemu-system-x86_64 \
+        -no-reboot \
+        -nographic \
+        -monitor none \
+        -serial stdio \
+        -m 512 \
+        -M q35,kernel-irqchip=split \
+        -drive if=pflash,format=raw,readonly=on,file=${FW_PREFIX}OVMF_CODE.fd \
+        -drive if=pflash,format=raw,file=${WORKDIR}/OVMF_VARS.fd \
+        -drive file=fat:rw:${esp_dir},media=disk,index=0,format=raw \
+    "
+}
diff --git a/automation/scripts/qemu-smoke-x86-64-efi.sh b/automation/scripts/qemu-smoke-x86-64-efi.sh
deleted file mode 100755
index 7572722be6..0000000000
--- a/automation/scripts/qemu-smoke-x86-64-efi.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash
-
-set -ex -o pipefail
-
-# variant should be either pv or pvh
-variant=$1
-
-# Clone and build XTF
-git clone https://xenbits.xen.org/git-http/xtf.git
-cd xtf && make -j$(nproc) && cd -
-
-case $variant in
-    pvh) k=test-hvm64-example    extra="dom0-iommu=none dom0=pvh" ;;
-    *)   k=test-pv64-example     extra= ;;
-esac
-
-mkdir -p boot-esp/EFI/BOOT
-cp binaries/xen.efi boot-esp/EFI/BOOT/BOOTX64.EFI
-cp xtf/tests/example/$k boot-esp/EFI/BOOT/kernel
-
-cat > boot-esp/EFI/BOOT/BOOTX64.cfg <<EOF
-[global]
-default=test
-
-[test]
-options=loglvl=all console=com1 noreboot console_timestamps=boot $extra
-kernel=kernel
-EOF
-
-cp /usr/share/OVMF/OVMF_CODE.fd OVMF_CODE.fd
-cp /usr/share/OVMF/OVMF_VARS.fd OVMF_VARS.fd
-
-rm -f smoke.serial
-export TEST_CMD="qemu-system-x86_64 -nographic -M q35,kernel-irqchip=split \
-        -drive if=pflash,format=raw,readonly=on,file=OVMF_CODE.fd \
-        -drive if=pflash,format=raw,file=OVMF_VARS.fd \
-        -drive file=fat:rw:boot-esp,media=disk,index=0,format=raw \
-        -m 512 -monitor none -serial stdio"
-
-export TEST_LOG="smoke.serial"
-export PASSED="Test result: SUCCESS"
-
-./automation/scripts/console.exp | sed 's/\r\+$//'
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 22 20:55:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Apr 2025 20:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.963634.1354592 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7KeJ-000314-6V; Tue, 22 Apr 2025 20:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 963634.1354592; Tue, 22 Apr 2025 20: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 1u7KeJ-00030w-3v; Tue, 22 Apr 2025 20:55:23 +0000
Received: by outflank-mailman (input) for mailman id 963634;
 Tue, 22 Apr 2025 20: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 1u7KeI-00030q-Ji
 for xen-changelog@lists.xenproject.org; Tue, 22 Apr 2025 20: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 1u7KeI-00F6ul-1s
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 20:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7KeI-001vZ0-1i
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 20: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=6fQ+rgcw0EjO6hce+SGZOwqnbYsLp2BAgCyCyLlozNA=; b=VJNrpBHYvNmaeoL5IWxI+GqMXx
	gghtU+USgZRwwHdtVMLhZzDhE6XlEhzh+b1E2h0x9BLOwUWRM3cMBhqQe20Ag3QSw3ZjVy8x7Z3Af
	crSeM2tsj7QlowEBJDLLeAEeakF+3GKCU1ogfDZBKTe0uRKj4UK0lXDNZ5HlnG/RgVH4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: switch arm64 XTF test runner to qemu-xtf.sh
Message-Id: <E1u7KeI-001vZ0-1i@xenbits.xenproject.org>
Date: Tue, 22 Apr 2025 20:55:22 +0000

commit 934fcfb17dbac059bfaabf0dc4277e32176a043e
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Tue Apr 22 16:18:59 2025 +0000
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Apr 22 13:07:13 2025 -0700

    CI: switch arm64 XTF test runner to qemu-xtf.sh
    
    Hook arm64 QEMU configuration to qemu-xtf.sh and use new script in arm64 CI
    jobs.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/gitlab-ci/test.yaml                     |  4 +-
 automation/scripts/.gitignore                      |  3 +
 .../scripts/include/configs/xtf-arm64-config       |  2 +
 automation/scripts/include/xtf-arm64               | 81 ++++++++++++++++++++++
 automation/scripts/qemu-xtf-dom0less-arm64.sh      | 68 ------------------
 5 files changed, 88 insertions(+), 70 deletions(-)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 1d89575b24..a603d4039a 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -571,7 +571,7 @@ qemu-smoke-dom0less-arm64-gcc-debug-earlyprintk:
 qemu-xtf-dom0less-arm64-gcc-hyp-xen-version:
   extends: .qemu-arm64
   script:
-    - ./automation/scripts/qemu-xtf-dom0less-arm64.sh hyp-xen-version 2>&1 | tee ${LOGFILE}
+    - ./automation/scripts/qemu-xtf.sh arm64 mmu64le hyp-xen-version 2>&1 | tee ${LOGFILE}
   needs:
     - alpine-3.18-gcc-arm64
     - qemu-system-aarch64-6.0.0-arm64-export
@@ -579,7 +579,7 @@ qemu-xtf-dom0less-arm64-gcc-hyp-xen-version:
 qemu-xtf-dom0less-arm64-gcc-debug-hyp-xen-version:
   extends: .qemu-arm64
   script:
-    - ./automation/scripts/qemu-xtf-dom0less-arm64.sh hyp-xen-version 2>&1 | tee ${LOGFILE}
+    - ./automation/scripts/qemu-xtf.sh arm64 mmu64le hyp-xen-version 2>&1 | tee ${LOGFILE}
   needs:
     - alpine-3.18-gcc-debug-arm64
     - qemu-system-aarch64-6.0.0-arm64-export
diff --git a/automation/scripts/.gitignore b/automation/scripts/.gitignore
index 310a577bef..a01b533c60 100644
--- a/automation/scripts/.gitignore
+++ b/automation/scripts/.gitignore
@@ -1,3 +1,6 @@
 /binaries/
+/imagebuilder/
 /smoke.serial
 /xtf-*/
+
+*.rom
diff --git a/automation/scripts/include/configs/xtf-arm64-config b/automation/scripts/include/configs/xtf-arm64-config
new file mode 100644
index 0000000000..9942740927
--- /dev/null
+++ b/automation/scripts/include/configs/xtf-arm64-config
@@ -0,0 +1,2 @@
+CONFIG_GICV2=y
+CONFIG_SBSA_UART=y
diff --git a/automation/scripts/include/xtf-arm64 b/automation/scripts/include/xtf-arm64
new file mode 100644
index 0000000000..1a318b7aa0
--- /dev/null
+++ b/automation/scripts/include/xtf-arm64
@@ -0,0 +1,81 @@
+#!/bin/bash
+#
+# XTF test utilities (arm64).
+#
+
+# Arch-specific environment overrides.
+function xtf_arch_prepare()
+{
+    export FW_PREFIX="${FW_PREFIX:-/usr/lib/u-boot/qemu_arm64/}"
+    export QEMU_PREFIX="${QEMU_PREFIX:-${WORKDIR}/}"
+    export XEN_BINARY="${XEN_BINARY:-${WORKDIR}/xen}"
+    export XEN_CMDLINE="${XEN_CMDLINE:-loglvl=all noreboot console_timestamps=boot console=dtuart}"
+    export XTF_SRC_BRANCH="${XTF_SRC_BRANCH:-xtf-arm}"
+    export XTF_SRC_URI="${XTF_SRC_URI:-https://gitlab.com/xen-project/fusa/xtf.git}"
+    export XTF_SRC_VARIANTS="mmu64le"
+}
+
+# Perform arch-specific XTF environment setup.
+function xtf_arch_setup()
+{
+    # QEMU looks for "efi-virtio.rom" even if it is unneeded
+    curl -fsSLO https://github.com/qemu/qemu/raw/v5.2.0/pc-bios/efi-virtio.rom
+
+    # Crude check for local testing
+    if [ ! -d imagebuilder ]; then
+        git clone --depth 1 https://gitlab.com/xen-project/imagebuilder.git
+    fi
+
+    cat > ${WORKDIR}/config <<EOF
+MEMORY_START="0x40000000"
+MEMORY_END="0xC0000000"
+
+XEN="xen"
+DEVICE_TREE="virt-gicv2.dtb"
+
+XEN_CMD="${XEN_CMDLINE}"
+
+DOMU_KERNEL[0]="xtf-test"
+DOMU_MEM[0]="128"
+
+NUM_DOMUS=1
+
+LOAD_CMD="tftpb"
+UBOOT_SOURCE="boot.source"
+UBOOT_SCRIPT="boot.scr"
+EOF
+    cp ${XTF_BINARY} ${WORKDIR}/xtf-test
+
+    # Generate virt-gicv2.dtb
+    ${WORKDIR}/qemu-system-aarch64 \
+        -machine virtualization=true \
+        -cpu cortex-a57 \
+        -machine type=virt \
+        -m 2048 \
+        -smp 2 \
+        -display none \
+        -machine dumpdtb=${WORKDIR}/virt-gicv2.dtb
+
+    # Generate U-Boot environment
+    bash -x imagebuilder/scripts/uboot-script-gen \
+        -t tftp \
+        -d ${WORKDIR}/ \
+        -c ${WORKDIR}/config
+
+    export TEST_CMD="${QEMU_PREFIX}qemu-system-aarch64 \
+        -machine virtualization=true \
+        -cpu cortex-a57 \
+        -machine type=virt \
+        -no-reboot \
+        -nographic \
+        -monitor none \
+        -serial stdio \
+        -m 2048 \
+        -smp 2 \
+        -device virtio-net-pci,netdev=n0 \
+        -netdev user,id=n0,tftp=${WORKDIR} \
+        -bios ${FW_PREFIX}u-boot.bin \
+    "
+
+    export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
+}
diff --git a/automation/scripts/qemu-xtf-dom0less-arm64.sh b/automation/scripts/qemu-xtf-dom0less-arm64.sh
deleted file mode 100755
index 436f460c3c..0000000000
--- a/automation/scripts/qemu-xtf-dom0less-arm64.sh
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/bin/bash
-
-set -ex -o pipefail
-
-# Name of the XTF test
-xtf_test=$1
-
-# Message returned by XTF in case of success
-passed="Test result: SUCCESS"
-
-# XXX QEMU looks for "efi-virtio.rom" even if it is unneeded
-curl -fsSLO https://github.com/qemu/qemu/raw/v5.2.0/pc-bios/efi-virtio.rom
-./binaries/qemu-system-aarch64 \
-   -machine virtualization=true \
-   -cpu cortex-a57 -machine type=virt \
-   -m 2048 -smp 2 -display none \
-   -machine dumpdtb=binaries/virt-gicv2.dtb
-
-# XTF
-# Build a single XTF test passed as a first parameter to the script.
-# Build XTF with GICv2 support to match Qemu configuration and with SBSA UART
-# support, so that the test will use an emulated UART for printing messages.
-# This will allow us to run the test on both debug and non-debug Xen builds.
-rm -rf xtf
-git clone https://gitlab.com/xen-project/fusa/xtf.git -b xtf-arm
-make -C xtf TESTS=tests/${xtf_test} CONFIG_SBSA_UART=y CONFIG_GICV2=y -j$(nproc)
-cp xtf/tests/${xtf_test}/test-mmu64le-${xtf_test} binaries/xtf-test
-
-# ImageBuilder
-echo 'MEMORY_START="0x40000000"
-MEMORY_END="0xC0000000"
-
-XEN="xen"
-DEVICE_TREE="virt-gicv2.dtb"
-
-XEN_CMD="console=dtuart console_timestamps=boot"
-
-DOMU_KERNEL[0]="xtf-test"
-DOMU_MEM[0]="128"
-
-NUM_DOMUS=1
-
-LOAD_CMD="tftpb"
-UBOOT_SOURCE="boot.source"
-UBOOT_SCRIPT="boot.scr"' > binaries/config
-
-rm -rf imagebuilder
-git clone --depth 1 https://gitlab.com/xen-project/imagebuilder.git
-bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/config
-
-# Run the test
-rm -f smoke.serial
-export TEST_CMD="./binaries/qemu-system-aarch64 \
-    -machine virtualization=true \
-    -cpu cortex-a57 -machine type=virt \
-    -m 2048 -monitor none -serial stdio \
-    -smp 2 \
-    -no-reboot \
-    -device virtio-net-pci,netdev=n0 \
-    -netdev user,id=n0,tftp=binaries \
-    -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"
-
-export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
-export BOOT_MSG="Latest ChangeSet: "
-export TEST_LOG="smoke.serial"
-export PASSED="${passed}"
-
-./automation/scripts/console.exp | sed 's/\r\+$//'
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 22 21:44:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Apr 2025 21:44:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.963641.1354598 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7LPP-0002Xw-Bu; Tue, 22 Apr 2025 21:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 963641.1354598; Tue, 22 Apr 2025 21: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 1u7LPP-0002Xo-8d; Tue, 22 Apr 2025 21:44:03 +0000
Received: by outflank-mailman (input) for mailman id 963641;
 Tue, 22 Apr 2025 21: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 1u7LPN-0002Xg-V7
 for xen-changelog@lists.xenproject.org; Tue, 22 Apr 2025 21: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 1u7LPN-00F8As-2O
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 21:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7LPN-002qP2-2E
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 21: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=PqxXBxt2wnpmliaVOI6MIqZm3OEKUrgXUPaFC8p8F0s=; b=GRH9AlqmgVYkdVfi5j2o+QaScT
	xNWhp6DBpsnIBgx29ITZnseAARbEDXcc/FUV/faaPcfSvF5KJbHWg91uAOoh6ev3jQI4WY/Fd5ZGb
	HSzygJH421itauDDbjh1sGsffC8RiSHV5hWyorl+CMoo49K2o21emebsiApXT9iKy3u0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: unify x86 XTF test runner
Message-Id: <E1u7LPN-002qP2-2E@xenbits.xenproject.org>
Date: Tue, 22 Apr 2025 21:44:01 +0000

commit a22f80e7585d424cc40ce0e52233b35146845b94
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Tue Apr 22 16:18:48 2025 +0000
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Apr 22 13:07:12 2025 -0700

    CI: unify x86 XTF test runner
    
    Add test runner script qemu-xtf.sh which is allows any XTF x86 test to be
    easily executed. Test runner is invoked from the qemu-smoke* jobs with the
    hardcoded parameters.
    
    Each x86 XTF job lead time is reduced a bit since only the test-related code
    is built, not the entire XTF project.
    
    Add .gitignore to avoid committing test artifacts by mistake.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/gitlab-ci/test.yaml                     |   8 +-
 automation/scripts/.gitignore                      |   3 +
 .../scripts/include/configs/xtf-x86-64-config      |   0
 automation/scripts/include/xtf-runner              | 131 +++++++++++++++++++++
 automation/scripts/include/xtf-x86-64              |  31 +++++
 automation/scripts/qemu-smoke-x86-64.sh            |  26 ----
 automation/scripts/qemu-xtf.sh                     |  28 +++++
 7 files changed, 197 insertions(+), 30 deletions(-)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 5ce445b78f..3adc841335 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -659,28 +659,28 @@ qemu-alpine-x86_64-gcc:
 qemu-smoke-x86-64-gcc:
   extends: .qemu-smoke-x86-64
   script:
-    - ./automation/scripts/qemu-smoke-x86-64.sh pv 2>&1 | tee ${LOGFILE}
+    - ./automation/scripts/qemu-xtf.sh x86-64 pv64 example 2>&1 | tee ${LOGFILE}
   needs:
     - debian-12-x86_64-gcc-debug
 
 qemu-smoke-x86-64-clang:
   extends: .qemu-smoke-x86-64
   script:
-    - ./automation/scripts/qemu-smoke-x86-64.sh pv 2>&1 | tee ${LOGFILE}
+    - ./automation/scripts/qemu-xtf.sh x86-64 pv64 example 2>&1 | tee ${LOGFILE}
   needs:
     - debian-12-x86_64-clang-debug
 
 qemu-smoke-x86-64-gcc-pvh:
   extends: .qemu-smoke-x86-64
   script:
-    - ./automation/scripts/qemu-smoke-x86-64.sh pvh 2>&1 | tee ${LOGFILE}
+    - ./automation/scripts/qemu-xtf.sh x86-64 hvm64 example 2>&1 | tee ${LOGFILE}
   needs:
     - debian-12-x86_64-gcc-debug
 
 qemu-smoke-x86-64-clang-pvh:
   extends: .qemu-smoke-x86-64
   script:
-    - ./automation/scripts/qemu-smoke-x86-64.sh pvh 2>&1 | tee ${LOGFILE}
+    - ./automation/scripts/qemu-xtf.sh x86-64 hvm64 example 2>&1 | tee ${LOGFILE}
   needs:
     - debian-12-x86_64-clang-debug
 
diff --git a/automation/scripts/.gitignore b/automation/scripts/.gitignore
new file mode 100644
index 0000000000..310a577bef
--- /dev/null
+++ b/automation/scripts/.gitignore
@@ -0,0 +1,3 @@
+/binaries/
+/smoke.serial
+/xtf-*/
diff --git a/automation/scripts/include/configs/xtf-x86-64-config b/automation/scripts/include/configs/xtf-x86-64-config
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/automation/scripts/include/xtf-runner b/automation/scripts/include/xtf-runner
new file mode 100644
index 0000000000..320eb65dc8
--- /dev/null
+++ b/automation/scripts/include/xtf-runner
@@ -0,0 +1,131 @@
+#!/bin/bash
+#
+# XTF test utilities.
+#
+# Environment variables:
+#   BOOT_MSG: Expected boot message
+#   FW_PREFIX: Firmware images path including '/' at the end
+#   PASSED: XTF test printout in case of a pass
+#   QEMU_PREFIX: QEMU path including '/' at the end
+#   TEST_LOG: Output log file
+#   UBOOT_CMD: U-Boot command line
+#   WORKDIR: Test working directory
+#   XEN_BINARY: Xen binary location
+#   XEN_CONSOLE: Xen console device name
+#   XTF_SRC_CONFIG: XTF config file
+#   XTF_SRC_BRANCH: XTF branch
+#   XTF_SRC_URI: XTF source code URI
+
+# Output log file
+TEST_LOG="${TEST_LOG:-${XEN_ROOT}/smoke.serial}"
+# XTF test printout in case of a pass
+PASSED="${PASSED:-Test result: SUCCESS}"
+# Expected boot message
+BOOT_MSG="${BOOT_MSG:-Latest ChangeSet: }"
+# Test working directory
+WORKDIR="${WORKDIR:-${XEN_ROOT}/binaries}"
+# XTF source code
+XTF_SRC_CONFIG="${XTF_SRC_CONFIG:-include/configs/xtf-${ARCH}-config}"
+
+function die()
+{
+    set +x
+    echo "FATAL: $*" >&2
+    exit 1
+}
+
+# Build an XTF test binary.
+# $1 Test variant.
+# $2 Test name.
+function xtf_build_binary()
+{
+    local xtf_variant=$1
+    local xtf_name=$2
+    local xtf_dir="xtf-${ARCH}"
+
+    # Crude check for local testing
+    if [ ! -d ${xtf_dir} ]; then
+        git clone ${XTF_SRC_URI} ${xtf_dir} -b ${XTF_SRC_BRANCH}
+    fi
+
+    make \
+        -C ${xtf_dir} \
+        -j$(nproc) \
+        $(tr '\n' ' ' < ${XTF_SRC_CONFIG}) \
+        TESTS=tests/${xtf_name}
+
+    export XTF_NAME="${xtf_name}"
+    export XTF_VARIANT="${xtf_variant}"
+    export XTF_WORKDIR="$(readlink -f ${xtf_dir})"
+    export XTF_BINARY="${XTF_WORKDIR}/tests/${xtf_name}/test-${xtf_variant}-${xtf_name}"
+}
+
+# Build Xen command line for running an XTF test.
+# $1 Test variant.
+# $2 Test name.
+function xtf_build_cmdline()
+{
+    local xtf_variant=$1
+    local xtf_name=$2
+    declare -a cmdline=()
+
+    cmdline+=("${XEN_CMDLINE}")
+
+    # NB: OK to have hvm64, which is x86-only variant
+    if [[ $xtf_variant == "hvm64" ]]; then
+        cmdline+=("dom0-iommu=none dom0=pvh")
+    fi
+
+    export XEN_CMDLINE="${cmdline[@]}"
+}
+
+# Build an XTF test environment.
+# $1 Test variant.
+# $2 Test name.
+function xtf_build_test()
+{
+    local v=$1
+    local xtf_name=$2
+    local xtf_variant=""
+
+    for x in ${XTF_SRC_VARIANTS}; do
+        if [[ "${x}" == "${v}" ]]; then
+            xtf_variant=${v}
+            break
+        fi
+    done
+    if [[ -z $xtf_variant ]]; then
+        die "unsupported test variant '$1', supported variants: ${XTF_SRC_VARIANTS}"
+    fi
+
+    xtf_build_binary ${xtf_variant} ${xtf_name}
+    xtf_build_cmdline ${xtf_variant} ${xtf_name}
+}
+
+# Execute an XTF test.
+function xtf_run_test()
+{
+    rm -f ${TEST_LOG}
+    export BOOT_MSG PASSED TEST_CMD TEST_LOG UBOOT_CMD
+    ./console.exp | sed 's/\r\+$//'
+}
+
+# Setup environment and run an XTF test.
+# $1 Test variant.
+# $2 Test name.
+function xtf_test()
+{
+    # Out: FW_*, QEMU_*, XEN_{BINARY,CONSOLE}, XTF_SRC_*
+    xtf_arch_prepare
+
+    # In: XTF_SRC_*
+    # OUt: XTF_{BINARY,NAME,VARIANT,WORKDIR} and XEN_CMDLINE
+    xtf_build_test $@
+
+    # In: FW_*, QEMU_*, XTF_*, XEN_*
+    # Out: BOOT_MSG, PASSED, TEST_{CMD,LOG}, UBOOT_CMD
+    xtf_arch_setup
+
+    # In: BOOT_MSG, PASSED, TEST_{CMD,LOG}, UBOOT_CMD
+    xtf_run_test
+}
diff --git a/automation/scripts/include/xtf-x86-64 b/automation/scripts/include/xtf-x86-64
new file mode 100644
index 0000000000..b1b0cc201e
--- /dev/null
+++ b/automation/scripts/include/xtf-x86-64
@@ -0,0 +1,31 @@
+#!/bin/bash
+#
+# XTF test utilities (x86_64).
+#
+
+# Arch-specific environment overrides.
+function xtf_arch_prepare()
+{
+    export FW_PREFIX="${FW_PREFIX:-}"
+    export QEMU_PREFIX="${QEMU_PREFIX:-}"
+    export XEN_BINARY="${XEN_BINARY:-${WORKDIR}/xen}"
+    export XEN_CMDLINE="${XEN_CMDLINE:-loglvl=all noreboot console_timestamps=boot console=com1}"
+    export XTF_SRC_BRANCH="${XTF_SRC_BRANCH:-master}"
+    export XTF_SRC_URI="${XTF_SRC_URI:-https://xenbits.xen.org/git-http/xtf.git}"
+    export XTF_SRC_VARIANTS="hvm64 pv64"
+}
+
+# Perform arch-specific XTF environment setup.
+function xtf_arch_setup()
+{
+    export TEST_CMD="${QEMU_PREFIX}qemu-system-x86_64 \
+        -no-reboot \
+        -nographic \
+        -monitor none \
+        -serial stdio \
+        -m 512 \
+        -kernel ${XEN_BINARY} \
+        -initrd ${XTF_BINARY} \
+        -append \"${XEN_CMDLINE}\" \
+    "
+}
diff --git a/automation/scripts/qemu-smoke-x86-64.sh b/automation/scripts/qemu-smoke-x86-64.sh
deleted file mode 100755
index da0c26cc2f..0000000000
--- a/automation/scripts/qemu-smoke-x86-64.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/bash
-
-set -ex -o pipefail
-
-# variant should be either pv or pvh
-variant=$1
-
-# Clone and build XTF
-git clone https://xenbits.xen.org/git-http/xtf.git
-cd xtf && make -j$(nproc) && cd -
-
-case $variant in
-    pvh) k=test-hvm64-example    extra="dom0-iommu=none dom0=pvh" ;;
-    *)   k=test-pv64-example     extra= ;;
-esac
-
-rm -f smoke.serial
-export TEST_CMD="qemu-system-x86_64 -nographic -kernel binaries/xen \
-        -initrd xtf/tests/example/$k \
-        -append \"loglvl=all console=com1 noreboot console_timestamps=boot $extra\" \
-        -m 512 -monitor none -serial stdio"
-
-export TEST_LOG="smoke.serial"
-export PASSED="Test result: SUCCESS"
-
-./automation/scripts/console.exp | sed 's/\r\+$//'
diff --git a/automation/scripts/qemu-xtf.sh b/automation/scripts/qemu-xtf.sh
new file mode 100755
index 0000000000..55c221b36d
--- /dev/null
+++ b/automation/scripts/qemu-xtf.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+#
+# XTF test runner (QEMU).
+#
+
+set -e -o pipefail
+
+if [ $# -lt 3 ]; then
+    echo "Usage: $(basename $0) ARCH XTF-VARIANT XTF-NAME"
+    exit 0
+fi
+
+export ARCH="$1"
+shift
+
+set -x
+
+export XEN_ROOT="${PWD}"
+cd $(dirname $0)
+
+source include/xtf-runner
+
+if [ ! -f "include/xtf-${ARCH}" ]; then
+    die "unsupported architecture '${ARCH}'"
+fi
+source include/xtf-${ARCH}
+
+xtf_test $@
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 22 21:44:12 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Apr 2025 21:44:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.963642.1354601 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7LPY-0002a8-Ed; Tue, 22 Apr 2025 21:44:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 963642.1354601; Tue, 22 Apr 2025 21: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 1u7LPY-0002a0-Bc; Tue, 22 Apr 2025 21:44:12 +0000
Received: by outflank-mailman (input) for mailman id 963642;
 Tue, 22 Apr 2025 21: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 1u7LPX-0002Zu-SN
 for xen-changelog@lists.xenproject.org; Tue, 22 Apr 2025 21: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 1u7LPX-00F8Aw-2j
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 21:44:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7LPX-002qlv-2b
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 21: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=2Bu90MFG0MhH7p9WUyNZsHHBOF8Rn1BpDMbuSkIw+BA=; b=RellYsUz5jBFruSLt/iBmBAZQ/
	kxRUTBDHgwYp55V/h9uTbhgxRpfGEL669HEcqFF1b/eK+5gTdzm7BtrNGfz1uFrFbzjPFmKZ0BBVw
	WQOvvJsXQ9DCraeE5P7URuPoVcAGUfcnUr/FgT5m/z5KvPS+Kkq1PnFl+YPI2VncNh0c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: switch x86 EFI smoke test runner to qemu-xtf.sh
Message-Id: <E1u7LPX-002qlv-2b@xenbits.xenproject.org>
Date: Tue, 22 Apr 2025 21:44:11 +0000

commit 23041e72d98265e23218d7a2d97f89bb7cb862e9
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Tue Apr 22 16:18:53 2025 +0000
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Apr 22 13:07:12 2025 -0700

    CI: switch x86 EFI smoke test runner to qemu-xtf.sh
    
    Use qemu-xtf.sh for qemu-smoke-x86-64-gcc-efi job.
    
    Lead time is reduced a bit since not all XTF code base is built, just the
    required test.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/gitlab-ci/test.yaml                     |  2 +-
 .../scripts/include/configs/xtf-x86-64-efi-config  |  0
 automation/scripts/include/xtf-x86-64-efi          | 52 ++++++++++++++++++++++
 automation/scripts/qemu-smoke-x86-64-efi.sh        | 43 ------------------
 4 files changed, 53 insertions(+), 44 deletions(-)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 3adc841335..1d89575b24 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -687,7 +687,7 @@ qemu-smoke-x86-64-clang-pvh:
 qemu-smoke-x86-64-gcc-efi:
   extends: .qemu-smoke-x86-64
   script:
-    - ./automation/scripts/qemu-smoke-x86-64-efi.sh pv 2>&1 | tee ${LOGFILE}
+    - ./automation/scripts/qemu-xtf.sh x86-64-efi pv64 example 2>&1 | tee ${LOGFILE}
   needs:
     - debian-12-x86_64-gcc-debug
 
diff --git a/automation/scripts/include/configs/xtf-x86-64-efi-config b/automation/scripts/include/configs/xtf-x86-64-efi-config
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/automation/scripts/include/xtf-x86-64-efi b/automation/scripts/include/xtf-x86-64-efi
new file mode 100644
index 0000000000..e0d821b3f6
--- /dev/null
+++ b/automation/scripts/include/xtf-x86-64-efi
@@ -0,0 +1,52 @@
+#!/bin/bash
+#
+# XTF test utilities (x86_64, EFI).
+#
+
+# Arch-specific environment overrides.
+function xtf_arch_prepare()
+{
+    export FW_PREFIX="${FW_PREFIX:-/usr/share/OVMF/}"
+    export QEMU_PREFIX="${QEMU_PREFIX:-}"
+    export XEN_BINARY="${XEN_BINARY:-${WORKDIR}/xen.efi}"
+    export XEN_CMDLINE="${XEN_CMDLINE:-loglvl=all noreboot console_timestamps=boot console=com1}"
+    export XTF_SRC_BRANCH="${XTF_SRC_BRANCH:-master}"
+    export XTF_SRC_URI="${XTF_SRC_URI:-https://xenbits.xen.org/git-http/xtf.git}"
+    export XTF_SRC_VARIANTS="hvm64 pv64"
+}
+
+# Perform arch-specific XTF environment setup.
+function xtf_arch_setup()
+{
+    local esp_dir="${WORKDIR}/boot-esp"
+    local efi_dir="${esp_dir}/EFI/BOOT"
+
+    # Generate EFI boot environment
+    mkdir -p ${efi_dir}
+    cp ${XEN_BINARY} ${efi_dir}/BOOTX64.EFI
+    cp ${XTF_BINARY} ${efi_dir}/kernel
+
+    cat > ${efi_dir}/BOOTX64.cfg <<EOF
+[global]
+default=test
+
+[test]
+options=${XEN_CMDLINE}
+kernel=kernel
+EOF
+
+    # NB: OVMF_CODE.fd is read-only, no need to copy
+    cp ${FW_PREFIX}OVMF_VARS.fd ${WORKDIR}
+
+    export TEST_CMD="${QEMU_PREFIX}qemu-system-x86_64 \
+        -no-reboot \
+        -nographic \
+        -monitor none \
+        -serial stdio \
+        -m 512 \
+        -M q35,kernel-irqchip=split \
+        -drive if=pflash,format=raw,readonly=on,file=${FW_PREFIX}OVMF_CODE.fd \
+        -drive if=pflash,format=raw,file=${WORKDIR}/OVMF_VARS.fd \
+        -drive file=fat:rw:${esp_dir},media=disk,index=0,format=raw \
+    "
+}
diff --git a/automation/scripts/qemu-smoke-x86-64-efi.sh b/automation/scripts/qemu-smoke-x86-64-efi.sh
deleted file mode 100755
index 7572722be6..0000000000
--- a/automation/scripts/qemu-smoke-x86-64-efi.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash
-
-set -ex -o pipefail
-
-# variant should be either pv or pvh
-variant=$1
-
-# Clone and build XTF
-git clone https://xenbits.xen.org/git-http/xtf.git
-cd xtf && make -j$(nproc) && cd -
-
-case $variant in
-    pvh) k=test-hvm64-example    extra="dom0-iommu=none dom0=pvh" ;;
-    *)   k=test-pv64-example     extra= ;;
-esac
-
-mkdir -p boot-esp/EFI/BOOT
-cp binaries/xen.efi boot-esp/EFI/BOOT/BOOTX64.EFI
-cp xtf/tests/example/$k boot-esp/EFI/BOOT/kernel
-
-cat > boot-esp/EFI/BOOT/BOOTX64.cfg <<EOF
-[global]
-default=test
-
-[test]
-options=loglvl=all console=com1 noreboot console_timestamps=boot $extra
-kernel=kernel
-EOF
-
-cp /usr/share/OVMF/OVMF_CODE.fd OVMF_CODE.fd
-cp /usr/share/OVMF/OVMF_VARS.fd OVMF_VARS.fd
-
-rm -f smoke.serial
-export TEST_CMD="qemu-system-x86_64 -nographic -M q35,kernel-irqchip=split \
-        -drive if=pflash,format=raw,readonly=on,file=OVMF_CODE.fd \
-        -drive if=pflash,format=raw,file=OVMF_VARS.fd \
-        -drive file=fat:rw:boot-esp,media=disk,index=0,format=raw \
-        -m 512 -monitor none -serial stdio"
-
-export TEST_LOG="smoke.serial"
-export PASSED="Test result: SUCCESS"
-
-./automation/scripts/console.exp | sed 's/\r\+$//'
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 22 21:44:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Apr 2025 21:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.963643.1354605 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7LPj-0002cn-Ff; Tue, 22 Apr 2025 21:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 963643.1354605; Tue, 22 Apr 2025 21: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 1u7LPj-0002cb-D3; Tue, 22 Apr 2025 21:44:23 +0000
Received: by outflank-mailman (input) for mailman id 963643;
 Tue, 22 Apr 2025 21: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 1u7LPh-0002cR-VS
 for xen-changelog@lists.xenproject.org; Tue, 22 Apr 2025 21:44:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7LPh-00F8BG-31
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 21:44:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7LPh-002rAS-2u
 for xen-changelog@lists.xenproject.org;
 Tue, 22 Apr 2025 21: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=kFZeMWOBcoAOPS+2n3Vf9xTjaPCLN39Q/auBeNlW464=; b=MANOtzYBOshEP2Teyi9Y7oRZGk
	DzXXh0UlcP1x5YTIaqxprsUWNKbJjlfNFGLFREiuuwzkG0bLSEQfUps7u9De2grR2j1bY95UuwQmG
	pdES7XIwV62MGCh3LPm0ur6FHhYE35g2qAC+q+jnXFd2e9i7uTCiL5w6WcfKwv5cryBs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: switch arm64 XTF test runner to qemu-xtf.sh
Message-Id: <E1u7LPh-002rAS-2u@xenbits.xenproject.org>
Date: Tue, 22 Apr 2025 21:44:21 +0000

commit 934fcfb17dbac059bfaabf0dc4277e32176a043e
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Tue Apr 22 16:18:59 2025 +0000
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Apr 22 13:07:13 2025 -0700

    CI: switch arm64 XTF test runner to qemu-xtf.sh
    
    Hook arm64 QEMU configuration to qemu-xtf.sh and use new script in arm64 CI
    jobs.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/gitlab-ci/test.yaml                     |  4 +-
 automation/scripts/.gitignore                      |  3 +
 .../scripts/include/configs/xtf-arm64-config       |  2 +
 automation/scripts/include/xtf-arm64               | 81 ++++++++++++++++++++++
 automation/scripts/qemu-xtf-dom0less-arm64.sh      | 68 ------------------
 5 files changed, 88 insertions(+), 70 deletions(-)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 1d89575b24..a603d4039a 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -571,7 +571,7 @@ qemu-smoke-dom0less-arm64-gcc-debug-earlyprintk:
 qemu-xtf-dom0less-arm64-gcc-hyp-xen-version:
   extends: .qemu-arm64
   script:
-    - ./automation/scripts/qemu-xtf-dom0less-arm64.sh hyp-xen-version 2>&1 | tee ${LOGFILE}
+    - ./automation/scripts/qemu-xtf.sh arm64 mmu64le hyp-xen-version 2>&1 | tee ${LOGFILE}
   needs:
     - alpine-3.18-gcc-arm64
     - qemu-system-aarch64-6.0.0-arm64-export
@@ -579,7 +579,7 @@ qemu-xtf-dom0less-arm64-gcc-hyp-xen-version:
 qemu-xtf-dom0less-arm64-gcc-debug-hyp-xen-version:
   extends: .qemu-arm64
   script:
-    - ./automation/scripts/qemu-xtf-dom0less-arm64.sh hyp-xen-version 2>&1 | tee ${LOGFILE}
+    - ./automation/scripts/qemu-xtf.sh arm64 mmu64le hyp-xen-version 2>&1 | tee ${LOGFILE}
   needs:
     - alpine-3.18-gcc-debug-arm64
     - qemu-system-aarch64-6.0.0-arm64-export
diff --git a/automation/scripts/.gitignore b/automation/scripts/.gitignore
index 310a577bef..a01b533c60 100644
--- a/automation/scripts/.gitignore
+++ b/automation/scripts/.gitignore
@@ -1,3 +1,6 @@
 /binaries/
+/imagebuilder/
 /smoke.serial
 /xtf-*/
+
+*.rom
diff --git a/automation/scripts/include/configs/xtf-arm64-config b/automation/scripts/include/configs/xtf-arm64-config
new file mode 100644
index 0000000000..9942740927
--- /dev/null
+++ b/automation/scripts/include/configs/xtf-arm64-config
@@ -0,0 +1,2 @@
+CONFIG_GICV2=y
+CONFIG_SBSA_UART=y
diff --git a/automation/scripts/include/xtf-arm64 b/automation/scripts/include/xtf-arm64
new file mode 100644
index 0000000000..1a318b7aa0
--- /dev/null
+++ b/automation/scripts/include/xtf-arm64
@@ -0,0 +1,81 @@
+#!/bin/bash
+#
+# XTF test utilities (arm64).
+#
+
+# Arch-specific environment overrides.
+function xtf_arch_prepare()
+{
+    export FW_PREFIX="${FW_PREFIX:-/usr/lib/u-boot/qemu_arm64/}"
+    export QEMU_PREFIX="${QEMU_PREFIX:-${WORKDIR}/}"
+    export XEN_BINARY="${XEN_BINARY:-${WORKDIR}/xen}"
+    export XEN_CMDLINE="${XEN_CMDLINE:-loglvl=all noreboot console_timestamps=boot console=dtuart}"
+    export XTF_SRC_BRANCH="${XTF_SRC_BRANCH:-xtf-arm}"
+    export XTF_SRC_URI="${XTF_SRC_URI:-https://gitlab.com/xen-project/fusa/xtf.git}"
+    export XTF_SRC_VARIANTS="mmu64le"
+}
+
+# Perform arch-specific XTF environment setup.
+function xtf_arch_setup()
+{
+    # QEMU looks for "efi-virtio.rom" even if it is unneeded
+    curl -fsSLO https://github.com/qemu/qemu/raw/v5.2.0/pc-bios/efi-virtio.rom
+
+    # Crude check for local testing
+    if [ ! -d imagebuilder ]; then
+        git clone --depth 1 https://gitlab.com/xen-project/imagebuilder.git
+    fi
+
+    cat > ${WORKDIR}/config <<EOF
+MEMORY_START="0x40000000"
+MEMORY_END="0xC0000000"
+
+XEN="xen"
+DEVICE_TREE="virt-gicv2.dtb"
+
+XEN_CMD="${XEN_CMDLINE}"
+
+DOMU_KERNEL[0]="xtf-test"
+DOMU_MEM[0]="128"
+
+NUM_DOMUS=1
+
+LOAD_CMD="tftpb"
+UBOOT_SOURCE="boot.source"
+UBOOT_SCRIPT="boot.scr"
+EOF
+    cp ${XTF_BINARY} ${WORKDIR}/xtf-test
+
+    # Generate virt-gicv2.dtb
+    ${WORKDIR}/qemu-system-aarch64 \
+        -machine virtualization=true \
+        -cpu cortex-a57 \
+        -machine type=virt \
+        -m 2048 \
+        -smp 2 \
+        -display none \
+        -machine dumpdtb=${WORKDIR}/virt-gicv2.dtb
+
+    # Generate U-Boot environment
+    bash -x imagebuilder/scripts/uboot-script-gen \
+        -t tftp \
+        -d ${WORKDIR}/ \
+        -c ${WORKDIR}/config
+
+    export TEST_CMD="${QEMU_PREFIX}qemu-system-aarch64 \
+        -machine virtualization=true \
+        -cpu cortex-a57 \
+        -machine type=virt \
+        -no-reboot \
+        -nographic \
+        -monitor none \
+        -serial stdio \
+        -m 2048 \
+        -smp 2 \
+        -device virtio-net-pci,netdev=n0 \
+        -netdev user,id=n0,tftp=${WORKDIR} \
+        -bios ${FW_PREFIX}u-boot.bin \
+    "
+
+    export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
+}
diff --git a/automation/scripts/qemu-xtf-dom0less-arm64.sh b/automation/scripts/qemu-xtf-dom0less-arm64.sh
deleted file mode 100755
index 436f460c3c..0000000000
--- a/automation/scripts/qemu-xtf-dom0less-arm64.sh
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/bin/bash
-
-set -ex -o pipefail
-
-# Name of the XTF test
-xtf_test=$1
-
-# Message returned by XTF in case of success
-passed="Test result: SUCCESS"
-
-# XXX QEMU looks for "efi-virtio.rom" even if it is unneeded
-curl -fsSLO https://github.com/qemu/qemu/raw/v5.2.0/pc-bios/efi-virtio.rom
-./binaries/qemu-system-aarch64 \
-   -machine virtualization=true \
-   -cpu cortex-a57 -machine type=virt \
-   -m 2048 -smp 2 -display none \
-   -machine dumpdtb=binaries/virt-gicv2.dtb
-
-# XTF
-# Build a single XTF test passed as a first parameter to the script.
-# Build XTF with GICv2 support to match Qemu configuration and with SBSA UART
-# support, so that the test will use an emulated UART for printing messages.
-# This will allow us to run the test on both debug and non-debug Xen builds.
-rm -rf xtf
-git clone https://gitlab.com/xen-project/fusa/xtf.git -b xtf-arm
-make -C xtf TESTS=tests/${xtf_test} CONFIG_SBSA_UART=y CONFIG_GICV2=y -j$(nproc)
-cp xtf/tests/${xtf_test}/test-mmu64le-${xtf_test} binaries/xtf-test
-
-# ImageBuilder
-echo 'MEMORY_START="0x40000000"
-MEMORY_END="0xC0000000"
-
-XEN="xen"
-DEVICE_TREE="virt-gicv2.dtb"
-
-XEN_CMD="console=dtuart console_timestamps=boot"
-
-DOMU_KERNEL[0]="xtf-test"
-DOMU_MEM[0]="128"
-
-NUM_DOMUS=1
-
-LOAD_CMD="tftpb"
-UBOOT_SOURCE="boot.source"
-UBOOT_SCRIPT="boot.scr"' > binaries/config
-
-rm -rf imagebuilder
-git clone --depth 1 https://gitlab.com/xen-project/imagebuilder.git
-bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/config
-
-# Run the test
-rm -f smoke.serial
-export TEST_CMD="./binaries/qemu-system-aarch64 \
-    -machine virtualization=true \
-    -cpu cortex-a57 -machine type=virt \
-    -m 2048 -monitor none -serial stdio \
-    -smp 2 \
-    -no-reboot \
-    -device virtio-net-pci,netdev=n0 \
-    -netdev user,id=n0,tftp=binaries \
-    -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"
-
-export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
-export BOOT_MSG="Latest ChangeSet: "
-export TEST_LOG="smoke.serial"
-export PASSED="${passed}"
-
-./automation/scripts/console.exp | sed 's/\r\+$//'
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 23 00:11:10 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Apr 2025 00:11:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.963771.1354699 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7Nhg-0003JL-N4; Wed, 23 Apr 2025 00:11:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 963771.1354699; Wed, 23 Apr 2025 00: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 1u7Nhg-0003JB-KN; Wed, 23 Apr 2025 00:11:04 +0000
Received: by outflank-mailman (input) for mailman id 963771;
 Wed, 23 Apr 2025 00: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 1u7Nhe-0003Iz-MG
 for xen-changelog@lists.xenproject.org; Wed, 23 Apr 2025 00: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 1u7Nhe-00FCXK-1N
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 00:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7Nhe-0096I7-1A
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 00: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=QhYTFpv+hglaFUFB1rQOKUYc6wKrZEh5tSwez9qBnqo=; b=go1sR8ChmskwiQ7vMLXOK8uXnW
	WDJvdh8zBUmv1HKeXy07jc8t7xtH31YCTPDJ9og3iLoXavCz0GK8ywMXVe/9Mls1A5qZa2VzKLbfC
	p1vw18rwToqIb74+keisprIUvsRT9Ed/hzsnOEGYMjFdqpiIw+IrF/OETibZGeabVXCk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: debug: gcov: add condition coverage support
Message-Id: <E1u7Nhe-0096I7-1A@xenbits.xenproject.org>
Date: Wed, 23 Apr 2025 00:11:02 +0000

commit 920cc4e65e9ea15676c2326656674c9e212e55fe
Author:     Volodymyr Babchuk <volodymyr_babchuk@epam.com>
AuthorDate: Tue Apr 22 16:29:23 2025 -0700
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Apr 22 16:29:23 2025 -0700

    xen: debug: gcov: add condition coverage support
    
    Condition coverage, also known as MC/DC (modified condition/decision
    coverage) is a coverage metric that tracks separate outcomes in
    boolean expressions.
    
    This patch adds CONFIG_CONDITION_COVERAGE option to enable MC/DC for
    GCC. Clang is not supported right now because Xen can't emit version
    10 of LLVM profile data, where MC/DC support was added.
    
    Also, use the opportunity to convert COV_FLAGS to cov-cflags-y, which
    reduces amount of ifeqs in Rules.mk. Otherwise this patch had to add
    another nesting level with "ifeq ($(CONFIG_CONDITION_COVERAGE),y)".
    
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/Kconfig       |  4 ++++
 xen/Kconfig.debug |  9 +++++++++
 xen/Rules.mk      | 14 +++++++-------
 3 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/xen/Kconfig b/xen/Kconfig
index 486b36b843..1b24e8f3c0 100644
--- a/xen/Kconfig
+++ b/xen/Kconfig
@@ -47,6 +47,10 @@ config CC_HAS_ASM_GOTO_OUTPUT
 	depends on !GCC_ASM_GOTO_OUTPUT_BROKEN
 	depends on $(success,echo 'int foo(int x) { asm goto ("": "=r"(x) ::: bar); return x; bar: return 0; }' | $(CC) -x c - -c -o /dev/null)
 
+# Compiler supports -fcondition-coverage aka MC/DC
+config CC_HAS_MCDC
+	def_bool $(cc-option,-fcondition-coverage)
+
 # Set code alignment.
 #
 # Allow setting on a boolean basis, and then convert such selection to an
diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug
index c4a8d86912..d14093017e 100644
--- a/xen/Kconfig.debug
+++ b/xen/Kconfig.debug
@@ -44,6 +44,15 @@ config COVERAGE
 
 	  If unsure, say N here.
 
+config CONDITION_COVERAGE
+	bool "Condition coverage support"
+	depends on COVERAGE && CC_HAS_MCDC
+	help
+	  Enable condition coverage support. Used for collecting MC/DC
+	  (Modified Condition/Decision Coverage) metrics.
+
+	  If unsure, say N here.
+
 config DEBUG_LOCK_PROFILE
 	bool "Lock Profiling"
 	select DEBUG_LOCKS
diff --git a/xen/Rules.mk b/xen/Rules.mk
index d759cccee3..da21850926 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -29,6 +29,7 @@ targets :=
 subdir-y :=
 CFLAGS-y :=
 AFLAGS-y :=
+cov-cflags-y :=
 nocov-y :=
 noubsan-y :=
 
@@ -133,19 +134,18 @@ $(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS-y += -DINIT_SECTIONS
 
 non-init-objects = $(filter-out %.init.o, $(obj-y) $(obj-bin-y) $(extra-y))
 
-ifeq ($(CONFIG_COVERAGE),y)
 ifeq ($(CONFIG_CC_IS_CLANG),y)
-    COV_FLAGS := -fprofile-instr-generate -fcoverage-mapping
+    cov-cflags-$(CONFIG_COVERAGE) := -fprofile-instr-generate -fcoverage-mapping
 else
-    COV_FLAGS := -fprofile-arcs -ftest-coverage
+    cov-cflags-$(CONFIG_COVERAGE) := -fprofile-arcs -ftest-coverage
+    cov-cflags-$(CONFIG_CONDITION_COVERAGE) += -fcondition-coverage
 endif
 
-# Reset COV_FLAGS in cases where an objects has another one as prerequisite
+# Reset cov-cflags-y in cases where an objects has another one as prerequisite
 $(nocov-y) $(filter %.init.o, $(obj-y) $(obj-bin-y) $(extra-y)): \
-    COV_FLAGS :=
+    cov-cflags-y :=
 
-$(non-init-objects): _c_flags += $(COV_FLAGS)
-endif
+$(non-init-objects): _c_flags += $(cov-cflags-y)
 
 ifeq ($(CONFIG_UBSAN),y)
 # Any -fno-sanitize= options need to come after any -fsanitize= options
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 23 01:11:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Apr 2025 01:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.963853.1354792 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7Odj-0006pv-I4; Wed, 23 Apr 2025 01:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 963853.1354792; Wed, 23 Apr 2025 01: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 1u7Odj-0006pn-FS; Wed, 23 Apr 2025 01:11:03 +0000
Received: by outflank-mailman (input) for mailman id 963853;
 Wed, 23 Apr 2025 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 1u7Odh-0006pb-Vg
 for xen-changelog@lists.xenproject.org; Wed, 23 Apr 2025 01: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 1u7Odh-00Gjq9-27
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 01:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7Odh-00BgYX-1w
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 01: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=AyZ+IF+IhTi7boyioYmBP/o2ThdDe1hp/7RSqgf1Jdk=; b=P8Ch2CGaRsXFkGh2ap7lg5s6av
	z4a25QolH/PnJofNEpbM40gYXD26q2xYstDnwypX+yjvYaNOCGI5Pb7Bh1cczdkoNPlp0LjHqutA7
	poQ3tTU9vHD/THKqy6aBrfzojcmA5R/EwoJk05m5rTIbATCEycN/JnfiUxXVZAKVhb0I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: debug: gcov: add condition coverage support
Message-Id: <E1u7Odh-00BgYX-1w@xenbits.xenproject.org>
Date: Wed, 23 Apr 2025 01:11:01 +0000

commit 920cc4e65e9ea15676c2326656674c9e212e55fe
Author:     Volodymyr Babchuk <volodymyr_babchuk@epam.com>
AuthorDate: Tue Apr 22 16:29:23 2025 -0700
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue Apr 22 16:29:23 2025 -0700

    xen: debug: gcov: add condition coverage support
    
    Condition coverage, also known as MC/DC (modified condition/decision
    coverage) is a coverage metric that tracks separate outcomes in
    boolean expressions.
    
    This patch adds CONFIG_CONDITION_COVERAGE option to enable MC/DC for
    GCC. Clang is not supported right now because Xen can't emit version
    10 of LLVM profile data, where MC/DC support was added.
    
    Also, use the opportunity to convert COV_FLAGS to cov-cflags-y, which
    reduces amount of ifeqs in Rules.mk. Otherwise this patch had to add
    another nesting level with "ifeq ($(CONFIG_CONDITION_COVERAGE),y)".
    
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/Kconfig       |  4 ++++
 xen/Kconfig.debug |  9 +++++++++
 xen/Rules.mk      | 14 +++++++-------
 3 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/xen/Kconfig b/xen/Kconfig
index 486b36b843..1b24e8f3c0 100644
--- a/xen/Kconfig
+++ b/xen/Kconfig
@@ -47,6 +47,10 @@ config CC_HAS_ASM_GOTO_OUTPUT
 	depends on !GCC_ASM_GOTO_OUTPUT_BROKEN
 	depends on $(success,echo 'int foo(int x) { asm goto ("": "=r"(x) ::: bar); return x; bar: return 0; }' | $(CC) -x c - -c -o /dev/null)
 
+# Compiler supports -fcondition-coverage aka MC/DC
+config CC_HAS_MCDC
+	def_bool $(cc-option,-fcondition-coverage)
+
 # Set code alignment.
 #
 # Allow setting on a boolean basis, and then convert such selection to an
diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug
index c4a8d86912..d14093017e 100644
--- a/xen/Kconfig.debug
+++ b/xen/Kconfig.debug
@@ -44,6 +44,15 @@ config COVERAGE
 
 	  If unsure, say N here.
 
+config CONDITION_COVERAGE
+	bool "Condition coverage support"
+	depends on COVERAGE && CC_HAS_MCDC
+	help
+	  Enable condition coverage support. Used for collecting MC/DC
+	  (Modified Condition/Decision Coverage) metrics.
+
+	  If unsure, say N here.
+
 config DEBUG_LOCK_PROFILE
 	bool "Lock Profiling"
 	select DEBUG_LOCKS
diff --git a/xen/Rules.mk b/xen/Rules.mk
index d759cccee3..da21850926 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -29,6 +29,7 @@ targets :=
 subdir-y :=
 CFLAGS-y :=
 AFLAGS-y :=
+cov-cflags-y :=
 nocov-y :=
 noubsan-y :=
 
@@ -133,19 +134,18 @@ $(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS-y += -DINIT_SECTIONS
 
 non-init-objects = $(filter-out %.init.o, $(obj-y) $(obj-bin-y) $(extra-y))
 
-ifeq ($(CONFIG_COVERAGE),y)
 ifeq ($(CONFIG_CC_IS_CLANG),y)
-    COV_FLAGS := -fprofile-instr-generate -fcoverage-mapping
+    cov-cflags-$(CONFIG_COVERAGE) := -fprofile-instr-generate -fcoverage-mapping
 else
-    COV_FLAGS := -fprofile-arcs -ftest-coverage
+    cov-cflags-$(CONFIG_COVERAGE) := -fprofile-arcs -ftest-coverage
+    cov-cflags-$(CONFIG_CONDITION_COVERAGE) += -fcondition-coverage
 endif
 
-# Reset COV_FLAGS in cases where an objects has another one as prerequisite
+# Reset cov-cflags-y in cases where an objects has another one as prerequisite
 $(nocov-y) $(filter %.init.o, $(obj-y) $(obj-bin-y) $(extra-y)): \
-    COV_FLAGS :=
+    cov-cflags-y :=
 
-$(non-init-objects): _c_flags += $(COV_FLAGS)
-endif
+$(non-init-objects): _c_flags += $(cov-cflags-y)
 
 ifeq ($(CONFIG_UBSAN),y)
 # Any -fno-sanitize= options need to come after any -fsanitize= options
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 23 07:55:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Apr 2025 07:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.964064.1354927 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7Uwh-0002Qt-Mx; Wed, 23 Apr 2025 07:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 964064.1354927; Wed, 23 Apr 2025 07: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 1u7Uwh-0002Ql-K2; Wed, 23 Apr 2025 07:55:03 +0000
Received: by outflank-mailman (input) for mailman id 964064;
 Wed, 23 Apr 2025 07:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u7Uwg-0002Qf-59
 for xen-changelog@lists.xenproject.org; Wed, 23 Apr 2025 07:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7Uwg-00GvSx-0C
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 07:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7Uwf-001Hbb-3C
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 07: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=nJ0S06LlfxNKBHP39WdS026reMCip0zhm2mgdhR5DXU=; b=cxLTDlOPXL5NhDnyBWTYOkmIOd
	n8O85bxrrtnJT8JPRDfF9o8Q34fXeXQdgDpEefKeqmeWoPCqKVEAsXz/PKuAINo2nqWvJGxX4sAjf
	vpf7a4Lqxh1O0c33Mr1qL/L+TbagTF9tHsu06CSainEx1FwPVZtNEm2mlXLGFJoaaFDA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/EFI: correct mkreloc header (field) reading
Message-Id: <E1u7Uwf-001Hbb-3C@xenbits.xenproject.org>
Date: Wed, 23 Apr 2025 07:55:01 +0000

commit 042e9616f2e67476635487f2cd530406c6e3c0c1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Apr 23 09:39:44 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 23 09:39:44 2025 +0200

    x86/EFI: correct mkreloc header (field) reading
    
    With us now reading the full combined optional and NT headers, the
    subsequent reading of (and seeking to) NT header fields is wrong. Since
    PE32 and PE32+ NT headers are different anyway (beyond the image base
    oddity extending across both headers), switch to using a union. This
    allows to fetch the image base more directly then.
    
    Additionally add checking to map_section(), which would have caught at
    least the wrong (zero) image size that we previously used.
    
    Fixes: f7f42accbbbb ("x86/efi: Use generic PE/COFF structures")
    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>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/efi/mkreloc.c | 70 ++++++++++++++++++++++++++++++++--------------
 1 file changed, 49 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/efi/mkreloc.c b/xen/arch/x86/efi/mkreloc.c
index 375cb79d69..4b3b2dd7ea 100644
--- a/xen/arch/x86/efi/mkreloc.c
+++ b/xen/arch/x86/efi/mkreloc.c
@@ -28,14 +28,16 @@ static void usage(const char *cmd, int rc)
 static unsigned int load(const char *name, int *handle,
                          struct section_header **sections,
                          uint_fast64_t *image_base,
-                         uint32_t *image_size,
+                         uint_fast32_t *image_size,
                          unsigned int *width)
 {
     int in = open(name, O_RDONLY);
     struct mz_hdr mz_hdr;
     struct pe_hdr pe_hdr;
-    struct pe32_opt_hdr pe32_opt_hdr;
-    uint32_t base;
+    union {
+        struct pe32_opt_hdr pe;
+        struct pe32plus_opt_hdr pep;
+    } pe32_opt_hdr;
 
     if ( in < 0 ||
          read(in, &mz_hdr, sizeof(mz_hdr)) != sizeof(mz_hdr) )
@@ -54,31 +56,40 @@ static unsigned int load(const char *name, int *handle,
 
     if ( lseek(in, mz_hdr.peaddr, SEEK_SET) < 0 ||
          read(in, &pe_hdr, sizeof(pe_hdr)) != sizeof(pe_hdr) ||
-         read(in, &pe32_opt_hdr, sizeof(pe32_opt_hdr)) != sizeof(pe32_opt_hdr) ||
-         read(in, &base, sizeof(base)) != sizeof(base) ||
-         /*
-          * Luckily the image size field lives at the
-          * same offset for both formats.
-          */
-         lseek(in, 24, SEEK_CUR) < 0 ||
-         read(in, image_size, sizeof(*image_size)) != sizeof(*image_size) )
+         (read(in, &pe32_opt_hdr.pe, sizeof(pe32_opt_hdr.pe)) !=
+          sizeof(pe32_opt_hdr.pe)) )
     {
         perror(name);
         exit(3);
     }
 
     switch ( (pe_hdr.magic == PE_MAGIC &&
-              pe_hdr.opt_hdr_size > sizeof(pe32_opt_hdr)) *
-              pe32_opt_hdr.magic )
+              pe_hdr.opt_hdr_size > sizeof(pe32_opt_hdr.pe)) *
+              pe32_opt_hdr.pe.magic )
     {
     case PE_OPT_MAGIC_PE32:
         *width = 32;
-        *image_base = base;
+        *image_base = pe32_opt_hdr.pe.image_base;
+        *image_size = pe32_opt_hdr.pe.image_size;
         break;
     case PE_OPT_MAGIC_PE32PLUS:
-        *width = 64;
-        *image_base = ((uint64_t)base << 32) | pe32_opt_hdr.data_base;
-        break;
+        if ( pe_hdr.opt_hdr_size > sizeof(pe32_opt_hdr.pep) )
+        {
+            if ( read(in,
+                      &pe32_opt_hdr.pe + 1,
+                      sizeof(pe32_opt_hdr.pep) - sizeof(pe32_opt_hdr.pe)) !=
+                 sizeof(pe32_opt_hdr.pep) - sizeof(pe32_opt_hdr.pe) )
+            {
+                perror(name);
+                exit(3);
+            }
+
+            *width = 64;
+            *image_base = pe32_opt_hdr.pep.image_base;
+            *image_size = pe32_opt_hdr.pep.image_size;
+            break;
+        }
+        /* Fall through. */
     default:
         fprintf(stderr, "%s: Wrong PE file format\n", name);
         exit(3);
@@ -108,11 +119,28 @@ static unsigned int load(const char *name, int *handle,
 static long page_size;
 
 static const void *map_section(const struct section_header *sec, int in,
-                               const char *name)
+                               const char *name, uint_fast32_t image_size)
 {
     const char *ptr;
     unsigned long offs;
 
+    if ( sec->rva > image_size )
+    {
+        fprintf(stderr,
+                "%s: section %.8s @ %08"PRIx32" beyond image size %08"PRIxFAST32"\n",
+                name, sec->name, sec->rva, image_size);
+        exit(6);
+    }
+
+    if ( (uint_fast64_t)sec->rva + sec->virtual_size > image_size )
+    {
+        fprintf(stderr,
+                "%s: section %.8s @ [%09"PRIx32",%09"PRIxFAST64") extends beyond image size %09"PRIxFAST32"\n",
+                name, sec->name, sec->rva,
+                (uint_fast64_t)sec->rva + sec->virtual_size, image_size);
+        exit(6);
+    }
+
     if ( !page_size )
         page_size = sysconf(_SC_PAGESIZE);
     offs = sec->data_addr & (page_size - 1);
@@ -233,7 +261,7 @@ int main(int argc, char *argv[])
     int in1, in2;
     unsigned int i, nsec, width1, width2;
     uint_fast64_t base1, base2;
-    uint32_t size1, size2;
+    uint_fast32_t size1, size2;
     struct section_header *sec1, *sec2;
 
     if ( argc == 1 ||
@@ -308,8 +336,8 @@ int main(int argc, char *argv[])
             sec1[i].raw_data_size = sec1[i].virtual_size;
             sec2[i].raw_data_size = sec2[i].virtual_size;
         }
-        ptr1 = map_section(sec1 + i, in1, argv[1]);
-        ptr2 = map_section(sec2 + i, in2, argv[2]);
+        ptr1 = map_section(sec1 + i, in1, argv[1], size1);
+        ptr2 = map_section(sec2 + i, in2, argv[2], size1);
 
         diff_sections(ptr1, ptr2, sec1 + i, base2 - base1, width1,
                       base1, base1 + size1);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 23 07:55:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Apr 2025 07:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.964065.1354931 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7Uwr-0002TE-Pl; Wed, 23 Apr 2025 07:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 964065.1354931; Wed, 23 Apr 2025 07: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 1u7Uwr-0002T6-NA; Wed, 23 Apr 2025 07:55:13 +0000
Received: by outflank-mailman (input) for mailman id 964065;
 Wed, 23 Apr 2025 07:55:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u7Uwq-0002Sr-Hv
 for xen-changelog@lists.xenproject.org; Wed, 23 Apr 2025 07:55:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7Uwq-00GvT1-1g
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 07:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7Uwq-001IE7-1E
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 07:55:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Vo7Re/zzK36sde1ehOlVd7FLVcFqomAdLLyzITpIm0E=; b=FST1KG/u8MmhCBUMWbYL9KdupG
	yoHmTR0jSIdRJDvz6L1z9ALHeJOIvt1kuOd+7+kvpQc42yUDIQX1SSqBGjJJw5zJBcJ6hY/VheNBK
	2CSolkGtNFjwJMVq5rFcXV+Lx3oE9rEvJMmtGeUMhpidqB5JIppkEDkq7dRzY6JRkJgQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: Increase XEN_VIRT_SIZE
Message-Id: <E1u7Uwq-001IE7-1E@xenbits.xenproject.org>
Date: Wed, 23 Apr 2025 07:55:12 +0000

commit 16d69b2870ce7dacf47565673992131eafd03644
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Wed Apr 23 09:41:42 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 23 09:41:42 2025 +0200

    xen/riscv: Increase XEN_VIRT_SIZE
    
    A randconfig job failed with the following issue:
      riscv64-linux-gnu-ld: Xen too large for early-boot assumptions
    
    The reason is that enabling the UBSAN config increased the size of
    the Xen binary.
    
    Increase XEN_VIRT_SIZE to reserve enough space, allowing both UBSAN
    and GCOV to be enabled together, with some slack for future growth.
    
    Additionally, add checks to verify that XEN_VIRT_START is 1GB-aligned
    and XEN_VIRT_SIZE is 2MB-aligned to reduce the number of page tables
    needed for the initial mapping. In the future, when 2MB mappings are
    used for .text (rx), .rodata (r), and .data (rw), this will also help
    reduce TLB pressure.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/include/asm/config.h |  8 ++++----
 xen/arch/riscv/include/asm/mm.h     | 15 ++++++++++++---
 xen/arch/riscv/mm.c                 | 37 ++++++++++++++++++++++++++++---------
 xen/include/xen/sections.h          |  4 ++++
 4 files changed, 48 insertions(+), 16 deletions(-)

diff --git a/xen/arch/riscv/include/asm/config.h b/xen/arch/riscv/include/asm/config.h
index 314c97c20a..e150f28f53 100644
--- a/xen/arch/riscv/include/asm/config.h
+++ b/xen/arch/riscv/include/asm/config.h
@@ -41,11 +41,11 @@
  * Start addr          | End addr         | Slot       | area description
  * ============================================================================
  *                   .....                 L2 511          Unused
- *  0xffffffffc0a00000  0xffffffffc0bfffff L2 511          Fixmap
+ *  0xffffffffc1800000  0xffffffffc19fffff L2 511          Fixmap
  *                   ..... ( 2 MB gap )
- *  0xffffffffc0400000  0xffffffffc07fffff L2 511          FDT
+ *  0xffffffffc1200000  0xffffffffc15fffff L2 511          FDT
  *                   ..... ( 2 MB gap )
- *  0xffffffffc0000000  0xffffffffc01fffff L2 511          Xen
+ *  0xffffffffc0000000  0xffffffffc0ffffff L2 511          Xen
  *                   .....                 L2 510          Unused
  *  0x3200000000        0x7f7fffffff       L2 200-509      Direct map
  *                   .....                 L2 199          Unused
@@ -78,7 +78,7 @@
 
 #define GAP_SIZE                MB(2)
 
-#define XEN_VIRT_SIZE           MB(2)
+#define XEN_VIRT_SIZE           MB(16)
 
 #define BOOT_FDT_VIRT_START     (XEN_VIRT_START + XEN_VIRT_SIZE + GAP_SIZE)
 #define BOOT_FDT_VIRT_SIZE      MB(4)
diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h
index 4035cd400a..ef8b35d7c2 100644
--- a/xen/arch/riscv/include/asm/mm.h
+++ b/xen/arch/riscv/include/asm/mm.h
@@ -9,6 +9,7 @@
 #include <xen/mm-frame.h>
 #include <xen/pdx.h>
 #include <xen/pfn.h>
+#include <xen/sections.h>
 #include <xen/types.h>
 
 #include <asm/page-bits.h>
@@ -43,13 +44,21 @@ static inline void *maddr_to_virt(paddr_t ma)
  */
 static inline unsigned long virt_to_maddr(unsigned long va)
 {
+    const unsigned long xen_size = (unsigned long)(_end - _start);
+    const unsigned long xen_virt_start = _AC(XEN_VIRT_START, UL);
+    const unsigned long xen_virt_end = xen_virt_start + xen_size - 1;
+
     if ((va >= DIRECTMAP_VIRT_START) &&
         (va <= DIRECTMAP_VIRT_END))
         return directmapoff_to_maddr(va - directmap_virt_start);
 
-    BUILD_BUG_ON(XEN_VIRT_SIZE != MB(2));
-    ASSERT((va >> (PAGETABLE_ORDER + PAGE_SHIFT)) ==
-           (_AC(XEN_VIRT_START, UL) >> (PAGETABLE_ORDER + PAGE_SHIFT)));
+    ASSERT((va >= xen_virt_start) && (va <= xen_virt_end));
+
+    /*
+    * The .init* sections will be freed when Xen completes booting,
+    * so the [__init_begin, __init_end) range must be excluded.
+    */
+    ASSERT((system_state < SYS_STATE_active) || !is_init_section(va));
 
     /* phys_offset = load_start - XEN_VIRT_START */
     return phys_offset + va;
diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c
index f2bf279bac..d3ece9f132 100644
--- a/xen/arch/riscv/mm.c
+++ b/xen/arch/riscv/mm.c
@@ -31,20 +31,39 @@ unsigned long __ro_after_init phys_offset; /* = load_start - XEN_VIRT_START */
 #define LOAD_TO_LINK(addr) ((unsigned long)(addr) - phys_offset)
 
 /*
- * It is expected that Xen won't be more then 2 MB.
+ * It is expected that Xen won't be more then XEN_VIRT_SIZE.
  * The check in xen.lds.S guarantees that.
- * At least 3 page tables (in case of Sv39 ) are needed to cover 2 MB.
- * One for each page level table with PAGE_SIZE = 4 Kb.
  *
- * One L0 page table can cover 2 MB(512 entries of one page table * PAGE_SIZE).
+ * Root page table is shared with the initial mapping and is declared
+ * separately (look at stage1_pgtbl_root), so it isn't taken into account
+ * in PGTBL_INITIAL_COUNT.
  *
- * It might be needed one more page table in case when Xen load address
- * isn't 2 MB aligned.
+ * An amount of page tables between root page table and L0 page table
+ * (in the case of Sv39 it covers L1 table):
+ *   (CONFIG_PAGING_LEVELS - 2) are needed for an identity mapping and
+ *   the same amount are needed for Xen.
  *
- * CONFIG_PAGING_LEVELS page tables are needed for the identity mapping,
- * except that the root page table is shared with the initial mapping
+ * An amount of L0 page tables:
+ *   (512 entries of one L0 page table covers 2MB == 1<<XEN_PT_LEVEL_SHIFT(1))
+ *   XEN_VIRT_SIZE >> XEN_PT_LEVEL_SHIFT(1) are needed for Xen and
+ *   one L0 is needed for identity mapping.
  */
-#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) * 2 + 1)
+#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 2) * 2 + \
+                             (XEN_VIRT_SIZE >> XEN_PT_LEVEL_SHIFT(1)) + 1)
+
+/*
+ * Modifying these checks may require updating PGTBL_INITIAL_COUNT.
+ *
+ * If XEN_VIRT_{START,SIZE} are not properly aligned and XEN_VIRT_SIZE > GB(1),
+ * additional L1 and L0 page tables are required.
+ */
+static void __init __maybe_unused build_assertions(void)
+{
+    BUILD_BUG_ON(!IS_ALIGNED(XEN_VIRT_START, GB(1)));
+    BUILD_BUG_ON(!IS_ALIGNED(XEN_VIRT_SIZE, MB(2)));
+
+    BUILD_BUG_ON(XEN_VIRT_SIZE > GB(1));
+}
 
 pte_t __section(".bss.page_aligned") __aligned(PAGE_SIZE)
 stage1_pgtbl_root[PAGETABLE_ENTRIES];
diff --git a/xen/include/xen/sections.h b/xen/include/xen/sections.h
index f2fac8d7fa..fe49d7d0e6 100644
--- a/xen/include/xen/sections.h
+++ b/xen/include/xen/sections.h
@@ -7,6 +7,10 @@
 
 /* SAF-0-safe */
 extern char __init_begin[], __init_end[];
+#define is_init_section(p) ({                           \
+    const char *p_ = (const char *)(unsigned long)(p);  \
+    (p_ >= __init_begin) && (p_ < __init_end);          \
+})
 
 /*
  * Some data is expected to be written rarely (if at all).
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 23 07:55:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Apr 2025 07:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.964067.1354945 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7Ux2-0002k9-2f; Wed, 23 Apr 2025 07:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 964067.1354945; Wed, 23 Apr 2025 07:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7Ux1-0002jy-Vx; Wed, 23 Apr 2025 07:55:23 +0000
Received: by outflank-mailman (input) for mailman id 964067;
 Wed, 23 Apr 2025 07:55:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u7Ux0-0002jP-PT
 for xen-changelog@lists.xenproject.org; Wed, 23 Apr 2025 07:55:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7Ux0-00GvT9-2R
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 07:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7Ux0-001J0D-2H
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 07:55:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bGK8vhVTc8zULuf0zd4xIVIr5BewQ/8Pn1PZw1MWwfI=; b=LZ3rN7l1wmNfg1So4qPAOM2KyV
	UVGXV0YdoMA6MTXxHT8liDspDshBVJKNVFGqPNuZ+KfPPRjvyE5/46igu5luvi147oEm4nPzrUecX
	3gfbyq6vZzGj1PjMJS7u4Ej0bDIjxvVwAU38GRzjSDpHH5G5PxTAbOMVtcw/siI/Jj54=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] drivers/pci: Get next capability without passing caps
Message-Id: <E1u7Ux0-001J0D-2H@xenbits.xenproject.org>
Date: Wed, 23 Apr 2025 07:55:22 +0000

commit fcc44f8548b89a649003c4348702e04e0c20b205
Author:     Jiqian Chen <Jiqian.Chen@amd.com>
AuthorDate: Wed Apr 23 09:42:08 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 23 09:42:08 2025 +0200

    drivers/pci: Get next capability without passing caps
    
    Modify function pci_find_next_cap_ttl to support returning position
    of next capability when size "n" is zero.
    
    That can help caller to get next capability offset if caller just
    has a information of current capability offset.
    
    That will be used in a follow-on change.
    
    Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/pci/pci.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/drivers/pci/pci.c b/xen/drivers/pci/pci.c
index edf5b9f7ae..acf4cebe42 100644
--- a/xen/drivers/pci/pci.c
+++ b/xen/drivers/pci/pci.c
@@ -55,6 +55,11 @@ unsigned int pci_find_next_cap_ttl(pci_sbdf_t sbdf, unsigned int pos,
 
         if ( id == 0xff )
             break;
+
+        if ( !n )
+            return pos;
+        ASSERT(caps);
+
         for ( i = 0; i < n; i++ )
         {
             if ( id == caps[i] )
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 23 08:22:04 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Apr 2025 08:22:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.964162.1355019 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7VMo-0003NW-LZ; Wed, 23 Apr 2025 08:22:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 964162.1355019; Wed, 23 Apr 2025 08: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 1u7VMo-0003NO-Is; Wed, 23 Apr 2025 08:22:02 +0000
Received: by outflank-mailman (input) for mailman id 964162;
 Wed, 23 Apr 2025 08: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 1u7VMn-0003NG-Lh
 for xen-changelog@lists.xenproject.org; Wed, 23 Apr 2025 08: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 1u7VMn-00GwpR-1o
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 08:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7VMn-002Ps2-1a
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 08: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=+2Yy4jpRzIZgVisai1/hgOsseU0GVGSXxGQGppzFDYY=; b=6eKNK06lILJLZSqF6E1vahTlOT
	IjDtL4tivxOuyfq+l2JAtydlJlcgwibs3EA9E/tzsfOUQNrU9zWaSm3HEJLDQhjElguIkfr16ez8Y
	XNQJ1j3+3WaC2p+7sGR6eQkhbZzmI6aDE4fFvhlmsh4fgnKJU96HKqlVw/dGCXHiJsCk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/EFI: correct mkreloc header (field) reading
Message-Id: <E1u7VMn-002Ps2-1a@xenbits.xenproject.org>
Date: Wed, 23 Apr 2025 08:22:01 +0000

commit 042e9616f2e67476635487f2cd530406c6e3c0c1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Apr 23 09:39:44 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 23 09:39:44 2025 +0200

    x86/EFI: correct mkreloc header (field) reading
    
    With us now reading the full combined optional and NT headers, the
    subsequent reading of (and seeking to) NT header fields is wrong. Since
    PE32 and PE32+ NT headers are different anyway (beyond the image base
    oddity extending across both headers), switch to using a union. This
    allows to fetch the image base more directly then.
    
    Additionally add checking to map_section(), which would have caught at
    least the wrong (zero) image size that we previously used.
    
    Fixes: f7f42accbbbb ("x86/efi: Use generic PE/COFF structures")
    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>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/efi/mkreloc.c | 70 ++++++++++++++++++++++++++++++++--------------
 1 file changed, 49 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/efi/mkreloc.c b/xen/arch/x86/efi/mkreloc.c
index 375cb79d69..4b3b2dd7ea 100644
--- a/xen/arch/x86/efi/mkreloc.c
+++ b/xen/arch/x86/efi/mkreloc.c
@@ -28,14 +28,16 @@ static void usage(const char *cmd, int rc)
 static unsigned int load(const char *name, int *handle,
                          struct section_header **sections,
                          uint_fast64_t *image_base,
-                         uint32_t *image_size,
+                         uint_fast32_t *image_size,
                          unsigned int *width)
 {
     int in = open(name, O_RDONLY);
     struct mz_hdr mz_hdr;
     struct pe_hdr pe_hdr;
-    struct pe32_opt_hdr pe32_opt_hdr;
-    uint32_t base;
+    union {
+        struct pe32_opt_hdr pe;
+        struct pe32plus_opt_hdr pep;
+    } pe32_opt_hdr;
 
     if ( in < 0 ||
          read(in, &mz_hdr, sizeof(mz_hdr)) != sizeof(mz_hdr) )
@@ -54,31 +56,40 @@ static unsigned int load(const char *name, int *handle,
 
     if ( lseek(in, mz_hdr.peaddr, SEEK_SET) < 0 ||
          read(in, &pe_hdr, sizeof(pe_hdr)) != sizeof(pe_hdr) ||
-         read(in, &pe32_opt_hdr, sizeof(pe32_opt_hdr)) != sizeof(pe32_opt_hdr) ||
-         read(in, &base, sizeof(base)) != sizeof(base) ||
-         /*
-          * Luckily the image size field lives at the
-          * same offset for both formats.
-          */
-         lseek(in, 24, SEEK_CUR) < 0 ||
-         read(in, image_size, sizeof(*image_size)) != sizeof(*image_size) )
+         (read(in, &pe32_opt_hdr.pe, sizeof(pe32_opt_hdr.pe)) !=
+          sizeof(pe32_opt_hdr.pe)) )
     {
         perror(name);
         exit(3);
     }
 
     switch ( (pe_hdr.magic == PE_MAGIC &&
-              pe_hdr.opt_hdr_size > sizeof(pe32_opt_hdr)) *
-              pe32_opt_hdr.magic )
+              pe_hdr.opt_hdr_size > sizeof(pe32_opt_hdr.pe)) *
+              pe32_opt_hdr.pe.magic )
     {
     case PE_OPT_MAGIC_PE32:
         *width = 32;
-        *image_base = base;
+        *image_base = pe32_opt_hdr.pe.image_base;
+        *image_size = pe32_opt_hdr.pe.image_size;
         break;
     case PE_OPT_MAGIC_PE32PLUS:
-        *width = 64;
-        *image_base = ((uint64_t)base << 32) | pe32_opt_hdr.data_base;
-        break;
+        if ( pe_hdr.opt_hdr_size > sizeof(pe32_opt_hdr.pep) )
+        {
+            if ( read(in,
+                      &pe32_opt_hdr.pe + 1,
+                      sizeof(pe32_opt_hdr.pep) - sizeof(pe32_opt_hdr.pe)) !=
+                 sizeof(pe32_opt_hdr.pep) - sizeof(pe32_opt_hdr.pe) )
+            {
+                perror(name);
+                exit(3);
+            }
+
+            *width = 64;
+            *image_base = pe32_opt_hdr.pep.image_base;
+            *image_size = pe32_opt_hdr.pep.image_size;
+            break;
+        }
+        /* Fall through. */
     default:
         fprintf(stderr, "%s: Wrong PE file format\n", name);
         exit(3);
@@ -108,11 +119,28 @@ static unsigned int load(const char *name, int *handle,
 static long page_size;
 
 static const void *map_section(const struct section_header *sec, int in,
-                               const char *name)
+                               const char *name, uint_fast32_t image_size)
 {
     const char *ptr;
     unsigned long offs;
 
+    if ( sec->rva > image_size )
+    {
+        fprintf(stderr,
+                "%s: section %.8s @ %08"PRIx32" beyond image size %08"PRIxFAST32"\n",
+                name, sec->name, sec->rva, image_size);
+        exit(6);
+    }
+
+    if ( (uint_fast64_t)sec->rva + sec->virtual_size > image_size )
+    {
+        fprintf(stderr,
+                "%s: section %.8s @ [%09"PRIx32",%09"PRIxFAST64") extends beyond image size %09"PRIxFAST32"\n",
+                name, sec->name, sec->rva,
+                (uint_fast64_t)sec->rva + sec->virtual_size, image_size);
+        exit(6);
+    }
+
     if ( !page_size )
         page_size = sysconf(_SC_PAGESIZE);
     offs = sec->data_addr & (page_size - 1);
@@ -233,7 +261,7 @@ int main(int argc, char *argv[])
     int in1, in2;
     unsigned int i, nsec, width1, width2;
     uint_fast64_t base1, base2;
-    uint32_t size1, size2;
+    uint_fast32_t size1, size2;
     struct section_header *sec1, *sec2;
 
     if ( argc == 1 ||
@@ -308,8 +336,8 @@ int main(int argc, char *argv[])
             sec1[i].raw_data_size = sec1[i].virtual_size;
             sec2[i].raw_data_size = sec2[i].virtual_size;
         }
-        ptr1 = map_section(sec1 + i, in1, argv[1]);
-        ptr2 = map_section(sec2 + i, in2, argv[2]);
+        ptr1 = map_section(sec1 + i, in1, argv[1], size1);
+        ptr2 = map_section(sec2 + i, in2, argv[2], size1);
 
         diff_sections(ptr1, ptr2, sec1 + i, base2 - base1, width1,
                       base1, base1 + size1);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 23 08:22:12 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Apr 2025 08:22:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.964163.1355023 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7VMy-0003RS-NC; Wed, 23 Apr 2025 08:22:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 964163.1355023; Wed, 23 Apr 2025 08: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 1u7VMy-0003RL-KR; Wed, 23 Apr 2025 08:22:12 +0000
Received: by outflank-mailman (input) for mailman id 964163;
 Wed, 23 Apr 2025 08:22:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u7VMx-0003R5-MZ
 for xen-changelog@lists.xenproject.org; Wed, 23 Apr 2025 08:22:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7VMx-00GwsY-29
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 08:22:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7VMx-002QCU-21
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 08: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=IN1RqKBC3fj5SWXcKV+n+yM1BD2ylEkpJBM84EyO4sw=; b=H3xGPyIYgBzn524pNmKat4UcEc
	xzr4v7lrCnKrALHznW4cTGKlfCR0L1pMPgKRN9GU2XJzL681Pz7LMrDqb+FgSSsWri2KTEPsS8uKw
	U30MolpZhauiSEWkKS6j4mG5Pwu8Uas8FlIq6iQBgbRuhmJIzO1XMOJQL/jtHZ7MkKN0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: Increase XEN_VIRT_SIZE
Message-Id: <E1u7VMx-002QCU-21@xenbits.xenproject.org>
Date: Wed, 23 Apr 2025 08:22:11 +0000

commit 16d69b2870ce7dacf47565673992131eafd03644
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Wed Apr 23 09:41:42 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 23 09:41:42 2025 +0200

    xen/riscv: Increase XEN_VIRT_SIZE
    
    A randconfig job failed with the following issue:
      riscv64-linux-gnu-ld: Xen too large for early-boot assumptions
    
    The reason is that enabling the UBSAN config increased the size of
    the Xen binary.
    
    Increase XEN_VIRT_SIZE to reserve enough space, allowing both UBSAN
    and GCOV to be enabled together, with some slack for future growth.
    
    Additionally, add checks to verify that XEN_VIRT_START is 1GB-aligned
    and XEN_VIRT_SIZE is 2MB-aligned to reduce the number of page tables
    needed for the initial mapping. In the future, when 2MB mappings are
    used for .text (rx), .rodata (r), and .data (rw), this will also help
    reduce TLB pressure.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/include/asm/config.h |  8 ++++----
 xen/arch/riscv/include/asm/mm.h     | 15 ++++++++++++---
 xen/arch/riscv/mm.c                 | 37 ++++++++++++++++++++++++++++---------
 xen/include/xen/sections.h          |  4 ++++
 4 files changed, 48 insertions(+), 16 deletions(-)

diff --git a/xen/arch/riscv/include/asm/config.h b/xen/arch/riscv/include/asm/config.h
index 314c97c20a..e150f28f53 100644
--- a/xen/arch/riscv/include/asm/config.h
+++ b/xen/arch/riscv/include/asm/config.h
@@ -41,11 +41,11 @@
  * Start addr          | End addr         | Slot       | area description
  * ============================================================================
  *                   .....                 L2 511          Unused
- *  0xffffffffc0a00000  0xffffffffc0bfffff L2 511          Fixmap
+ *  0xffffffffc1800000  0xffffffffc19fffff L2 511          Fixmap
  *                   ..... ( 2 MB gap )
- *  0xffffffffc0400000  0xffffffffc07fffff L2 511          FDT
+ *  0xffffffffc1200000  0xffffffffc15fffff L2 511          FDT
  *                   ..... ( 2 MB gap )
- *  0xffffffffc0000000  0xffffffffc01fffff L2 511          Xen
+ *  0xffffffffc0000000  0xffffffffc0ffffff L2 511          Xen
  *                   .....                 L2 510          Unused
  *  0x3200000000        0x7f7fffffff       L2 200-509      Direct map
  *                   .....                 L2 199          Unused
@@ -78,7 +78,7 @@
 
 #define GAP_SIZE                MB(2)
 
-#define XEN_VIRT_SIZE           MB(2)
+#define XEN_VIRT_SIZE           MB(16)
 
 #define BOOT_FDT_VIRT_START     (XEN_VIRT_START + XEN_VIRT_SIZE + GAP_SIZE)
 #define BOOT_FDT_VIRT_SIZE      MB(4)
diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h
index 4035cd400a..ef8b35d7c2 100644
--- a/xen/arch/riscv/include/asm/mm.h
+++ b/xen/arch/riscv/include/asm/mm.h
@@ -9,6 +9,7 @@
 #include <xen/mm-frame.h>
 #include <xen/pdx.h>
 #include <xen/pfn.h>
+#include <xen/sections.h>
 #include <xen/types.h>
 
 #include <asm/page-bits.h>
@@ -43,13 +44,21 @@ static inline void *maddr_to_virt(paddr_t ma)
  */
 static inline unsigned long virt_to_maddr(unsigned long va)
 {
+    const unsigned long xen_size = (unsigned long)(_end - _start);
+    const unsigned long xen_virt_start = _AC(XEN_VIRT_START, UL);
+    const unsigned long xen_virt_end = xen_virt_start + xen_size - 1;
+
     if ((va >= DIRECTMAP_VIRT_START) &&
         (va <= DIRECTMAP_VIRT_END))
         return directmapoff_to_maddr(va - directmap_virt_start);
 
-    BUILD_BUG_ON(XEN_VIRT_SIZE != MB(2));
-    ASSERT((va >> (PAGETABLE_ORDER + PAGE_SHIFT)) ==
-           (_AC(XEN_VIRT_START, UL) >> (PAGETABLE_ORDER + PAGE_SHIFT)));
+    ASSERT((va >= xen_virt_start) && (va <= xen_virt_end));
+
+    /*
+    * The .init* sections will be freed when Xen completes booting,
+    * so the [__init_begin, __init_end) range must be excluded.
+    */
+    ASSERT((system_state < SYS_STATE_active) || !is_init_section(va));
 
     /* phys_offset = load_start - XEN_VIRT_START */
     return phys_offset + va;
diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c
index f2bf279bac..d3ece9f132 100644
--- a/xen/arch/riscv/mm.c
+++ b/xen/arch/riscv/mm.c
@@ -31,20 +31,39 @@ unsigned long __ro_after_init phys_offset; /* = load_start - XEN_VIRT_START */
 #define LOAD_TO_LINK(addr) ((unsigned long)(addr) - phys_offset)
 
 /*
- * It is expected that Xen won't be more then 2 MB.
+ * It is expected that Xen won't be more then XEN_VIRT_SIZE.
  * The check in xen.lds.S guarantees that.
- * At least 3 page tables (in case of Sv39 ) are needed to cover 2 MB.
- * One for each page level table with PAGE_SIZE = 4 Kb.
  *
- * One L0 page table can cover 2 MB(512 entries of one page table * PAGE_SIZE).
+ * Root page table is shared with the initial mapping and is declared
+ * separately (look at stage1_pgtbl_root), so it isn't taken into account
+ * in PGTBL_INITIAL_COUNT.
  *
- * It might be needed one more page table in case when Xen load address
- * isn't 2 MB aligned.
+ * An amount of page tables between root page table and L0 page table
+ * (in the case of Sv39 it covers L1 table):
+ *   (CONFIG_PAGING_LEVELS - 2) are needed for an identity mapping and
+ *   the same amount are needed for Xen.
  *
- * CONFIG_PAGING_LEVELS page tables are needed for the identity mapping,
- * except that the root page table is shared with the initial mapping
+ * An amount of L0 page tables:
+ *   (512 entries of one L0 page table covers 2MB == 1<<XEN_PT_LEVEL_SHIFT(1))
+ *   XEN_VIRT_SIZE >> XEN_PT_LEVEL_SHIFT(1) are needed for Xen and
+ *   one L0 is needed for identity mapping.
  */
-#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) * 2 + 1)
+#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 2) * 2 + \
+                             (XEN_VIRT_SIZE >> XEN_PT_LEVEL_SHIFT(1)) + 1)
+
+/*
+ * Modifying these checks may require updating PGTBL_INITIAL_COUNT.
+ *
+ * If XEN_VIRT_{START,SIZE} are not properly aligned and XEN_VIRT_SIZE > GB(1),
+ * additional L1 and L0 page tables are required.
+ */
+static void __init __maybe_unused build_assertions(void)
+{
+    BUILD_BUG_ON(!IS_ALIGNED(XEN_VIRT_START, GB(1)));
+    BUILD_BUG_ON(!IS_ALIGNED(XEN_VIRT_SIZE, MB(2)));
+
+    BUILD_BUG_ON(XEN_VIRT_SIZE > GB(1));
+}
 
 pte_t __section(".bss.page_aligned") __aligned(PAGE_SIZE)
 stage1_pgtbl_root[PAGETABLE_ENTRIES];
diff --git a/xen/include/xen/sections.h b/xen/include/xen/sections.h
index f2fac8d7fa..fe49d7d0e6 100644
--- a/xen/include/xen/sections.h
+++ b/xen/include/xen/sections.h
@@ -7,6 +7,10 @@
 
 /* SAF-0-safe */
 extern char __init_begin[], __init_end[];
+#define is_init_section(p) ({                           \
+    const char *p_ = (const char *)(unsigned long)(p);  \
+    (p_ >= __init_begin) && (p_ < __init_end);          \
+})
 
 /*
  * Some data is expected to be written rarely (if at all).
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 23 08:22:22 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Apr 2025 08:22:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.964164.1355029 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7VN8-0003V9-QF; Wed, 23 Apr 2025 08:22:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 964164.1355029; Wed, 23 Apr 2025 08: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 1u7VN8-0003V1-MJ; Wed, 23 Apr 2025 08:22:22 +0000
Received: by outflank-mailman (input) for mailman id 964164;
 Wed, 23 Apr 2025 08:22: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 1u7VN7-0003Ua-PM
 for xen-changelog@lists.xenproject.org; Wed, 23 Apr 2025 08:22:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7VN7-00GwuR-2S
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 08:22:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7VN7-002QhK-2K
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 08:22:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nIlg72RToaYR3dgesyzzDWtWQ7skl5EJWhWC2ItMKpg=; b=d+1Lfn2UN2D7YBzGp3RomZfCcs
	zYE797fXADe82tFPLumw07HFjrv5LPxhRZ/hH2pms0oFATPqw/513iDjbtrQEa7pGclszZZbO7u84
	bBcRLpaHc68PuHLaIk20VKcMH4YbbjJOwP3BCONvWhxvIGduy22RMTsVBEZsOmYRmzCI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] drivers/pci: Get next capability without passing caps
Message-Id: <E1u7VN7-002QhK-2K@xenbits.xenproject.org>
Date: Wed, 23 Apr 2025 08:22:21 +0000

commit fcc44f8548b89a649003c4348702e04e0c20b205
Author:     Jiqian Chen <Jiqian.Chen@amd.com>
AuthorDate: Wed Apr 23 09:42:08 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 23 09:42:08 2025 +0200

    drivers/pci: Get next capability without passing caps
    
    Modify function pci_find_next_cap_ttl to support returning position
    of next capability when size "n" is zero.
    
    That can help caller to get next capability offset if caller just
    has a information of current capability offset.
    
    That will be used in a follow-on change.
    
    Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/pci/pci.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/drivers/pci/pci.c b/xen/drivers/pci/pci.c
index edf5b9f7ae..acf4cebe42 100644
--- a/xen/drivers/pci/pci.c
+++ b/xen/drivers/pci/pci.c
@@ -55,6 +55,11 @@ unsigned int pci_find_next_cap_ttl(pci_sbdf_t sbdf, unsigned int pos,
 
         if ( id == 0xff )
             break;
+
+        if ( !n )
+            return pos;
+        ASSERT(caps);
+
         for ( i = 0; i < n; i++ )
         {
             if ( id == caps[i] )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 23 14:55:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Apr 2025 14:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.964879.1355570 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7bV9-0001m7-6j; Wed, 23 Apr 2025 14:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 964879.1355570; Wed, 23 Apr 2025 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 1u7bV9-0001lz-2s; Wed, 23 Apr 2025 14:55:03 +0000
Received: by outflank-mailman (input) for mailman id 964879;
 Wed, 23 Apr 2025 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 1u7bV8-0001lt-0i
 for xen-changelog@lists.xenproject.org; Wed, 23 Apr 2025 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 1u7bV7-00H81q-39
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 14:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7bV7-00EMDi-30
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 14: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=JAwugQ/uV7CckQ2gd9KILXmL3SXfCiL/Z6Cx8aAnXqg=; b=2pYi5CXGDniM4/ZP+X/4JY0l7A
	wn/Dbzk/Ee3wpiuDJ72xwbtXyhHC+FcHLYv8/d+3/90vzxjdfVyrJk0CgL5/z8u495bEZID3ARazh
	GW7zXX7wioZEVLTAgbmU+QSSYQ5WI4teJeL2DvG89umPu4O5p+qCkHR529VuQAMTYZTk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/intel: workaround several MONITOR/MWAIT errata
Message-Id: <E1u7bV7-00EMDi-30@xenbits.xenproject.org>
Date: Wed, 23 Apr 2025 14:55:01 +0000

commit 4aae4452efeee3d3bba092b875e37d1e7c8f6db9
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Apr 17 12:35:28 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Wed Apr 23 16:12:25 2025 +0200

    x86/intel: workaround several MONITOR/MWAIT errata
    
    There are several errata on Intel regarding the usage of the MONITOR/MWAIT
    instructions, all having in common that stores to the monitored region
    might not wake up the CPU.
    
    Fix them by forcing the sending of an IPI for the affected models.
    
    The Ice Lake issue has been reproduced internally on XenServer hardware,
    and the fix does seem to prevent it.  The symptom was APs getting stuck in
    the idle loop immediately after bring up, which in turn prevented the BSP
    from making progress.  This would happen before the watchdog was
    initialized, and hence the whole system would get stuck.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/acpi/cpu_idle.c     |  6 ++++++
 xen/arch/x86/cpu/intel.c         | 36 +++++++++++++++++++++++++++++++++++-
 xen/arch/x86/include/asm/mwait.h |  3 +++
 3 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index 420198406d..1dbf15b01e 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -441,8 +441,14 @@ void cpuidle_wakeup_mwait(cpumask_t *mask)
     cpumask_andnot(mask, mask, &target);
 }
 
+/* Force sending of a wakeup IPI regardless of mwait usage. */
+bool __ro_after_init force_mwait_ipi_wakeup;
+
 bool arch_skip_send_event_check(unsigned int cpu)
 {
+    if ( force_mwait_ipi_wakeup )
+        return false;
+
     /*
      * This relies on softirq_pending() and mwait_wakeup() to access data
      * on the same cache line.
diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index 6a680ba38d..63f65ea5b0 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -8,6 +8,7 @@
 #include <asm/intel-family.h>
 #include <asm/processor.h>
 #include <asm/msr.h>
+#include <asm/mwait.h>
 #include <asm/uaccess.h>
 #include <asm/mpspec.h>
 #include <asm/apic.h>
@@ -368,7 +369,6 @@ static void probe_c3_errata(const struct cpuinfo_x86 *c)
         INTEL_FAM6_MODEL(0x25),
         { }
     };
-#undef INTEL_FAM6_MODEL
 
     /* Serialized by the AP bringup code. */
     if ( max_cstate > 1 && (c->apicid & (c->x86_num_siblings - 1)) &&
@@ -380,6 +380,38 @@ static void probe_c3_errata(const struct cpuinfo_x86 *c)
     }
 }
 
+/*
+ * APL30: One use of the MONITOR/MWAIT instruction pair is to allow a logical
+ * processor to wait in a sleep state until a store to the armed address range
+ * occurs. Due to this erratum, stores to the armed address range may not
+ * trigger MWAIT to resume execution.
+ *
+ * ICX143: Under complex microarchitectural conditions, a monitor that is armed
+ * with the MWAIT instruction may not be triggered, leading to a processor
+ * hang.
+ *
+ * LNL030: Problem P-cores may not exit power state Core C6 on monitor hit.
+ *
+ * Force the sending of an IPI in those cases.
+ */
+static void __init probe_mwait_errata(void)
+{
+    static const struct x86_cpu_id __initconst models[] = {
+        INTEL_FAM6_MODEL(INTEL_FAM6_ATOM_GOLDMONT), /* APL30  */
+        INTEL_FAM6_MODEL(INTEL_FAM6_ICELAKE_X),     /* ICX143 */
+        INTEL_FAM6_MODEL(INTEL_FAM6_LUNARLAKE_M),   /* LNL030 */
+        { }
+    };
+#undef INTEL_FAM6_MODEL
+
+    if ( boot_cpu_has(X86_FEATURE_MONITOR) && x86_match_cpu(models) )
+    {
+        printk(XENLOG_WARNING
+               "Forcing IPI MWAIT wakeup due to CPU erratum\n");
+        force_mwait_ipi_wakeup = true;
+    }
+}
+
 /*
  * P4 Xeon errata 037 workaround.
  * Hardware prefetcher may cause stale data to be loaded into the cache.
@@ -406,6 +438,8 @@ static void Intel_errata_workarounds(struct cpuinfo_x86 *c)
 		__set_bit(X86_FEATURE_CLFLUSH_MONITOR, c->x86_capability);
 
 	probe_c3_errata(c);
+	if (system_state < SYS_STATE_smp_boot)
+		probe_mwait_errata();
 }
 
 
diff --git a/xen/arch/x86/include/asm/mwait.h b/xen/arch/x86/include/asm/mwait.h
index 000a692f6d..c52cd3f510 100644
--- a/xen/arch/x86/include/asm/mwait.h
+++ b/xen/arch/x86/include/asm/mwait.h
@@ -13,6 +13,9 @@
 
 #define MWAIT_ECX_INTERRUPT_BREAK	0x1
 
+/* Force sending of a wakeup IPI regardless of mwait usage. */
+extern bool force_mwait_ipi_wakeup;
+
 void mwait_idle_with_hints(unsigned int eax, unsigned int ecx);
 #ifdef CONFIG_INTEL
 bool mwait_pc10_supported(void);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 23 14:55:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Apr 2025 14:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.964880.1355572 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7bVK-0001oE-6o; Wed, 23 Apr 2025 14:55:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 964880.1355572; Wed, 23 Apr 2025 14: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 1u7bVK-0001o5-4J; Wed, 23 Apr 2025 14:55:14 +0000
Received: by outflank-mailman (input) for mailman id 964880;
 Wed, 23 Apr 2025 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 1u7bVI-0001ns-3L
 for xen-changelog@lists.xenproject.org; Wed, 23 Apr 2025 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 1u7bVI-00H81u-0D
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 14:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7bVI-00EMJL-06
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 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=67SITwy/I1da/TcVvz8nPQPwx+fQGSj92/Vm5Zd/bfY=; b=R2+bqDpnRCkfv3R1sv+WO+A/b7
	AVbqaaWpLLhnWnJC+Q3o3BitBuvLXq0uK/+oHFsK+x0Dxjyae/dL1hoVCji839zoYi6fDTa61G7g4
	FZDTWjdoCnosD8znjqlg3o3cTWpJwiQFRxGTKZ83zd3siTNAf9D6/u8JfoAoX5ktHT4k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: remove -N from the linker command line
Message-Id: <E1u7bVI-00EMJL-06@xenbits.xenproject.org>
Date: Wed, 23 Apr 2025 14:55:12 +0000

commit d444763f8ca556d0a67a4b933be303d346baef02
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Mar 5 11:53:20 2025 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Wed Apr 23 16:12:25 2025 +0200

    xen: remove -N from the linker command line
    
    It's unclear why -N is being used in the first place.  It was added by
    commit 4676bbf96dc8 back in 2002 without any justification.
    
    When building a PE image it's actually detrimental to forcefully set the
    .text section as writable.  The GNU LD man page contains the following
    warning regarding the -N option:
    
    > Note: Although a writable text section is allowed for PE-COFF targets, it
    > does not conform to the format specification published by Microsoft.
    
    Remove the usage of -N uniformly on all architectures, assuming that the
    addition was simply done as a copy and paste of the original x86 linking
    rune.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/Makefile   |  6 +++---
 xen/arch/ppc/Makefile   |  6 +++---
 xen/arch/riscv/Makefile |  6 +++---
 xen/arch/x86/Makefile   | 12 ++++++------
 4 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 4837ad467a..129a109d6e 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -97,19 +97,19 @@ ifeq ($(CONFIG_ARM_64),y)
 endif
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
 	    $(dot-target).0.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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).1.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
diff --git a/xen/arch/ppc/Makefile b/xen/arch/ppc/Makefile
index 655d212f66..cf27bcebb2 100644
--- a/xen/arch/ppc/Makefile
+++ b/xen/arch/ppc/Makefile
@@ -12,19 +12,19 @@ $(TARGET): $(TARGET)-syms
 	cp -f $< $@
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
 	    $(dot-target).0.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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).1.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index 0c6c4a38a3..d882c57528 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -19,19 +19,19 @@ $(TARGET): $(TARGET)-syms
 	$(OBJCOPY) -O binary -S $< $@
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
 	    $(dot-target).0.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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).1.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index f59c9665fd..c2f1dcf301 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -139,19 +139,19 @@ $(TARGET): $(TARGET)-syms $(efi-y) $(obj)/boot/mkelf32
 CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).0.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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(orphan-handling-y) $(dot-target).1.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
@@ -212,7 +212,7 @@ ifeq ($(CONFIG_DEBUG_INFO),y)
 	$(if $(filter --strip-debug,$(EFI_LDFLAGS)),echo,:) "Will strip debug info from $(@F)"
 endif
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
-	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds -N $< $(relocs-dummy) \
+	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< $(relocs-dummy) \
 	                $(objtree)/common/symbols-dummy.o $(note_file_option) \
 	                -o $(dot-target).$(base).0 &&) :
 	$(MKRELOC) $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(dot-target).$(base).0) \
@@ -222,7 +222,7 @@ endif
 		> $(dot-target).0s.S
 	$(MAKE) $(build)=$(@D) .$(@F).0r.o .$(@F).0s.o
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
-	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds -N $< \
+	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< \
 	                $(dot-target).0r.o $(dot-target).0s.o $(note_file_option) \
 	                -o $(dot-target).$(base).1 &&) :
 	$(MKRELOC) $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(dot-target).$(base).1) \
@@ -231,7 +231,7 @@ endif
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(dot-target).1s.S
 	$(MAKE) $(build)=$(@D) .$(@F).1r.o .$(@F).1s.o
-	$(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds -N $< \
+	$(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds $< \
 	      $(dot-target).1r.o $(dot-target).1s.o $(orphan-handling-y) \
 	      $(note_file_option) -o $@
 	$(NM) -pa --format=sysv $@ \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 23 15:22:08 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Apr 2025 15:22:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.964938.1355626 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7bvI-0000ly-4I; Wed, 23 Apr 2025 15:22:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 964938.1355626; Wed, 23 Apr 2025 15:22:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7bvI-0000lp-1h; Wed, 23 Apr 2025 15:22:04 +0000
Received: by outflank-mailman (input) for mailman id 964938;
 Wed, 23 Apr 2025 15: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 1u7bvG-0000kD-6u
 for xen-changelog@lists.xenproject.org; Wed, 23 Apr 2025 15: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 1u7bvG-00H8jY-0D
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 15:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7bvG-00EeLx-02
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 15: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=WxSyMK50Jb45X/G5LVYO8WzUAGM73WK+vgfBM+p8cnM=; b=Drwx28RihJB830Jvh16EMaQidv
	vyO4lbq2h9e8cZ9i3NIgb0qgeVOPZNeRO4WgsLLvrfXtw2Qowuoqp6HxiQFMZi7JjnSRqDmUN1e5E
	R0SnQT5j0g6rtzOyt9YE7Hs9J4sOR9N5XSNlTjqyr6HZFbMfYfg275ofIWTHVxLf+5AU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/intel: workaround several MONITOR/MWAIT errata
Message-Id: <E1u7bvG-00EeLx-02@xenbits.xenproject.org>
Date: Wed, 23 Apr 2025 15:22:02 +0000

commit 4aae4452efeee3d3bba092b875e37d1e7c8f6db9
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Apr 17 12:35:28 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Wed Apr 23 16:12:25 2025 +0200

    x86/intel: workaround several MONITOR/MWAIT errata
    
    There are several errata on Intel regarding the usage of the MONITOR/MWAIT
    instructions, all having in common that stores to the monitored region
    might not wake up the CPU.
    
    Fix them by forcing the sending of an IPI for the affected models.
    
    The Ice Lake issue has been reproduced internally on XenServer hardware,
    and the fix does seem to prevent it.  The symptom was APs getting stuck in
    the idle loop immediately after bring up, which in turn prevented the BSP
    from making progress.  This would happen before the watchdog was
    initialized, and hence the whole system would get stuck.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/acpi/cpu_idle.c     |  6 ++++++
 xen/arch/x86/cpu/intel.c         | 36 +++++++++++++++++++++++++++++++++++-
 xen/arch/x86/include/asm/mwait.h |  3 +++
 3 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index 420198406d..1dbf15b01e 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -441,8 +441,14 @@ void cpuidle_wakeup_mwait(cpumask_t *mask)
     cpumask_andnot(mask, mask, &target);
 }
 
+/* Force sending of a wakeup IPI regardless of mwait usage. */
+bool __ro_after_init force_mwait_ipi_wakeup;
+
 bool arch_skip_send_event_check(unsigned int cpu)
 {
+    if ( force_mwait_ipi_wakeup )
+        return false;
+
     /*
      * This relies on softirq_pending() and mwait_wakeup() to access data
      * on the same cache line.
diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index 6a680ba38d..63f65ea5b0 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -8,6 +8,7 @@
 #include <asm/intel-family.h>
 #include <asm/processor.h>
 #include <asm/msr.h>
+#include <asm/mwait.h>
 #include <asm/uaccess.h>
 #include <asm/mpspec.h>
 #include <asm/apic.h>
@@ -368,7 +369,6 @@ static void probe_c3_errata(const struct cpuinfo_x86 *c)
         INTEL_FAM6_MODEL(0x25),
         { }
     };
-#undef INTEL_FAM6_MODEL
 
     /* Serialized by the AP bringup code. */
     if ( max_cstate > 1 && (c->apicid & (c->x86_num_siblings - 1)) &&
@@ -380,6 +380,38 @@ static void probe_c3_errata(const struct cpuinfo_x86 *c)
     }
 }
 
+/*
+ * APL30: One use of the MONITOR/MWAIT instruction pair is to allow a logical
+ * processor to wait in a sleep state until a store to the armed address range
+ * occurs. Due to this erratum, stores to the armed address range may not
+ * trigger MWAIT to resume execution.
+ *
+ * ICX143: Under complex microarchitectural conditions, a monitor that is armed
+ * with the MWAIT instruction may not be triggered, leading to a processor
+ * hang.
+ *
+ * LNL030: Problem P-cores may not exit power state Core C6 on monitor hit.
+ *
+ * Force the sending of an IPI in those cases.
+ */
+static void __init probe_mwait_errata(void)
+{
+    static const struct x86_cpu_id __initconst models[] = {
+        INTEL_FAM6_MODEL(INTEL_FAM6_ATOM_GOLDMONT), /* APL30  */
+        INTEL_FAM6_MODEL(INTEL_FAM6_ICELAKE_X),     /* ICX143 */
+        INTEL_FAM6_MODEL(INTEL_FAM6_LUNARLAKE_M),   /* LNL030 */
+        { }
+    };
+#undef INTEL_FAM6_MODEL
+
+    if ( boot_cpu_has(X86_FEATURE_MONITOR) && x86_match_cpu(models) )
+    {
+        printk(XENLOG_WARNING
+               "Forcing IPI MWAIT wakeup due to CPU erratum\n");
+        force_mwait_ipi_wakeup = true;
+    }
+}
+
 /*
  * P4 Xeon errata 037 workaround.
  * Hardware prefetcher may cause stale data to be loaded into the cache.
@@ -406,6 +438,8 @@ static void Intel_errata_workarounds(struct cpuinfo_x86 *c)
 		__set_bit(X86_FEATURE_CLFLUSH_MONITOR, c->x86_capability);
 
 	probe_c3_errata(c);
+	if (system_state < SYS_STATE_smp_boot)
+		probe_mwait_errata();
 }
 
 
diff --git a/xen/arch/x86/include/asm/mwait.h b/xen/arch/x86/include/asm/mwait.h
index 000a692f6d..c52cd3f510 100644
--- a/xen/arch/x86/include/asm/mwait.h
+++ b/xen/arch/x86/include/asm/mwait.h
@@ -13,6 +13,9 @@
 
 #define MWAIT_ECX_INTERRUPT_BREAK	0x1
 
+/* Force sending of a wakeup IPI regardless of mwait usage. */
+extern bool force_mwait_ipi_wakeup;
+
 void mwait_idle_with_hints(unsigned int eax, unsigned int ecx);
 #ifdef CONFIG_INTEL
 bool mwait_pc10_supported(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 23 15:22:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Apr 2025 15:22:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.964939.1355630 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7bvS-0000oO-5t; Wed, 23 Apr 2025 15:22:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 964939.1355630; Wed, 23 Apr 2025 15: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 1u7bvS-0000oG-38; Wed, 23 Apr 2025 15:22:14 +0000
Received: by outflank-mailman (input) for mailman id 964939;
 Wed, 23 Apr 2025 15: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 1u7bvQ-0000o4-7O
 for xen-changelog@lists.xenproject.org; Wed, 23 Apr 2025 15: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 1u7bvQ-00H8jc-0c
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 15:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7bvQ-00EeXE-0S
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 15: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=iKZZFgj5HA3B20fCkT87H/P9ppGseu8DC8+r9Y8+zO4=; b=lJmMBIxffigq5SqOrdC6SxwDDd
	gtJ0U4D5D9bTm6UB+h3RRg6NbOWUDu2m2o/XrDf190GgT2V6DYMroERkx1R0LFC3J4Hlt/c4+89oi
	CiHrOn1WaYpwACybgJypx8OFX3MkkLWC+Yqm/IRalRH9GSZ6q2ENkzJv0F37IRNsw+/Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: remove -N from the linker command line
Message-Id: <E1u7bvQ-00EeXE-0S@xenbits.xenproject.org>
Date: Wed, 23 Apr 2025 15:22:12 +0000

commit d444763f8ca556d0a67a4b933be303d346baef02
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Mar 5 11:53:20 2025 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Wed Apr 23 16:12:25 2025 +0200

    xen: remove -N from the linker command line
    
    It's unclear why -N is being used in the first place.  It was added by
    commit 4676bbf96dc8 back in 2002 without any justification.
    
    When building a PE image it's actually detrimental to forcefully set the
    .text section as writable.  The GNU LD man page contains the following
    warning regarding the -N option:
    
    > Note: Although a writable text section is allowed for PE-COFF targets, it
    > does not conform to the format specification published by Microsoft.
    
    Remove the usage of -N uniformly on all architectures, assuming that the
    addition was simply done as a copy and paste of the original x86 linking
    rune.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/Makefile   |  6 +++---
 xen/arch/ppc/Makefile   |  6 +++---
 xen/arch/riscv/Makefile |  6 +++---
 xen/arch/x86/Makefile   | 12 ++++++------
 4 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 4837ad467a..129a109d6e 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -97,19 +97,19 @@ ifeq ($(CONFIG_ARM_64),y)
 endif
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
 	    $(dot-target).0.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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).1.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
diff --git a/xen/arch/ppc/Makefile b/xen/arch/ppc/Makefile
index 655d212f66..cf27bcebb2 100644
--- a/xen/arch/ppc/Makefile
+++ b/xen/arch/ppc/Makefile
@@ -12,19 +12,19 @@ $(TARGET): $(TARGET)-syms
 	cp -f $< $@
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
 	    $(dot-target).0.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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).1.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index 0c6c4a38a3..d882c57528 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -19,19 +19,19 @@ $(TARGET): $(TARGET)-syms
 	$(OBJCOPY) -O binary -S $< $@
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
 	    $(dot-target).0.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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).1.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index f59c9665fd..c2f1dcf301 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -139,19 +139,19 @@ $(TARGET): $(TARGET)-syms $(efi-y) $(obj)/boot/mkelf32
 CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).0.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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(orphan-handling-y) $(dot-target).1.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
@@ -212,7 +212,7 @@ ifeq ($(CONFIG_DEBUG_INFO),y)
 	$(if $(filter --strip-debug,$(EFI_LDFLAGS)),echo,:) "Will strip debug info from $(@F)"
 endif
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
-	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds -N $< $(relocs-dummy) \
+	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< $(relocs-dummy) \
 	                $(objtree)/common/symbols-dummy.o $(note_file_option) \
 	                -o $(dot-target).$(base).0 &&) :
 	$(MKRELOC) $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(dot-target).$(base).0) \
@@ -222,7 +222,7 @@ endif
 		> $(dot-target).0s.S
 	$(MAKE) $(build)=$(@D) .$(@F).0r.o .$(@F).0s.o
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
-	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds -N $< \
+	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< \
 	                $(dot-target).0r.o $(dot-target).0s.o $(note_file_option) \
 	                -o $(dot-target).$(base).1 &&) :
 	$(MKRELOC) $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(dot-target).$(base).1) \
@@ -231,7 +231,7 @@ endif
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(dot-target).1s.S
 	$(MAKE) $(build)=$(@D) .$(@F).1r.o .$(@F).1s.o
-	$(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds -N $< \
+	$(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds $< \
 	      $(dot-target).1r.o $(dot-target).1s.o $(orphan-handling-y) \
 	      $(note_file_option) -o $@
 	$(NM) -pa --format=sysv $@ \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 23 18:44:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Apr 2025 18:44:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.965162.1355778 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7f4l-0004GD-FT; Wed, 23 Apr 2025 18:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 965162.1355778; Wed, 23 Apr 2025 18: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 1u7f4l-0004G6-Cr; Wed, 23 Apr 2025 18:44:03 +0000
Received: by outflank-mailman (input) for mailman id 965162;
 Wed, 23 Apr 2025 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 1u7f4k-0004G0-Ha
 for xen-changelog@lists.xenproject.org; Wed, 23 Apr 2025 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 1u7f4k-00HEcQ-1G
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 18:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7f4k-001uEk-11
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 18: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=MjvE8foZzt4ZkYuxh6BZeqPYtseN1ilnwY1v9Jp4RVo=; b=Pr6bwyZLma6KJVLJwLIOQfAiXt
	LbaPQwD3+9mQaUqsGGkW6AjiX4A0lcb7IEQsLZyo/TwMbFq8Xb9GID2HDvF3dLT3w5EVw/4PpLFaN
	0bzKfTcKm/c4V2b4tXBT1uloXMucsZ5QeTRwRW/+Tno4Seo01CePXvuP1fGPoE/+1IoE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/altcall: Split alternative-call.h out of alternative.h
Message-Id: <E1u7f4k-001uEk-11@xenbits.xenproject.org>
Date: Wed, 23 Apr 2025 18:44:02 +0000

commit ab2da34b207cb8fb98db9d96ed6f4b09d3791ace
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sat Apr 19 21:23:56 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 23 19:37:57 2025 +0100

    x86/altcall: Split alternative-call.h out of alternative.h
    
    ... in preparation for changing how they're implemented.
    
    Update the MISRA deviations with the new path.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl |   4 +-
 xen/arch/x86/include/asm/alternative-call.h      | 269 +++++++++++++++++++++++
 xen/arch/x86/include/asm/alternative.h           | 262 ----------------------
 xen/arch/x86/include/asm/hvm/hvm.h               |   2 +-
 xen/common/core_parking.c                        |   4 +-
 xen/include/xen/alternative-call.h               |  10 +-
 6 files changed, 279 insertions(+), 272 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 2c8fb92713..9c67358d46 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -414,8 +414,8 @@ of the short-circuit evaluation strategy of such logical operators."
 -doc_end
 
 -doc_begin="Macros alternative_v?call[0-9] use sizeof and typeof to check that the argument types match the corresponding parameter ones."
--config=MC3A2.R13.6,reports+={deliberate,"any_area(any_loc(any_exp(macro(^alternative_vcall[0-9]$))&&file(^xen/arch/x86/include/asm/alternative\\.h*$)))"}
--config=B.UNEVALEFF,reports+={deliberate,"any_area(any_loc(any_exp(macro(^alternative_v?call[0-9]$))&&file(^xen/arch/x86/include/asm/alterantive\\.h*$)))"}
+-config=MC3A2.R13.6,reports+={deliberate,"any_area(any_loc(any_exp(macro(^alternative_vcall[0-9]$))&&file(^xen/arch/x86/include/asm/alternative-call\\.h*$)))"}
+-config=B.UNEVALEFF,reports+={deliberate,"any_area(any_loc(any_exp(macro(^alternative_v?call[0-9]$))&&file(^xen/arch/x86/include/asm/alterantive-call\\.h*$)))"}
 -doc_end
 
 -doc_begin="Anything, no matter how complicated, inside the BUILD_BUG_ON macro is subject to a compile-time evaluation without relevant side effects."
diff --git a/xen/arch/x86/include/asm/alternative-call.h b/xen/arch/x86/include/asm/alternative-call.h
new file mode 100644
index 0000000000..828ea32a96
--- /dev/null
+++ b/xen/arch/x86/include/asm/alternative-call.h
@@ -0,0 +1,269 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef X86_ALTERNATIVE_CALL_H
+#define X86_ALTERNATIVE_CALL_H
+
+#include <asm/alternative.h>
+
+/*
+ * Machinery to allow converting indirect to direct calls, when the called
+ * function is determined once at boot and later never changed.
+ */
+
+#define ALT_CALL_arg1 "rdi"
+#define ALT_CALL_arg2 "rsi"
+#define ALT_CALL_arg3 "rdx"
+#define ALT_CALL_arg4 "rcx"
+#define ALT_CALL_arg5 "r8"
+#define ALT_CALL_arg6 "r9"
+
+#ifdef CONFIG_CC_IS_CLANG
+/*
+ * Clang doesn't follow the psABI and doesn't truncate parameter values at the
+ * callee.  This can lead to bad code being generated when using alternative
+ * calls.
+ *
+ * Workaround it by using a temporary intermediate variable that's zeroed
+ * before being assigned the parameter value, as that forces clang to zero the
+ * register at the caller.
+ *
+ * This has been reported upstream:
+ * https://github.com/llvm/llvm-project/issues/12579
+ * https://github.com/llvm/llvm-project/issues/82598
+ */
+#define ALT_CALL_ARG(arg, n)                                            \
+    register unsigned long a ## n ## _ asm ( ALT_CALL_arg ## n ) = ({   \
+        unsigned long tmp = 0;                                          \
+        BUILD_BUG_ON(sizeof(arg) > sizeof(unsigned long));              \
+        *(typeof(arg) *)&tmp = (arg);                                   \
+        tmp;                                                            \
+    })
+#else
+#define ALT_CALL_ARG(arg, n) \
+    register typeof(arg) a ## n ## _ asm ( ALT_CALL_arg ## n ) = \
+        ({ BUILD_BUG_ON(sizeof(arg) > sizeof(void *)); (arg); })
+#endif
+#define ALT_CALL_NO_ARG(n) \
+    register unsigned long a ## n ## _ asm ( ALT_CALL_arg ## n )
+
+#define ALT_CALL_NO_ARG6 ALT_CALL_NO_ARG(6)
+#define ALT_CALL_NO_ARG5 ALT_CALL_NO_ARG(5); ALT_CALL_NO_ARG6
+#define ALT_CALL_NO_ARG4 ALT_CALL_NO_ARG(4); ALT_CALL_NO_ARG5
+#define ALT_CALL_NO_ARG3 ALT_CALL_NO_ARG(3); ALT_CALL_NO_ARG4
+#define ALT_CALL_NO_ARG2 ALT_CALL_NO_ARG(2); ALT_CALL_NO_ARG3
+#define ALT_CALL_NO_ARG1 ALT_CALL_NO_ARG(1); ALT_CALL_NO_ARG2
+
+/*
+ * Unfortunately ALT_CALL_NO_ARG() above can't use a fake initializer (to
+ * suppress "uninitialized variable" warnings), as various versions of gcc
+ * older than 8.1 fall on the nose in various ways with that (always because
+ * of some other construct elsewhere in the same function needing to use the
+ * same hard register). Otherwise the asm() below could uniformly use "+r"
+ * output constraints, making unnecessary all these ALT_CALL<n>_OUT macros.
+ */
+#define ALT_CALL0_OUT "=r" (a1_), "=r" (a2_), "=r" (a3_), \
+                      "=r" (a4_), "=r" (a5_), "=r" (a6_)
+#define ALT_CALL1_OUT "+r" (a1_), "=r" (a2_), "=r" (a3_), \
+                      "=r" (a4_), "=r" (a5_), "=r" (a6_)
+#define ALT_CALL2_OUT "+r" (a1_), "+r" (a2_), "=r" (a3_), \
+                      "=r" (a4_), "=r" (a5_), "=r" (a6_)
+#define ALT_CALL3_OUT "+r" (a1_), "+r" (a2_), "+r" (a3_), \
+                      "=r" (a4_), "=r" (a5_), "=r" (a6_)
+#define ALT_CALL4_OUT "+r" (a1_), "+r" (a2_), "+r" (a3_), \
+                      "+r" (a4_), "=r" (a5_), "=r" (a6_)
+#define ALT_CALL5_OUT "+r" (a1_), "+r" (a2_), "+r" (a3_), \
+                      "+r" (a4_), "+r" (a5_), "=r" (a6_)
+#define ALT_CALL6_OUT "+r" (a1_), "+r" (a2_), "+r" (a3_), \
+                      "+r" (a4_), "+r" (a5_), "+r" (a6_)
+
+#define alternative_callN(n, rettype, func) ({                     \
+    rettype ret_;                                                  \
+    register unsigned long r10_ asm("r10");                        \
+    register unsigned long r11_ asm("r11");                        \
+    asm volatile (ALTERNATIVE("call *%c[addr](%%rip)", "call .",   \
+                              X86_FEATURE_ALWAYS)                  \
+                  : ALT_CALL ## n ## _OUT, "=a" (ret_),            \
+                    "=r" (r10_), "=r" (r11_) ASM_CALL_CONSTRAINT   \
+                  : [addr] "i" (&(func)), "g" (func)               \
+                  : "memory" );                                    \
+    ret_;                                                          \
+})
+
+#define alternative_vcall0(func) ({             \
+    ALT_CALL_NO_ARG1;                           \
+    (void)sizeof(func());                       \
+    (void)alternative_callN(0, int, func);      \
+})
+
+#define alternative_call0(func) ({              \
+    ALT_CALL_NO_ARG1;                           \
+    alternative_callN(0, typeof(func()), func); \
+})
+
+#define alternative_vcall1(func, arg) ({           \
+    typeof(arg) v1_ = (arg);                       \
+    ALT_CALL_ARG(v1_, 1);                          \
+    ALT_CALL_NO_ARG2;                              \
+    (void)sizeof(func(arg));                       \
+    (void)alternative_callN(1, int, func);         \
+})
+
+#define alternative_call1(func, arg) ({            \
+    typeof(arg) 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);                            \
+    ALT_CALL_ARG(v1_, 1);                                 \
+    ALT_CALL_ARG(v2_, 2);                                 \
+    ALT_CALL_NO_ARG3;                                     \
+    (void)sizeof(func(arg1, arg2));                       \
+    (void)alternative_callN(2, int, func);                \
+})
+
+#define alternative_call2(func, arg1, arg2) ({            \
+    typeof(arg1) v1_ = (arg1);                            \
+    typeof(arg2) v2_ = (arg2);                            \
+    ALT_CALL_ARG(v1_, 1);                                 \
+    ALT_CALL_ARG(v2_, 2);                                 \
+    ALT_CALL_NO_ARG3;                                     \
+    alternative_callN(2, typeof(func(arg1, arg2)), func); \
+})
+
+#define alternative_vcall3(func, arg1, arg2, arg3) ({    \
+    typeof(arg1) v1_ = (arg1);                           \
+    typeof(arg2) v2_ = (arg2);                           \
+    typeof(arg3) v3_ = (arg3);                           \
+    ALT_CALL_ARG(v1_, 1);                                \
+    ALT_CALL_ARG(v2_, 2);                                \
+    ALT_CALL_ARG(v3_, 3);                                \
+    ALT_CALL_NO_ARG4;                                    \
+    (void)sizeof(func(arg1, arg2, arg3));                \
+    (void)alternative_callN(3, int, func);               \
+})
+
+#define alternative_call3(func, arg1, arg2, arg3) ({     \
+    typeof(arg1) v1_ = (arg1);                           \
+    typeof(arg2) v2_ = (arg2);                           \
+    typeof(arg3) v3_ = (arg3);                           \
+    ALT_CALL_ARG(v1_, 1);                                \
+    ALT_CALL_ARG(v2_, 2);                                \
+    ALT_CALL_ARG(v3_, 3);                                \
+    ALT_CALL_NO_ARG4;                                    \
+    alternative_callN(3, typeof(func(arg1, arg2, arg3)), \
+                      func);                             \
+})
+
+#define alternative_vcall4(func, arg1, arg2, arg3, arg4) ({ \
+    typeof(arg1) v1_ = (arg1);                              \
+    typeof(arg2) v2_ = (arg2);                              \
+    typeof(arg3) v3_ = (arg3);                              \
+    typeof(arg4) v4_ = (arg4);                              \
+    ALT_CALL_ARG(v1_, 1);                                   \
+    ALT_CALL_ARG(v2_, 2);                                   \
+    ALT_CALL_ARG(v3_, 3);                                   \
+    ALT_CALL_ARG(v4_, 4);                                   \
+    ALT_CALL_NO_ARG5;                                       \
+    (void)sizeof(func(arg1, arg2, arg3, arg4));             \
+    (void)alternative_callN(4, int, func);                  \
+})
+
+#define alternative_call4(func, arg1, arg2, arg3, arg4) ({  \
+    typeof(arg1) v1_ = (arg1);                              \
+    typeof(arg2) v2_ = (arg2);                              \
+    typeof(arg3) v3_ = (arg3);                              \
+    typeof(arg4) v4_ = (arg4);                              \
+    ALT_CALL_ARG(v1_, 1);                                   \
+    ALT_CALL_ARG(v2_, 2);                                   \
+    ALT_CALL_ARG(v3_, 3);                                   \
+    ALT_CALL_ARG(v4_, 4);                                   \
+    ALT_CALL_NO_ARG5;                                       \
+    alternative_callN(4, typeof(func(arg1, arg2,            \
+                                     arg3, arg4)),          \
+                      func);                                \
+})
+
+#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);                                    \
+    ALT_CALL_ARG(v1_, 1);                                         \
+    ALT_CALL_ARG(v2_, 2);                                         \
+    ALT_CALL_ARG(v3_, 3);                                         \
+    ALT_CALL_ARG(v4_, 4);                                         \
+    ALT_CALL_ARG(v5_, 5);                                         \
+    ALT_CALL_NO_ARG6;                                             \
+    (void)sizeof(func(arg1, arg2, arg3, arg4, arg5));             \
+    (void)alternative_callN(5, int, func);                        \
+})
+
+#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);                                    \
+    ALT_CALL_ARG(v1_, 1);                                         \
+    ALT_CALL_ARG(v2_, 2);                                         \
+    ALT_CALL_ARG(v3_, 3);                                         \
+    ALT_CALL_ARG(v4_, 4);                                         \
+    ALT_CALL_ARG(v5_, 5);                                         \
+    ALT_CALL_NO_ARG6;                                             \
+    alternative_callN(5, typeof(func(arg1, arg2, arg3,            \
+                                     arg4, arg5)),                \
+                      func);                                      \
+})
+
+#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);                                          \
+    ALT_CALL_ARG(v1_, 1);                                               \
+    ALT_CALL_ARG(v2_, 2);                                               \
+    ALT_CALL_ARG(v3_, 3);                                               \
+    ALT_CALL_ARG(v4_, 4);                                               \
+    ALT_CALL_ARG(v5_, 5);                                               \
+    ALT_CALL_ARG(v6_, 6);                                               \
+    (void)sizeof(func(arg1, arg2, arg3, arg4, arg5, arg6));             \
+    (void)alternative_callN(6, int, func);                              \
+})
+
+#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);                                          \
+    ALT_CALL_ARG(v1_, 1);                                               \
+    ALT_CALL_ARG(v2_, 2);                                               \
+    ALT_CALL_ARG(v3_, 3);                                               \
+    ALT_CALL_ARG(v4_, 4);                                               \
+    ALT_CALL_ARG(v5_, 5);                                               \
+    ALT_CALL_ARG(v6_, 6);                                               \
+    alternative_callN(6, typeof(func(arg1, arg2, arg3,                  \
+                                     arg4, arg5, arg6)),                \
+                      func);                                            \
+})
+
+#define alternative_vcall__(nr) alternative_vcall ## nr
+#define alternative_call__(nr)  alternative_call ## nr
+
+#define alternative_vcall_(nr) alternative_vcall__(nr)
+#define alternative_call_(nr)  alternative_call__(nr)
+
+#define alternative_vcall(func, args...) \
+    alternative_vcall_(count_args(args))(func, ## args)
+
+#define alternative_call(func, args...) \
+    alternative_call_(count_args(args))(func, ## args)
+
+#endif /* X86_ALTERNATIVE_CALL_H */
diff --git a/xen/arch/x86/include/asm/alternative.h b/xen/arch/x86/include/asm/alternative.h
index 7326ad9428..2d2ace97f7 100644
--- a/xen/arch/x86/include/asm/alternative.h
+++ b/xen/arch/x86/include/asm/alternative.h
@@ -161,268 +161,6 @@ extern void alternative_branches(void);
 /* Use this macro(s) if you need more than one output parameter. */
 #define ASM_OUTPUT2(a...) a
 
-/*
- * Machinery to allow converting indirect to direct calls, when the called
- * function is determined once at boot and later never changed.
- */
-
-#define ALT_CALL_arg1 "rdi"
-#define ALT_CALL_arg2 "rsi"
-#define ALT_CALL_arg3 "rdx"
-#define ALT_CALL_arg4 "rcx"
-#define ALT_CALL_arg5 "r8"
-#define ALT_CALL_arg6 "r9"
-
-#ifdef CONFIG_CC_IS_CLANG
-/*
- * Clang doesn't follow the psABI and doesn't truncate parameter values at the
- * callee.  This can lead to bad code being generated when using alternative
- * calls.
- *
- * Workaround it by using a temporary intermediate variable that's zeroed
- * before being assigned the parameter value, as that forces clang to zero the
- * register at the caller.
- *
- * This has been reported upstream:
- * https://github.com/llvm/llvm-project/issues/12579
- * https://github.com/llvm/llvm-project/issues/82598
- */
-#define ALT_CALL_ARG(arg, n)                                            \
-    register unsigned long a ## n ## _ asm ( ALT_CALL_arg ## n ) = ({   \
-        unsigned long tmp = 0;                                          \
-        BUILD_BUG_ON(sizeof(arg) > sizeof(unsigned long));              \
-        *(typeof(arg) *)&tmp = (arg);                                   \
-        tmp;                                                            \
-    })
-#else
-#define ALT_CALL_ARG(arg, n) \
-    register typeof(arg) a ## n ## _ asm ( ALT_CALL_arg ## n ) = \
-        ({ BUILD_BUG_ON(sizeof(arg) > sizeof(void *)); (arg); })
-#endif
-#define ALT_CALL_NO_ARG(n) \
-    register unsigned long a ## n ## _ asm ( ALT_CALL_arg ## n )
-
-#define ALT_CALL_NO_ARG6 ALT_CALL_NO_ARG(6)
-#define ALT_CALL_NO_ARG5 ALT_CALL_NO_ARG(5); ALT_CALL_NO_ARG6
-#define ALT_CALL_NO_ARG4 ALT_CALL_NO_ARG(4); ALT_CALL_NO_ARG5
-#define ALT_CALL_NO_ARG3 ALT_CALL_NO_ARG(3); ALT_CALL_NO_ARG4
-#define ALT_CALL_NO_ARG2 ALT_CALL_NO_ARG(2); ALT_CALL_NO_ARG3
-#define ALT_CALL_NO_ARG1 ALT_CALL_NO_ARG(1); ALT_CALL_NO_ARG2
-
-/*
- * Unfortunately ALT_CALL_NO_ARG() above can't use a fake initializer (to
- * suppress "uninitialized variable" warnings), as various versions of gcc
- * older than 8.1 fall on the nose in various ways with that (always because
- * of some other construct elsewhere in the same function needing to use the
- * same hard register). Otherwise the asm() below could uniformly use "+r"
- * output constraints, making unnecessary all these ALT_CALL<n>_OUT macros.
- */
-#define ALT_CALL0_OUT "=r" (a1_), "=r" (a2_), "=r" (a3_), \
-                      "=r" (a4_), "=r" (a5_), "=r" (a6_)
-#define ALT_CALL1_OUT "+r" (a1_), "=r" (a2_), "=r" (a3_), \
-                      "=r" (a4_), "=r" (a5_), "=r" (a6_)
-#define ALT_CALL2_OUT "+r" (a1_), "+r" (a2_), "=r" (a3_), \
-                      "=r" (a4_), "=r" (a5_), "=r" (a6_)
-#define ALT_CALL3_OUT "+r" (a1_), "+r" (a2_), "+r" (a3_), \
-                      "=r" (a4_), "=r" (a5_), "=r" (a6_)
-#define ALT_CALL4_OUT "+r" (a1_), "+r" (a2_), "+r" (a3_), \
-                      "+r" (a4_), "=r" (a5_), "=r" (a6_)
-#define ALT_CALL5_OUT "+r" (a1_), "+r" (a2_), "+r" (a3_), \
-                      "+r" (a4_), "+r" (a5_), "=r" (a6_)
-#define ALT_CALL6_OUT "+r" (a1_), "+r" (a2_), "+r" (a3_), \
-                      "+r" (a4_), "+r" (a5_), "+r" (a6_)
-
-#define alternative_callN(n, rettype, func) ({                     \
-    rettype ret_;                                                  \
-    register unsigned long r10_ asm("r10");                        \
-    register unsigned long r11_ asm("r11");                        \
-    asm volatile (ALTERNATIVE("call *%c[addr](%%rip)", "call .",   \
-                              X86_FEATURE_ALWAYS)                  \
-                  : ALT_CALL ## n ## _OUT, "=a" (ret_),            \
-                    "=r" (r10_), "=r" (r11_) ASM_CALL_CONSTRAINT   \
-                  : [addr] "i" (&(func)), "g" (func)               \
-                  : "memory" );                                    \
-    ret_;                                                          \
-})
-
-#define alternative_vcall0(func) ({             \
-    ALT_CALL_NO_ARG1;                           \
-    (void)sizeof(func());                       \
-    (void)alternative_callN(0, int, func);      \
-})
-
-#define alternative_call0(func) ({              \
-    ALT_CALL_NO_ARG1;                           \
-    alternative_callN(0, typeof(func()), func); \
-})
-
-#define alternative_vcall1(func, arg) ({           \
-    typeof(arg) v1_ = (arg);                       \
-    ALT_CALL_ARG(v1_, 1);                          \
-    ALT_CALL_NO_ARG2;                              \
-    (void)sizeof(func(arg));                       \
-    (void)alternative_callN(1, int, func);         \
-})
-
-#define alternative_call1(func, arg) ({            \
-    typeof(arg) 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);                            \
-    ALT_CALL_ARG(v1_, 1);                                 \
-    ALT_CALL_ARG(v2_, 2);                                 \
-    ALT_CALL_NO_ARG3;                                     \
-    (void)sizeof(func(arg1, arg2));                       \
-    (void)alternative_callN(2, int, func);                \
-})
-
-#define alternative_call2(func, arg1, arg2) ({            \
-    typeof(arg1) v1_ = (arg1);                            \
-    typeof(arg2) v2_ = (arg2);                            \
-    ALT_CALL_ARG(v1_, 1);                                 \
-    ALT_CALL_ARG(v2_, 2);                                 \
-    ALT_CALL_NO_ARG3;                                     \
-    alternative_callN(2, typeof(func(arg1, arg2)), func); \
-})
-
-#define alternative_vcall3(func, arg1, arg2, arg3) ({    \
-    typeof(arg1) v1_ = (arg1);                           \
-    typeof(arg2) v2_ = (arg2);                           \
-    typeof(arg3) v3_ = (arg3);                           \
-    ALT_CALL_ARG(v1_, 1);                                \
-    ALT_CALL_ARG(v2_, 2);                                \
-    ALT_CALL_ARG(v3_, 3);                                \
-    ALT_CALL_NO_ARG4;                                    \
-    (void)sizeof(func(arg1, arg2, arg3));                \
-    (void)alternative_callN(3, int, func);               \
-})
-
-#define alternative_call3(func, arg1, arg2, arg3) ({     \
-    typeof(arg1) v1_ = (arg1);                            \
-    typeof(arg2) v2_ = (arg2);                           \
-    typeof(arg3) v3_ = (arg3);                           \
-    ALT_CALL_ARG(v1_, 1);                                \
-    ALT_CALL_ARG(v2_, 2);                                \
-    ALT_CALL_ARG(v3_, 3);                                \
-    ALT_CALL_NO_ARG4;                                    \
-    alternative_callN(3, typeof(func(arg1, arg2, arg3)), \
-                      func);                             \
-})
-
-#define alternative_vcall4(func, arg1, arg2, arg3, arg4) ({ \
-    typeof(arg1) v1_ = (arg1);                              \
-    typeof(arg2) v2_ = (arg2);                              \
-    typeof(arg3) v3_ = (arg3);                              \
-    typeof(arg4) v4_ = (arg4);                              \
-    ALT_CALL_ARG(v1_, 1);                                   \
-    ALT_CALL_ARG(v2_, 2);                                   \
-    ALT_CALL_ARG(v3_, 3);                                   \
-    ALT_CALL_ARG(v4_, 4);                                   \
-    ALT_CALL_NO_ARG5;                                       \
-    (void)sizeof(func(arg1, arg2, arg3, arg4));             \
-    (void)alternative_callN(4, int, func);                  \
-})
-
-#define alternative_call4(func, arg1, arg2, arg3, arg4) ({  \
-    typeof(arg1) v1_ = (arg1);                              \
-    typeof(arg2) v2_ = (arg2);                              \
-    typeof(arg3) v3_ = (arg3);                              \
-    typeof(arg4) v4_ = (arg4);                              \
-    ALT_CALL_ARG(v1_, 1);                                   \
-    ALT_CALL_ARG(v2_, 2);                                   \
-    ALT_CALL_ARG(v3_, 3);                                   \
-    ALT_CALL_ARG(v4_, 4);                                   \
-    ALT_CALL_NO_ARG5;                                       \
-    alternative_callN(4, typeof(func(arg1, arg2,            \
-                                     arg3, arg4)),          \
-                      func);                                \
-})
-
-#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);                                    \
-    ALT_CALL_ARG(v1_, 1);                                         \
-    ALT_CALL_ARG(v2_, 2);                                         \
-    ALT_CALL_ARG(v3_, 3);                                         \
-    ALT_CALL_ARG(v4_, 4);                                         \
-    ALT_CALL_ARG(v5_, 5);                                         \
-    ALT_CALL_NO_ARG6;                                             \
-    (void)sizeof(func(arg1, arg2, arg3, arg4, arg5));             \
-    (void)alternative_callN(5, int, func);                        \
-})
-
-#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);                                    \
-    ALT_CALL_ARG(v1_, 1);                                         \
-    ALT_CALL_ARG(v2_, 2);                                         \
-    ALT_CALL_ARG(v3_, 3);                                         \
-    ALT_CALL_ARG(v4_, 4);                                         \
-    ALT_CALL_ARG(v5_, 5);                                         \
-    ALT_CALL_NO_ARG6;                                             \
-    alternative_callN(5, typeof(func(arg1, arg2, arg3,            \
-                                     arg4, arg5)),                \
-                      func);                                      \
-})
-
-#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);                                          \
-    ALT_CALL_ARG(v1_, 1);                                               \
-    ALT_CALL_ARG(v2_, 2);                                               \
-    ALT_CALL_ARG(v3_, 3);                                               \
-    ALT_CALL_ARG(v4_, 4);                                               \
-    ALT_CALL_ARG(v5_, 5);                                               \
-    ALT_CALL_ARG(v6_, 6);                                               \
-    (void)sizeof(func(arg1, arg2, arg3, arg4, arg5, arg6));             \
-    (void)alternative_callN(6, int, func);                              \
-})
-
-#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);                                          \
-    ALT_CALL_ARG(v1_, 1);                                               \
-    ALT_CALL_ARG(v2_, 2);                                               \
-    ALT_CALL_ARG(v3_, 3);                                               \
-    ALT_CALL_ARG(v4_, 4);                                               \
-    ALT_CALL_ARG(v5_, 5);                                               \
-    ALT_CALL_ARG(v6_, 6);                                               \
-    alternative_callN(6, typeof(func(arg1, arg2, arg3,                  \
-                                     arg4, arg5, arg6)),                \
-                      func);                                            \
-})
-
-#define alternative_vcall__(nr) alternative_vcall ## nr
-#define alternative_call__(nr)  alternative_call ## nr
-
-#define alternative_vcall_(nr) alternative_vcall__(nr)
-#define alternative_call_(nr)  alternative_call__(nr)
-
-#define alternative_vcall(func, args...) \
-    alternative_vcall_(count_args(args))(func, ## args)
-
-#define alternative_call(func, args...) \
-    alternative_call_(count_args(args))(func, ## args)
-
 #endif /*  !__ASSEMBLY__  */
 
 #endif /* __X86_ALTERNATIVE_H__ */
diff --git a/xen/arch/x86/include/asm/hvm/hvm.h b/xen/arch/x86/include/asm/hvm/hvm.h
index 963e820113..bf8bc2e100 100644
--- a/xen/arch/x86/include/asm/hvm/hvm.h
+++ b/xen/arch/x86/include/asm/hvm/hvm.h
@@ -9,9 +9,9 @@
 #ifndef __ASM_X86_HVM_HVM_H__
 #define __ASM_X86_HVM_HVM_H__
 
+#include <xen/alternative-call.h>
 #include <xen/mm.h>
 
-#include <asm/alternative.h>
 #include <asm/asm_defns.h>
 #include <asm/current.h>
 #include <asm/x86_emulate.h>
diff --git a/xen/common/core_parking.c b/xen/common/core_parking.c
index a970ffeab8..7d6a18cdcf 100644
--- a/xen/common/core_parking.c
+++ b/xen/common/core_parking.c
@@ -15,10 +15,10 @@
  *  General Public License for more details.
  */
 
-#include <xen/types.h>
+#include <xen/alternative-call.h>
 #include <xen/cpu.h>
-#include <xen/init.h>
 #include <xen/cpumask.h>
+#include <xen/init.h>
 #include <xen/param.h>
 
 #include <asm/smp.h>
diff --git a/xen/include/xen/alternative-call.h b/xen/include/xen/alternative-call.h
index 62672b7324..39339c3f0f 100644
--- a/xen/include/xen/alternative-call.h
+++ b/xen/include/xen/alternative-call.h
@@ -13,10 +13,10 @@
  *
  * For architectures to support:
  *
- * - Implement alternative_{,v}call() in asm/alternative.h.  Code generation
- *   requirements are to emit a function pointer call at build time, and stash
- *   enough metadata to simplify the call at boot once the implementation has
- *   been resolved.
+ * - Implement alternative_{,v}call() in asm/alternative-call.h.  Code
+ *   generation requirements are to emit a function pointer call at build
+ *   time, and stash enough metadata to simplify the call at boot once the
+ *   implementation has been resolved.
  * - Select ALTERNATIVE_CALL in Kconfig.
  *
  * To use:
@@ -48,7 +48,7 @@
 
 #ifdef CONFIG_ALTERNATIVE_CALL
 
-#include <asm/alternative.h>
+#include <asm/alternative-call.h>
 
 #ifdef CONFIG_LIVEPATCH
 /* Must keep for livepatches to resolve alternative calls. */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 23 18:44:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Apr 2025 18:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.965163.1355782 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7f4v-0004Ij-IT; Wed, 23 Apr 2025 18:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 965163.1355782; Wed, 23 Apr 2025 18: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 1u7f4v-0004Ib-Fo; Wed, 23 Apr 2025 18:44:13 +0000
Received: by outflank-mailman (input) for mailman id 965163;
 Wed, 23 Apr 2025 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 1u7f4u-0004IR-IB
 for xen-changelog@lists.xenproject.org; Wed, 23 Apr 2025 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 1u7f4u-00HEcU-1g
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 18:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7f4u-001ued-1U
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 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=yZpZAWN8YKCH2pZHriYTpuQfUglQrWWDI+r2RNSpomw=; b=5VaHR+cdbHFz/GuBrcmvHPsIoc
	shcu/vgJpSm5XlISobhqmV9nh39TpbHYC9ROWXB4N15o2RQuHuCPzZDFOyEaUqSQSS+D804C2xjTF
	O84CyMOg/BtwOauYrJqulpcFl5wtY0rRmjq5d3roy/yH1f/Lxgc4RnC9i4vjVkLWqbTE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/altcall: Rename alternative_branches() to boot_apply_alt_calls()
Message-Id: <E1u7f4u-001ued-1U@xenbits.xenproject.org>
Date: Wed, 23 Apr 2025 18:44:12 +0000

commit 4ab3d34da3d88cff102a76c2ba928cff1ce8ea75
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sat Apr 19 22:38:23 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 23 19:37:57 2025 +0100

    x86/altcall: Rename alternative_branches() to boot_apply_alt_calls()
    
    The alternatives APIs are not great; rename alternative_branches() to be more
    precise.  Centralise the declaration in xen/alternative-call.h, in the
    expectation that x86 won't be the only user in the long term.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/alternative.c             |  2 +-
 xen/arch/x86/include/asm/alternative.h |  1 -
 xen/arch/x86/setup.c                   |  3 ++-
 xen/include/xen/alternative-call.h     | 10 +++++++++-
 4 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
index 1ba35cb9ed..d1a3b7ea7c 100644
--- a/xen/arch/x86/alternative.c
+++ b/xen/arch/x86/alternative.c
@@ -493,7 +493,7 @@ void __init alternative_instructions(void)
     _alternative_instructions(false);
 }
 
-void __init alternative_branches(void)
+void __init boot_apply_alt_calls(void)
 {
     local_irq_disable();
     _alternative_instructions(true);
diff --git a/xen/arch/x86/include/asm/alternative.h b/xen/arch/x86/include/asm/alternative.h
index 2d2ace97f7..29c3d724b0 100644
--- a/xen/arch/x86/include/asm/alternative.h
+++ b/xen/arch/x86/include/asm/alternative.h
@@ -29,7 +29,6 @@ extern void add_nops(void *insns, unsigned int len);
 /* Similar to alternative_instructions except it can be run with IRQs enabled. */
 extern int apply_alternatives(struct alt_instr *start, struct alt_instr *end);
 extern void alternative_instructions(void);
-extern void alternative_branches(void);
 
 #define alt_orig_len       "(.LXEN%=_orig_e - .LXEN%=_orig_s)"
 #define alt_pad_len        "(.LXEN%=_orig_p - .LXEN%=_orig_e)"
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index cf1ea040dd..2518954124 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1,4 +1,5 @@
 #include <xen/acpi.h>
+#include <xen/alternative-call.h>
 #include <xen/bitops.h>
 #include <xen/console.h>
 #include <xen/cpu.h>
@@ -2082,7 +2083,7 @@ void asmlinkage __init noreturn __start_xen(void)
 
     do_presmp_initcalls();
 
-    alternative_branches();
+    boot_apply_alt_calls();
 
     /*
      * NB: when running as a PV shim VCPUOP_up/down is wired to the shim
diff --git a/xen/include/xen/alternative-call.h b/xen/include/xen/alternative-call.h
index 39339c3f0f..3c855bfa44 100644
--- a/xen/include/xen/alternative-call.h
+++ b/xen/include/xen/alternative-call.h
@@ -17,6 +17,8 @@
  *   generation requirements are to emit a function pointer call at build
  *   time, and stash enough metadata to simplify the call at boot once the
  *   implementation has been resolved.
+ * - Implement boot_apply_alt_calls() to convert the function pointer calls
+ *   into direct calls on boot.
  * - Select ALTERNATIVE_CALL in Kconfig.
  *
  * To use:
@@ -57,7 +59,13 @@
 # define __alt_call_maybe_initdata __initdata
 #endif
 
-#else
+/*
+ * Devirtualise the alternative_{,v}call()'s on boot.  Convert still-NULL
+ * function pointers into traps.
+ */
+void boot_apply_alt_calls(void);
+
+#else /* CONFIG_ALTERNATIVE_CALL */
 
 #define alternative_call(func, args...)  (func)(args)
 #define alternative_vcall(func, args...) (func)(args)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 23 18:44:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Apr 2025 18:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.965164.1355786 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7f55-0004LQ-K7; Wed, 23 Apr 2025 18:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 965164.1355786; Wed, 23 Apr 2025 18: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 1u7f55-0004LI-HD; Wed, 23 Apr 2025 18:44:23 +0000
Received: by outflank-mailman (input) for mailman id 965164;
 Wed, 23 Apr 2025 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 1u7f54-0004L9-L7
 for xen-changelog@lists.xenproject.org; Wed, 23 Apr 2025 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 1u7f54-00HEcY-1z
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 18:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7f54-001v1D-1s
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 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=hNZC7+WerdALTLPanHsXECGSjJ1Vu51gAAawXOGxoyY=; b=gbj1T/dV/V6h6NQ2OGMolj0iTG
	IzhviSib2m9tVs/Q6MxWia9I+Fu4dCmJx6wzQVKmEshYzxo2Q0pbPjZCQK+dgWamc8bu32PILank+
	CIFXZMGZozt6OF+dYymGs/4ZO4LeHXflMumzs31wa00a5wA/HQEwAFgFcBvHNfJl1xLY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/alternatives: Rework information passing into nmi_apply_alternatives()
Message-Id: <E1u7f54-001v1D-1s@xenbits.xenproject.org>
Date: Wed, 23 Apr 2025 18:44:22 +0000

commit d4ef51d840f4329782cd204b0899be27e8592693
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sun Apr 20 00:44:17 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 23 19:37:57 2025 +0100

    x86/alternatives: Rework information passing into nmi_apply_alternatives()
    
    nmi_apply_alternatives() is soon going to need to dispatch to multiple
    functions, and a force parameter is not a good way of passing information.
    
    Introduce ALT_INSNS and ALT_CALLS to pass in at the top level to select the
    operation(s) desired.  They represent what will happen when we've separated
    the altcalls out of the general alternative instructions infrastructure,
    although in the short term we still need to synthesise the force parameter for
    _apply_alternatives().
    
    Move two externs to reduce their scope a little.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/alternative.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
index d1a3b7ea7c..9aa591b364 100644
--- a/xen/arch/x86/alternative.c
+++ b/xen/arch/x86/alternative.c
@@ -19,8 +19,6 @@
 
 #define MAX_PATCH_LEN (255-1)
 
-extern struct alt_instr __alt_instructions[], __alt_instructions_end[];
-
 #ifdef K8_NOP1
 static const unsigned char k8nops[] init_or_livepatch_const = {
     K8_NOP1,
@@ -387,9 +385,13 @@ int apply_alternatives(struct alt_instr *start, struct alt_instr *end)
 }
 #endif
 
+#define ALT_INSNS (1U << 0)
+#define ALT_CALLS (1U << 1)
 static unsigned int __initdata alt_todo;
 static unsigned int __initdata alt_done;
 
+extern struct alt_instr __alt_instructions[], __alt_instructions_end[];
+
 /*
  * At boot time, we patch alternatives in NMI context.  This means that the
  * active NMI-shadow will defer any further NMIs, removing the slim race
@@ -419,7 +421,7 @@ static int __init cf_check nmi_apply_alternatives(
         flush_local(FLUSH_TLB_GLOBAL);
 
         rc = _apply_alternatives(__alt_instructions, __alt_instructions_end,
-                                 alt_done);
+                                 alt_todo == ALT_CALLS);
         if ( rc )
             panic("Unable to apply alternatives: %d\n", rc);
 
@@ -442,7 +444,7 @@ static int __init cf_check nmi_apply_alternatives(
  * This routine is called with local interrupt disabled and used during
  * bootup.
  */
-static void __init _alternative_instructions(bool force)
+static void __init _alternative_instructions(unsigned int what)
 {
     unsigned int i;
     nmi_callback_t *saved_nmi_callback;
@@ -460,7 +462,7 @@ static void __init _alternative_instructions(bool force)
     ASSERT(!local_irq_is_enabled());
 
     /* Set what operation to perform /before/ setting the callback. */
-    alt_todo = 1u << force;
+    alt_todo = what;
     barrier();
 
     /*
@@ -490,12 +492,12 @@ static void __init _alternative_instructions(bool force)
 void __init alternative_instructions(void)
 {
     arch_init_ideal_nops();
-    _alternative_instructions(false);
+    _alternative_instructions(ALT_INSNS);
 }
 
 void __init boot_apply_alt_calls(void)
 {
     local_irq_disable();
-    _alternative_instructions(true);
+    _alternative_instructions(ALT_CALLS);
     local_irq_enable();
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 23 18:44:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Apr 2025 18:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.965165.1355789 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7f5F-0004Nw-Ky; Wed, 23 Apr 2025 18:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 965165.1355789; Wed, 23 Apr 2025 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 1u7f5F-0004Np-IZ; Wed, 23 Apr 2025 18:44:33 +0000
Received: by outflank-mailman (input) for mailman id 965165;
 Wed, 23 Apr 2025 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 1u7f5E-0004Ni-Ot
 for xen-changelog@lists.xenproject.org; Wed, 23 Apr 2025 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 1u7f5E-00HEck-2N
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 18:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7f5E-001vUJ-2C
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 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=hK8lZl8QUvdFImwvRsJlmov2rB89zkMVX+Yuy6nxAFg=; b=Ckt33WXd33lj+UuAzXakvQrqEo
	NfpTv5+i482aLCvJ/22L/3zY0wbQ+So+I1PiewolOu19x+rQUsX99vUmuPJjC9864n3aYAnQOaaew
	0CcfU9h3d2oD+Dm5KyhMJljmL63YafvZ9tQB8trR42ncUKbvAozzQ8tbNs4L5wBqa6jo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/alternatives: Factor seal_endbr64() out of _apply_alternatives()
Message-Id: <E1u7f5E-001vUJ-2C@xenbits.xenproject.org>
Date: Wed, 23 Apr 2025 18:44:32 +0000

commit 9815ce18f29ffb7009480c4f60cb5b2d2056cf72
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sun Apr 20 01:19:47 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 23 19:37:57 2025 +0100

    x86/alternatives: Factor seal_endbr64() out of _apply_alternatives()
    
    We are going to need to reposition the call in a change with several moving
    parts.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/alternative.c | 70 ++++++++++++++++++++++++++--------------------
 1 file changed, 40 insertions(+), 30 deletions(-)

diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
index 9aa591b364..4b9f8d8601 100644
--- a/xen/arch/x86/alternative.c
+++ b/xen/arch/x86/alternative.c
@@ -162,6 +162,44 @@ text_poke(void *addr, const void *opcode, size_t len)
 extern void *const __initdata_cf_clobber_start[];
 extern void *const __initdata_cf_clobber_end[];
 
+/*
+ * In CET-IBT enabled builds, clobber endbr64 instructions after altcall has
+ * finished optimising all indirect branches to direct ones.
+ */
+static void __init seal_endbr64(void)
+{
+    void *const *val;
+    unsigned int clobbered = 0;
+
+    if ( !cpu_has_xen_ibt )
+        return;
+
+    /*
+     * This is some minor structure (ab)use.  We walk the entire contents
+     * of .init.{ro,}data.cf_clobber as if it were an array of pointers.
+     *
+     * If the pointer points into .text, and at an endbr64 instruction,
+     * nop out the endbr64.  This causes the pointer to no longer be a
+     * legal indirect branch target under CET-IBT.  This is a
+     * defence-in-depth measure, to reduce the options available to an
+     * adversary who has managed to hijack a function pointer.
+     */
+    for ( val = __initdata_cf_clobber_start;
+          val < __initdata_cf_clobber_end;
+          val++ )
+    {
+        void *ptr = *val;
+
+        if ( !is_kernel_text(ptr) || !is_endbr64(ptr) )
+            continue;
+
+        place_endbr64_poison(ptr);
+        clobbered++;
+    }
+
+    printk("altcall: Optimised away %u endbr64 instructions\n", clobbered);
+}
+
 /*
  * Replace instructions with better alternatives for this CPU type.
  * This runs before SMP is initialized to avoid SMP problems with
@@ -344,36 +382,8 @@ static int init_or_livepatch _apply_alternatives(struct alt_instr *start,
      * Clobber endbr64 instructions now that altcall has finished optimising
      * all indirect branches to direct ones.
      */
-    if ( force && cpu_has_xen_ibt && system_state < SYS_STATE_active )
-    {
-        void *const *val;
-        unsigned int clobbered = 0;
-
-        /*
-         * This is some minor structure (ab)use.  We walk the entire contents
-         * of .init.{ro,}data.cf_clobber as if it were an array of pointers.
-         *
-         * If the pointer points into .text, and at an endbr64 instruction,
-         * nop out the endbr64.  This causes the pointer to no longer be a
-         * legal indirect branch target under CET-IBT.  This is a
-         * defence-in-depth measure, to reduce the options available to an
-         * adversary who has managed to hijack a function pointer.
-         */
-        for ( val = __initdata_cf_clobber_start;
-              val < __initdata_cf_clobber_end;
-              val++ )
-        {
-            void *ptr = *val;
-
-            if ( !is_kernel_text(ptr) || !is_endbr64(ptr) )
-                continue;
-
-            place_endbr64_poison(ptr);
-            clobbered++;
-        }
-
-        printk("altcall: Optimised away %u endbr64 instructions\n", clobbered);
-    }
+    if ( force && system_state < SYS_STATE_active )
+        seal_endbr64();
 
     return 0;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 23 18:44:43 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Apr 2025 18:44:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.965166.1355793 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7f5P-0004QO-MP; Wed, 23 Apr 2025 18:44:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 965166.1355793; Wed, 23 Apr 2025 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 1u7f5P-0004QH-K1; Wed, 23 Apr 2025 18:44:43 +0000
Received: by outflank-mailman (input) for mailman id 965166;
 Wed, 23 Apr 2025 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 1u7f5O-0004Q7-Sl
 for xen-changelog@lists.xenproject.org; Wed, 23 Apr 2025 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 1u7f5O-00HEd6-2l
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 18:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7f5O-001vvQ-2a
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 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=lmC4JlFxZhp+rRwKpidQuiwQkC2kTl/iwZvgv5Ly7Do=; b=P1gGkGYRbyAJXJ6JyAKwLKW8+i
	2YcIPIKit2vJMa1QrPq1TqYmVekhN+ZnudZ6PJnnW0F70+4zu1L6IbmNYg8QHpxc5rK+YaJP1nzpj
	wuheOuQ4XrH3VM0Kh35e1wkV8eHgCavKQysCcHwGxS6SrsGb5Knw/7iwvRm6ZMBHQbrI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/altcall: Introduce new simpler scheme
Message-Id: <E1u7f5O-001vvQ-2a@xenbits.xenproject.org>
Date: Wed, 23 Apr 2025 18:44:42 +0000

commit ac02ee9c82d115a824629edb10c14f260108ef56
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sat Apr 19 23:05:52 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 23 19:37:57 2025 +0100

    x86/altcall: Introduce new simpler scheme
    
    Encoding altcalls as regular alternatives leads to an unreasonable amount of
    complexity in _apply_alternatives().
    
    Introduce apply_alt_calls(), and an .alt_call_sites section which simply
    tracks the source address (relative, to save on space).  That's literally all
    that is needed in order to devirtualise the function pointers.
    
    apply_alt_calls() is mostly as per _apply_alternatives(), except the size is
    known to be 6 bytes.  Drop the logic for JMP *RIPREL, as there's no support
    for tailcall optimisations, nor a feasbile plan on how to introduce support.
    Pad with a redundant prefix to avoid needing a separate NOP on the end.
    
    Wire it up in nmi_apply_alternatives(), although the section is empty at this
    juncture so nothing happens in practice.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/alternative.c                  | 94 +++++++++++++++++++++++++++++
 xen/arch/x86/include/asm/alternative-call.h |  7 +++
 xen/arch/x86/xen.lds.S                      |  4 ++
 3 files changed, 105 insertions(+)

diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
index 4b9f8d8601..f6594e21a1 100644
--- a/xen/arch/x86/alternative.c
+++ b/xen/arch/x86/alternative.c
@@ -388,6 +388,92 @@ static int init_or_livepatch _apply_alternatives(struct alt_instr *start,
     return 0;
 }
 
+/*
+ * At build time, alternative calls are emitted as:
+ *   ff 15 xx xx xx xx  =>  call *disp32(%rip)
+ *
+ * During boot, we devirtualise by editing to:
+ *   2e e8 xx xx xx xx  =>  cs call disp32
+ *
+ * or, if the function pointer is still NULL, poison to:
+ *   0f 0b 0f 0b 0f 0b  =>  ud2a (x3)
+ */
+static int init_or_livepatch apply_alt_calls(
+    const struct alt_call *start, const struct alt_call *end)
+{
+    const struct alt_call *a;
+
+    for ( a = start; a < end; a++ )
+    {
+        const uint8_t *dest;
+        uint8_t buf[6], *orig = ALT_CALL_PTR(a);
+        long disp;
+
+        /* It's likely that this won't change, but check just to be safe. */
+        BUILD_BUG_ON(ALT_CALL_LEN(a) != 6);
+
+        if ( orig[0] != 0xff || orig[1] != 0x15 )
+        {
+            printk(XENLOG_ERR
+                   "Altcall for %ps [%6ph] not CALL *RIPREL\n",
+                   orig, orig);
+            return -EINVAL;
+        }
+
+        disp = *(int32_t *)(orig + 2);
+        dest = *(const void **)(orig + 6 + disp);
+
+        if ( dest )
+        {
+            /*
+             * When building for CET-IBT, all function pointer targets
+             * should have an endbr64 instruction.
+             *
+             * If this is not the case, leave a warning because
+             * something is probably wrong with the build.  A CET-IBT
+             * enabled system might have exploded already.
+             *
+             * Otherwise, skip the endbr64 instruction.  This is a
+             * marginal perf improvement which saves on instruction
+             * decode bandwidth.
+             */
+            if ( IS_ENABLED(CONFIG_XEN_IBT) )
+            {
+                if ( is_endbr64(dest) )
+                    dest += ENDBR64_LEN;
+                else
+                    printk(XENLOG_WARNING
+                           "Altcall %ps dest %ps has no endbr64\n",
+                           orig, dest);
+            }
+
+            disp = dest - (orig + 6);
+            ASSERT(disp == (int32_t)disp);
+
+            buf[0] = 0x2e;
+            buf[1] = 0xe8;
+            *(int32_t *)(buf + 2) = disp;
+        }
+        else
+        {
+            /*
+             * The function pointer is still NULL.  Seal the whole call, as
+             * it's not used.
+             */
+            buf[0] = 0x0f;
+            buf[1] = 0x0b;
+            buf[2] = 0x0f;
+            buf[3] = 0x0b;
+            buf[4] = 0x0f;
+            buf[5] = 0x0b;
+        }
+
+        text_poke(orig, buf, sizeof(buf));
+    }
+
+    return 0;
+}
+
 #ifdef CONFIG_LIVEPATCH
 int apply_alternatives(struct alt_instr *start, struct alt_instr *end)
 {
@@ -401,6 +487,7 @@ static unsigned int __initdata alt_todo;
 static unsigned int __initdata alt_done;
 
 extern struct alt_instr __alt_instructions[], __alt_instructions_end[];
+extern struct alt_call __alt_call_sites_start[], __alt_call_sites_end[];
 
 /*
  * At boot time, we patch alternatives in NMI context.  This means that the
@@ -435,6 +522,13 @@ static int __init cf_check nmi_apply_alternatives(
         if ( rc )
             panic("Unable to apply alternatives: %d\n", rc);
 
+        if ( alt_todo & ALT_CALLS )
+        {
+            rc = apply_alt_calls(__alt_call_sites_start, __alt_call_sites_end);
+            if ( rc )
+                panic("Unable to apply alternative calls: %d\n", rc);
+        }
+
         /*
          * Reinstate perms on .text to be RX.  This also cleans out the dirty
          * bits, which matters when CET Shstk is active.
diff --git a/xen/arch/x86/include/asm/alternative-call.h b/xen/arch/x86/include/asm/alternative-call.h
index 828ea32a96..49a04a7cc4 100644
--- a/xen/arch/x86/include/asm/alternative-call.h
+++ b/xen/arch/x86/include/asm/alternative-call.h
@@ -4,6 +4,13 @@
 
 #include <asm/alternative.h>
 
+/* Simply the relative position of the source call. */
+struct alt_call {
+    int32_t offset;
+};
+#define ALT_CALL_PTR(a) ((void *)&(a)->offset + (a)->offset)
+#define ALT_CALL_LEN(a) (6)
+
 /*
  * Machinery to allow converting indirect to direct calls, when the called
  * function is determined once at boot and later never changed.
diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index d4dd6434c4..53bafc98a5 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -260,6 +260,10 @@ SECTIONS
         __alt_instructions = .;
         *(.altinstructions)
         __alt_instructions_end = .;
+        . = ALIGN(4);
+        __alt_call_sites_start = .;
+        *(.alt_call_sites)
+        __alt_call_sites_end = .;
 
        LOCK_PROFILE_DATA
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 23 18:44:53 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Apr 2025 18:44:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.965167.1355797 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7f5Z-0004Sb-OC; Wed, 23 Apr 2025 18:44:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 965167.1355797; Wed, 23 Apr 2025 18:44:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7f5Z-0004ST-LS; Wed, 23 Apr 2025 18:44:53 +0000
Received: by outflank-mailman (input) for mailman id 965167;
 Wed, 23 Apr 2025 18: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 1u7f5Y-0004SJ-Vg
 for xen-changelog@lists.xenproject.org; Wed, 23 Apr 2025 18: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 1u7f5Y-00HEdA-34
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 18:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7f5Y-001wVm-2x
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 18: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=EwL8X6d7LqAmgWLnyWkENhjPZFJFEKKOpww0KUnOVEE=; b=ax1ISVY6dXHOG9YXYfSg1Gf6j+
	yDCT7m2KnbFceLDpr3yvPa1keTMrX+YcZvHtsiilaH01hSn2vRLlGwqkXrOYaXW41pI0YCrR8emxZ
	i6Bq4KrCo2LWuIFuKvfkTBnv01CsbBrbnt+gSiVdjN0VD+LevxeL8r+o3J24gmhC/ncA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/livepatch: Support new altcall scheme
Message-Id: <E1u7f5Y-001wVm-2x@xenbits.xenproject.org>
Date: Wed, 23 Apr 2025 18:44:52 +0000

commit d2fd5f0fcd5d65f357f40672a9db213076ba09a0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sun Apr 20 02:32:26 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 23 19:37:57 2025 +0100

    xen/livepatch: Support new altcall scheme
    
    The new altcall scheme uses an .alt_call_sites section.  Wire this up in very
    much the same way as the .altinstructions section, although there is less
    sanity checking necessary.
    
    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/alternative.c         |  6 ++++
 xen/common/livepatch.c             | 58 ++++++++++++++++++++++++++++++++++++++
 xen/include/xen/alternative-call.h |  8 ++++--
 3 files changed, 70 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
index f6594e21a1..22af224f08 100644
--- a/xen/arch/x86/alternative.c
+++ b/xen/arch/x86/alternative.c
@@ -479,6 +479,12 @@ int apply_alternatives(struct alt_instr *start, struct alt_instr *end)
 {
     return _apply_alternatives(start, end, true);
 }
+
+int livepatch_apply_alt_calls(const struct alt_call *start,
+                              const struct alt_call *end)
+{
+    return apply_alt_calls(start, end);
+}
 #endif
 
 #define ALT_INSNS (1U << 0)
diff --git a/xen/common/livepatch.c b/xen/common/livepatch.c
index 6ce77bf021..be9b7e3675 100644
--- a/xen/common/livepatch.c
+++ b/xen/common/livepatch.c
@@ -905,6 +905,64 @@ static int prepare_payload(struct payload *payload,
 #endif
     }
 
+    sec = livepatch_elf_sec_by_name(elf, ".alt_call_sites");
+    if ( sec )
+    {
+#ifdef CONFIG_ALTERNATIVE_CALL
+        const struct alt_call *a, *start, *end;
+
+        if ( !section_ok(elf, sec, sizeof(*a)) )
+            return -EINVAL;
+
+        /* Tolerate an empty .alt_call_sites section... */
+        if ( sec->sec->sh_size == 0 )
+            goto alt_call_done;
+
+        /* ... but otherwise, there needs to be something to alter... */
+        if ( payload->text_size == 0 )
+        {
+            printk(XENLOG_ERR LIVEPATCH "%s Alternative calls provided, but no .text\n",
+                   elf->name);
+            return -EINVAL;
+        }
+
+        start = sec->addr;
+        end = sec->addr + sec->sec->sh_size;
+
+        for ( a = start; a < end; a++ )
+        {
+            const void *orig = ALT_CALL_PTR(a);
+            size_t len = ALT_CALL_LEN(a);
+
+            /* orig must be fully within .text. */
+            if ( orig       < payload->text_addr ||
+                 len        > payload->text_size ||
+                 orig + len > payload->text_addr + payload->text_size )
+            {
+                printk(XENLOG_ERR LIVEPATCH
+                       "%s: Alternative call %p+%#zx outside payload text %p+%#zx\n",
+                       elf->name, orig, len,
+                       payload->text_addr, payload->text_size);
+                return -EINVAL;
+            }
+        }
+
+        rc = livepatch_apply_alt_calls(start, end);
+        if ( rc )
+        {
+            printk(XENLOG_ERR LIVEPATCH "%s: Applying alternative calls failed: %d\n",
+                   elf->name, rc);
+            return rc;
+        }
+
+    alt_call_done:;
+#else /* CONFIG_ALTERNATIVE_CALL */
+        printk(XENLOG_ERR LIVEPATCH "%s: Alternative calls not supported\n",
+               elf->name);
+        return -EOPNOTSUPP;
+#endif /* !CONFIG_ALTERNATIVE_CALL */
+    }
+
     sec = livepatch_elf_sec_by_name(elf, ".ex_table");
     if ( sec )
     {
diff --git a/xen/include/xen/alternative-call.h b/xen/include/xen/alternative-call.h
index 3c855bfa44..767c2149bc 100644
--- a/xen/include/xen/alternative-call.h
+++ b/xen/include/xen/alternative-call.h
@@ -17,8 +17,8 @@
  *   generation requirements are to emit a function pointer call at build
  *   time, and stash enough metadata to simplify the call at boot once the
  *   implementation has been resolved.
- * - Implement boot_apply_alt_calls() to convert the function pointer calls
- *   into direct calls on boot.
+ * - Implement {boot,livepatch}_apply_alt_calls() to convert the function
+ *   pointer calls into direct calls on boot/livepatch.
  * - Select ALTERNATIVE_CALL in Kconfig.
  *
  * To use:
@@ -65,6 +65,10 @@
  */
 void boot_apply_alt_calls(void);
 
+/* As per boot_apply_alt_calls() but for a livepatch. */
+int livepatch_apply_alt_calls(const struct alt_call *start,
+                              const struct alt_call *end);
+
 #else /* CONFIG_ALTERNATIVE_CALL */
 
 #define alternative_call(func, args...)  (func)(args)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 23 18:45:03 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Apr 2025 18:45:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.965168.1355802 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7f5j-0004VX-Qs; Wed, 23 Apr 2025 18:45:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 965168.1355802; Wed, 23 Apr 2025 18:45:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7f5j-0004VP-OF; Wed, 23 Apr 2025 18:45:03 +0000
Received: by outflank-mailman (input) for mailman id 965168;
 Wed, 23 Apr 2025 18: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 1u7f5j-0004VG-45
 for xen-changelog@lists.xenproject.org; Wed, 23 Apr 2025 18: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 1u7f5j-00HEda-0I
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 18:45:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7f5j-001wtg-02
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 18: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=Otl8fiahR41o2Joxd77pOMUV4f/PSIN+beE0wpsUHbY=; b=adXquJJL2bBk2Bt69fu3y1/Aj1
	yUASm5833JMOiQRSog5XOgGjPxiezMy3/pe+GC0r64X5TRd4qjcBdl21rnc9WkKPw7Tlpt7+gdeM4
	6wls5N2LVtwNSk3qaJrqspgjh3TWTEDgtwYi+zMl1xKosBHbsn6srEUytAb8mW7qMZiI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/altcall: Switch to simpler scheme
Message-Id: <E1u7f5j-001wtg-02@xenbits.xenproject.org>
Date: Wed, 23 Apr 2025 18:45:03 +0000

commit ca29b7a70d1b0426295c62e93effdd96f10cbde7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sat Apr 19 20:44:31 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 23 19:37:57 2025 +0100

    x86/altcall: Switch to simpler scheme
    
    With all the infrastructure in place, switch from using ALTERNATIVE() to
    simply populating .alt_call_sites.
    
    Before, _apply_alternatives() would devirtualise in two passes; the first
    being opportunistic, and the second (signified by the force parameter) sealing
    any call with a still-NULL function pointer.
    
    Now, all devirtualising is performed together, at the point in time of the
    second pass previously.  The call to seal_endbr64() needs delaying until after
    apply_alt_calls() is complete, or we have a narrow window with real indirect
    branches and no ENDBR64 instructions.
    
    Under the hood, the following changes are happening:
    
      Section                Old size   New size   Change (%)
      .alt_call_sites               0    0x00730   +0x0730
      .altinstructions        0x1350a    0x11fe0   -0x152a (-7%)
      .altinstr_replacement   0x015f2    0x00e35   -0x07bd (-23%)
    
    The changes aren't quite equal because inlining is affected by the smaller
    asm() block.  Nevertheless, the metadata is held in 1/3 of the space, and
    there are no CALL instructions held in the replacement section any more.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/alternative.c                  | 9 ++-------
 xen/arch/x86/include/asm/alternative-call.h | 9 ++++++---
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
index 22af224f08..047bfc6e42 100644
--- a/xen/arch/x86/alternative.c
+++ b/xen/arch/x86/alternative.c
@@ -378,13 +378,6 @@ static int init_or_livepatch _apply_alternatives(struct alt_instr *start,
         text_poke(orig, buf, total_len);
     }
 
-    /*
-     * Clobber endbr64 instructions now that altcall has finished optimising
-     * all indirect branches to direct ones.
-     */
-    if ( force && system_state < SYS_STATE_active )
-        seal_endbr64();
-
     return 0;
 }
 
@@ -533,6 +526,8 @@ static int __init cf_check nmi_apply_alternatives(
             rc = apply_alt_calls(__alt_call_sites_start, __alt_call_sites_end);
             if ( rc )
                 panic("Unable to apply alternative calls: %d\n", rc);
+
+            seal_endbr64();
         }
 
         /*
diff --git a/xen/arch/x86/include/asm/alternative-call.h b/xen/arch/x86/include/asm/alternative-call.h
index 49a04a7cc4..bbc49a5274 100644
--- a/xen/arch/x86/include/asm/alternative-call.h
+++ b/xen/arch/x86/include/asm/alternative-call.h
@@ -2,7 +2,8 @@
 #ifndef X86_ALTERNATIVE_CALL_H
 #define X86_ALTERNATIVE_CALL_H
 
-#include <asm/alternative.h>
+#include <xen/macros.h>
+#include <xen/stdint.h>
 
 /* Simply the relative position of the source call. */
 struct alt_call {
@@ -86,8 +87,10 @@ struct alt_call {
     rettype ret_;                                                  \
     register unsigned long r10_ asm("r10");                        \
     register unsigned long r11_ asm("r11");                        \
-    asm volatile (ALTERNATIVE("call *%c[addr](%%rip)", "call .",   \
-                              X86_FEATURE_ALWAYS)                  \
+    asm volatile ("1: call *%c[addr](%%rip)\n\t"                   \
+                  ".pushsection .alt_call_sites, \"a\", @progbits\n\t"  \
+                  ".long 1b - .\n\t"                               \
+                  ".popsection"                                    \
                   : ALT_CALL ## n ## _OUT, "=a" (ret_),            \
                     "=r" (r10_), "=r" (r11_) ASM_CALL_CONSTRAINT   \
                   : [addr] "i" (&(func)), "g" (func)               \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 23 18:45:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Apr 2025 18:45:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.965169.1355806 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7f5u-0004YL-SP; Wed, 23 Apr 2025 18:45:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 965169.1355806; Wed, 23 Apr 2025 18: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 1u7f5u-0004YE-Ph; Wed, 23 Apr 2025 18:45:14 +0000
Received: by outflank-mailman (input) for mailman id 965169;
 Wed, 23 Apr 2025 18: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 1u7f5t-0004Xz-7f
 for xen-changelog@lists.xenproject.org; Wed, 23 Apr 2025 18: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 1u7f5t-00HEde-0f
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 18:45:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7f5t-001xNJ-0Z
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 18: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=/MhhoUM9ijiLMCm0HNFUcaJwlBLii0QqG29hTAbFoEU=; b=2qrbhSvbKjHrqcl7S+MAAPpfLL
	rPpuQgyxKDtNETimFScqorDcYp8ihbKxs6EmMvpMLPfo9jG/RzgmmIJm/nH1oSCeDz0DEWcfz4Noi
	vCIerlBzGuSwgwhkNjLwHhn3nGyCAoHQwUIXDYrY+AS5jUOPCQBaZbP5UiInqZXC2WDQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/alternatives: Simplify _apply_alternatives() now altcall is separate
Message-Id: <E1u7f5t-001xNJ-0Z@xenbits.xenproject.org>
Date: Wed, 23 Apr 2025 18:45:13 +0000

commit 6dc1b711ded0e477c501d4017ccb0da83d6d56a1
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sun Apr 20 01:46:57 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 23 19:37:57 2025 +0100

    x86/alternatives: Simplify _apply_alternatives() now altcall is separate
    
    With altcall handled separately, the special case in _apply_alternatives() is
    unused and can be dropped.  The force parameter (used to signify the seal
    pass) can be removed too.
    
    In turn, nmi_apply_alternatives() no longer needs to call
    _apply_alternatives() on the second pass.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/alternative.c | 94 +++++-----------------------------------------
 1 file changed, 10 insertions(+), 84 deletions(-)

diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
index 047bfc6e42..43b009888c 100644
--- a/xen/arch/x86/alternative.c
+++ b/xen/arch/x86/alternative.c
@@ -206,14 +206,9 @@ static void __init seal_endbr64(void)
  * self modifying code. This implies that asymmetric systems where
  * APs have less capabilities than the boot processor are not handled.
  * Tough. Make sure you disable such features by hand.
- *
- * The caller will set the "force" argument to true for the final
- * invocation, such that no CALLs/JMPs to NULL pointers will be left
- * around. See also the further comment below.
  */
 static int init_or_livepatch _apply_alternatives(struct alt_instr *start,
-                                                 struct alt_instr *end,
-                                                 bool force)
+                                                 struct alt_instr *end)
 {
     struct alt_instr *a, *base;
 
@@ -274,10 +269,7 @@ static int init_or_livepatch _apply_alternatives(struct alt_instr *start,
 
         /* Skip patch sites already handled during the first pass. */
         if ( a->priv )
-        {
-            ASSERT(force);
             continue;
-        }
 
         /* If there is no replacement to make, see about optimising the nops. */
         if ( !boot_cpu_has(a->cpuid) )
@@ -301,76 +293,7 @@ static int init_or_livepatch _apply_alternatives(struct alt_instr *start,
 
         /* 0xe8/0xe9 are relative branches; fix the offset. */
         if ( a->repl_len >= 5 && (*buf & 0xfe) == 0xe8 )
-        {
-            /*
-             * Detect the special case of indirect-to-direct branch patching:
-             * - replacement is a direct CALL/JMP (opcodes 0xE8/0xE9; already
-             *   checked above),
-             * - replacement's displacement is -5 (pointing back at the very
-             *   insn, which makes no sense in a real replacement insn),
-             * - original is an indirect CALL/JMP (opcodes 0xFF/2 or 0xFF/4)
-             *   using RIP-relative addressing.
-             * Some branch destinations may still be NULL when we come here
-             * the first time. Defer patching of those until the post-presmp-
-             * initcalls re-invocation (with force set to true). If at that
-             * point the branch destination is still NULL, insert "UD2; UD0"
-             * (for ease of recognition) instead of CALL/JMP.
-             */
-            if ( a->cpuid == X86_FEATURE_ALWAYS &&
-                 *(int32_t *)(buf + 1) == -5 &&
-                 a->orig_len >= 6 &&
-                 orig[0] == 0xff &&
-                 orig[1] == (*buf & 1 ? 0x25 : 0x15) )
-            {
-                long disp = *(int32_t *)(orig + 2);
-                const uint8_t *dest = *(void **)(orig + 6 + disp);
-
-                if ( dest )
-                {
-                    /*
-                     * When building for CET-IBT, all function pointer targets
-                     * should have an endbr64 instruction.
-                     *
-                     * If this is not the case, leave a warning because
-                     * something is probably wrong with the build.  A CET-IBT
-                     * enabled system might have exploded already.
-                     *
-                     * Otherwise, skip the endbr64 instruction.  This is a
-                     * marginal perf improvement which saves on instruction
-                     * decode bandwidth.
-                     */
-                    if ( IS_ENABLED(CONFIG_XEN_IBT) )
-                    {
-                        if ( is_endbr64(dest) )
-                            dest += ENDBR64_LEN;
-                        else
-                            printk(XENLOG_WARNING
-                                   "altcall %ps dest %ps has no endbr64\n",
-                                   orig, dest);
-                    }
-
-                    disp = dest - (orig + 5);
-                    ASSERT(disp == (int32_t)disp);
-                    *(int32_t *)(buf + 1) = disp;
-                }
-                else if ( force )
-                {
-                    buf[0] = 0x0f;
-                    buf[1] = 0x0b;
-                    buf[2] = 0x0f;
-                    buf[3] = 0xff;
-                    buf[4] = 0xff;
-                }
-                else
-                    continue;
-            }
-            else if ( force && system_state < SYS_STATE_active )
-                ASSERT_UNREACHABLE();
-            else
-                *(int32_t *)(buf + 1) += repl - orig;
-        }
-        else if ( force && system_state < SYS_STATE_active  )
-            ASSERT_UNREACHABLE();
+            *(int32_t *)(buf + 1) += repl - orig;
 
         a->priv = 1;
 
@@ -470,7 +393,7 @@ static int init_or_livepatch apply_alt_calls(
 #ifdef CONFIG_LIVEPATCH
 int apply_alternatives(struct alt_instr *start, struct alt_instr *end)
 {
-    return _apply_alternatives(start, end, true);
+    return _apply_alternatives(start, end);
 }
 
 int livepatch_apply_alt_calls(const struct alt_call *start,
@@ -516,10 +439,13 @@ static int __init cf_check nmi_apply_alternatives(
                                  PAGE_HYPERVISOR_RWX);
         flush_local(FLUSH_TLB_GLOBAL);
 
-        rc = _apply_alternatives(__alt_instructions, __alt_instructions_end,
-                                 alt_todo == ALT_CALLS);
-        if ( rc )
-            panic("Unable to apply alternatives: %d\n", rc);
+        if ( alt_todo & ALT_INSNS )
+        {
+            rc = _apply_alternatives(__alt_instructions,
+                                     __alt_instructions_end);
+            if ( rc )
+                panic("Unable to apply alternatives: %d\n", rc);
+        }
 
         if ( alt_todo & ALT_CALLS )
         {
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 23 22:44:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Apr 2025 22:44:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.965649.1356120 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7ip1-0007l0-Ta; Wed, 23 Apr 2025 22:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 965649.1356120; Wed, 23 Apr 2025 22: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 1u7ip1-0007ks-QA; Wed, 23 Apr 2025 22:44:03 +0000
Received: by outflank-mailman (input) for mailman id 965649;
 Wed, 23 Apr 2025 22: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 1u7ip0-0007ka-CD
 for xen-changelog@lists.xenproject.org; Wed, 23 Apr 2025 22: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 1u7ip0-00HLG3-0v
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 22:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7ip0-00BNok-0a
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 22: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=LXhCkZc7zsLKz31IQCKU2/A44gdek6Tjd8gkj3Km0D4=; b=J8+Deu0wJJHnkdL2HBPqnESFyz
	RBq8NSIS9uEWCE/r0NMMJyqerEhm1W5zs8uH84R1jg8RHcSAvS8TW2ibBK7Z21JjdRLezsADTbARk
	aTbi2Yk/spCCYAL47heGWz48aFgMOHGVl9PwOM7624cStpktK5FEYq4Lpd4WbCS6Skx0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/altcall: Split alternative-call.h out of alternative.h
Message-Id: <E1u7ip0-00BNok-0a@xenbits.xenproject.org>
Date: Wed, 23 Apr 2025 22:44:02 +0000

commit ab2da34b207cb8fb98db9d96ed6f4b09d3791ace
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sat Apr 19 21:23:56 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 23 19:37:57 2025 +0100

    x86/altcall: Split alternative-call.h out of alternative.h
    
    ... in preparation for changing how they're implemented.
    
    Update the MISRA deviations with the new path.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl |   4 +-
 xen/arch/x86/include/asm/alternative-call.h      | 269 +++++++++++++++++++++++
 xen/arch/x86/include/asm/alternative.h           | 262 ----------------------
 xen/arch/x86/include/asm/hvm/hvm.h               |   2 +-
 xen/common/core_parking.c                        |   4 +-
 xen/include/xen/alternative-call.h               |  10 +-
 6 files changed, 279 insertions(+), 272 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 2c8fb92713..9c67358d46 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -414,8 +414,8 @@ of the short-circuit evaluation strategy of such logical operators."
 -doc_end
 
 -doc_begin="Macros alternative_v?call[0-9] use sizeof and typeof to check that the argument types match the corresponding parameter ones."
--config=MC3A2.R13.6,reports+={deliberate,"any_area(any_loc(any_exp(macro(^alternative_vcall[0-9]$))&&file(^xen/arch/x86/include/asm/alternative\\.h*$)))"}
--config=B.UNEVALEFF,reports+={deliberate,"any_area(any_loc(any_exp(macro(^alternative_v?call[0-9]$))&&file(^xen/arch/x86/include/asm/alterantive\\.h*$)))"}
+-config=MC3A2.R13.6,reports+={deliberate,"any_area(any_loc(any_exp(macro(^alternative_vcall[0-9]$))&&file(^xen/arch/x86/include/asm/alternative-call\\.h*$)))"}
+-config=B.UNEVALEFF,reports+={deliberate,"any_area(any_loc(any_exp(macro(^alternative_v?call[0-9]$))&&file(^xen/arch/x86/include/asm/alterantive-call\\.h*$)))"}
 -doc_end
 
 -doc_begin="Anything, no matter how complicated, inside the BUILD_BUG_ON macro is subject to a compile-time evaluation without relevant side effects."
diff --git a/xen/arch/x86/include/asm/alternative-call.h b/xen/arch/x86/include/asm/alternative-call.h
new file mode 100644
index 0000000000..828ea32a96
--- /dev/null
+++ b/xen/arch/x86/include/asm/alternative-call.h
@@ -0,0 +1,269 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef X86_ALTERNATIVE_CALL_H
+#define X86_ALTERNATIVE_CALL_H
+
+#include <asm/alternative.h>
+
+/*
+ * Machinery to allow converting indirect to direct calls, when the called
+ * function is determined once at boot and later never changed.
+ */
+
+#define ALT_CALL_arg1 "rdi"
+#define ALT_CALL_arg2 "rsi"
+#define ALT_CALL_arg3 "rdx"
+#define ALT_CALL_arg4 "rcx"
+#define ALT_CALL_arg5 "r8"
+#define ALT_CALL_arg6 "r9"
+
+#ifdef CONFIG_CC_IS_CLANG
+/*
+ * Clang doesn't follow the psABI and doesn't truncate parameter values at the
+ * callee.  This can lead to bad code being generated when using alternative
+ * calls.
+ *
+ * Workaround it by using a temporary intermediate variable that's zeroed
+ * before being assigned the parameter value, as that forces clang to zero the
+ * register at the caller.
+ *
+ * This has been reported upstream:
+ * https://github.com/llvm/llvm-project/issues/12579
+ * https://github.com/llvm/llvm-project/issues/82598
+ */
+#define ALT_CALL_ARG(arg, n)                                            \
+    register unsigned long a ## n ## _ asm ( ALT_CALL_arg ## n ) = ({   \
+        unsigned long tmp = 0;                                          \
+        BUILD_BUG_ON(sizeof(arg) > sizeof(unsigned long));              \
+        *(typeof(arg) *)&tmp = (arg);                                   \
+        tmp;                                                            \
+    })
+#else
+#define ALT_CALL_ARG(arg, n) \
+    register typeof(arg) a ## n ## _ asm ( ALT_CALL_arg ## n ) = \
+        ({ BUILD_BUG_ON(sizeof(arg) > sizeof(void *)); (arg); })
+#endif
+#define ALT_CALL_NO_ARG(n) \
+    register unsigned long a ## n ## _ asm ( ALT_CALL_arg ## n )
+
+#define ALT_CALL_NO_ARG6 ALT_CALL_NO_ARG(6)
+#define ALT_CALL_NO_ARG5 ALT_CALL_NO_ARG(5); ALT_CALL_NO_ARG6
+#define ALT_CALL_NO_ARG4 ALT_CALL_NO_ARG(4); ALT_CALL_NO_ARG5
+#define ALT_CALL_NO_ARG3 ALT_CALL_NO_ARG(3); ALT_CALL_NO_ARG4
+#define ALT_CALL_NO_ARG2 ALT_CALL_NO_ARG(2); ALT_CALL_NO_ARG3
+#define ALT_CALL_NO_ARG1 ALT_CALL_NO_ARG(1); ALT_CALL_NO_ARG2
+
+/*
+ * Unfortunately ALT_CALL_NO_ARG() above can't use a fake initializer (to
+ * suppress "uninitialized variable" warnings), as various versions of gcc
+ * older than 8.1 fall on the nose in various ways with that (always because
+ * of some other construct elsewhere in the same function needing to use the
+ * same hard register). Otherwise the asm() below could uniformly use "+r"
+ * output constraints, making unnecessary all these ALT_CALL<n>_OUT macros.
+ */
+#define ALT_CALL0_OUT "=r" (a1_), "=r" (a2_), "=r" (a3_), \
+                      "=r" (a4_), "=r" (a5_), "=r" (a6_)
+#define ALT_CALL1_OUT "+r" (a1_), "=r" (a2_), "=r" (a3_), \
+                      "=r" (a4_), "=r" (a5_), "=r" (a6_)
+#define ALT_CALL2_OUT "+r" (a1_), "+r" (a2_), "=r" (a3_), \
+                      "=r" (a4_), "=r" (a5_), "=r" (a6_)
+#define ALT_CALL3_OUT "+r" (a1_), "+r" (a2_), "+r" (a3_), \
+                      "=r" (a4_), "=r" (a5_), "=r" (a6_)
+#define ALT_CALL4_OUT "+r" (a1_), "+r" (a2_), "+r" (a3_), \
+                      "+r" (a4_), "=r" (a5_), "=r" (a6_)
+#define ALT_CALL5_OUT "+r" (a1_), "+r" (a2_), "+r" (a3_), \
+                      "+r" (a4_), "+r" (a5_), "=r" (a6_)
+#define ALT_CALL6_OUT "+r" (a1_), "+r" (a2_), "+r" (a3_), \
+                      "+r" (a4_), "+r" (a5_), "+r" (a6_)
+
+#define alternative_callN(n, rettype, func) ({                     \
+    rettype ret_;                                                  \
+    register unsigned long r10_ asm("r10");                        \
+    register unsigned long r11_ asm("r11");                        \
+    asm volatile (ALTERNATIVE("call *%c[addr](%%rip)", "call .",   \
+                              X86_FEATURE_ALWAYS)                  \
+                  : ALT_CALL ## n ## _OUT, "=a" (ret_),            \
+                    "=r" (r10_), "=r" (r11_) ASM_CALL_CONSTRAINT   \
+                  : [addr] "i" (&(func)), "g" (func)               \
+                  : "memory" );                                    \
+    ret_;                                                          \
+})
+
+#define alternative_vcall0(func) ({             \
+    ALT_CALL_NO_ARG1;                           \
+    (void)sizeof(func());                       \
+    (void)alternative_callN(0, int, func);      \
+})
+
+#define alternative_call0(func) ({              \
+    ALT_CALL_NO_ARG1;                           \
+    alternative_callN(0, typeof(func()), func); \
+})
+
+#define alternative_vcall1(func, arg) ({           \
+    typeof(arg) v1_ = (arg);                       \
+    ALT_CALL_ARG(v1_, 1);                          \
+    ALT_CALL_NO_ARG2;                              \
+    (void)sizeof(func(arg));                       \
+    (void)alternative_callN(1, int, func);         \
+})
+
+#define alternative_call1(func, arg) ({            \
+    typeof(arg) 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);                            \
+    ALT_CALL_ARG(v1_, 1);                                 \
+    ALT_CALL_ARG(v2_, 2);                                 \
+    ALT_CALL_NO_ARG3;                                     \
+    (void)sizeof(func(arg1, arg2));                       \
+    (void)alternative_callN(2, int, func);                \
+})
+
+#define alternative_call2(func, arg1, arg2) ({            \
+    typeof(arg1) v1_ = (arg1);                            \
+    typeof(arg2) v2_ = (arg2);                            \
+    ALT_CALL_ARG(v1_, 1);                                 \
+    ALT_CALL_ARG(v2_, 2);                                 \
+    ALT_CALL_NO_ARG3;                                     \
+    alternative_callN(2, typeof(func(arg1, arg2)), func); \
+})
+
+#define alternative_vcall3(func, arg1, arg2, arg3) ({    \
+    typeof(arg1) v1_ = (arg1);                           \
+    typeof(arg2) v2_ = (arg2);                           \
+    typeof(arg3) v3_ = (arg3);                           \
+    ALT_CALL_ARG(v1_, 1);                                \
+    ALT_CALL_ARG(v2_, 2);                                \
+    ALT_CALL_ARG(v3_, 3);                                \
+    ALT_CALL_NO_ARG4;                                    \
+    (void)sizeof(func(arg1, arg2, arg3));                \
+    (void)alternative_callN(3, int, func);               \
+})
+
+#define alternative_call3(func, arg1, arg2, arg3) ({     \
+    typeof(arg1) v1_ = (arg1);                           \
+    typeof(arg2) v2_ = (arg2);                           \
+    typeof(arg3) v3_ = (arg3);                           \
+    ALT_CALL_ARG(v1_, 1);                                \
+    ALT_CALL_ARG(v2_, 2);                                \
+    ALT_CALL_ARG(v3_, 3);                                \
+    ALT_CALL_NO_ARG4;                                    \
+    alternative_callN(3, typeof(func(arg1, arg2, arg3)), \
+                      func);                             \
+})
+
+#define alternative_vcall4(func, arg1, arg2, arg3, arg4) ({ \
+    typeof(arg1) v1_ = (arg1);                              \
+    typeof(arg2) v2_ = (arg2);                              \
+    typeof(arg3) v3_ = (arg3);                              \
+    typeof(arg4) v4_ = (arg4);                              \
+    ALT_CALL_ARG(v1_, 1);                                   \
+    ALT_CALL_ARG(v2_, 2);                                   \
+    ALT_CALL_ARG(v3_, 3);                                   \
+    ALT_CALL_ARG(v4_, 4);                                   \
+    ALT_CALL_NO_ARG5;                                       \
+    (void)sizeof(func(arg1, arg2, arg3, arg4));             \
+    (void)alternative_callN(4, int, func);                  \
+})
+
+#define alternative_call4(func, arg1, arg2, arg3, arg4) ({  \
+    typeof(arg1) v1_ = (arg1);                              \
+    typeof(arg2) v2_ = (arg2);                              \
+    typeof(arg3) v3_ = (arg3);                              \
+    typeof(arg4) v4_ = (arg4);                              \
+    ALT_CALL_ARG(v1_, 1);                                   \
+    ALT_CALL_ARG(v2_, 2);                                   \
+    ALT_CALL_ARG(v3_, 3);                                   \
+    ALT_CALL_ARG(v4_, 4);                                   \
+    ALT_CALL_NO_ARG5;                                       \
+    alternative_callN(4, typeof(func(arg1, arg2,            \
+                                     arg3, arg4)),          \
+                      func);                                \
+})
+
+#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);                                    \
+    ALT_CALL_ARG(v1_, 1);                                         \
+    ALT_CALL_ARG(v2_, 2);                                         \
+    ALT_CALL_ARG(v3_, 3);                                         \
+    ALT_CALL_ARG(v4_, 4);                                         \
+    ALT_CALL_ARG(v5_, 5);                                         \
+    ALT_CALL_NO_ARG6;                                             \
+    (void)sizeof(func(arg1, arg2, arg3, arg4, arg5));             \
+    (void)alternative_callN(5, int, func);                        \
+})
+
+#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);                                    \
+    ALT_CALL_ARG(v1_, 1);                                         \
+    ALT_CALL_ARG(v2_, 2);                                         \
+    ALT_CALL_ARG(v3_, 3);                                         \
+    ALT_CALL_ARG(v4_, 4);                                         \
+    ALT_CALL_ARG(v5_, 5);                                         \
+    ALT_CALL_NO_ARG6;                                             \
+    alternative_callN(5, typeof(func(arg1, arg2, arg3,            \
+                                     arg4, arg5)),                \
+                      func);                                      \
+})
+
+#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);                                          \
+    ALT_CALL_ARG(v1_, 1);                                               \
+    ALT_CALL_ARG(v2_, 2);                                               \
+    ALT_CALL_ARG(v3_, 3);                                               \
+    ALT_CALL_ARG(v4_, 4);                                               \
+    ALT_CALL_ARG(v5_, 5);                                               \
+    ALT_CALL_ARG(v6_, 6);                                               \
+    (void)sizeof(func(arg1, arg2, arg3, arg4, arg5, arg6));             \
+    (void)alternative_callN(6, int, func);                              \
+})
+
+#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);                                          \
+    ALT_CALL_ARG(v1_, 1);                                               \
+    ALT_CALL_ARG(v2_, 2);                                               \
+    ALT_CALL_ARG(v3_, 3);                                               \
+    ALT_CALL_ARG(v4_, 4);                                               \
+    ALT_CALL_ARG(v5_, 5);                                               \
+    ALT_CALL_ARG(v6_, 6);                                               \
+    alternative_callN(6, typeof(func(arg1, arg2, arg3,                  \
+                                     arg4, arg5, arg6)),                \
+                      func);                                            \
+})
+
+#define alternative_vcall__(nr) alternative_vcall ## nr
+#define alternative_call__(nr)  alternative_call ## nr
+
+#define alternative_vcall_(nr) alternative_vcall__(nr)
+#define alternative_call_(nr)  alternative_call__(nr)
+
+#define alternative_vcall(func, args...) \
+    alternative_vcall_(count_args(args))(func, ## args)
+
+#define alternative_call(func, args...) \
+    alternative_call_(count_args(args))(func, ## args)
+
+#endif /* X86_ALTERNATIVE_CALL_H */
diff --git a/xen/arch/x86/include/asm/alternative.h b/xen/arch/x86/include/asm/alternative.h
index 7326ad9428..2d2ace97f7 100644
--- a/xen/arch/x86/include/asm/alternative.h
+++ b/xen/arch/x86/include/asm/alternative.h
@@ -161,268 +161,6 @@ extern void alternative_branches(void);
 /* Use this macro(s) if you need more than one output parameter. */
 #define ASM_OUTPUT2(a...) a
 
-/*
- * Machinery to allow converting indirect to direct calls, when the called
- * function is determined once at boot and later never changed.
- */
-
-#define ALT_CALL_arg1 "rdi"
-#define ALT_CALL_arg2 "rsi"
-#define ALT_CALL_arg3 "rdx"
-#define ALT_CALL_arg4 "rcx"
-#define ALT_CALL_arg5 "r8"
-#define ALT_CALL_arg6 "r9"
-
-#ifdef CONFIG_CC_IS_CLANG
-/*
- * Clang doesn't follow the psABI and doesn't truncate parameter values at the
- * callee.  This can lead to bad code being generated when using alternative
- * calls.
- *
- * Workaround it by using a temporary intermediate variable that's zeroed
- * before being assigned the parameter value, as that forces clang to zero the
- * register at the caller.
- *
- * This has been reported upstream:
- * https://github.com/llvm/llvm-project/issues/12579
- * https://github.com/llvm/llvm-project/issues/82598
- */
-#define ALT_CALL_ARG(arg, n)                                            \
-    register unsigned long a ## n ## _ asm ( ALT_CALL_arg ## n ) = ({   \
-        unsigned long tmp = 0;                                          \
-        BUILD_BUG_ON(sizeof(arg) > sizeof(unsigned long));              \
-        *(typeof(arg) *)&tmp = (arg);                                   \
-        tmp;                                                            \
-    })
-#else
-#define ALT_CALL_ARG(arg, n) \
-    register typeof(arg) a ## n ## _ asm ( ALT_CALL_arg ## n ) = \
-        ({ BUILD_BUG_ON(sizeof(arg) > sizeof(void *)); (arg); })
-#endif
-#define ALT_CALL_NO_ARG(n) \
-    register unsigned long a ## n ## _ asm ( ALT_CALL_arg ## n )
-
-#define ALT_CALL_NO_ARG6 ALT_CALL_NO_ARG(6)
-#define ALT_CALL_NO_ARG5 ALT_CALL_NO_ARG(5); ALT_CALL_NO_ARG6
-#define ALT_CALL_NO_ARG4 ALT_CALL_NO_ARG(4); ALT_CALL_NO_ARG5
-#define ALT_CALL_NO_ARG3 ALT_CALL_NO_ARG(3); ALT_CALL_NO_ARG4
-#define ALT_CALL_NO_ARG2 ALT_CALL_NO_ARG(2); ALT_CALL_NO_ARG3
-#define ALT_CALL_NO_ARG1 ALT_CALL_NO_ARG(1); ALT_CALL_NO_ARG2
-
-/*
- * Unfortunately ALT_CALL_NO_ARG() above can't use a fake initializer (to
- * suppress "uninitialized variable" warnings), as various versions of gcc
- * older than 8.1 fall on the nose in various ways with that (always because
- * of some other construct elsewhere in the same function needing to use the
- * same hard register). Otherwise the asm() below could uniformly use "+r"
- * output constraints, making unnecessary all these ALT_CALL<n>_OUT macros.
- */
-#define ALT_CALL0_OUT "=r" (a1_), "=r" (a2_), "=r" (a3_), \
-                      "=r" (a4_), "=r" (a5_), "=r" (a6_)
-#define ALT_CALL1_OUT "+r" (a1_), "=r" (a2_), "=r" (a3_), \
-                      "=r" (a4_), "=r" (a5_), "=r" (a6_)
-#define ALT_CALL2_OUT "+r" (a1_), "+r" (a2_), "=r" (a3_), \
-                      "=r" (a4_), "=r" (a5_), "=r" (a6_)
-#define ALT_CALL3_OUT "+r" (a1_), "+r" (a2_), "+r" (a3_), \
-                      "=r" (a4_), "=r" (a5_), "=r" (a6_)
-#define ALT_CALL4_OUT "+r" (a1_), "+r" (a2_), "+r" (a3_), \
-                      "+r" (a4_), "=r" (a5_), "=r" (a6_)
-#define ALT_CALL5_OUT "+r" (a1_), "+r" (a2_), "+r" (a3_), \
-                      "+r" (a4_), "+r" (a5_), "=r" (a6_)
-#define ALT_CALL6_OUT "+r" (a1_), "+r" (a2_), "+r" (a3_), \
-                      "+r" (a4_), "+r" (a5_), "+r" (a6_)
-
-#define alternative_callN(n, rettype, func) ({                     \
-    rettype ret_;                                                  \
-    register unsigned long r10_ asm("r10");                        \
-    register unsigned long r11_ asm("r11");                        \
-    asm volatile (ALTERNATIVE("call *%c[addr](%%rip)", "call .",   \
-                              X86_FEATURE_ALWAYS)                  \
-                  : ALT_CALL ## n ## _OUT, "=a" (ret_),            \
-                    "=r" (r10_), "=r" (r11_) ASM_CALL_CONSTRAINT   \
-                  : [addr] "i" (&(func)), "g" (func)               \
-                  : "memory" );                                    \
-    ret_;                                                          \
-})
-
-#define alternative_vcall0(func) ({             \
-    ALT_CALL_NO_ARG1;                           \
-    (void)sizeof(func());                       \
-    (void)alternative_callN(0, int, func);      \
-})
-
-#define alternative_call0(func) ({              \
-    ALT_CALL_NO_ARG1;                           \
-    alternative_callN(0, typeof(func()), func); \
-})
-
-#define alternative_vcall1(func, arg) ({           \
-    typeof(arg) v1_ = (arg);                       \
-    ALT_CALL_ARG(v1_, 1);                          \
-    ALT_CALL_NO_ARG2;                              \
-    (void)sizeof(func(arg));                       \
-    (void)alternative_callN(1, int, func);         \
-})
-
-#define alternative_call1(func, arg) ({            \
-    typeof(arg) 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);                            \
-    ALT_CALL_ARG(v1_, 1);                                 \
-    ALT_CALL_ARG(v2_, 2);                                 \
-    ALT_CALL_NO_ARG3;                                     \
-    (void)sizeof(func(arg1, arg2));                       \
-    (void)alternative_callN(2, int, func);                \
-})
-
-#define alternative_call2(func, arg1, arg2) ({            \
-    typeof(arg1) v1_ = (arg1);                            \
-    typeof(arg2) v2_ = (arg2);                            \
-    ALT_CALL_ARG(v1_, 1);                                 \
-    ALT_CALL_ARG(v2_, 2);                                 \
-    ALT_CALL_NO_ARG3;                                     \
-    alternative_callN(2, typeof(func(arg1, arg2)), func); \
-})
-
-#define alternative_vcall3(func, arg1, arg2, arg3) ({    \
-    typeof(arg1) v1_ = (arg1);                           \
-    typeof(arg2) v2_ = (arg2);                           \
-    typeof(arg3) v3_ = (arg3);                           \
-    ALT_CALL_ARG(v1_, 1);                                \
-    ALT_CALL_ARG(v2_, 2);                                \
-    ALT_CALL_ARG(v3_, 3);                                \
-    ALT_CALL_NO_ARG4;                                    \
-    (void)sizeof(func(arg1, arg2, arg3));                \
-    (void)alternative_callN(3, int, func);               \
-})
-
-#define alternative_call3(func, arg1, arg2, arg3) ({     \
-    typeof(arg1) v1_ = (arg1);                            \
-    typeof(arg2) v2_ = (arg2);                           \
-    typeof(arg3) v3_ = (arg3);                           \
-    ALT_CALL_ARG(v1_, 1);                                \
-    ALT_CALL_ARG(v2_, 2);                                \
-    ALT_CALL_ARG(v3_, 3);                                \
-    ALT_CALL_NO_ARG4;                                    \
-    alternative_callN(3, typeof(func(arg1, arg2, arg3)), \
-                      func);                             \
-})
-
-#define alternative_vcall4(func, arg1, arg2, arg3, arg4) ({ \
-    typeof(arg1) v1_ = (arg1);                              \
-    typeof(arg2) v2_ = (arg2);                              \
-    typeof(arg3) v3_ = (arg3);                              \
-    typeof(arg4) v4_ = (arg4);                              \
-    ALT_CALL_ARG(v1_, 1);                                   \
-    ALT_CALL_ARG(v2_, 2);                                   \
-    ALT_CALL_ARG(v3_, 3);                                   \
-    ALT_CALL_ARG(v4_, 4);                                   \
-    ALT_CALL_NO_ARG5;                                       \
-    (void)sizeof(func(arg1, arg2, arg3, arg4));             \
-    (void)alternative_callN(4, int, func);                  \
-})
-
-#define alternative_call4(func, arg1, arg2, arg3, arg4) ({  \
-    typeof(arg1) v1_ = (arg1);                              \
-    typeof(arg2) v2_ = (arg2);                              \
-    typeof(arg3) v3_ = (arg3);                              \
-    typeof(arg4) v4_ = (arg4);                              \
-    ALT_CALL_ARG(v1_, 1);                                   \
-    ALT_CALL_ARG(v2_, 2);                                   \
-    ALT_CALL_ARG(v3_, 3);                                   \
-    ALT_CALL_ARG(v4_, 4);                                   \
-    ALT_CALL_NO_ARG5;                                       \
-    alternative_callN(4, typeof(func(arg1, arg2,            \
-                                     arg3, arg4)),          \
-                      func);                                \
-})
-
-#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);                                    \
-    ALT_CALL_ARG(v1_, 1);                                         \
-    ALT_CALL_ARG(v2_, 2);                                         \
-    ALT_CALL_ARG(v3_, 3);                                         \
-    ALT_CALL_ARG(v4_, 4);                                         \
-    ALT_CALL_ARG(v5_, 5);                                         \
-    ALT_CALL_NO_ARG6;                                             \
-    (void)sizeof(func(arg1, arg2, arg3, arg4, arg5));             \
-    (void)alternative_callN(5, int, func);                        \
-})
-
-#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);                                    \
-    ALT_CALL_ARG(v1_, 1);                                         \
-    ALT_CALL_ARG(v2_, 2);                                         \
-    ALT_CALL_ARG(v3_, 3);                                         \
-    ALT_CALL_ARG(v4_, 4);                                         \
-    ALT_CALL_ARG(v5_, 5);                                         \
-    ALT_CALL_NO_ARG6;                                             \
-    alternative_callN(5, typeof(func(arg1, arg2, arg3,            \
-                                     arg4, arg5)),                \
-                      func);                                      \
-})
-
-#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);                                          \
-    ALT_CALL_ARG(v1_, 1);                                               \
-    ALT_CALL_ARG(v2_, 2);                                               \
-    ALT_CALL_ARG(v3_, 3);                                               \
-    ALT_CALL_ARG(v4_, 4);                                               \
-    ALT_CALL_ARG(v5_, 5);                                               \
-    ALT_CALL_ARG(v6_, 6);                                               \
-    (void)sizeof(func(arg1, arg2, arg3, arg4, arg5, arg6));             \
-    (void)alternative_callN(6, int, func);                              \
-})
-
-#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);                                          \
-    ALT_CALL_ARG(v1_, 1);                                               \
-    ALT_CALL_ARG(v2_, 2);                                               \
-    ALT_CALL_ARG(v3_, 3);                                               \
-    ALT_CALL_ARG(v4_, 4);                                               \
-    ALT_CALL_ARG(v5_, 5);                                               \
-    ALT_CALL_ARG(v6_, 6);                                               \
-    alternative_callN(6, typeof(func(arg1, arg2, arg3,                  \
-                                     arg4, arg5, arg6)),                \
-                      func);                                            \
-})
-
-#define alternative_vcall__(nr) alternative_vcall ## nr
-#define alternative_call__(nr)  alternative_call ## nr
-
-#define alternative_vcall_(nr) alternative_vcall__(nr)
-#define alternative_call_(nr)  alternative_call__(nr)
-
-#define alternative_vcall(func, args...) \
-    alternative_vcall_(count_args(args))(func, ## args)
-
-#define alternative_call(func, args...) \
-    alternative_call_(count_args(args))(func, ## args)
-
 #endif /*  !__ASSEMBLY__  */
 
 #endif /* __X86_ALTERNATIVE_H__ */
diff --git a/xen/arch/x86/include/asm/hvm/hvm.h b/xen/arch/x86/include/asm/hvm/hvm.h
index 963e820113..bf8bc2e100 100644
--- a/xen/arch/x86/include/asm/hvm/hvm.h
+++ b/xen/arch/x86/include/asm/hvm/hvm.h
@@ -9,9 +9,9 @@
 #ifndef __ASM_X86_HVM_HVM_H__
 #define __ASM_X86_HVM_HVM_H__
 
+#include <xen/alternative-call.h>
 #include <xen/mm.h>
 
-#include <asm/alternative.h>
 #include <asm/asm_defns.h>
 #include <asm/current.h>
 #include <asm/x86_emulate.h>
diff --git a/xen/common/core_parking.c b/xen/common/core_parking.c
index a970ffeab8..7d6a18cdcf 100644
--- a/xen/common/core_parking.c
+++ b/xen/common/core_parking.c
@@ -15,10 +15,10 @@
  *  General Public License for more details.
  */
 
-#include <xen/types.h>
+#include <xen/alternative-call.h>
 #include <xen/cpu.h>
-#include <xen/init.h>
 #include <xen/cpumask.h>
+#include <xen/init.h>
 #include <xen/param.h>
 
 #include <asm/smp.h>
diff --git a/xen/include/xen/alternative-call.h b/xen/include/xen/alternative-call.h
index 62672b7324..39339c3f0f 100644
--- a/xen/include/xen/alternative-call.h
+++ b/xen/include/xen/alternative-call.h
@@ -13,10 +13,10 @@
  *
  * For architectures to support:
  *
- * - Implement alternative_{,v}call() in asm/alternative.h.  Code generation
- *   requirements are to emit a function pointer call at build time, and stash
- *   enough metadata to simplify the call at boot once the implementation has
- *   been resolved.
+ * - Implement alternative_{,v}call() in asm/alternative-call.h.  Code
+ *   generation requirements are to emit a function pointer call at build
+ *   time, and stash enough metadata to simplify the call at boot once the
+ *   implementation has been resolved.
  * - Select ALTERNATIVE_CALL in Kconfig.
  *
  * To use:
@@ -48,7 +48,7 @@
 
 #ifdef CONFIG_ALTERNATIVE_CALL
 
-#include <asm/alternative.h>
+#include <asm/alternative-call.h>
 
 #ifdef CONFIG_LIVEPATCH
 /* Must keep for livepatches to resolve alternative calls. */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 23 22:44:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Apr 2025 22:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.965653.1356124 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7ipC-0007pB-06; Wed, 23 Apr 2025 22:44:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 965653.1356124; Wed, 23 Apr 2025 22: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 1u7ipB-0007p3-Tn; Wed, 23 Apr 2025 22:44:13 +0000
Received: by outflank-mailman (input) for mailman id 965653;
 Wed, 23 Apr 2025 22: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 1u7ipA-0007or-Ep
 for xen-changelog@lists.xenproject.org; Wed, 23 Apr 2025 22: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 1u7ipA-00HLG7-1N
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 22:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7ipA-00BNuK-17
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 22: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=hFVgefOecbOhEXt6Kw2DXQYMNpeysLGvzPrduciN7d8=; b=47Hf3BTCOD0V3F49+s/m+4aJRV
	MFiHBN4d0TnFW4e+jpOr9m7bx6dpLRKTGtKVBJzAc2yMqlE3rpEaTeP2T+onbehXF25Gpz7zuFbfp
	wKv6EJuSleGm2d9TvwuWLcZaK8cVHp3t767ZQ10J2R+EU+nd7ySD5jtGIyvafKUNGr/M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/altcall: Rename alternative_branches() to boot_apply_alt_calls()
Message-Id: <E1u7ipA-00BNuK-17@xenbits.xenproject.org>
Date: Wed, 23 Apr 2025 22:44:12 +0000

commit 4ab3d34da3d88cff102a76c2ba928cff1ce8ea75
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sat Apr 19 22:38:23 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 23 19:37:57 2025 +0100

    x86/altcall: Rename alternative_branches() to boot_apply_alt_calls()
    
    The alternatives APIs are not great; rename alternative_branches() to be more
    precise.  Centralise the declaration in xen/alternative-call.h, in the
    expectation that x86 won't be the only user in the long term.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/alternative.c             |  2 +-
 xen/arch/x86/include/asm/alternative.h |  1 -
 xen/arch/x86/setup.c                   |  3 ++-
 xen/include/xen/alternative-call.h     | 10 +++++++++-
 4 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
index 1ba35cb9ed..d1a3b7ea7c 100644
--- a/xen/arch/x86/alternative.c
+++ b/xen/arch/x86/alternative.c
@@ -493,7 +493,7 @@ void __init alternative_instructions(void)
     _alternative_instructions(false);
 }
 
-void __init alternative_branches(void)
+void __init boot_apply_alt_calls(void)
 {
     local_irq_disable();
     _alternative_instructions(true);
diff --git a/xen/arch/x86/include/asm/alternative.h b/xen/arch/x86/include/asm/alternative.h
index 2d2ace97f7..29c3d724b0 100644
--- a/xen/arch/x86/include/asm/alternative.h
+++ b/xen/arch/x86/include/asm/alternative.h
@@ -29,7 +29,6 @@ extern void add_nops(void *insns, unsigned int len);
 /* Similar to alternative_instructions except it can be run with IRQs enabled. */
 extern int apply_alternatives(struct alt_instr *start, struct alt_instr *end);
 extern void alternative_instructions(void);
-extern void alternative_branches(void);
 
 #define alt_orig_len       "(.LXEN%=_orig_e - .LXEN%=_orig_s)"
 #define alt_pad_len        "(.LXEN%=_orig_p - .LXEN%=_orig_e)"
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index cf1ea040dd..2518954124 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1,4 +1,5 @@
 #include <xen/acpi.h>
+#include <xen/alternative-call.h>
 #include <xen/bitops.h>
 #include <xen/console.h>
 #include <xen/cpu.h>
@@ -2082,7 +2083,7 @@ void asmlinkage __init noreturn __start_xen(void)
 
     do_presmp_initcalls();
 
-    alternative_branches();
+    boot_apply_alt_calls();
 
     /*
      * NB: when running as a PV shim VCPUOP_up/down is wired to the shim
diff --git a/xen/include/xen/alternative-call.h b/xen/include/xen/alternative-call.h
index 39339c3f0f..3c855bfa44 100644
--- a/xen/include/xen/alternative-call.h
+++ b/xen/include/xen/alternative-call.h
@@ -17,6 +17,8 @@
  *   generation requirements are to emit a function pointer call at build
  *   time, and stash enough metadata to simplify the call at boot once the
  *   implementation has been resolved.
+ * - Implement boot_apply_alt_calls() to convert the function pointer calls
+ *   into direct calls on boot.
  * - Select ALTERNATIVE_CALL in Kconfig.
  *
  * To use:
@@ -57,7 +59,13 @@
 # define __alt_call_maybe_initdata __initdata
 #endif
 
-#else
+/*
+ * Devirtualise the alternative_{,v}call()'s on boot.  Convert still-NULL
+ * function pointers into traps.
+ */
+void boot_apply_alt_calls(void);
+
+#else /* CONFIG_ALTERNATIVE_CALL */
 
 #define alternative_call(func, args...)  (func)(args)
 #define alternative_vcall(func, args...) (func)(args)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 23 22:44:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Apr 2025 22:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.965655.1356128 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7ipM-0007rx-1X; Wed, 23 Apr 2025 22:44:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 965655.1356128; Wed, 23 Apr 2025 22: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 1u7ipL-0007rp-VC; Wed, 23 Apr 2025 22:44:23 +0000
Received: by outflank-mailman (input) for mailman id 965655;
 Wed, 23 Apr 2025 22: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 1u7ipK-0007rY-J8
 for xen-changelog@lists.xenproject.org; Wed, 23 Apr 2025 22: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 1u7ipK-00HLGB-1e
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 22:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7ipK-00BO29-1X
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 22: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=U6GsP2XSPEBSTn5NKWba4xa8tlF1wTC4BfGVEVPhL6w=; b=dYF/zCOnRJKA42BfA/ADxsTZcD
	picYb6WnrDevtXB4noLdOk49SMwmvBpV5geNuK1LuIevxjNagJcwBEbyFYhpC0pZfOYL81Kiv6Sx9
	xc8x7Cl4qNc7l7r/TXdbJM/7IxLvsfaATqfM68aB/ZI9Fxa2o6Z++0DKZmTMBR8nMgYA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/alternatives: Rework information passing into nmi_apply_alternatives()
Message-Id: <E1u7ipK-00BO29-1X@xenbits.xenproject.org>
Date: Wed, 23 Apr 2025 22:44:22 +0000

commit d4ef51d840f4329782cd204b0899be27e8592693
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sun Apr 20 00:44:17 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 23 19:37:57 2025 +0100

    x86/alternatives: Rework information passing into nmi_apply_alternatives()
    
    nmi_apply_alternatives() is soon going to need to dispatch to multiple
    functions, and a force parameter is not a good way of passing information.
    
    Introduce ALT_INSNS and ALT_CALLS to pass in at the top level to select the
    operation(s) desired.  They represent what will happen when we've separated
    the altcalls out of the general alternative instructions infrastructure,
    although in the short term we still need to synthesise the force parameter for
    _apply_alternatives().
    
    Move two externs to reduce their scope a little.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/alternative.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
index d1a3b7ea7c..9aa591b364 100644
--- a/xen/arch/x86/alternative.c
+++ b/xen/arch/x86/alternative.c
@@ -19,8 +19,6 @@
 
 #define MAX_PATCH_LEN (255-1)
 
-extern struct alt_instr __alt_instructions[], __alt_instructions_end[];
-
 #ifdef K8_NOP1
 static const unsigned char k8nops[] init_or_livepatch_const = {
     K8_NOP1,
@@ -387,9 +385,13 @@ int apply_alternatives(struct alt_instr *start, struct alt_instr *end)
 }
 #endif
 
+#define ALT_INSNS (1U << 0)
+#define ALT_CALLS (1U << 1)
 static unsigned int __initdata alt_todo;
 static unsigned int __initdata alt_done;
 
+extern struct alt_instr __alt_instructions[], __alt_instructions_end[];
+
 /*
  * At boot time, we patch alternatives in NMI context.  This means that the
  * active NMI-shadow will defer any further NMIs, removing the slim race
@@ -419,7 +421,7 @@ static int __init cf_check nmi_apply_alternatives(
         flush_local(FLUSH_TLB_GLOBAL);
 
         rc = _apply_alternatives(__alt_instructions, __alt_instructions_end,
-                                 alt_done);
+                                 alt_todo == ALT_CALLS);
         if ( rc )
             panic("Unable to apply alternatives: %d\n", rc);
 
@@ -442,7 +444,7 @@ static int __init cf_check nmi_apply_alternatives(
  * This routine is called with local interrupt disabled and used during
  * bootup.
  */
-static void __init _alternative_instructions(bool force)
+static void __init _alternative_instructions(unsigned int what)
 {
     unsigned int i;
     nmi_callback_t *saved_nmi_callback;
@@ -460,7 +462,7 @@ static void __init _alternative_instructions(bool force)
     ASSERT(!local_irq_is_enabled());
 
     /* Set what operation to perform /before/ setting the callback. */
-    alt_todo = 1u << force;
+    alt_todo = what;
     barrier();
 
     /*
@@ -490,12 +492,12 @@ static void __init _alternative_instructions(bool force)
 void __init alternative_instructions(void)
 {
     arch_init_ideal_nops();
-    _alternative_instructions(false);
+    _alternative_instructions(ALT_INSNS);
 }
 
 void __init boot_apply_alt_calls(void)
 {
     local_irq_disable();
-    _alternative_instructions(true);
+    _alternative_instructions(ALT_CALLS);
     local_irq_enable();
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 23 22:44:34 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Apr 2025 22:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.965656.1356132 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7ipW-0007uj-2r; Wed, 23 Apr 2025 22:44:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 965656.1356132; Wed, 23 Apr 2025 22: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 1u7ipW-0007ub-0K; Wed, 23 Apr 2025 22:44:34 +0000
Received: by outflank-mailman (input) for mailman id 965656;
 Wed, 23 Apr 2025 22: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 1u7ipU-0007uC-Lq
 for xen-changelog@lists.xenproject.org; Wed, 23 Apr 2025 22: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 1u7ipU-00HLGI-26
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 22:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7ipU-00BO7A-1o
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 22: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=SMuf9WEEAnveFOzKHRaNAkgIZEfJzhMxWIJsSONlKUU=; b=G2I/WqUZEDgEEsLe614hIDy4MS
	h/Y+cHF+GqKAbgH3lvfGwM7UoCboxkY3reesuG040qZ4YEMXSUTqK66eiidKYqF2DSLZdMCwabayG
	K63Ooie6S14uTh1a+Ow/53NM5jErgxh+D+aa6VVZLRDwKQzF/bz2OTs0CGTS4sFJcefY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/alternatives: Factor seal_endbr64() out of _apply_alternatives()
Message-Id: <E1u7ipU-00BO7A-1o@xenbits.xenproject.org>
Date: Wed, 23 Apr 2025 22:44:32 +0000

commit 9815ce18f29ffb7009480c4f60cb5b2d2056cf72
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sun Apr 20 01:19:47 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 23 19:37:57 2025 +0100

    x86/alternatives: Factor seal_endbr64() out of _apply_alternatives()
    
    We are going to need to reposition the call in a change with several moving
    parts.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/alternative.c | 70 ++++++++++++++++++++++++++--------------------
 1 file changed, 40 insertions(+), 30 deletions(-)

diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
index 9aa591b364..4b9f8d8601 100644
--- a/xen/arch/x86/alternative.c
+++ b/xen/arch/x86/alternative.c
@@ -162,6 +162,44 @@ text_poke(void *addr, const void *opcode, size_t len)
 extern void *const __initdata_cf_clobber_start[];
 extern void *const __initdata_cf_clobber_end[];
 
+/*
+ * In CET-IBT enabled builds, clobber endbr64 instructions after altcall has
+ * finished optimising all indirect branches to direct ones.
+ */
+static void __init seal_endbr64(void)
+{
+    void *const *val;
+    unsigned int clobbered = 0;
+
+    if ( !cpu_has_xen_ibt )
+        return;
+
+    /*
+     * This is some minor structure (ab)use.  We walk the entire contents
+     * of .init.{ro,}data.cf_clobber as if it were an array of pointers.
+     *
+     * If the pointer points into .text, and at an endbr64 instruction,
+     * nop out the endbr64.  This causes the pointer to no longer be a
+     * legal indirect branch target under CET-IBT.  This is a
+     * defence-in-depth measure, to reduce the options available to an
+     * adversary who has managed to hijack a function pointer.
+     */
+    for ( val = __initdata_cf_clobber_start;
+          val < __initdata_cf_clobber_end;
+          val++ )
+    {
+        void *ptr = *val;
+
+        if ( !is_kernel_text(ptr) || !is_endbr64(ptr) )
+            continue;
+
+        place_endbr64_poison(ptr);
+        clobbered++;
+    }
+
+    printk("altcall: Optimised away %u endbr64 instructions\n", clobbered);
+}
+
 /*
  * Replace instructions with better alternatives for this CPU type.
  * This runs before SMP is initialized to avoid SMP problems with
@@ -344,36 +382,8 @@ static int init_or_livepatch _apply_alternatives(struct alt_instr *start,
      * Clobber endbr64 instructions now that altcall has finished optimising
      * all indirect branches to direct ones.
      */
-    if ( force && cpu_has_xen_ibt && system_state < SYS_STATE_active )
-    {
-        void *const *val;
-        unsigned int clobbered = 0;
-
-        /*
-         * This is some minor structure (ab)use.  We walk the entire contents
-         * of .init.{ro,}data.cf_clobber as if it were an array of pointers.
-         *
-         * If the pointer points into .text, and at an endbr64 instruction,
-         * nop out the endbr64.  This causes the pointer to no longer be a
-         * legal indirect branch target under CET-IBT.  This is a
-         * defence-in-depth measure, to reduce the options available to an
-         * adversary who has managed to hijack a function pointer.
-         */
-        for ( val = __initdata_cf_clobber_start;
-              val < __initdata_cf_clobber_end;
-              val++ )
-        {
-            void *ptr = *val;
-
-            if ( !is_kernel_text(ptr) || !is_endbr64(ptr) )
-                continue;
-
-            place_endbr64_poison(ptr);
-            clobbered++;
-        }
-
-        printk("altcall: Optimised away %u endbr64 instructions\n", clobbered);
-    }
+    if ( force && system_state < SYS_STATE_active )
+        seal_endbr64();
 
     return 0;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 23 22:44:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Apr 2025 22:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.965657.1356136 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7ipg-0007xV-4I; Wed, 23 Apr 2025 22:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 965657.1356136; Wed, 23 Apr 2025 22: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 1u7ipg-0007xN-1h; Wed, 23 Apr 2025 22:44:44 +0000
Received: by outflank-mailman (input) for mailman id 965657;
 Wed, 23 Apr 2025 22: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 1u7ipe-0007x4-Oq
 for xen-changelog@lists.xenproject.org; Wed, 23 Apr 2025 22: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 1u7ipe-00HLGe-2N
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 22:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7ipe-00BOEa-2H
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 22: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=fL2rG/FU6w138hqudk3xmoN+zOLVamMFx5uleIqO5CQ=; b=S7s9IzwcreOpQ0yC+Ga054gCAi
	PaZcDjK56Q6cMSgdjjk/Gbb1E12TgeYnYgGKOLHcu3FTD8Q+LB4nthXQ9yCSabr0kePNYiC2/zT6J
	9gGa1IgeujWAXfkwf3inw0zhA6NTW9pEq3B0tygtJS2BVA8fsEbv+Xbvmx6M1IxIgF3w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/altcall: Introduce new simpler scheme
Message-Id: <E1u7ipe-00BOEa-2H@xenbits.xenproject.org>
Date: Wed, 23 Apr 2025 22:44:42 +0000

commit ac02ee9c82d115a824629edb10c14f260108ef56
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sat Apr 19 23:05:52 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 23 19:37:57 2025 +0100

    x86/altcall: Introduce new simpler scheme
    
    Encoding altcalls as regular alternatives leads to an unreasonable amount of
    complexity in _apply_alternatives().
    
    Introduce apply_alt_calls(), and an .alt_call_sites section which simply
    tracks the source address (relative, to save on space).  That's literally all
    that is needed in order to devirtualise the function pointers.
    
    apply_alt_calls() is mostly as per _apply_alternatives(), except the size is
    known to be 6 bytes.  Drop the logic for JMP *RIPREL, as there's no support
    for tailcall optimisations, nor a feasbile plan on how to introduce support.
    Pad with a redundant prefix to avoid needing a separate NOP on the end.
    
    Wire it up in nmi_apply_alternatives(), although the section is empty at this
    juncture so nothing happens in practice.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/alternative.c                  | 94 +++++++++++++++++++++++++++++
 xen/arch/x86/include/asm/alternative-call.h |  7 +++
 xen/arch/x86/xen.lds.S                      |  4 ++
 3 files changed, 105 insertions(+)

diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
index 4b9f8d8601..f6594e21a1 100644
--- a/xen/arch/x86/alternative.c
+++ b/xen/arch/x86/alternative.c
@@ -388,6 +388,92 @@ static int init_or_livepatch _apply_alternatives(struct alt_instr *start,
     return 0;
 }
 
+/*
+ * At build time, alternative calls are emitted as:
+ *   ff 15 xx xx xx xx  =>  call *disp32(%rip)
+ *
+ * During boot, we devirtualise by editing to:
+ *   2e e8 xx xx xx xx  =>  cs call disp32
+ *
+ * or, if the function pointer is still NULL, poison to:
+ *   0f 0b 0f 0b 0f 0b  =>  ud2a (x3)
+ */
+static int init_or_livepatch apply_alt_calls(
+    const struct alt_call *start, const struct alt_call *end)
+{
+    const struct alt_call *a;
+
+    for ( a = start; a < end; a++ )
+    {
+        const uint8_t *dest;
+        uint8_t buf[6], *orig = ALT_CALL_PTR(a);
+        long disp;
+
+        /* It's likely that this won't change, but check just to be safe. */
+        BUILD_BUG_ON(ALT_CALL_LEN(a) != 6);
+
+        if ( orig[0] != 0xff || orig[1] != 0x15 )
+        {
+            printk(XENLOG_ERR
+                   "Altcall for %ps [%6ph] not CALL *RIPREL\n",
+                   orig, orig);
+            return -EINVAL;
+        }
+
+        disp = *(int32_t *)(orig + 2);
+        dest = *(const void **)(orig + 6 + disp);
+
+        if ( dest )
+        {
+            /*
+             * When building for CET-IBT, all function pointer targets
+             * should have an endbr64 instruction.
+             *
+             * If this is not the case, leave a warning because
+             * something is probably wrong with the build.  A CET-IBT
+             * enabled system might have exploded already.
+             *
+             * Otherwise, skip the endbr64 instruction.  This is a
+             * marginal perf improvement which saves on instruction
+             * decode bandwidth.
+             */
+            if ( IS_ENABLED(CONFIG_XEN_IBT) )
+            {
+                if ( is_endbr64(dest) )
+                    dest += ENDBR64_LEN;
+                else
+                    printk(XENLOG_WARNING
+                           "Altcall %ps dest %ps has no endbr64\n",
+                           orig, dest);
+            }
+
+            disp = dest - (orig + 6);
+            ASSERT(disp == (int32_t)disp);
+
+            buf[0] = 0x2e;
+            buf[1] = 0xe8;
+            *(int32_t *)(buf + 2) = disp;
+        }
+        else
+        {
+            /*
+             * The function pointer is still NULL.  Seal the whole call, as
+             * it's not used.
+             */
+            buf[0] = 0x0f;
+            buf[1] = 0x0b;
+            buf[2] = 0x0f;
+            buf[3] = 0x0b;
+            buf[4] = 0x0f;
+            buf[5] = 0x0b;
+        }
+
+        text_poke(orig, buf, sizeof(buf));
+    }
+
+    return 0;
+}
+
 #ifdef CONFIG_LIVEPATCH
 int apply_alternatives(struct alt_instr *start, struct alt_instr *end)
 {
@@ -401,6 +487,7 @@ static unsigned int __initdata alt_todo;
 static unsigned int __initdata alt_done;
 
 extern struct alt_instr __alt_instructions[], __alt_instructions_end[];
+extern struct alt_call __alt_call_sites_start[], __alt_call_sites_end[];
 
 /*
  * At boot time, we patch alternatives in NMI context.  This means that the
@@ -435,6 +522,13 @@ static int __init cf_check nmi_apply_alternatives(
         if ( rc )
             panic("Unable to apply alternatives: %d\n", rc);
 
+        if ( alt_todo & ALT_CALLS )
+        {
+            rc = apply_alt_calls(__alt_call_sites_start, __alt_call_sites_end);
+            if ( rc )
+                panic("Unable to apply alternative calls: %d\n", rc);
+        }
+
         /*
          * Reinstate perms on .text to be RX.  This also cleans out the dirty
          * bits, which matters when CET Shstk is active.
diff --git a/xen/arch/x86/include/asm/alternative-call.h b/xen/arch/x86/include/asm/alternative-call.h
index 828ea32a96..49a04a7cc4 100644
--- a/xen/arch/x86/include/asm/alternative-call.h
+++ b/xen/arch/x86/include/asm/alternative-call.h
@@ -4,6 +4,13 @@
 
 #include <asm/alternative.h>
 
+/* Simply the relative position of the source call. */
+struct alt_call {
+    int32_t offset;
+};
+#define ALT_CALL_PTR(a) ((void *)&(a)->offset + (a)->offset)
+#define ALT_CALL_LEN(a) (6)
+
 /*
  * Machinery to allow converting indirect to direct calls, when the called
  * function is determined once at boot and later never changed.
diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index d4dd6434c4..53bafc98a5 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -260,6 +260,10 @@ SECTIONS
         __alt_instructions = .;
         *(.altinstructions)
         __alt_instructions_end = .;
+        . = ALIGN(4);
+        __alt_call_sites_start = .;
+        *(.alt_call_sites)
+        __alt_call_sites_end = .;
 
        LOCK_PROFILE_DATA
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 23 22:44:54 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Apr 2025 22:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.965658.1356141 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7ipq-000809-6L; Wed, 23 Apr 2025 22:44:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 965658.1356141; Wed, 23 Apr 2025 22: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 1u7ipq-000801-31; Wed, 23 Apr 2025 22:44:54 +0000
Received: by outflank-mailman (input) for mailman id 965658;
 Wed, 23 Apr 2025 22: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 1u7ipo-0007zp-Rk
 for xen-changelog@lists.xenproject.org; Wed, 23 Apr 2025 22: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 1u7ipo-00HLGk-2g
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 22:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7ipo-00BOIJ-2Z
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 22: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=YfKpOAu+KVlVg1RrEdsu44EXCbi21mFk2dNKYBjSSCE=; b=RB0kuaG2dJDXhqdzxGlGMoa85a
	y3cMGbM3yeyCX8TddU9a6+r1lCQPVRG1mxcHlOSms3EI50Iu8spDcySpkqL4+DKp6qzN/IBZUHcnq
	Q+K0B1+FirfBHuIbvRmSZLzoXOj/Ut+wPNYr95l5yvyuZfK+sIYK8w5zzYyxLbQkEUWY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/livepatch: Support new altcall scheme
Message-Id: <E1u7ipo-00BOIJ-2Z@xenbits.xenproject.org>
Date: Wed, 23 Apr 2025 22:44:52 +0000

commit d2fd5f0fcd5d65f357f40672a9db213076ba09a0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sun Apr 20 02:32:26 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 23 19:37:57 2025 +0100

    xen/livepatch: Support new altcall scheme
    
    The new altcall scheme uses an .alt_call_sites section.  Wire this up in very
    much the same way as the .altinstructions section, although there is less
    sanity checking necessary.
    
    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/alternative.c         |  6 ++++
 xen/common/livepatch.c             | 58 ++++++++++++++++++++++++++++++++++++++
 xen/include/xen/alternative-call.h |  8 ++++--
 3 files changed, 70 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
index f6594e21a1..22af224f08 100644
--- a/xen/arch/x86/alternative.c
+++ b/xen/arch/x86/alternative.c
@@ -479,6 +479,12 @@ int apply_alternatives(struct alt_instr *start, struct alt_instr *end)
 {
     return _apply_alternatives(start, end, true);
 }
+
+int livepatch_apply_alt_calls(const struct alt_call *start,
+                              const struct alt_call *end)
+{
+    return apply_alt_calls(start, end);
+}
 #endif
 
 #define ALT_INSNS (1U << 0)
diff --git a/xen/common/livepatch.c b/xen/common/livepatch.c
index 6ce77bf021..be9b7e3675 100644
--- a/xen/common/livepatch.c
+++ b/xen/common/livepatch.c
@@ -905,6 +905,64 @@ static int prepare_payload(struct payload *payload,
 #endif
     }
 
+    sec = livepatch_elf_sec_by_name(elf, ".alt_call_sites");
+    if ( sec )
+    {
+#ifdef CONFIG_ALTERNATIVE_CALL
+        const struct alt_call *a, *start, *end;
+
+        if ( !section_ok(elf, sec, sizeof(*a)) )
+            return -EINVAL;
+
+        /* Tolerate an empty .alt_call_sites section... */
+        if ( sec->sec->sh_size == 0 )
+            goto alt_call_done;
+
+        /* ... but otherwise, there needs to be something to alter... */
+        if ( payload->text_size == 0 )
+        {
+            printk(XENLOG_ERR LIVEPATCH "%s Alternative calls provided, but no .text\n",
+                   elf->name);
+            return -EINVAL;
+        }
+
+        start = sec->addr;
+        end = sec->addr + sec->sec->sh_size;
+
+        for ( a = start; a < end; a++ )
+        {
+            const void *orig = ALT_CALL_PTR(a);
+            size_t len = ALT_CALL_LEN(a);
+
+            /* orig must be fully within .text. */
+            if ( orig       < payload->text_addr ||
+                 len        > payload->text_size ||
+                 orig + len > payload->text_addr + payload->text_size )
+            {
+                printk(XENLOG_ERR LIVEPATCH
+                       "%s: Alternative call %p+%#zx outside payload text %p+%#zx\n",
+                       elf->name, orig, len,
+                       payload->text_addr, payload->text_size);
+                return -EINVAL;
+            }
+        }
+
+        rc = livepatch_apply_alt_calls(start, end);
+        if ( rc )
+        {
+            printk(XENLOG_ERR LIVEPATCH "%s: Applying alternative calls failed: %d\n",
+                   elf->name, rc);
+            return rc;
+        }
+
+    alt_call_done:;
+#else /* CONFIG_ALTERNATIVE_CALL */
+        printk(XENLOG_ERR LIVEPATCH "%s: Alternative calls not supported\n",
+               elf->name);
+        return -EOPNOTSUPP;
+#endif /* !CONFIG_ALTERNATIVE_CALL */
+    }
+
     sec = livepatch_elf_sec_by_name(elf, ".ex_table");
     if ( sec )
     {
diff --git a/xen/include/xen/alternative-call.h b/xen/include/xen/alternative-call.h
index 3c855bfa44..767c2149bc 100644
--- a/xen/include/xen/alternative-call.h
+++ b/xen/include/xen/alternative-call.h
@@ -17,8 +17,8 @@
  *   generation requirements are to emit a function pointer call at build
  *   time, and stash enough metadata to simplify the call at boot once the
  *   implementation has been resolved.
- * - Implement boot_apply_alt_calls() to convert the function pointer calls
- *   into direct calls on boot.
+ * - Implement {boot,livepatch}_apply_alt_calls() to convert the function
+ *   pointer calls into direct calls on boot/livepatch.
  * - Select ALTERNATIVE_CALL in Kconfig.
  *
  * To use:
@@ -65,6 +65,10 @@
  */
 void boot_apply_alt_calls(void);
 
+/* As per boot_apply_alt_calls() but for a livepatch. */
+int livepatch_apply_alt_calls(const struct alt_call *start,
+                              const struct alt_call *end);
+
 #else /* CONFIG_ALTERNATIVE_CALL */
 
 #define alternative_call(func, args...)  (func)(args)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 23 22:45:04 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Apr 2025 22:45:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.965659.1356144 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7iq0-00083R-8G; Wed, 23 Apr 2025 22:45:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 965659.1356144; Wed, 23 Apr 2025 22: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 1u7iq0-00083J-5k; Wed, 23 Apr 2025 22:45:04 +0000
Received: by outflank-mailman (input) for mailman id 965659;
 Wed, 23 Apr 2025 22: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 1u7ipy-00082z-Ue
 for xen-changelog@lists.xenproject.org; Wed, 23 Apr 2025 22: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 1u7ipy-00HLHA-2x
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 22:45:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7ipy-00BONY-2r
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 22: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=dfXqh6tIcSVCBsJ5yU26zXXA7KoW32yDCvb7mSX2lyM=; b=o1wGywU15zKxxOrfob06w1EBLn
	ockbUh74KW9sSrXiOtKb1fA9I4oaraKoXz98cnwZubIrd7SSU6jo5PVB31VKyZTvWw2qm3GhmveQp
	6/9nZhx2iyW5OLNpaAgXXpb3fb2dVrbqDW0lyzn5MyLGxg1uvGw5Y+y+LJJ3yoyu7bOo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/altcall: Switch to simpler scheme
Message-Id: <E1u7ipy-00BONY-2r@xenbits.xenproject.org>
Date: Wed, 23 Apr 2025 22:45:02 +0000

commit ca29b7a70d1b0426295c62e93effdd96f10cbde7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sat Apr 19 20:44:31 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 23 19:37:57 2025 +0100

    x86/altcall: Switch to simpler scheme
    
    With all the infrastructure in place, switch from using ALTERNATIVE() to
    simply populating .alt_call_sites.
    
    Before, _apply_alternatives() would devirtualise in two passes; the first
    being opportunistic, and the second (signified by the force parameter) sealing
    any call with a still-NULL function pointer.
    
    Now, all devirtualising is performed together, at the point in time of the
    second pass previously.  The call to seal_endbr64() needs delaying until after
    apply_alt_calls() is complete, or we have a narrow window with real indirect
    branches and no ENDBR64 instructions.
    
    Under the hood, the following changes are happening:
    
      Section                Old size   New size   Change (%)
      .alt_call_sites               0    0x00730   +0x0730
      .altinstructions        0x1350a    0x11fe0   -0x152a (-7%)
      .altinstr_replacement   0x015f2    0x00e35   -0x07bd (-23%)
    
    The changes aren't quite equal because inlining is affected by the smaller
    asm() block.  Nevertheless, the metadata is held in 1/3 of the space, and
    there are no CALL instructions held in the replacement section any more.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/alternative.c                  | 9 ++-------
 xen/arch/x86/include/asm/alternative-call.h | 9 ++++++---
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
index 22af224f08..047bfc6e42 100644
--- a/xen/arch/x86/alternative.c
+++ b/xen/arch/x86/alternative.c
@@ -378,13 +378,6 @@ static int init_or_livepatch _apply_alternatives(struct alt_instr *start,
         text_poke(orig, buf, total_len);
     }
 
-    /*
-     * Clobber endbr64 instructions now that altcall has finished optimising
-     * all indirect branches to direct ones.
-     */
-    if ( force && system_state < SYS_STATE_active )
-        seal_endbr64();
-
     return 0;
 }
 
@@ -533,6 +526,8 @@ static int __init cf_check nmi_apply_alternatives(
             rc = apply_alt_calls(__alt_call_sites_start, __alt_call_sites_end);
             if ( rc )
                 panic("Unable to apply alternative calls: %d\n", rc);
+
+            seal_endbr64();
         }
 
         /*
diff --git a/xen/arch/x86/include/asm/alternative-call.h b/xen/arch/x86/include/asm/alternative-call.h
index 49a04a7cc4..bbc49a5274 100644
--- a/xen/arch/x86/include/asm/alternative-call.h
+++ b/xen/arch/x86/include/asm/alternative-call.h
@@ -2,7 +2,8 @@
 #ifndef X86_ALTERNATIVE_CALL_H
 #define X86_ALTERNATIVE_CALL_H
 
-#include <asm/alternative.h>
+#include <xen/macros.h>
+#include <xen/stdint.h>
 
 /* Simply the relative position of the source call. */
 struct alt_call {
@@ -86,8 +87,10 @@ struct alt_call {
     rettype ret_;                                                  \
     register unsigned long r10_ asm("r10");                        \
     register unsigned long r11_ asm("r11");                        \
-    asm volatile (ALTERNATIVE("call *%c[addr](%%rip)", "call .",   \
-                              X86_FEATURE_ALWAYS)                  \
+    asm volatile ("1: call *%c[addr](%%rip)\n\t"                   \
+                  ".pushsection .alt_call_sites, \"a\", @progbits\n\t"  \
+                  ".long 1b - .\n\t"                               \
+                  ".popsection"                                    \
                   : ALT_CALL ## n ## _OUT, "=a" (ret_),            \
                     "=r" (r10_), "=r" (r11_) ASM_CALL_CONSTRAINT   \
                   : [addr] "i" (&(func)), "g" (func)               \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 23 22:45:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 23 Apr 2025 22:45:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.965660.1356149 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7iqA-00086a-Ab; Wed, 23 Apr 2025 22:45:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 965660.1356149; Wed, 23 Apr 2025 22: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 1u7iqA-00086R-79; Wed, 23 Apr 2025 22:45:14 +0000
Received: by outflank-mailman (input) for mailman id 965660;
 Wed, 23 Apr 2025 22: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 1u7iq9-00086E-0n
 for xen-changelog@lists.xenproject.org; Wed, 23 Apr 2025 22: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 1u7iq8-00HLHO-3D
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 22:45:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7iq8-00BOV4-38
 for xen-changelog@lists.xenproject.org;
 Wed, 23 Apr 2025 22: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=f5pmCNSuqexWGnmb2ybhsV070eOw1EPS6l2vsRVijks=; b=kfXBWlHvgepPerou0UQxD+Knns
	iOKwa85yDsr1PbAj6trF+85v9JVcX5Mj3dWowx9dufFXDaY/W6GPW5/uT2/BOnfRp49mJhTmxbJ6X
	lk7Ehkf2NrOL2YDTkXCRQV8fB/XhWeqAo4KAKSrYx5gzbajrgsXp9gDaLP+7zMoh11G4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/alternatives: Simplify _apply_alternatives() now altcall is separate
Message-Id: <E1u7iq8-00BOV4-38@xenbits.xenproject.org>
Date: Wed, 23 Apr 2025 22:45:12 +0000

commit 6dc1b711ded0e477c501d4017ccb0da83d6d56a1
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sun Apr 20 01:46:57 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 23 19:37:57 2025 +0100

    x86/alternatives: Simplify _apply_alternatives() now altcall is separate
    
    With altcall handled separately, the special case in _apply_alternatives() is
    unused and can be dropped.  The force parameter (used to signify the seal
    pass) can be removed too.
    
    In turn, nmi_apply_alternatives() no longer needs to call
    _apply_alternatives() on the second pass.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/alternative.c | 94 +++++-----------------------------------------
 1 file changed, 10 insertions(+), 84 deletions(-)

diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
index 047bfc6e42..43b009888c 100644
--- a/xen/arch/x86/alternative.c
+++ b/xen/arch/x86/alternative.c
@@ -206,14 +206,9 @@ static void __init seal_endbr64(void)
  * self modifying code. This implies that asymmetric systems where
  * APs have less capabilities than the boot processor are not handled.
  * Tough. Make sure you disable such features by hand.
- *
- * The caller will set the "force" argument to true for the final
- * invocation, such that no CALLs/JMPs to NULL pointers will be left
- * around. See also the further comment below.
  */
 static int init_or_livepatch _apply_alternatives(struct alt_instr *start,
-                                                 struct alt_instr *end,
-                                                 bool force)
+                                                 struct alt_instr *end)
 {
     struct alt_instr *a, *base;
 
@@ -274,10 +269,7 @@ static int init_or_livepatch _apply_alternatives(struct alt_instr *start,
 
         /* Skip patch sites already handled during the first pass. */
         if ( a->priv )
-        {
-            ASSERT(force);
             continue;
-        }
 
         /* If there is no replacement to make, see about optimising the nops. */
         if ( !boot_cpu_has(a->cpuid) )
@@ -301,76 +293,7 @@ static int init_or_livepatch _apply_alternatives(struct alt_instr *start,
 
         /* 0xe8/0xe9 are relative branches; fix the offset. */
         if ( a->repl_len >= 5 && (*buf & 0xfe) == 0xe8 )
-        {
-            /*
-             * Detect the special case of indirect-to-direct branch patching:
-             * - replacement is a direct CALL/JMP (opcodes 0xE8/0xE9; already
-             *   checked above),
-             * - replacement's displacement is -5 (pointing back at the very
-             *   insn, which makes no sense in a real replacement insn),
-             * - original is an indirect CALL/JMP (opcodes 0xFF/2 or 0xFF/4)
-             *   using RIP-relative addressing.
-             * Some branch destinations may still be NULL when we come here
-             * the first time. Defer patching of those until the post-presmp-
-             * initcalls re-invocation (with force set to true). If at that
-             * point the branch destination is still NULL, insert "UD2; UD0"
-             * (for ease of recognition) instead of CALL/JMP.
-             */
-            if ( a->cpuid == X86_FEATURE_ALWAYS &&
-                 *(int32_t *)(buf + 1) == -5 &&
-                 a->orig_len >= 6 &&
-                 orig[0] == 0xff &&
-                 orig[1] == (*buf & 1 ? 0x25 : 0x15) )
-            {
-                long disp = *(int32_t *)(orig + 2);
-                const uint8_t *dest = *(void **)(orig + 6 + disp);
-
-                if ( dest )
-                {
-                    /*
-                     * When building for CET-IBT, all function pointer targets
-                     * should have an endbr64 instruction.
-                     *
-                     * If this is not the case, leave a warning because
-                     * something is probably wrong with the build.  A CET-IBT
-                     * enabled system might have exploded already.
-                     *
-                     * Otherwise, skip the endbr64 instruction.  This is a
-                     * marginal perf improvement which saves on instruction
-                     * decode bandwidth.
-                     */
-                    if ( IS_ENABLED(CONFIG_XEN_IBT) )
-                    {
-                        if ( is_endbr64(dest) )
-                            dest += ENDBR64_LEN;
-                        else
-                            printk(XENLOG_WARNING
-                                   "altcall %ps dest %ps has no endbr64\n",
-                                   orig, dest);
-                    }
-
-                    disp = dest - (orig + 5);
-                    ASSERT(disp == (int32_t)disp);
-                    *(int32_t *)(buf + 1) = disp;
-                }
-                else if ( force )
-                {
-                    buf[0] = 0x0f;
-                    buf[1] = 0x0b;
-                    buf[2] = 0x0f;
-                    buf[3] = 0xff;
-                    buf[4] = 0xff;
-                }
-                else
-                    continue;
-            }
-            else if ( force && system_state < SYS_STATE_active )
-                ASSERT_UNREACHABLE();
-            else
-                *(int32_t *)(buf + 1) += repl - orig;
-        }
-        else if ( force && system_state < SYS_STATE_active  )
-            ASSERT_UNREACHABLE();
+            *(int32_t *)(buf + 1) += repl - orig;
 
         a->priv = 1;
 
@@ -470,7 +393,7 @@ static int init_or_livepatch apply_alt_calls(
 #ifdef CONFIG_LIVEPATCH
 int apply_alternatives(struct alt_instr *start, struct alt_instr *end)
 {
-    return _apply_alternatives(start, end, true);
+    return _apply_alternatives(start, end);
 }
 
 int livepatch_apply_alt_calls(const struct alt_call *start,
@@ -516,10 +439,13 @@ static int __init cf_check nmi_apply_alternatives(
                                  PAGE_HYPERVISOR_RWX);
         flush_local(FLUSH_TLB_GLOBAL);
 
-        rc = _apply_alternatives(__alt_instructions, __alt_instructions_end,
-                                 alt_todo == ALT_CALLS);
-        if ( rc )
-            panic("Unable to apply alternatives: %d\n", rc);
+        if ( alt_todo & ALT_INSNS )
+        {
+            rc = _apply_alternatives(__alt_instructions,
+                                     __alt_instructions_end);
+            if ( rc )
+                panic("Unable to apply alternatives: %d\n", rc);
+        }
 
         if ( alt_todo & ALT_CALLS )
         {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 24 16:00:10 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 24 Apr 2025 16:00:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.966526.1356696 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7yzc-0007pU-HH; Thu, 24 Apr 2025 16:00:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 966526.1356696; Thu, 24 Apr 2025 16:00: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 1u7yzc-0007p0-ED; Thu, 24 Apr 2025 16:00:04 +0000
Received: by outflank-mailman (input) for mailman id 966526;
 Thu, 24 Apr 2025 16:00: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 1u7yzb-0007TG-3q
 for xen-changelog@lists.xenproject.org; Thu, 24 Apr 2025 16:00: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 1u7yza-001jmA-2N
 for xen-changelog@lists.xenproject.org;
 Thu, 24 Apr 2025 16:00:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7yza-0030qA-21
 for xen-changelog@lists.xenproject.org;
 Thu, 24 Apr 2025 16:00:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HfakrbOzTovLmY162E8njvuB3EozMlQVVKjrw3fZ0B8=; b=okLYumFX05SRoqZVuZLOtlJTw2
	PYPEOYrO/Ad8K6lUIWnfDnHzFcghK65YxOb/20eV8FS3fpd641fRSVnq7ZWdOgkw+7UrL0cwSii6h
	+Ei4I6i9zQ0fkpvUkj6njDH0/EBtJQi/51tIV3PD3cxuUXmG4eHBSYW+qlhitl4rOjPo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/xen: Add xs_node_read() helper function
Message-Id: <E1u7yza-0030qA-21@xenbits.xenproject.org>
Date: Thu, 24 Apr 2025 16:00:02 +0000

commit 82354c9f2431a1c35bc12297697b8ab48f206f27
Author:     David Woodhouse <dwmw@amazon.co.uk>
AuthorDate: Fri Jan 10 10:35:30 2025 +0100
Commit:     Anthony PERARD <anthony.perard@citrix.com>
CommitDate: Thu Apr 24 10:51:17 2025 +0200

    hw/xen: Add xs_node_read() helper function
    
    This returns the full contents of the node, having created the node path
    from the printf-style format string provided in its arguments.
    
    This will save various callers from having to do so for themselves (and
    from using xs_node_scanf() with the non-portable %ms format string.
    
    Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
    [remove double newline and constify trace parameters]
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 hw/xen/trace-events             |  1 +
 hw/xen/xen-bus-helper.c         | 22 ++++++++++++++++++++++
 include/hw/xen/xen-bus-helper.h |  9 +++++++++
 3 files changed, 32 insertions(+)

diff --git a/hw/xen/trace-events b/hw/xen/trace-events
index d1b27f6c11..ae90c27091 100644
--- a/hw/xen/trace-events
+++ b/hw/xen/trace-events
@@ -39,6 +39,7 @@ xs_node_create(const char *node) "%s"
 xs_node_destroy(const char *node) "%s"
 xs_node_vprintf(char *path, char *value) "%s %s"
 xs_node_vscanf(char *path, char *value) "%s %s"
+xs_node_read(const char *path, const char *value) "%s %s"
 xs_node_watch(char *path) "%s"
 xs_node_unwatch(char *path) "%s"
 
diff --git a/hw/xen/xen-bus-helper.c b/hw/xen/xen-bus-helper.c
index b2b2cc9c5d..22fd2f6c1a 100644
--- a/hw/xen/xen-bus-helper.c
+++ b/hw/xen/xen-bus-helper.c
@@ -142,6 +142,28 @@ int xs_node_scanf(struct qemu_xs_handle *h,  xs_transaction_t tid,
     return rc;
 }
 
+char *xs_node_read(struct qemu_xs_handle *h, xs_transaction_t tid,
+                   unsigned int *len, Error **errp,
+                   const char *path_fmt, ...)
+{
+    char *path, *value;
+    va_list ap;
+
+    va_start(ap, path_fmt);
+    path = g_strdup_vprintf(path_fmt, ap);
+    va_end(ap);
+
+    value = qemu_xen_xs_read(h, tid, path, len);
+    trace_xs_node_read(path, value);
+    if (!value) {
+        error_setg_errno(errp, errno, "failed to read from '%s'", path);
+    }
+
+    g_free(path);
+
+    return value;
+}
+
 struct qemu_xs_watch *xs_node_watch(struct qemu_xs_handle *h, const char *node,
                                     const char *key, xs_watch_fn fn,
                                     void *opaque, Error **errp)
diff --git a/include/hw/xen/xen-bus-helper.h b/include/hw/xen/xen-bus-helper.h
index d8dcc2f010..e9911115b3 100644
--- a/include/hw/xen/xen-bus-helper.h
+++ b/include/hw/xen/xen-bus-helper.h
@@ -38,6 +38,15 @@ int xs_node_scanf(struct qemu_xs_handle *h,  xs_transaction_t tid,
                   const char *fmt, ...)
     G_GNUC_SCANF(6, 7);
 
+/*
+ * Unlike other functions here, the printf-formatted path_fmt is for
+ * the XenStore path, not the contents of the node.
+ */
+char *xs_node_read(struct qemu_xs_handle *h, xs_transaction_t tid,
+                   unsigned int *len, Error **errp,
+                   const char *path_fmt, ...)
+    G_GNUC_PRINTF(5, 6);
+
 /* Watch node/key unless node is empty, in which case watch key */
 struct qemu_xs_watch *xs_node_watch(struct qemu_xs_handle *h, const char *node,
                                     const char *key, xs_watch_fn fn,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 24 16:00:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 24 Apr 2025 16:00:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.966527.1356700 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7yzm-0008F9-J8; Thu, 24 Apr 2025 16:00:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 966527.1356700; Thu, 24 Apr 2025 16:00: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 1u7yzm-0008F1-Fp; Thu, 24 Apr 2025 16:00:14 +0000
Received: by outflank-mailman (input) for mailman id 966527;
 Thu, 24 Apr 2025 16:00: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 1u7yzk-0008Eq-V9
 for xen-changelog@lists.xenproject.org; Thu, 24 Apr 2025 16: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 1u7yzk-001jpp-2y
 for xen-changelog@lists.xenproject.org;
 Thu, 24 Apr 2025 16:00:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7yzk-00318M-2f
 for xen-changelog@lists.xenproject.org;
 Thu, 24 Apr 2025 16:00:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JFgbFtb6LadbOjB6Kr13eYmNswUQOJR9347fek8ITPU=; b=iZ2cQ6llaxSnIqFv3Mw37NRyjX
	UEikad2yFTU4WlDf1w7J9QE7+iXpMqid5nopTLZz/xeQMhpdf9741Smgtj3f7yRMot7Om3cAt0RgX
	Ab16sh9HlKQy69+vdUZEHDVx2+ItzssrsbqgjB8GqAxfOkMtXTtjEEd0yWUfRje3jL3c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] xen: do not use '%ms' scanf specifier
Message-Id: <E1u7yzk-00318M-2f@xenbits.xenproject.org>
Date: Thu, 24 Apr 2025 16:00:12 +0000

commit e064f42c80be6f6ff8c12dcb2a663bdf70f965f6
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Jan 10 10:35:31 2025 +0100
Commit:     Anthony PERARD <anthony.perard@citrix.com>
CommitDate: Thu Apr 24 10:51:17 2025 +0200

    xen: do not use '%ms' scanf specifier
    
    The 'm' parameter used to request auto-allocation of the destination variable
    is not supported on FreeBSD, and as such leads to failures to parse.
    
    What's more, the current usage of '%ms' with xs_node_scanf() is pointless, as
    it just leads to a double allocation of the same string.  Instead use
    xs_node_read() to read the whole xenstore node.
    
    Fixes: a783f8ad4ec9 ('xen: add a mechanism to automatically create XenDevice-s...')
    Fixes: 9b7737469080 ('hw/xen: update Xen console to XenDevice model')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 hw/block/xen-block.c     |  3 ++-
 hw/char/xen_console.c    |  6 ++++--
 hw/xen/xen-bus.c         | 14 ++++++++++++--
 include/hw/xen/xen-bus.h |  1 +
 4 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c
index aed1d5c330..9745a0f989 100644
--- a/hw/block/xen-block.c
+++ b/hw/block/xen-block.c
@@ -239,7 +239,8 @@ static void xen_block_connect(XenDevice *xendev, Error **errp)
         return;
     }
 
-    if (xen_device_frontend_scanf(xendev, "protocol", "%ms", &str) != 1) {
+    str = xen_device_frontend_read(xendev, "protocol");
+    if (!str) {
         /* x86 defaults to the 32-bit protocol even for 64-bit guests. */
         if (object_dynamic_cast(OBJECT(qdev_get_machine()), "x86-machine")) {
             protocol = BLKIF_PROTOCOL_X86_32;
diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c
index 683c92aca1..825cbdc6f2 100644
--- a/hw/char/xen_console.c
+++ b/hw/char/xen_console.c
@@ -551,7 +551,8 @@ static void xen_console_device_create(XenBackendInstance *backend,
         goto fail;
     }
 
-    if (xs_node_scanf(xsh, XBT_NULL, fe, "type", errp, "%ms", &type) != 1) {
+    type = xs_node_read(xsh, XBT_NULL, NULL, errp, "%s/%s", fe, "type");
+    if (!type) {
         error_prepend(errp, "failed to read console device type: ");
         goto fail;
     }
@@ -569,7 +570,8 @@ static void xen_console_device_create(XenBackendInstance *backend,
 
     snprintf(label, sizeof(label), "xencons%ld", number);
 
-    if (xs_node_scanf(xsh, XBT_NULL, fe, "output", NULL, "%ms", &output) == 1) {
+    output = xs_node_read(xsh, XBT_NULL, NULL, NULL, "%s/%s", fe, "output");
+    if (output) {
         /*
          * FIXME: sure we want to support implicit
          * muxed monitors here?
diff --git a/hw/xen/xen-bus.c b/hw/xen/xen-bus.c
index 95b207ac8b..6b55ca6a4d 100644
--- a/hw/xen/xen-bus.c
+++ b/hw/xen/xen-bus.c
@@ -156,8 +156,8 @@ again:
             !strcmp(key[i], "hotplug-status"))
             continue;
 
-        if (xs_node_scanf(xenbus->xsh, tid, path, key[i], NULL, "%ms",
-                          &val) == 1) {
+        val = xs_node_read(xenbus->xsh, tid, NULL, NULL, "%s/%s", path, key[i]);
+        if (val) {
             qdict_put_str(opts, key[i], val);
             free(val);
         }
@@ -650,6 +650,16 @@ int xen_device_frontend_scanf(XenDevice *xendev, const char *key,
     return rc;
 }
 
+char *xen_device_frontend_read(XenDevice *xendev, const char *key)
+{
+    XenBus *xenbus = XEN_BUS(qdev_get_parent_bus(DEVICE(xendev)));
+
+    g_assert(xenbus->xsh);
+
+    return xs_node_read(xenbus->xsh, XBT_NULL, NULL, NULL, "%s/%s",
+                        xendev->frontend_path, key);
+}
+
 static void xen_device_frontend_set_state(XenDevice *xendev,
                                           enum xenbus_state state,
                                           bool publish)
diff --git a/include/hw/xen/xen-bus.h b/include/hw/xen/xen-bus.h
index 38d40afa37..2adb2af839 100644
--- a/include/hw/xen/xen-bus.h
+++ b/include/hw/xen/xen-bus.h
@@ -91,6 +91,7 @@ void xen_device_frontend_printf(XenDevice *xendev, const char *key,
 int xen_device_frontend_scanf(XenDevice *xendev, const char *key,
                               const char *fmt, ...)
     G_GNUC_SCANF(3, 4);
+char *xen_device_frontend_read(XenDevice *xendev, const char *key);
 
 void xen_device_set_max_grant_refs(XenDevice *xendev, unsigned int nr_refs,
                                    Error **errp);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 24 16:11:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 24 Apr 2025 16:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.966535.1356745 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7zAG-0002pX-JN; Thu, 24 Apr 2025 16:11:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 966535.1356745; Thu, 24 Apr 2025 16: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 1u7zAG-0002pG-Ek; Thu, 24 Apr 2025 16:11:04 +0000
Received: by outflank-mailman (input) for mailman id 966535;
 Thu, 24 Apr 2025 16:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u7zAE-0002md-P4
 for xen-changelog@lists.xenproject.org; Thu, 24 Apr 2025 16: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 1u7zAE-001kBU-20
 for xen-changelog@lists.xenproject.org;
 Thu, 24 Apr 2025 16:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7zAE-003UC4-1o
 for xen-changelog@lists.xenproject.org;
 Thu, 24 Apr 2025 16: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=lv+wmEnDX8ZGjODcYRhlMut2lp2Sgx0o/8uu0mohwhU=; b=ZNR7AC/BzYa4CUik1BCwNQOMHb
	lNidz8E936aDn5G599PPZvRXbjKJdVwwy7slwekgTU6bfTlLyAsFHboM1xnY8pAC1vHpd14Bt/oeO
	wxSuEOzRlgq5oQc5trBWKLZ4fMQdIiIC0gSjsUUt3DATlcVh/CSN4ohV2GAOWnXX+3/w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/xen: Add xs_node_read() helper function
Message-Id: <E1u7zAE-003UC4-1o@xenbits.xenproject.org>
Date: Thu, 24 Apr 2025 16:11:02 +0000

commit 82354c9f2431a1c35bc12297697b8ab48f206f27
Author:     David Woodhouse <dwmw@amazon.co.uk>
AuthorDate: Fri Jan 10 10:35:30 2025 +0100
Commit:     Anthony PERARD <anthony.perard@citrix.com>
CommitDate: Thu Apr 24 10:51:17 2025 +0200

    hw/xen: Add xs_node_read() helper function
    
    This returns the full contents of the node, having created the node path
    from the printf-style format string provided in its arguments.
    
    This will save various callers from having to do so for themselves (and
    from using xs_node_scanf() with the non-portable %ms format string.
    
    Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
    [remove double newline and constify trace parameters]
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 hw/xen/trace-events             |  1 +
 hw/xen/xen-bus-helper.c         | 22 ++++++++++++++++++++++
 include/hw/xen/xen-bus-helper.h |  9 +++++++++
 3 files changed, 32 insertions(+)

diff --git a/hw/xen/trace-events b/hw/xen/trace-events
index d1b27f6c11..ae90c27091 100644
--- a/hw/xen/trace-events
+++ b/hw/xen/trace-events
@@ -39,6 +39,7 @@ xs_node_create(const char *node) "%s"
 xs_node_destroy(const char *node) "%s"
 xs_node_vprintf(char *path, char *value) "%s %s"
 xs_node_vscanf(char *path, char *value) "%s %s"
+xs_node_read(const char *path, const char *value) "%s %s"
 xs_node_watch(char *path) "%s"
 xs_node_unwatch(char *path) "%s"
 
diff --git a/hw/xen/xen-bus-helper.c b/hw/xen/xen-bus-helper.c
index b2b2cc9c5d..22fd2f6c1a 100644
--- a/hw/xen/xen-bus-helper.c
+++ b/hw/xen/xen-bus-helper.c
@@ -142,6 +142,28 @@ int xs_node_scanf(struct qemu_xs_handle *h,  xs_transaction_t tid,
     return rc;
 }
 
+char *xs_node_read(struct qemu_xs_handle *h, xs_transaction_t tid,
+                   unsigned int *len, Error **errp,
+                   const char *path_fmt, ...)
+{
+    char *path, *value;
+    va_list ap;
+
+    va_start(ap, path_fmt);
+    path = g_strdup_vprintf(path_fmt, ap);
+    va_end(ap);
+
+    value = qemu_xen_xs_read(h, tid, path, len);
+    trace_xs_node_read(path, value);
+    if (!value) {
+        error_setg_errno(errp, errno, "failed to read from '%s'", path);
+    }
+
+    g_free(path);
+
+    return value;
+}
+
 struct qemu_xs_watch *xs_node_watch(struct qemu_xs_handle *h, const char *node,
                                     const char *key, xs_watch_fn fn,
                                     void *opaque, Error **errp)
diff --git a/include/hw/xen/xen-bus-helper.h b/include/hw/xen/xen-bus-helper.h
index d8dcc2f010..e9911115b3 100644
--- a/include/hw/xen/xen-bus-helper.h
+++ b/include/hw/xen/xen-bus-helper.h
@@ -38,6 +38,15 @@ int xs_node_scanf(struct qemu_xs_handle *h,  xs_transaction_t tid,
                   const char *fmt, ...)
     G_GNUC_SCANF(6, 7);
 
+/*
+ * Unlike other functions here, the printf-formatted path_fmt is for
+ * the XenStore path, not the contents of the node.
+ */
+char *xs_node_read(struct qemu_xs_handle *h, xs_transaction_t tid,
+                   unsigned int *len, Error **errp,
+                   const char *path_fmt, ...)
+    G_GNUC_PRINTF(5, 6);
+
 /* Watch node/key unless node is empty, in which case watch key */
 struct qemu_xs_watch *xs_node_watch(struct qemu_xs_handle *h, const char *node,
                                     const char *key, xs_watch_fn fn,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 24 16:11:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 24 Apr 2025 16:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.966545.1356778 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u7zAQ-0003uh-Ga; Thu, 24 Apr 2025 16:11:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 966545.1356778; Thu, 24 Apr 2025 16: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 1u7zAQ-0003uV-CG; Thu, 24 Apr 2025 16:11:14 +0000
Received: by outflank-mailman (input) for mailman id 966545;
 Thu, 24 Apr 2025 16:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u7zAO-0003rg-Ry
 for xen-changelog@lists.xenproject.org; Thu, 24 Apr 2025 16:11:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7zAO-001kBq-2g
 for xen-changelog@lists.xenproject.org;
 Thu, 24 Apr 2025 16:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u7zAO-003UdH-2G
 for xen-changelog@lists.xenproject.org;
 Thu, 24 Apr 2025 16: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=044bakyzw6/kPBKtMTOgcRDf2LAHk/UpWTSs/c85BrI=; b=F0R3tZn9u0O9ylmigUeeeaDxWA
	Vb9g/ebZ+JUNeLmgqa3nxfK2IeavAHpGs6aND0dBV8M3pMxu9qg+HeKv80CXaVlE8MMwItw90jar9
	YYIKUgnwoaOP9yOI3LnWiDiiXnyruee+Ufv8bHKBQmwqMD8DOcOxrJoSZEBn3YbKsc7g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] xen: do not use '%ms' scanf specifier
Message-Id: <E1u7zAO-003UdH-2G@xenbits.xenproject.org>
Date: Thu, 24 Apr 2025 16:11:12 +0000

commit e064f42c80be6f6ff8c12dcb2a663bdf70f965f6
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Jan 10 10:35:31 2025 +0100
Commit:     Anthony PERARD <anthony.perard@citrix.com>
CommitDate: Thu Apr 24 10:51:17 2025 +0200

    xen: do not use '%ms' scanf specifier
    
    The 'm' parameter used to request auto-allocation of the destination variable
    is not supported on FreeBSD, and as such leads to failures to parse.
    
    What's more, the current usage of '%ms' with xs_node_scanf() is pointless, as
    it just leads to a double allocation of the same string.  Instead use
    xs_node_read() to read the whole xenstore node.
    
    Fixes: a783f8ad4ec9 ('xen: add a mechanism to automatically create XenDevice-s...')
    Fixes: 9b7737469080 ('hw/xen: update Xen console to XenDevice model')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 hw/block/xen-block.c     |  3 ++-
 hw/char/xen_console.c    |  6 ++++--
 hw/xen/xen-bus.c         | 14 ++++++++++++--
 include/hw/xen/xen-bus.h |  1 +
 4 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c
index aed1d5c330..9745a0f989 100644
--- a/hw/block/xen-block.c
+++ b/hw/block/xen-block.c
@@ -239,7 +239,8 @@ static void xen_block_connect(XenDevice *xendev, Error **errp)
         return;
     }
 
-    if (xen_device_frontend_scanf(xendev, "protocol", "%ms", &str) != 1) {
+    str = xen_device_frontend_read(xendev, "protocol");
+    if (!str) {
         /* x86 defaults to the 32-bit protocol even for 64-bit guests. */
         if (object_dynamic_cast(OBJECT(qdev_get_machine()), "x86-machine")) {
             protocol = BLKIF_PROTOCOL_X86_32;
diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c
index 683c92aca1..825cbdc6f2 100644
--- a/hw/char/xen_console.c
+++ b/hw/char/xen_console.c
@@ -551,7 +551,8 @@ static void xen_console_device_create(XenBackendInstance *backend,
         goto fail;
     }
 
-    if (xs_node_scanf(xsh, XBT_NULL, fe, "type", errp, "%ms", &type) != 1) {
+    type = xs_node_read(xsh, XBT_NULL, NULL, errp, "%s/%s", fe, "type");
+    if (!type) {
         error_prepend(errp, "failed to read console device type: ");
         goto fail;
     }
@@ -569,7 +570,8 @@ static void xen_console_device_create(XenBackendInstance *backend,
 
     snprintf(label, sizeof(label), "xencons%ld", number);
 
-    if (xs_node_scanf(xsh, XBT_NULL, fe, "output", NULL, "%ms", &output) == 1) {
+    output = xs_node_read(xsh, XBT_NULL, NULL, NULL, "%s/%s", fe, "output");
+    if (output) {
         /*
          * FIXME: sure we want to support implicit
          * muxed monitors here?
diff --git a/hw/xen/xen-bus.c b/hw/xen/xen-bus.c
index 95b207ac8b..6b55ca6a4d 100644
--- a/hw/xen/xen-bus.c
+++ b/hw/xen/xen-bus.c
@@ -156,8 +156,8 @@ again:
             !strcmp(key[i], "hotplug-status"))
             continue;
 
-        if (xs_node_scanf(xenbus->xsh, tid, path, key[i], NULL, "%ms",
-                          &val) == 1) {
+        val = xs_node_read(xenbus->xsh, tid, NULL, NULL, "%s/%s", path, key[i]);
+        if (val) {
             qdict_put_str(opts, key[i], val);
             free(val);
         }
@@ -650,6 +650,16 @@ int xen_device_frontend_scanf(XenDevice *xendev, const char *key,
     return rc;
 }
 
+char *xen_device_frontend_read(XenDevice *xendev, const char *key)
+{
+    XenBus *xenbus = XEN_BUS(qdev_get_parent_bus(DEVICE(xendev)));
+
+    g_assert(xenbus->xsh);
+
+    return xs_node_read(xenbus->xsh, XBT_NULL, NULL, NULL, "%s/%s",
+                        xendev->frontend_path, key);
+}
+
 static void xen_device_frontend_set_state(XenDevice *xendev,
                                           enum xenbus_state state,
                                           bool publish)
diff --git a/include/hw/xen/xen-bus.h b/include/hw/xen/xen-bus.h
index 38d40afa37..2adb2af839 100644
--- a/include/hw/xen/xen-bus.h
+++ b/include/hw/xen/xen-bus.h
@@ -91,6 +91,7 @@ void xen_device_frontend_printf(XenDevice *xendev, const char *key,
 int xen_device_frontend_scanf(XenDevice *xendev, const char *key,
                               const char *fmt, ...)
     G_GNUC_SCANF(3, 4);
+char *xen_device_frontend_read(XenDevice *xendev, const char *key);
 
 void xen_device_set_max_grant_refs(XenDevice *xendev, unsigned int nr_refs,
                                    Error **errp);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 25 11:44:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Apr 2025 11:44:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.967809.1357517 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u8HTP-0001dn-5h; Fri, 25 Apr 2025 11:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 967809.1357517; Fri, 25 Apr 2025 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 1u8HTP-0001df-2Q; Fri, 25 Apr 2025 11:44:03 +0000
Received: by outflank-mailman (input) for mailman id 967809;
 Fri, 25 Apr 2025 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 1u8HTN-0001dU-Sy
 for xen-changelog@lists.xenproject.org; Fri, 25 Apr 2025 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 1u8HTN-003map-2O
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 11:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u8HTN-005ua9-2D
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 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=cC6CfSQqcqzDoTxcpOaR1ZsOBCtvTJqXhYJzY4Uczz8=; b=qVOjrWSGc+2Dzp5Og0yv1OACyn
	8Cw7PcJoV39ugizRLD2LEv6cAxMUQm8TNrefMLdVYCHWhhdX08M9EvQBEP8MNMzmFQZEN3Zu0eKNG
	yoUQ4qy4D1mvDBvYXlihqjwoCETFaiKyYMiDDaDWUdW7OTWAFEERHiKZlt9UFG8Mqqqw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] automation: Avoid changing source files for randconfig tests
Message-Id: <E1u8HTN-005ua9-2D@xenbits.xenproject.org>
Date: Fri, 25 Apr 2025 11:44:01 +0000

commit e43d9621d8081a88397e2b49b08906c4f4acaa57
Author:     Anthony PERARD <anthony.perard@vates.tech>
AuthorDate: Wed Mar 26 14:28:25 2025 +0000
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Fri Apr 25 11:26:29 2025 +0200

    automation: Avoid changing source files for randconfig tests
    
    We should avoid changing files from the source tree if we don't intend
    to commit the result.
    
    We don't really need to check if $EXTRA_FIXED_RANDCONFIG is empty so
    add it to the temporary file in all cases.
    
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/scripts/build | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/automation/scripts/build b/automation/scripts/build
index a348c781d1..cdb8cd7c72 100755
--- a/automation/scripts/build
+++ b/automation/scripts/build
@@ -12,12 +12,12 @@ $cc --version
 # random config or default config
 if [[ "${RANDCONFIG}" == "y" ]]; then
 
+    cp -f xen/tools/kconfig/allrandom.config xen/allrandom.config.tmp
+
     # Append job-specific fixed configuration
-    if [[ -n "${EXTRA_FIXED_RANDCONFIG}" ]]; then
-        echo "${EXTRA_FIXED_RANDCONFIG}" >> xen/tools/kconfig/allrandom.config
-    fi
+    echo "${EXTRA_FIXED_RANDCONFIG}" >> xen/allrandom.config.tmp
 
-    make -j$(nproc) -C xen KCONFIG_ALLCONFIG=tools/kconfig/allrandom.config randconfig
+    make -j$(nproc) -C xen KCONFIG_ALLCONFIG=allrandom.config.tmp randconfig
 
     # RANDCONFIG implies HYPERVISOR_ONLY
     HYPERVISOR_ONLY="y"
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 25 11:44:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Apr 2025 11:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.967811.1357520 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u8HTZ-0001fb-6l; Fri, 25 Apr 2025 11:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 967811.1357520; Fri, 25 Apr 2025 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 1u8HTZ-0001fT-3z; Fri, 25 Apr 2025 11:44:13 +0000
Received: by outflank-mailman (input) for mailman id 967811;
 Fri, 25 Apr 2025 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 1u8HTX-0001fI-Rz
 for xen-changelog@lists.xenproject.org; Fri, 25 Apr 2025 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 1u8HTX-003mb7-2h
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 11:44:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u8HTX-005v2e-2a
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 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=5u0mHHqnnjftncweIeZCVhpfVHk1GJmIBjtZppgzYU0=; b=JPAM2y5ObfY9S8z9ps0zAJrjH7
	Qe6aNgbh9QVTPymVVge/3apSKfuovfippCcSaHgNpcRzAz/gLyMMB04w+Dv4LcKjD+Apjpv/zKTf9
	fmuxlfQDtQGzraKYFBMe9akTii/xPCfIr23xrxMohJYp/zgnkT/KPFup+s7zfpkEVJEg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libxl: search PATH for QEMU if `QEMU_XEN_PATH` is not absolute
Message-Id: <E1u8HTX-005v2e-2a@xenbits.xenproject.org>
Date: Fri, 25 Apr 2025 11:44:11 +0000

commit f6281291704aa356489f4bd927cc7348a920bd01
Author:     Hongbo <hehongbo@mail.com>
AuthorDate: Mon Mar 31 00:03:04 2025 +0800
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Fri Apr 25 11:42:32 2025 +0200

    tools/libxl: search PATH for QEMU if `QEMU_XEN_PATH` is not absolute
    
    `QEMU_XEN_PATH` will be configured as `qemu-system-i386` with no clue where, if
    `--with-system-qemu` is set without giving a path (as matched in the case `yes`
    but not `*`). However, the existence of the executable is checked by `access()`,
    that will not look for anywhere in $PATH but the current directory. And since it
    is possible for `qemu-system-i386` (or any other configured values) to be
    executed from PATH later, we'd better find that in PATH and return the full path
    for the caller to check against.
    
    Signed-off-by: Hongbo <hehongbo@mail.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
    [Initialise `saveptr` to NULL]
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/light/libxl_dm.c | 38 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 36 insertions(+), 2 deletions(-)

diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
index b193a5dc37..4627564c0d 100644
--- a/tools/libs/light/libxl_dm.c
+++ b/tools/libs/light/libxl_dm.c
@@ -331,9 +331,43 @@ const char *libxl__domain_device_model(libxl__gc *gc,
         case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
             dm = libxl__abs_path(gc, "qemu-dm", libxl__private_bindir_path());
             break;
-        case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
-            dm = qemu_xen_path(gc);
+        case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN: {
+            const char *configured_dm = qemu_xen_path(gc);
+            if (configured_dm[0] == '/')
+            {
+                dm = configured_dm;
+            }
+            else
+            {
+                const char *path_env = getenv("PATH");
+                if (!path_env)
+                {
+                    dm = configured_dm;
+                }
+                else
+                {
+                    char *path_dup = libxl__strdup(gc, path_env);
+                    char *saveptr = NULL;
+
+                    char *path = strtok_r(path_dup, ":", &saveptr);
+                    dm = NULL;
+                    while (path)
+                    {
+                        char *candidate = libxl__abs_path(gc, configured_dm, path);
+                        if (access(candidate, X_OK) == 0)
+                        {
+                            dm = candidate;
+                            break;
+                        }
+                        path = strtok_r(NULL, ":", &saveptr);
+                    }
+
+                    if (!dm)
+                        dm = configured_dm;
+                }
+            }
             break;
+        }
         default:
             LOG(ERROR, "invalid device model version %d",
                 info->device_model_version);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 25 11:44:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Apr 2025 11:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.967812.1357524 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u8HTj-0001k4-9i; Fri, 25 Apr 2025 11:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 967812.1357524; Fri, 25 Apr 2025 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 1u8HTj-0001jv-7E; Fri, 25 Apr 2025 11:44:23 +0000
Received: by outflank-mailman (input) for mailman id 967812;
 Fri, 25 Apr 2025 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 1u8HTh-0001iw-Um
 for xen-changelog@lists.xenproject.org; Fri, 25 Apr 2025 11:44:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u8HTh-003mbU-2z
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 11:44:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u8HTh-005vJo-2s
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 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=BJsZdYlvXxnAiL560onzcVJaVL5jtYDO23NW4AQmmaU=; b=atB4tsQ9iQmdEFS0f5ofuDcVi/
	8VtLCmIiwu8yCV3jQQ6U7yovmRrMff//5y/Og50COe90anlm6esbxPMUoCj6RvZwIm4hd4mW9tJUJ
	wrxNSHBhcNN/5tpdl8ZeHZ+3JRkb2eqefmPZggC5kWZ7NaBVd2uortLKbo6IpOCcpC8c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/tests: Fix newly introduced Makefile
Message-Id: <E1u8HTh-005vJo-2s@xenbits.xenproject.org>
Date: Fri, 25 Apr 2025 11:44:21 +0000

commit a5d0e9c901044055c1c412d0825b434f21ec273e
Author:     Anthony PERARD <anthony.perard@vates.tech>
AuthorDate: Mon Apr 14 16:17:14 2025 +0200
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Fri Apr 25 11:44:03 2025 +0200

    tools/tests: Fix newly introduced Makefile
    
    Fix few issue with this new directory:
    - clean generated files
    - and ignore those generated files
    - include the dependency files generated by `gcc`.
    - rework prerequisites:
      "test-rangeset.o" also needs the generated files "list.h" and
      "rangeset.h". Technically, both only needs "harness.h" which needs
      the generated headers, but that's a bit simpler and the previous
      point will add the dependency on "harness.h" automatically.
    
    This last point fix an issue where `make` might decide to build
    "test-rangeset.o" before the other files are ready.
    
    Fixes: 7bf777b42cad ("tootls/tests: introduce unit tests for rangesets")
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/tests/rangeset/.gitignore | 4 ++++
 tools/tests/rangeset/Makefile   | 8 ++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/tools/tests/rangeset/.gitignore b/tools/tests/rangeset/.gitignore
new file mode 100644
index 0000000000..cdeb778535
--- /dev/null
+++ b/tools/tests/rangeset/.gitignore
@@ -0,0 +1,4 @@
+/list.h
+/rangeset.c
+/rangeset.h
+/test-rangeset
diff --git a/tools/tests/rangeset/Makefile b/tools/tests/rangeset/Makefile
index 70076eff34..3dafcbd054 100644
--- a/tools/tests/rangeset/Makefile
+++ b/tools/tests/rangeset/Makefile
@@ -12,7 +12,7 @@ run: $(TARGET)
 
 .PHONY: clean
 clean:
-	$(RM) -- *.o $(TARGET) $(DEPS_RM)
+	$(RM) -- *.o $(TARGET) $(DEPS_RM) list.h rangeset.h rangeset.c
 
 .PHONY: distclean
 distclean: clean
@@ -32,7 +32,7 @@ rangeset.h: $(XEN_ROOT)/xen/include/xen/rangeset.h
 list.h rangeset.h:
 	sed -e '/#include/d' <$< >$@
 
-rangeset.c: $(XEN_ROOT)/xen/common/rangeset.c list.h rangeset.h
+rangeset.c: $(XEN_ROOT)/xen/common/rangeset.c
 	# Remove includes and add the test harness header
 	sed -e '/#include/d' -e '1s/^/#include "harness.h"/' <$< >$@
 
@@ -42,5 +42,9 @@ CFLAGS += $(CFLAGS_xeninclude)
 
 LDFLAGS += $(APPEND_LDFLAGS)
 
+test-rangeset.o rangeset.o: list.h rangeset.h
+
 test-rangeset: rangeset.o test-rangeset.o
 	$(CC) $^ -o $@ $(LDFLAGS)
+
+-include $(DEPS_INCLUDE)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 25 11:44:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Apr 2025 11:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.967813.1357529 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u8HTt-0001me-BV; Fri, 25 Apr 2025 11:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 967813.1357529; Fri, 25 Apr 2025 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 1u8HTt-0001mU-8i; Fri, 25 Apr 2025 11:44:33 +0000
Received: by outflank-mailman (input) for mailman id 967813;
 Fri, 25 Apr 2025 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 1u8HTs-0001mB-2z
 for xen-changelog@lists.xenproject.org; Fri, 25 Apr 2025 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 1u8HTs-003mba-0C
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 11:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u8HTs-005vpO-03
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 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=xCU1M5LbVFubHgBD5/1PXfmC0WRmKNBC6vAWCoh4fyU=; b=UIDGyNyU8yqXQXaysKSeo+hxDz
	jVgYK0ImKgzqryUotkNAKJi69pVwHKy2IVAQumuINGlI60nB10zMnyNrX28JgqobGFKhXDw4zZLQX
	UKQ7fb/BPvk7OHI/bV6c8HxYhVt3MQTcl6D5wp6imhv6hB98W9aN51GiQP3zuZJekz5k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libxl: Skip invalid IRQs
Message-Id: <E1u8HTs-005vpO-03@xenbits.xenproject.org>
Date: Fri, 25 Apr 2025 11:44:32 +0000

commit ec9fda045b517128e2173fa7b87bf6aee9dcc33a
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Fri Apr 18 17:05:49 2025 -0400
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Fri Apr 25 11:44:48 2025 +0200

    tools/libxl: Skip invalid IRQs
    
    A PCI device's irq field is an 8-bit number.  A value of 0xff indicates
    that the device IRQ is not connected.  Additionally, the Linux ACPI code
    can convert these 0xff values to IRQ_NOTCONNECTED(0x80000000) because
    "0x80000000 is guaranteed to be outside the available range of
    interrupts and easy to distinguish from other possible incorrect
    values."  When the hypercall to assign that IRQ fails, device
    passthrough as a whole fails.
    
    Add checking for a valid IRQ and skip the IRQ handling for PCI devices
    outside that range.  This allows for passthrough of devices without
    legacy IRQs.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/light/libxl_pci.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c
index 1647fd6f47..6ddcdef6ad 100644
--- a/tools/libs/light/libxl_pci.c
+++ b/tools/libs/light/libxl_pci.c
@@ -26,6 +26,9 @@
 #define PCI_BDF_XSPATH         "%04x-%02x-%02x-%01x"
 #define PCI_PT_QDEV_ID         "pci-pt-%02x_%02x.%01x"
 
+/* PCI Interrupt Line is an 8-bit value, 0xff means disconnected. */
+#define PCI_IRQ_LINE_LIMIT     0xff
+
 static unsigned int pci_encode_bdf(libxl_device_pci *pci)
 {
     unsigned int value;
@@ -1495,7 +1498,7 @@ static void pci_add_dm_done(libxl__egc *egc,
             LOGED(ERROR, domainid, "Couldn't open %s", sysfs_path);
             goto out_no_irq;
         }
-        if ((fscanf(f, "%u", &irq) == 1) && irq) {
+        if (fscanf(f, "%u", &irq) == 1 && irq > 0 && irq < PCI_IRQ_LINE_LIMIT) {
             r = xc_physdev_map_pirq(ctx->xch, domid, irq, &irq);
             if (r < 0) {
                 LOGED(ERROR, domainid, "xc_physdev_map_pirq irq=%d (error=%d)",
@@ -2257,7 +2260,7 @@ skip_bar:
             goto skip_legacy_irq;
         }
 
-        if ((fscanf(f, "%u", &irq) == 1) && irq) {
+        if (fscanf(f, "%u", &irq) == 1 && irq > 0 && irq < PCI_IRQ_LINE_LIMIT) {
             rc = xc_physdev_unmap_pirq(ctx->xch, domid, irq);
             if (rc < 0) {
                 /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 25 11:44:43 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Apr 2025 11:44:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.967814.1357533 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u8HU3-0001q5-Cj; Fri, 25 Apr 2025 11:44:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 967814.1357533; Fri, 25 Apr 2025 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 1u8HU3-0001py-A7; Fri, 25 Apr 2025 11:44:43 +0000
Received: by outflank-mailman (input) for mailman id 967814;
 Fri, 25 Apr 2025 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 1u8HU2-0001po-67
 for xen-changelog@lists.xenproject.org; Fri, 25 Apr 2025 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 1u8HU2-003mbg-0V
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 11:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u8HU2-005wJD-0N
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 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=AQfEli+3uYDrRGjhyhdWTgjFdDzPEnup/6lAwjPnfpU=; b=AqNn7GqSTi/2QYgQ35PiRdnt38
	mzTX0HpHtvSAgx99GFMuB64XpWE3GfmOETLIQUeXJciYnxmIgayh1WMfpHgTKfKE2Z5XgsZIMV/s0
	Gdg9CF0beABIfN75b3gADdEe8AtPZeWK2sFB3h8N317XlyGbZ8uZS0I6fntNmRzDdnO0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libxl: Switch irq to unsigned int
Message-Id: <E1u8HU2-005wJD-0N@xenbits.xenproject.org>
Date: Fri, 25 Apr 2025 11:44:42 +0000

commit 4ed6f75805507a431bcf48245f78c51caf3f95b6
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Fri Apr 18 17:05:50 2025 -0400
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Fri Apr 25 11:44:48 2025 +0200

    tools/libxl: Switch irq to unsigned int
    
    The PCI device irq is read with fscanf(%u).  Switch the irq variable to
    unsigned int to match.
    
    Linux driver/pci/pci-sysfs.c:irq_show() uses %u to print the value.
    
    However, unsigned int irq doesn't compile because of:
    error: pointer targets in passing argument 4 of 'xc_physdev_map_pirq' differ in signedness [-Werror=pointer-sign]
    
    Add int pirq to provide the desired type instead of re-using irq.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/light/libxl_pci.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c
index 6ddcdef6ad..a8460fb3ec 100644
--- a/tools/libs/light/libxl_pci.c
+++ b/tools/libs/light/libxl_pci.c
@@ -1420,8 +1420,8 @@ static void pci_add_dm_done(libxl__egc *egc,
     char *sysfs_path;
     FILE *f;
     unsigned long long start, end, flags, size;
-    int irq, i;
-    int r;
+    unsigned int irq;
+    int i, r;
     uint32_t flag = XEN_DOMCTL_DEV_RDM_RELAXED;
     uint32_t domainid = domid;
     bool isstubdom = libxl_is_stubdom(ctx, domid, &domainid);
@@ -1499,7 +1499,9 @@ static void pci_add_dm_done(libxl__egc *egc,
             goto out_no_irq;
         }
         if (fscanf(f, "%u", &irq) == 1 && irq > 0 && irq < PCI_IRQ_LINE_LIMIT) {
-            r = xc_physdev_map_pirq(ctx->xch, domid, irq, &irq);
+            int pirq = irq;
+
+            r = xc_physdev_map_pirq(ctx->xch, domid, irq, &pirq);
             if (r < 0) {
                 LOGED(ERROR, domainid, "xc_physdev_map_pirq irq=%d (error=%d)",
                     irq, r);
@@ -1507,10 +1509,10 @@ static void pci_add_dm_done(libxl__egc *egc,
                 rc = ERROR_FAIL;
                 goto out;
             }
-            r = xc_domain_irq_permission(ctx->xch, domid, irq, 1);
+            r = xc_domain_irq_permission(ctx->xch, domid, pirq, 1);
             if (r < 0) {
                 LOGED(ERROR, domainid,
-                    "xc_domain_irq_permission irq=%d (error=%d)", irq, r);
+                    "xc_domain_irq_permission irq=%d (error=%d)", pirq, r);
                 fclose(f);
                 rc = ERROR_FAIL;
                 goto out;
@@ -2182,8 +2184,8 @@ static void pci_remove_detached(libxl__egc *egc,
 {
     STATE_AO_GC(prs->aodev->ao);
     libxl_ctx *ctx = libxl__gc_owner(gc);
-    unsigned int start = 0, end = 0, flags = 0, size = 0;
-    int  irq = 0, i, stubdomid = 0;
+    unsigned int start = 0, end = 0, flags = 0, size = 0, irq = 0;
+    int i, stubdomid = 0;
     const char *sysfs_path;
     FILE *f;
     uint32_t domainid = prs->domid;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 25 11:44:53 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Apr 2025 11:44:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.967815.1357538 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u8HUD-0001sO-Eb; Fri, 25 Apr 2025 11:44:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 967815.1357538; Fri, 25 Apr 2025 11:44:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u8HUD-0001sG-Bc; Fri, 25 Apr 2025 11:44:53 +0000
Received: by outflank-mailman (input) for mailman id 967815;
 Fri, 25 Apr 2025 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 1u8HUC-0001s5-97
 for xen-changelog@lists.xenproject.org; Fri, 25 Apr 2025 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 1u8HUC-003mbl-0o
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 11:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u8HUC-005wg0-0g
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 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=gDkYh33ctgW/DM8V/cTwYBnWKGSxM1uHE+8bDyKY3Dg=; b=GCHFM5l6qaz2ZrSdIRQCiTk0tW
	iP/Genomyw9HAoCAl6pblEperLsannpiz7AOcZEDSaI8d6IQ84GaKUUTOxFwTotzXy07bpKFX9bLC
	difKVNIHVQEgYhSWOekbprHx95FqFwruxBGxAAFezbYjuIz6x1vRVFQPFb3wQV7LQRwM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xen-hptool: Add missing newlines
Message-Id: <E1u8HUC-005wg0-0g@xenbits.xenproject.org>
Date: Fri, 25 Apr 2025 11:44:52 +0000

commit b2819c850cc5b947080bfae94aa2ae50d5ab4d89
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Wed Apr 23 17:28:20 2025 -0400
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Fri Apr 25 11:47:05 2025 +0200

    tools/xen-hptool: Add missing newlines
    
    Add some missing newlines to error messages.
    
    Fixes: 284d5633be37 ("Tools: add online/offline hotplug user interfaces")
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Denis Mukhin <dmukhin@ford.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/misc/xen-hptool.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/misc/xen-hptool.c b/tools/misc/xen-hptool.c
index 6d6aec8bad..d850404e31 100644
--- a/tools/misc/xen-hptool.c
+++ b/tools/misc/xen-hptool.c
@@ -51,7 +51,7 @@ static int hp_mem_online_func(int argc, char *argv[])
     ret = xc_mark_page_online(xch, mfn, mfn, &status);
 
     if (ret < 0)
-        fprintf(stderr, "Onlining page mfn %lx failed, error %x", mfn, errno);
+        fprintf(stderr, "Onlining page mfn %lx failed, error %x\n", mfn, errno);
     else if (status & (PG_ONLINE_FAILED |PG_ONLINE_BROKEN)) {
         fprintf(stderr, "Onlining page mfn %lx is broken, "
                         "Memory online failed\n", mfn);
@@ -82,7 +82,7 @@ static int hp_mem_query_func(int argc, char *argv[])
     ret = xc_query_page_offline_status(xch, mfn, mfn, &status);
 
     if (ret < 0)
-        fprintf(stderr, "Querying page mfn %lx failed, error %x", mfn, errno);
+        fprintf(stderr, "Querying page mfn %lx failed, error %x\n", mfn, errno);
     else
     {
 		printf("Memory Status %x: [", status);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 25 11:45:03 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Apr 2025 11:45:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.967816.1357540 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u8HUN-0001uy-Fj; Fri, 25 Apr 2025 11:45:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 967816.1357540; Fri, 25 Apr 2025 11:45:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u8HUN-0001ur-D1; Fri, 25 Apr 2025 11:45:03 +0000
Received: by outflank-mailman (input) for mailman id 967816;
 Fri, 25 Apr 2025 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 1u8HUM-0001ue-Bv
 for xen-changelog@lists.xenproject.org; Fri, 25 Apr 2025 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 1u8HUM-003mcB-16
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 11:45:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u8HUM-005xFx-10
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 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=DxOvPyF/jOcD2tkURAV4mmY08eEmydoolOTg7Zu8q5w=; b=nd+RPR1zlTZialotmTUcNQWwnu
	JAadn3zdzERk4rYZotsY9CaR+jbocHworXFREXyY+QwnEIL3e7tEnTff01QhnB/ExfXigB0rlmf2n
	VA6K8qonqq1kkj3ZchCYTL+B1LgoMRFY15Re8Vy53dEuouuJGXAa3Y9x8TuRgmuO2VNA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xen-hptool: Replace hard tabs
Message-Id: <E1u8HUM-005xFx-10@xenbits.xenproject.org>
Date: Fri, 25 Apr 2025 11:45:02 +0000

commit 7897492d8082f18073514a9380f361b4f5df5897
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Wed Apr 23 17:28:21 2025 -0400
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Fri Apr 25 11:47:05 2025 +0200

    tools/xen-hptool: Replace hard tabs
    
    With a tab stop of 8, the alignment is off.  Replace the hard tabs with
    spaces to match the file.
    
    Fixes: 284d5633be37 ("Tools: add online/offline hotplug user interfaces")
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Denis Mukhin <dmukhin@ford.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/misc/xen-hptool.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/misc/xen-hptool.c b/tools/misc/xen-hptool.c
index d850404e31..590810b6eb 100644
--- a/tools/misc/xen-hptool.c
+++ b/tools/misc/xen-hptool.c
@@ -56,7 +56,7 @@ static int hp_mem_online_func(int argc, char *argv[])
         fprintf(stderr, "Onlining page mfn %lx is broken, "
                         "Memory online failed\n", mfn);
         ret = -1;
-	}
+    }
     else if (status & PG_ONLINE_ONLINED)
         printf("Memory mfn %lx onlined successfully\n", mfn);
     else
@@ -85,14 +85,14 @@ static int hp_mem_query_func(int argc, char *argv[])
         fprintf(stderr, "Querying page mfn %lx failed, error %x\n", mfn, errno);
     else
     {
-		printf("Memory Status %x: [", status);
+        printf("Memory Status %x: [", status);
         if ( status & PG_OFFLINE_STATUS_OFFLINE_PENDING)
             printf(" PAGE_OFFLINE_PENDING ");
         if ( status & PG_OFFLINE_STATUS_BROKEN )
             printf(" PAGE_BROKEND  ");
         if ( status & PG_OFFLINE_STATUS_OFFLINED )
             printf(" PAGE_OFFLINED ");
-		else
+        else
             printf(" PAGE_ONLINED ");
         printf("]\n");
     }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 25 12:33:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Apr 2025 12:33:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.967868.1357575 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u8IEq-0003h0-IG; Fri, 25 Apr 2025 12:33:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 967868.1357575; Fri, 25 Apr 2025 12: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 1u8IEq-0003gs-Fa; Fri, 25 Apr 2025 12:33:04 +0000
Received: by outflank-mailman (input) for mailman id 967868;
 Fri, 25 Apr 2025 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 1u8IEo-0003gk-HS
 for xen-changelog@lists.xenproject.org; Fri, 25 Apr 2025 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 1u8IEo-003ntc-1H
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 12:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u8IEo-007pc0-16
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 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=GuuzfJywmdETwoZ+T/yB9CoOgoYYORig+mPydkyU0Rk=; b=qd7D3BXG3hEFRZkCGVAHMC7qnm
	EJIR+zef8cS5tOdh4FQr6y07BjiaFqPXDyhIyt3czhjOj7DqjYIvi1qrFmnBfJ9UYNmev+E/bYrkM
	QZMpsycK2Op0nflX6flzz/tdw7iiC70uXNIzBN6pPRgfso08dgKNYi287hGgM9qNnWWA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation: Avoid changing source files for randconfig tests
Message-Id: <E1u8IEo-007pc0-16@xenbits.xenproject.org>
Date: Fri, 25 Apr 2025 12:33:02 +0000

commit e43d9621d8081a88397e2b49b08906c4f4acaa57
Author:     Anthony PERARD <anthony.perard@vates.tech>
AuthorDate: Wed Mar 26 14:28:25 2025 +0000
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Fri Apr 25 11:26:29 2025 +0200

    automation: Avoid changing source files for randconfig tests
    
    We should avoid changing files from the source tree if we don't intend
    to commit the result.
    
    We don't really need to check if $EXTRA_FIXED_RANDCONFIG is empty so
    add it to the temporary file in all cases.
    
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/scripts/build | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/automation/scripts/build b/automation/scripts/build
index a348c781d1..cdb8cd7c72 100755
--- a/automation/scripts/build
+++ b/automation/scripts/build
@@ -12,12 +12,12 @@ $cc --version
 # random config or default config
 if [[ "${RANDCONFIG}" == "y" ]]; then
 
+    cp -f xen/tools/kconfig/allrandom.config xen/allrandom.config.tmp
+
     # Append job-specific fixed configuration
-    if [[ -n "${EXTRA_FIXED_RANDCONFIG}" ]]; then
-        echo "${EXTRA_FIXED_RANDCONFIG}" >> xen/tools/kconfig/allrandom.config
-    fi
+    echo "${EXTRA_FIXED_RANDCONFIG}" >> xen/allrandom.config.tmp
 
-    make -j$(nproc) -C xen KCONFIG_ALLCONFIG=tools/kconfig/allrandom.config randconfig
+    make -j$(nproc) -C xen KCONFIG_ALLCONFIG=allrandom.config.tmp randconfig
 
     # RANDCONFIG implies HYPERVISOR_ONLY
     HYPERVISOR_ONLY="y"
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 25 12:33:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Apr 2025 12:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.967869.1357578 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u8IEz-0003ig-JO; Fri, 25 Apr 2025 12:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 967869.1357578; Fri, 25 Apr 2025 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 1u8IEz-0003iY-Gy; Fri, 25 Apr 2025 12:33:13 +0000
Received: by outflank-mailman (input) for mailman id 967869;
 Fri, 25 Apr 2025 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 1u8IEy-0003iQ-HD
 for xen-changelog@lists.xenproject.org; Fri, 25 Apr 2025 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 1u8IEy-003ntg-1a
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 12:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u8IEy-007q78-1T
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 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=6Oalq8xHEs+sFsKKMsFL1OOHcOCciNGkP9LcA1KqWFA=; b=sl+4NYRE9lgUvRxqF+YMR3c1fR
	j0lM+s2l5sDoIDkOKAaEqIHqnn2sjF/6UmqIoLHOXNwNyu/BB/a5C3RKqiy/EgPs4CsJ6yNNPY+Lg
	qO1oPHWgGeww4u3OnZ4mtQxYjUDaloFFBJKJEO0s7AvFAAf972OBjoBh4p8lntX+0Qic=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libxl: search PATH for QEMU if `QEMU_XEN_PATH` is not absolute
Message-Id: <E1u8IEy-007q78-1T@xenbits.xenproject.org>
Date: Fri, 25 Apr 2025 12:33:12 +0000

commit f6281291704aa356489f4bd927cc7348a920bd01
Author:     Hongbo <hehongbo@mail.com>
AuthorDate: Mon Mar 31 00:03:04 2025 +0800
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Fri Apr 25 11:42:32 2025 +0200

    tools/libxl: search PATH for QEMU if `QEMU_XEN_PATH` is not absolute
    
    `QEMU_XEN_PATH` will be configured as `qemu-system-i386` with no clue where, if
    `--with-system-qemu` is set without giving a path (as matched in the case `yes`
    but not `*`). However, the existence of the executable is checked by `access()`,
    that will not look for anywhere in $PATH but the current directory. And since it
    is possible for `qemu-system-i386` (or any other configured values) to be
    executed from PATH later, we'd better find that in PATH and return the full path
    for the caller to check against.
    
    Signed-off-by: Hongbo <hehongbo@mail.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
    [Initialise `saveptr` to NULL]
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/light/libxl_dm.c | 38 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 36 insertions(+), 2 deletions(-)

diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
index b193a5dc37..4627564c0d 100644
--- a/tools/libs/light/libxl_dm.c
+++ b/tools/libs/light/libxl_dm.c
@@ -331,9 +331,43 @@ const char *libxl__domain_device_model(libxl__gc *gc,
         case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
             dm = libxl__abs_path(gc, "qemu-dm", libxl__private_bindir_path());
             break;
-        case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
-            dm = qemu_xen_path(gc);
+        case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN: {
+            const char *configured_dm = qemu_xen_path(gc);
+            if (configured_dm[0] == '/')
+            {
+                dm = configured_dm;
+            }
+            else
+            {
+                const char *path_env = getenv("PATH");
+                if (!path_env)
+                {
+                    dm = configured_dm;
+                }
+                else
+                {
+                    char *path_dup = libxl__strdup(gc, path_env);
+                    char *saveptr = NULL;
+
+                    char *path = strtok_r(path_dup, ":", &saveptr);
+                    dm = NULL;
+                    while (path)
+                    {
+                        char *candidate = libxl__abs_path(gc, configured_dm, path);
+                        if (access(candidate, X_OK) == 0)
+                        {
+                            dm = candidate;
+                            break;
+                        }
+                        path = strtok_r(NULL, ":", &saveptr);
+                    }
+
+                    if (!dm)
+                        dm = configured_dm;
+                }
+            }
             break;
+        }
         default:
             LOG(ERROR, "invalid device model version %d",
                 info->device_model_version);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 25 12:33:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Apr 2025 12:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.967870.1357583 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u8IF9-0003lO-L0; Fri, 25 Apr 2025 12:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 967870.1357583; Fri, 25 Apr 2025 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 1u8IF9-0003lG-IM; Fri, 25 Apr 2025 12:33:23 +0000
Received: by outflank-mailman (input) for mailman id 967870;
 Fri, 25 Apr 2025 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 1u8IF8-0003l0-OA
 for xen-changelog@lists.xenproject.org; Fri, 25 Apr 2025 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 1u8IF8-003nu0-1y
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 12:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u8IF8-007qLO-1k
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 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=dCdhEeoJeHsIucoHr3z5RaMDlFFE3/MrXVrh+BjE0Ks=; b=wdtYgnWzqnU4uMH7x3g/dxPPbL
	rPARtNgk8hRnVRZPpS6pjhAy8hgUPm3oQhHnCGUCnqVFNNvBUgGX6KIFTUKXLWLKo/xBvB13TIPQA
	iHlvFAHYCgga5en0fvd92trn3sjZKqonA9KuTsMsSNzpLcfdSl/hZnRev0B5Lah0D8Ek=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/tests: Fix newly introduced Makefile
Message-Id: <E1u8IF8-007qLO-1k@xenbits.xenproject.org>
Date: Fri, 25 Apr 2025 12:33:22 +0000

commit a5d0e9c901044055c1c412d0825b434f21ec273e
Author:     Anthony PERARD <anthony.perard@vates.tech>
AuthorDate: Mon Apr 14 16:17:14 2025 +0200
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Fri Apr 25 11:44:03 2025 +0200

    tools/tests: Fix newly introduced Makefile
    
    Fix few issue with this new directory:
    - clean generated files
    - and ignore those generated files
    - include the dependency files generated by `gcc`.
    - rework prerequisites:
      "test-rangeset.o" also needs the generated files "list.h" and
      "rangeset.h". Technically, both only needs "harness.h" which needs
      the generated headers, but that's a bit simpler and the previous
      point will add the dependency on "harness.h" automatically.
    
    This last point fix an issue where `make` might decide to build
    "test-rangeset.o" before the other files are ready.
    
    Fixes: 7bf777b42cad ("tootls/tests: introduce unit tests for rangesets")
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/tests/rangeset/.gitignore | 4 ++++
 tools/tests/rangeset/Makefile   | 8 ++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/tools/tests/rangeset/.gitignore b/tools/tests/rangeset/.gitignore
new file mode 100644
index 0000000000..cdeb778535
--- /dev/null
+++ b/tools/tests/rangeset/.gitignore
@@ -0,0 +1,4 @@
+/list.h
+/rangeset.c
+/rangeset.h
+/test-rangeset
diff --git a/tools/tests/rangeset/Makefile b/tools/tests/rangeset/Makefile
index 70076eff34..3dafcbd054 100644
--- a/tools/tests/rangeset/Makefile
+++ b/tools/tests/rangeset/Makefile
@@ -12,7 +12,7 @@ run: $(TARGET)
 
 .PHONY: clean
 clean:
-	$(RM) -- *.o $(TARGET) $(DEPS_RM)
+	$(RM) -- *.o $(TARGET) $(DEPS_RM) list.h rangeset.h rangeset.c
 
 .PHONY: distclean
 distclean: clean
@@ -32,7 +32,7 @@ rangeset.h: $(XEN_ROOT)/xen/include/xen/rangeset.h
 list.h rangeset.h:
 	sed -e '/#include/d' <$< >$@
 
-rangeset.c: $(XEN_ROOT)/xen/common/rangeset.c list.h rangeset.h
+rangeset.c: $(XEN_ROOT)/xen/common/rangeset.c
 	# Remove includes and add the test harness header
 	sed -e '/#include/d' -e '1s/^/#include "harness.h"/' <$< >$@
 
@@ -42,5 +42,9 @@ CFLAGS += $(CFLAGS_xeninclude)
 
 LDFLAGS += $(APPEND_LDFLAGS)
 
+test-rangeset.o rangeset.o: list.h rangeset.h
+
 test-rangeset: rangeset.o test-rangeset.o
 	$(CC) $^ -o $@ $(LDFLAGS)
+
+-include $(DEPS_INCLUDE)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 25 12:33:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Apr 2025 12:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.967871.1357586 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u8IFJ-0003nn-MD; Fri, 25 Apr 2025 12:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 967871.1357586; Fri, 25 Apr 2025 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 1u8IFJ-0003ng-Jk; Fri, 25 Apr 2025 12:33:33 +0000
Received: by outflank-mailman (input) for mailman id 967871;
 Fri, 25 Apr 2025 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 1u8IFI-0003nT-Ss
 for xen-changelog@lists.xenproject.org; Fri, 25 Apr 2025 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 1u8IFI-003nu5-2c
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 12:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u8IFI-007qd1-2J
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 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=DIq2s4xcQ4uEAcb31QKPwmG2DH/AWZ8INao1OQ/hRUg=; b=plOAs3iMeNuFS9cl0IkyTC8iHJ
	9ZEoQyiTE/pXjV3nn3PIQhmhCRK8MH3iOyIklDEMIh6F95gFIqlu1cz6M1YFyzfB229//1/EKBwTH
	kKjf2P6vt26SlZkKap+G0U9xan1JpTBDDnr+iZMyjJ9ag0NFhez7IRN+xcAT8bDH88x8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libxl: Skip invalid IRQs
Message-Id: <E1u8IFI-007qd1-2J@xenbits.xenproject.org>
Date: Fri, 25 Apr 2025 12:33:32 +0000

commit ec9fda045b517128e2173fa7b87bf6aee9dcc33a
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Fri Apr 18 17:05:49 2025 -0400
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Fri Apr 25 11:44:48 2025 +0200

    tools/libxl: Skip invalid IRQs
    
    A PCI device's irq field is an 8-bit number.  A value of 0xff indicates
    that the device IRQ is not connected.  Additionally, the Linux ACPI code
    can convert these 0xff values to IRQ_NOTCONNECTED(0x80000000) because
    "0x80000000 is guaranteed to be outside the available range of
    interrupts and easy to distinguish from other possible incorrect
    values."  When the hypercall to assign that IRQ fails, device
    passthrough as a whole fails.
    
    Add checking for a valid IRQ and skip the IRQ handling for PCI devices
    outside that range.  This allows for passthrough of devices without
    legacy IRQs.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/light/libxl_pci.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c
index 1647fd6f47..6ddcdef6ad 100644
--- a/tools/libs/light/libxl_pci.c
+++ b/tools/libs/light/libxl_pci.c
@@ -26,6 +26,9 @@
 #define PCI_BDF_XSPATH         "%04x-%02x-%02x-%01x"
 #define PCI_PT_QDEV_ID         "pci-pt-%02x_%02x.%01x"
 
+/* PCI Interrupt Line is an 8-bit value, 0xff means disconnected. */
+#define PCI_IRQ_LINE_LIMIT     0xff
+
 static unsigned int pci_encode_bdf(libxl_device_pci *pci)
 {
     unsigned int value;
@@ -1495,7 +1498,7 @@ static void pci_add_dm_done(libxl__egc *egc,
             LOGED(ERROR, domainid, "Couldn't open %s", sysfs_path);
             goto out_no_irq;
         }
-        if ((fscanf(f, "%u", &irq) == 1) && irq) {
+        if (fscanf(f, "%u", &irq) == 1 && irq > 0 && irq < PCI_IRQ_LINE_LIMIT) {
             r = xc_physdev_map_pirq(ctx->xch, domid, irq, &irq);
             if (r < 0) {
                 LOGED(ERROR, domainid, "xc_physdev_map_pirq irq=%d (error=%d)",
@@ -2257,7 +2260,7 @@ skip_bar:
             goto skip_legacy_irq;
         }
 
-        if ((fscanf(f, "%u", &irq) == 1) && irq) {
+        if (fscanf(f, "%u", &irq) == 1 && irq > 0 && irq < PCI_IRQ_LINE_LIMIT) {
             rc = xc_physdev_unmap_pirq(ctx->xch, domid, irq);
             if (rc < 0) {
                 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 25 12:33:43 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Apr 2025 12:33:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.967873.1357601 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u8IFT-000456-Uk; Fri, 25 Apr 2025 12:33:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 967873.1357601; Fri, 25 Apr 2025 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 1u8IFT-00044z-SF; Fri, 25 Apr 2025 12:33:43 +0000
Received: by outflank-mailman (input) for mailman id 967873;
 Fri, 25 Apr 2025 12: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 1u8IFT-00044j-3J
 for xen-changelog@lists.xenproject.org; Fri, 25 Apr 2025 12: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 1u8IFT-003nuB-0E
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 12:33:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u8IFT-007qzr-06
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 12: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=eqJxuL0RMX/IreLb0jM+Khr3OntLDNDoxsaeRDq/vyM=; b=3AchtRyooDFDwOlK3KwK1wAIpH
	LEQatt8nIc4LNyE38iVgdNzvDj/B5lSFPcbp/Preo0x1uv53q4yRBediZ+N8ciw5sLohmJiBt2ijg
	HoWttb/PgNxYn0pdoem0WyaGU1+AbNu9/bnRTSxhzSTZXoNOouMfK4pznXdnIU71kUxg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libxl: Switch irq to unsigned int
Message-Id: <E1u8IFT-007qzr-06@xenbits.xenproject.org>
Date: Fri, 25 Apr 2025 12:33:43 +0000

commit 4ed6f75805507a431bcf48245f78c51caf3f95b6
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Fri Apr 18 17:05:50 2025 -0400
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Fri Apr 25 11:44:48 2025 +0200

    tools/libxl: Switch irq to unsigned int
    
    The PCI device irq is read with fscanf(%u).  Switch the irq variable to
    unsigned int to match.
    
    Linux driver/pci/pci-sysfs.c:irq_show() uses %u to print the value.
    
    However, unsigned int irq doesn't compile because of:
    error: pointer targets in passing argument 4 of 'xc_physdev_map_pirq' differ in signedness [-Werror=pointer-sign]
    
    Add int pirq to provide the desired type instead of re-using irq.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/light/libxl_pci.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c
index 6ddcdef6ad..a8460fb3ec 100644
--- a/tools/libs/light/libxl_pci.c
+++ b/tools/libs/light/libxl_pci.c
@@ -1420,8 +1420,8 @@ static void pci_add_dm_done(libxl__egc *egc,
     char *sysfs_path;
     FILE *f;
     unsigned long long start, end, flags, size;
-    int irq, i;
-    int r;
+    unsigned int irq;
+    int i, r;
     uint32_t flag = XEN_DOMCTL_DEV_RDM_RELAXED;
     uint32_t domainid = domid;
     bool isstubdom = libxl_is_stubdom(ctx, domid, &domainid);
@@ -1499,7 +1499,9 @@ static void pci_add_dm_done(libxl__egc *egc,
             goto out_no_irq;
         }
         if (fscanf(f, "%u", &irq) == 1 && irq > 0 && irq < PCI_IRQ_LINE_LIMIT) {
-            r = xc_physdev_map_pirq(ctx->xch, domid, irq, &irq);
+            int pirq = irq;
+
+            r = xc_physdev_map_pirq(ctx->xch, domid, irq, &pirq);
             if (r < 0) {
                 LOGED(ERROR, domainid, "xc_physdev_map_pirq irq=%d (error=%d)",
                     irq, r);
@@ -1507,10 +1509,10 @@ static void pci_add_dm_done(libxl__egc *egc,
                 rc = ERROR_FAIL;
                 goto out;
             }
-            r = xc_domain_irq_permission(ctx->xch, domid, irq, 1);
+            r = xc_domain_irq_permission(ctx->xch, domid, pirq, 1);
             if (r < 0) {
                 LOGED(ERROR, domainid,
-                    "xc_domain_irq_permission irq=%d (error=%d)", irq, r);
+                    "xc_domain_irq_permission irq=%d (error=%d)", pirq, r);
                 fclose(f);
                 rc = ERROR_FAIL;
                 goto out;
@@ -2182,8 +2184,8 @@ static void pci_remove_detached(libxl__egc *egc,
 {
     STATE_AO_GC(prs->aodev->ao);
     libxl_ctx *ctx = libxl__gc_owner(gc);
-    unsigned int start = 0, end = 0, flags = 0, size = 0;
-    int  irq = 0, i, stubdomid = 0;
+    unsigned int start = 0, end = 0, flags = 0, size = 0, irq = 0;
+    int i, stubdomid = 0;
     const char *sysfs_path;
     FILE *f;
     uint32_t domainid = prs->domid;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 25 12:33:54 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Apr 2025 12:33:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.967875.1357605 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u8IFe-0004Ci-03; Fri, 25 Apr 2025 12:33:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 967875.1357605; Fri, 25 Apr 2025 12: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 1u8IFd-0004Ca-Tk; Fri, 25 Apr 2025 12:33:53 +0000
Received: by outflank-mailman (input) for mailman id 967875;
 Fri, 25 Apr 2025 12: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 1u8IFd-0004CC-67
 for xen-changelog@lists.xenproject.org; Fri, 25 Apr 2025 12: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 1u8IFd-003nuK-0W
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 12:33:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u8IFd-007rDT-0O
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 12: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=oCXR1wVAFsNRjmhGdMLZtpTbgMbaNArcw7JHs5Ez2Eo=; b=p+QsBPr4OgJoxny6PRZLytKPVZ
	Q0Z8hEZpePowyLiKjMuSU8cAzyQN7skZvu+55SAapo/J14QPDvrcYOSyqqfOvjGM+COqFdfF41hZs
	9ZDCbaUyf6vMJ1H39Xs3fkFc6RNbKymcoo1SD/sgXsTy6rT5BfpuBBTHjm/RJ2LEp+4Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xen-hptool: Add missing newlines
Message-Id: <E1u8IFd-007rDT-0O@xenbits.xenproject.org>
Date: Fri, 25 Apr 2025 12:33:53 +0000

commit b2819c850cc5b947080bfae94aa2ae50d5ab4d89
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Wed Apr 23 17:28:20 2025 -0400
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Fri Apr 25 11:47:05 2025 +0200

    tools/xen-hptool: Add missing newlines
    
    Add some missing newlines to error messages.
    
    Fixes: 284d5633be37 ("Tools: add online/offline hotplug user interfaces")
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Denis Mukhin <dmukhin@ford.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/misc/xen-hptool.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/misc/xen-hptool.c b/tools/misc/xen-hptool.c
index 6d6aec8bad..d850404e31 100644
--- a/tools/misc/xen-hptool.c
+++ b/tools/misc/xen-hptool.c
@@ -51,7 +51,7 @@ static int hp_mem_online_func(int argc, char *argv[])
     ret = xc_mark_page_online(xch, mfn, mfn, &status);
 
     if (ret < 0)
-        fprintf(stderr, "Onlining page mfn %lx failed, error %x", mfn, errno);
+        fprintf(stderr, "Onlining page mfn %lx failed, error %x\n", mfn, errno);
     else if (status & (PG_ONLINE_FAILED |PG_ONLINE_BROKEN)) {
         fprintf(stderr, "Onlining page mfn %lx is broken, "
                         "Memory online failed\n", mfn);
@@ -82,7 +82,7 @@ static int hp_mem_query_func(int argc, char *argv[])
     ret = xc_query_page_offline_status(xch, mfn, mfn, &status);
 
     if (ret < 0)
-        fprintf(stderr, "Querying page mfn %lx failed, error %x", mfn, errno);
+        fprintf(stderr, "Querying page mfn %lx failed, error %x\n", mfn, errno);
     else
     {
 		printf("Memory Status %x: [", status);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 25 12:34:04 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Apr 2025 12:34:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.967879.1357609 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u8IFo-0004KM-1Y; Fri, 25 Apr 2025 12:34:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 967879.1357609; Fri, 25 Apr 2025 12: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 1u8IFn-0004KE-VD; Fri, 25 Apr 2025 12:34:03 +0000
Received: by outflank-mailman (input) for mailman id 967879;
 Fri, 25 Apr 2025 12: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 1u8IFn-0004K1-9B
 for xen-changelog@lists.xenproject.org; Fri, 25 Apr 2025 12: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 1u8IFn-003nub-0p
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 12:34:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u8IFn-007rVm-0g
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 12: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=LL4clO+iFQviLet/vRG4Z8ijyOEUYv3HEmXfQhNCEQo=; b=vBFez/BwPYTJW5vjWRXjle2LuC
	XhSJpsYPrDUbvQcsLp4ENoj7bPbGzObk/9458jiRslyaLMD0Zo5f1LvK4bTTAmUaVYmRheXhgqdvT
	QoVEgcxsM11jFxQb8/kMPtfq6WzsCSJo/K2u7Uc6aBzQhiChc6rLnNamHDP9HWuNLOro=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xen-hptool: Replace hard tabs
Message-Id: <E1u8IFn-007rVm-0g@xenbits.xenproject.org>
Date: Fri, 25 Apr 2025 12:34:03 +0000

commit 7897492d8082f18073514a9380f361b4f5df5897
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Wed Apr 23 17:28:21 2025 -0400
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Fri Apr 25 11:47:05 2025 +0200

    tools/xen-hptool: Replace hard tabs
    
    With a tab stop of 8, the alignment is off.  Replace the hard tabs with
    spaces to match the file.
    
    Fixes: 284d5633be37 ("Tools: add online/offline hotplug user interfaces")
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Denis Mukhin <dmukhin@ford.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/misc/xen-hptool.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/misc/xen-hptool.c b/tools/misc/xen-hptool.c
index d850404e31..590810b6eb 100644
--- a/tools/misc/xen-hptool.c
+++ b/tools/misc/xen-hptool.c
@@ -56,7 +56,7 @@ static int hp_mem_online_func(int argc, char *argv[])
         fprintf(stderr, "Onlining page mfn %lx is broken, "
                         "Memory online failed\n", mfn);
         ret = -1;
-	}
+    }
     else if (status & PG_ONLINE_ONLINED)
         printf("Memory mfn %lx onlined successfully\n", mfn);
     else
@@ -85,14 +85,14 @@ static int hp_mem_query_func(int argc, char *argv[])
         fprintf(stderr, "Querying page mfn %lx failed, error %x\n", mfn, errno);
     else
     {
-		printf("Memory Status %x: [", status);
+        printf("Memory Status %x: [", status);
         if ( status & PG_OFFLINE_STATUS_OFFLINE_PENDING)
             printf(" PAGE_OFFLINE_PENDING ");
         if ( status & PG_OFFLINE_STATUS_BROKEN )
             printf(" PAGE_BROKEND  ");
         if ( status & PG_OFFLINE_STATUS_OFFLINED )
             printf(" PAGE_OFFLINED ");
-		else
+        else
             printf(" PAGE_ONLINED ");
         printf("]\n");
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 25 12:55:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Apr 2025 12:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.968030.1357733 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u8Ia8-0005sn-BW; Fri, 25 Apr 2025 12:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 968030.1357733; Fri, 25 Apr 2025 12: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 1u8Ia8-0005sf-8k; Fri, 25 Apr 2025 12:55:04 +0000
Received: by outflank-mailman (input) for mailman id 968030;
 Fri, 25 Apr 2025 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 1u8Ia6-0005sV-Dz
 for xen-changelog@lists.xenproject.org; Fri, 25 Apr 2025 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 1u8Ia6-003oTB-0G
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 12:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u8Ia6-008B5J-06
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 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=TlgL+B/bqrNVJRAF8tdqW17PuPnbLwzhGhOOYrblF84=; b=J5cC6WgMK/ok8BTBOLKR1hMaSC
	fS5MdoJKl0F9rsOTVewtN7PWMD+klpVNd/0cqZ9DHRD64CWDIExiCZvkMT92ONlc1HYLgpAChTy5p
	j66Q4hCDWAHcoWkUeWydUqQcFDfneU5dzX4A2oB+62mCMNBDkzYvu5T+i+tDXCARwLpQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: fix buffer over-read in bitmap_to_xenctl_bitmap()
Message-Id: <E1u8Ia6-008B5J-06@xenbits.xenproject.org>
Date: Fri, 25 Apr 2025 12:55:02 +0000

commit cba90ddee086e8d26063d8de90e40a098395e99b
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Apr 24 12:23:14 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Fri Apr 25 14:50:19 2025 +0200

    xen: fix buffer over-read in bitmap_to_xenctl_bitmap()
    
    There's an off-by-one when calculating the last byte in the input array to
    bitmap_to_xenctl_bitmap(), which leads to bitmaps with sizes multiple of 8
    to over-read and incorrectly use a byte past the end of the array.
    
    Fixes: 288c4641c80d ('xen: simplify bitmap_to_xenctl_bitmap for little endian')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/bitmap.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/common/bitmap.c b/xen/common/bitmap.c
index bf1a7fd91e..4f96fda389 100644
--- a/xen/common/bitmap.c
+++ b/xen/common/bitmap.c
@@ -369,6 +369,9 @@ int bitmap_to_xenctl_bitmap(struct xenctl_bitmap *xenctl_bitmap,
     const uint8_t *bytemap;
     uint8_t last, *buf = NULL;
 
+    if ( !nbits )
+        return 0;
+
     if ( !IS_ENABLED(LITTLE_ENDIAN) )
     {
         buf = xmalloc_array(uint8_t, xen_bytes);
@@ -396,7 +399,7 @@ int bitmap_to_xenctl_bitmap(struct xenctl_bitmap *xenctl_bitmap,
      * their loops to 8 bits. Ensure we clear those left over bits so as to
      * prevent surprises.
      */
-    last = bytemap[nbits / 8];
+    last = bytemap[(nbits - 1) / 8];
     if ( nbits % 8 )
         last &= (1U << (nbits % 8)) - 1;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 25 12:55:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Apr 2025 12:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.968031.1357737 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u8IaH-0005vP-Cm; Fri, 25 Apr 2025 12:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 968031.1357737; Fri, 25 Apr 2025 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 1u8IaH-0005vI-A1; Fri, 25 Apr 2025 12:55:13 +0000
Received: by outflank-mailman (input) for mailman id 968031;
 Fri, 25 Apr 2025 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 1u8IaG-0005v1-6i
 for xen-changelog@lists.xenproject.org; Fri, 25 Apr 2025 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 1u8IaG-003oTK-0Y
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 12:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u8IaG-008B8f-0R
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 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=mSVf/dEHzB/bwnCxdM0817oY+8KqCP/KCrepdQF8pog=; b=oGUbqVgBt+04kRdWCiATO4g5C/
	Ujkg7PhmF5tX4MjmCRpB9vHCOhFomJ5pA+JmoKT4zzkNzFzkk903jvvUFVi1iHURKar88ucSrmrpZ
	Lqp+AcBxc0fiXWqoLPG4uoAvr5izIHpITgl4RO0nE8FLRSzsmDOomJDfRlkrutkPVM/s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/hvmloader: fix usage of NULL with cpuid_count()
Message-Id: <E1u8IaG-008B8f-0R@xenbits.xenproject.org>
Date: Fri, 25 Apr 2025 12:55:12 +0000

commit 8f2c5dc611404fe17a1fc7cfc03153c65db2bcd5
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Apr 24 13:39:45 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Fri Apr 25 14:50:19 2025 +0200

    x86/hvmloader: fix usage of NULL with cpuid_count()
    
    The commit that added support for retrieving the APIC IDs from the APs
    introduced several usages of cpuid() with NULL parameters, which is not
    handled by the underlying implementation.  For GCC I expect this results in
    writes to the physical address at 0, however when using Clang 19.1.2 the
    generated code in smp.o for the whole file is:
    
    tools/firmware/hvmloader/smp.o: file format elf32-i386
    
    Disassembly of section .text:
    
    00000000 <smp_initialise>:
           0: 55                            pushl   %ebp
           1: 89 e5                         movl    %esp, %ebp
           3: 53                            pushl   %ebx
           4: 31 c0                         xorl    %eax, %eax
           6: 31 c9                         xorl    %ecx, %ecx
           8: 0f a2                         cpuid
    
    Showing the usage of a NULL pointer results in undefined behavior, and
    Clang refusing to generate further code after it.
    
    Fix by using a temporary variable in cpuid_count() in place for any NULL
    parameter.
    
    Fixes: 9ad0db58c7e2 ('tools/hvmloader: Retrieve APIC IDs from the APs themselves')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/firmware/hvmloader/util.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tools/firmware/hvmloader/util.h b/tools/firmware/hvmloader/util.h
index 644450c51c..765a013ddd 100644
--- a/tools/firmware/hvmloader/util.h
+++ b/tools/firmware/hvmloader/util.h
@@ -190,6 +190,17 @@ static inline void cpuid_count(
     uint32_t *ecx,
     uint32_t *edx)
 {
+    uint32_t tmp;
+
+    if ( !eax )
+        eax = &tmp;
+    if ( !ebx )
+        ebx = &tmp;
+    if ( !ecx )
+        ecx = &tmp;
+    if ( !edx )
+        edx = &tmp;
+
     asm volatile ( "cpuid"
                    : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)
                    : "a" (leaf), "c" (subleaf) );
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 25 12:55:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Apr 2025 12:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.968033.1357740 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u8IaR-0005yE-E4; Fri, 25 Apr 2025 12:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 968033.1357740; Fri, 25 Apr 2025 12: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 1u8IaR-0005y7-BX; Fri, 25 Apr 2025 12:55:23 +0000
Received: by outflank-mailman (input) for mailman id 968033;
 Fri, 25 Apr 2025 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 1u8IaQ-0005xw-9Z
 for xen-changelog@lists.xenproject.org; Fri, 25 Apr 2025 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 1u8IaQ-003oTl-0r
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 12:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u8IaQ-008BKr-0k
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 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=NWuWb2xC6be2+1hH9pTLw+PwLtfsWRfnNJdV5uWNCek=; b=IEd/GDRawfdLzDT98Y+vjMpElD
	SOC20VKUaSVY4PgzppfF7XFvbTnSqwFaJwH/kgualh9erPrWv2AOFfpiDZNCWNPPN324jRspEhOGA
	PimVp6fP4RZPB4+TVoGDJUX0AQI1TEh5FtMmWLJtoU2fhTIFfJXD8nb4bhbeLoIIzi1A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/vpci: Fix msix existing mapping printk
Message-Id: <E1u8IaQ-008BKr-0k@xenbits.xenproject.org>
Date: Fri, 25 Apr 2025 12:55:22 +0000

commit 888cdbd9f1efc35bae9cba26e2d6466e1c78de47
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Thu Apr 24 17:23:26 2025 -0400
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Fri Apr 25 14:50:19 2025 +0200

    xen/vpci: Fix msix existing mapping printk
    
    The format string lacks a space, so mfn and type run together:
    (XEN) d0v0 0000:06:00.7: existing mapping (mfn: 753037type: 0) at 0x1 clobbers MSIX MMIO area
    
    Add a space.  Additionally, move the format string to a single long line
    to improve grep-ability.
    
    Fixes: 677053fac17a ("vpci/msix: carve p2m hole for MSIX MMIO regions")
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/vpci/msix.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index f3804ce047..3568f2a651 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -665,8 +665,7 @@ int vpci_make_msix_hole(const struct pci_dev *pdev)
             default:
                 put_gfn(d, start);
                 gprintk(XENLOG_WARNING,
-                        "%pp: existing mapping (mfn: %" PRI_mfn
-                        "type: %d) at %#lx clobbers MSIX MMIO area\n",
+                        "%pp: existing mapping (mfn: %" PRI_mfn " type: %d) at %#lx clobbers MSIX MMIO area\n",
                         &pdev->sbdf, mfn_x(mfn), t, start);
                 return -EEXIST;
             }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 25 13:33:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Apr 2025 13:33:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.968101.1357795 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u8JAu-0007pK-6E; Fri, 25 Apr 2025 13:33:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 968101.1357795; Fri, 25 Apr 2025 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 1u8JAu-0007pC-3f; Fri, 25 Apr 2025 13:33:04 +0000
Received: by outflank-mailman (input) for mailman id 968101;
 Fri, 25 Apr 2025 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 1u8JAs-0007p0-8c
 for xen-changelog@lists.xenproject.org; Fri, 25 Apr 2025 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 1u8JAs-003pVz-0k
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 13:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u8JAs-008bZp-0Z
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 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=XXd7239Tme8m/oMu42xZP78cUXI9WUJoUad5Gj+1V8M=; b=GtVY2Jfpl80Eu2PmISV4v52mvV
	XmT8LpthB5w3keoC5JKdlCwfx2QynOMxg++WQwZz4oK86sgD90A1ywpfEZNpzmZkjPf56S9PdvRrQ
	Jux1e0qzti9mez72p2IJ9pFvmfrYDCCazAEv2MkiNCdH0rrNgfBgRJPmePNsuy8sX5KU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: fix buffer over-read in bitmap_to_xenctl_bitmap()
Message-Id: <E1u8JAs-008bZp-0Z@xenbits.xenproject.org>
Date: Fri, 25 Apr 2025 13:33:02 +0000

commit cba90ddee086e8d26063d8de90e40a098395e99b
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Apr 24 12:23:14 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Fri Apr 25 14:50:19 2025 +0200

    xen: fix buffer over-read in bitmap_to_xenctl_bitmap()
    
    There's an off-by-one when calculating the last byte in the input array to
    bitmap_to_xenctl_bitmap(), which leads to bitmaps with sizes multiple of 8
    to over-read and incorrectly use a byte past the end of the array.
    
    Fixes: 288c4641c80d ('xen: simplify bitmap_to_xenctl_bitmap for little endian')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/bitmap.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/common/bitmap.c b/xen/common/bitmap.c
index bf1a7fd91e..4f96fda389 100644
--- a/xen/common/bitmap.c
+++ b/xen/common/bitmap.c
@@ -369,6 +369,9 @@ int bitmap_to_xenctl_bitmap(struct xenctl_bitmap *xenctl_bitmap,
     const uint8_t *bytemap;
     uint8_t last, *buf = NULL;
 
+    if ( !nbits )
+        return 0;
+
     if ( !IS_ENABLED(LITTLE_ENDIAN) )
     {
         buf = xmalloc_array(uint8_t, xen_bytes);
@@ -396,7 +399,7 @@ int bitmap_to_xenctl_bitmap(struct xenctl_bitmap *xenctl_bitmap,
      * their loops to 8 bits. Ensure we clear those left over bits so as to
      * prevent surprises.
      */
-    last = bytemap[nbits / 8];
+    last = bytemap[(nbits - 1) / 8];
     if ( nbits % 8 )
         last &= (1U << (nbits % 8)) - 1;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 25 13:33:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Apr 2025 13:33:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.968103.1357798 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u8JB4-0007wd-7U; Fri, 25 Apr 2025 13:33:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 968103.1357798; Fri, 25 Apr 2025 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 1u8JB4-0007wW-50; Fri, 25 Apr 2025 13:33:14 +0000
Received: by outflank-mailman (input) for mailman id 968103;
 Fri, 25 Apr 2025 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 1u8JB2-0007w8-BA
 for xen-changelog@lists.xenproject.org; Fri, 25 Apr 2025 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 1u8JB2-003pW3-11
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 13:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u8JB2-008bkG-0v
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 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=uO2Sovwm7QvccJCaXKUJOTtXIw6hAQ1DQb5kK37wDx8=; b=4dTa1QAyjSJollNqZCnE+T6Nz9
	F+sjKBuLIHRXvcujHC3olZQagrsOeYmLHq2BcayhxjPz5AFXhp+c32FvCo3GyZ2AUGExk6GArIZmt
	VYMxSz7I1bzG5iJ/bgX0bQNOsloI2qUiyrBHliD9fpOUnrK08AZhw1fzHQbxix7H0XZs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/hvmloader: fix usage of NULL with cpuid_count()
Message-Id: <E1u8JB2-008bkG-0v@xenbits.xenproject.org>
Date: Fri, 25 Apr 2025 13:33:12 +0000

commit 8f2c5dc611404fe17a1fc7cfc03153c65db2bcd5
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Apr 24 13:39:45 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Fri Apr 25 14:50:19 2025 +0200

    x86/hvmloader: fix usage of NULL with cpuid_count()
    
    The commit that added support for retrieving the APIC IDs from the APs
    introduced several usages of cpuid() with NULL parameters, which is not
    handled by the underlying implementation.  For GCC I expect this results in
    writes to the physical address at 0, however when using Clang 19.1.2 the
    generated code in smp.o for the whole file is:
    
    tools/firmware/hvmloader/smp.o: file format elf32-i386
    
    Disassembly of section .text:
    
    00000000 <smp_initialise>:
           0: 55                            pushl   %ebp
           1: 89 e5                         movl    %esp, %ebp
           3: 53                            pushl   %ebx
           4: 31 c0                         xorl    %eax, %eax
           6: 31 c9                         xorl    %ecx, %ecx
           8: 0f a2                         cpuid
    
    Showing the usage of a NULL pointer results in undefined behavior, and
    Clang refusing to generate further code after it.
    
    Fix by using a temporary variable in cpuid_count() in place for any NULL
    parameter.
    
    Fixes: 9ad0db58c7e2 ('tools/hvmloader: Retrieve APIC IDs from the APs themselves')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/firmware/hvmloader/util.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tools/firmware/hvmloader/util.h b/tools/firmware/hvmloader/util.h
index 644450c51c..765a013ddd 100644
--- a/tools/firmware/hvmloader/util.h
+++ b/tools/firmware/hvmloader/util.h
@@ -190,6 +190,17 @@ static inline void cpuid_count(
     uint32_t *ecx,
     uint32_t *edx)
 {
+    uint32_t tmp;
+
+    if ( !eax )
+        eax = &tmp;
+    if ( !ebx )
+        ebx = &tmp;
+    if ( !ecx )
+        ecx = &tmp;
+    if ( !edx )
+        edx = &tmp;
+
     asm volatile ( "cpuid"
                    : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)
                    : "a" (leaf), "c" (subleaf) );
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 25 13:33:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Apr 2025 13:33:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.968104.1357803 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u8JBE-0007z9-9C; Fri, 25 Apr 2025 13:33:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 968104.1357803; Fri, 25 Apr 2025 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 1u8JBE-0007z2-6Q; Fri, 25 Apr 2025 13:33:24 +0000
Received: by outflank-mailman (input) for mailman id 968104;
 Fri, 25 Apr 2025 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 1u8JBC-0007yg-FU
 for xen-changelog@lists.xenproject.org; Fri, 25 Apr 2025 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 1u8JBC-003pWN-1H
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 13:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u8JBC-008bs1-1B
 for xen-changelog@lists.xenproject.org;
 Fri, 25 Apr 2025 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=xGxCIRFgPJnKBn9Gp7pMYMUr7ZOVIxbMfyYSSndenKo=; b=P3Q0gIJptuJUunFL+cHVicZnZx
	WUeIhKyLbSuLEkTVCq9LmXMcT7P23YDwd/EIpPVZ4be73eZnNOriRdI8XxC64Ha958skTxp6s0+6M
	S4vje9bprNhvGjMufW9+TgmhmASjWtHCuB6qPTmSuBFEkaDirNj39TRqmCSj9j/X1EJY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/vpci: Fix msix existing mapping printk
Message-Id: <E1u8JBC-008bs1-1B@xenbits.xenproject.org>
Date: Fri, 25 Apr 2025 13:33:22 +0000

commit 888cdbd9f1efc35bae9cba26e2d6466e1c78de47
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Thu Apr 24 17:23:26 2025 -0400
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Fri Apr 25 14:50:19 2025 +0200

    xen/vpci: Fix msix existing mapping printk
    
    The format string lacks a space, so mfn and type run together:
    (XEN) d0v0 0000:06:00.7: existing mapping (mfn: 753037type: 0) at 0x1 clobbers MSIX MMIO area
    
    Add a space.  Additionally, move the format string to a single long line
    to improve grep-ability.
    
    Fixes: 677053fac17a ("vpci/msix: carve p2m hole for MSIX MMIO regions")
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/vpci/msix.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index f3804ce047..3568f2a651 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -665,8 +665,7 @@ int vpci_make_msix_hole(const struct pci_dev *pdev)
             default:
                 put_gfn(d, start);
                 gprintk(XENLOG_WARNING,
-                        "%pp: existing mapping (mfn: %" PRI_mfn
-                        "type: %d) at %#lx clobbers MSIX MMIO area\n",
+                        "%pp: existing mapping (mfn: %" PRI_mfn " type: %d) at %#lx clobbers MSIX MMIO area\n",
                         &pdev->sbdf, mfn_x(mfn), t, start);
                 return -EEXIST;
             }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 28 07:55:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Apr 2025 07:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.970225.1358957 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9JKQ-00032f-LP; Mon, 28 Apr 2025 07:55:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 970225.1358957; Mon, 28 Apr 2025 07: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 1u9JKQ-00032Y-IZ; Mon, 28 Apr 2025 07:55:02 +0000
Received: by outflank-mailman (input) for mailman id 970225;
 Mon, 28 Apr 2025 07: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 1u9JKP-00032S-Pv
 for xen-changelog@lists.xenproject.org; Mon, 28 Apr 2025 07: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 1u9JKP-00AIs7-1t
 for xen-changelog@lists.xenproject.org;
 Mon, 28 Apr 2025 07:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9JKP-002eci-1g
 for xen-changelog@lists.xenproject.org;
 Mon, 28 Apr 2025 07: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=c/PyW8oIwOn+gRPUoUvvgdTmqv0pH+1GpQyOb+M56ko=; b=nyyw2lYylaybt8ZBRcn1cxp/QI
	G5P5vikFmrxN8n4yYyBHT605UyXN+4HgSWMdDtn4of5bRpcSZCdvnCK16X/CZxgIe+bNn7nkzS5SE
	nx5oKO1vMZFE3O7qEkfZmA9b9xjJth5b7C7yltlSn5YwjJ16HO5NEii7YsXjc6Hqu1AU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] SUPPORT.md: make Linux based stubdom fully supported
Message-Id: <E1u9JKP-002eci-1g@xenbits.xenproject.org>
Date: Mon, 28 Apr 2025 07:55:01 +0000

commit 62daba3b6c70c0b68bfba61629b6ee34cf03823c
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Apr 28 09:47:15 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 28 09:47:15 2025 +0200

    SUPPORT.md: make Linux based stubdom fully supported
    
    All patches needed for running with a Linux stubdom device model are
    in the tree and QubesOS is using and testing Linux stubdoms nowadays.
    
    Switch support from "Tech Preview" to "Supported, with caveats".
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-By: Oleksii Kurochko<oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 CHANGELOG.md | 1 +
 SUPPORT.md   | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index d3dd31dea2..1ea06524db 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
  - The minimum toolchain requirements have increased for some architectures:
    - For x86, GCC 5.1 and Binutils 2.25, or Clang/LLVM 11
    - For ARM32 and ARM64, GCC 5.1 and Binutils 2.25
+ - Linux based device model stubdomains are now fully supported.
 
 ### Added
  - On x86:
diff --git a/SUPPORT.md b/SUPPORT.md
index 91cb6f8ed2..e8fd0c251e 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -260,7 +260,10 @@ Go (golang) bindings for libxl
 
 Support for running qemu-xen device model in a linux stubdomain.
 
-    Status: Tech Preview
+    Status: Supported, with caveats
+
+Any issue in the stubdomain affecting only the guest it is servicing
+or itself will not be regarded a security issue.
 
 ## Xenstore
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 28 07:55:12 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Apr 2025 07:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.970226.1358960 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9JKa-00034K-MW; Mon, 28 Apr 2025 07:55:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 970226.1358960; Mon, 28 Apr 2025 07: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 1u9JKa-00034C-K2; Mon, 28 Apr 2025 07:55:12 +0000
Received: by outflank-mailman (input) for mailman id 970226;
 Mon, 28 Apr 2025 07: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 1u9JKZ-000342-My
 for xen-changelog@lists.xenproject.org; Mon, 28 Apr 2025 07: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 1u9JKZ-00AIsB-2C
 for xen-changelog@lists.xenproject.org;
 Mon, 28 Apr 2025 07:55:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9JKZ-002ekG-23
 for xen-changelog@lists.xenproject.org;
 Mon, 28 Apr 2025 07: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=kWNMewE6AriTRB0aYnlGU7esn0gezeCPbGqlTV6E7Dg=; b=sIBKowOPwleiwdr4AmxEWlrp4V
	kDlRtB6G4s2/0nf6vDVR7+S6m7RSIZ77gOU0DGIc0KQhkvVxgqi3z2aZc/GzbCyh+dPt0XP0qxoiH
	jFGXuevJMcUleHzPo1u9kH5U53DFSMHuAB54qjzvEuSyNSj1HQIIHdDLiKJ0Y+cdDtOA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] stubdom: remove ancient stubdom-dm script
Message-Id: <E1u9JKZ-002ekG-23@xenbits.xenproject.org>
Date: Mon, 28 Apr 2025 07:55:11 +0000

commit 4ad0f0d417b2e62e1edc47a823da5e3a1bee041d
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Apr 28 09:47:30 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 28 09:47:30 2025 +0200

    stubdom: remove ancient stubdom-dm script
    
    The stubdom-dm script is still using "xm" instead of "xl", so it is
    probably unused since more than 10 years now.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 stubdom/stubdom-dm | 182 -----------------------------------------------------
 1 file changed, 182 deletions(-)

diff --git a/stubdom/stubdom-dm b/stubdom/stubdom-dm
deleted file mode 100644
index 05d07ac0d1..0000000000
--- a/stubdom/stubdom-dm
+++ /dev/null
@@ -1,182 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2007-2008 Samuel Thibault <samuel.thibault@eu.citrix.net>
-#
-# dm script around stubdomains.
-#
-
-DIR=`dirname $0`
-. "${DIR}/stubdompath.sh"
-stubdom_configdir="${XEN_CONFIG_DIR}/stubdoms"
-
-# To fit xterms nicely
-height=339
-
-# Parse arguments
-
-domid=
-domname=
-vncviewer=0
-vncpid=
-extra=
-sdl=0
-opengl=1
-vnc=0
-vncunused=0
-while [ "$#" -gt 0 ];
-do
-    if [ "$#" -ge 2 ];
-    then
-	case "$1" in
-	    -d)
-                domid=$2;
-                extra="$extra -d $domid";
-                shift
-                ;;
-	    -domain-name)
-                domname=$2;
-                shift
-                ;;
-	    -vnc)
-                vnc=1
-                op=${2%,*}
-		ip=${op%:*};
-		vnc_port=${op#*:};
-		shift
-		;;
-            -vncunused)
-                vncunused=1
-                shift
-                ;;
-            -loadvm)
-                extra="$extra -loadvm $2";
-                shift
-                ;;
-            -k)
-                keymap=$2
-                shift
-                ;;
-	    -serial)
-		serial="$2"
-		shift
-		;;
-            -monitor)
-		monitor="$2"
-		shift
-		;;
-	esac
-    fi
-    case "$1" in
-	-vncviewer) vncviewer=1 ;;
-        -sdl) sdl=1 ;;
-        -disable-opengl) opengl=0 ;;
-    esac
-    shift
-done
-
-[ -z "$domid"   ] && { echo "couldn't find domain ID" ; exit 1; }
-[ -z "$domname" ] && { echo "couldn't find domain name" ; exit 1; }
-
-# Termination handler
-
-term() {
-    [ -n "$vncpid" ] && kill -9 $vncpid
-    rm -f /tmp/domname-dm
-    rm ${stubdom_configdir}/$domname-dm
-    exit 0
-}
-
-trap term SIGHUP
-
-############
-# stubdomain
-# Wait for any previous stubdom to terminate
-while xm list | grep -w $domname-dm
-do
-	sleep 1
-done
-
-# Generate stubdom config file
-mkdir -p ${stubdom_configdir} &>/dev/null
-echo "#This file is autogenerated, edit $domname instead!" > ${stubdom_configdir}/$domname-dm
-echo "kernel = '${XENFIRMWAREDIR}/ioemu-stubdom.gz'" >> ${stubdom_configdir}/$domname-dm
-
-vfb="sdl=$sdl, opengl=$opengl"
-test "$DISPLAY" && vfb="$vfb, display=$DISPLAY"
-test "$XAUTHORITY" && vfb="$vfb, xauthority=$XAUTHORITY"
-test $vnc != 0 && vfb="$vfb, vnc=$vnc, vncdisplay=$vnc_port, vnclisten=$ip, vncunused=$vncunused"
-vncpasswd=`xenstore-read /local/domain/0/backend/vfb/$domid/0/vncpasswd 2>/dev/null`
-test "$vncpasswd" && vfb="$vfb, vncpasswd=$vncpasswd"
-test "$keymap" && vfb="$vfb, keymap=$keymap"
-test "$monitor" && vfb="$vfb, monitor=$monitor"
-test "$serial" && vfb="$vfb, serial=$serial"
-echo "vfb = ['$vfb']" >> ${stubdom_configdir}/$domname-dm
-
-echo -n "disk = [ " >> ${stubdom_configdir}/$domname-dm
-j=0
-for i in `xenstore-ls /local/domain/$domid/device/vbd | grep 'backend =' | awk '{print $3}'`
-do
-    i=${i%\"}
-    i=${i#\"}
-    vbd_mode=`xenstore-read $i/mode`
-    vbd_disk=`xenstore-read $i/params`
-    vbd_type=`xenstore-read $i/type`
-    vbd_dev=`xenstore-read $i/dev`
-    vbd_front=`xenstore-read $i/frontend`
-    vbd_devtype=`xenstore-read $vbd_front/device-type`
-    if [ $j -ne 0 ]
-    then
-        echo -n "," >> ${stubdom_configdir}/$domname-dm
-    fi
-    echo -n "'$vbd_type:$vbd_disk,$vbd_dev:$vbd_devtype,$vbd_mode'" >> ${stubdom_configdir}/$domname-dm
-    j=$(( $j + 1 ))
-done
-echo " ] " >> ${stubdom_configdir}/$domname-dm
-echo -n "vif = [ " >> ${stubdom_configdir}/$domname-dm
-j=0
-for i in `xenstore-ls /local/domain/$domid/device/vif | grep 'backend =' | awk '{print $3}'`
-do
-    i=${i%\"}
-    i=${i#\"}
-    vif_mac=`xenstore-read $i/mac`
-    vif_bridge=`xenstore-read $i/bridge`
-    if [ $j -ne 0 ]
-    then
-        echo -n "," >> ${stubdom_configdir}/$domname-dm
-    fi
-    echo -n "'mac=$vif_mac" >> ${stubdom_configdir}/$domname-dm
-    if [ "$vif_bridge" ]
-    then
-        echo -n ",bridge=$vif_bridge'" >> ${stubdom_configdir}/$domname-dm
-    else
-        echo -n "'" >> ${stubdom_configdir}/$domname-dm
-    fi
-    j=$(( $j + 1 ))
-done
-echo " ] " >> ${stubdom_configdir}/$domname-dm
-
-mkfifo /tmp/$domname-dm
-xm create -c ${stubdom_configdir}/$domname-dm target=$domid memory=32 extra="$extra" < /tmp/$domname-dm &
-exec 4>/tmp/$domname-dm
-
-
-###########
-# vncviewer
-if [ "$vncviewer" = 1 ]
-then
-    # Wait for vnc server to appear
-    while ! vnc_port=`xenstore-read /local/domain/$domid/console/vnc-port`
-    do
-        # Check that the stubdom job is still alive
-        kill -0 $consolepid || term
-	sleep 1
-    done
-
-    vncviewer $ip:$vnc_port &
-    vncpid=$!
-fi
-
-# wait for SIGHUP or stubdom termination
-wait
-
-term
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 28 07:55:22 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Apr 2025 07:55:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.970227.1358966 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9JKk-00036j-Oi; Mon, 28 Apr 2025 07:55:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 970227.1358966; Mon, 28 Apr 2025 07: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 1u9JKk-00036b-LR; Mon, 28 Apr 2025 07:55:22 +0000
Received: by outflank-mailman (input) for mailman id 970227;
 Mon, 28 Apr 2025 07: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 1u9JKj-00036V-RV
 for xen-changelog@lists.xenproject.org; Mon, 28 Apr 2025 07: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 1u9JKj-00AIsY-2a
 for xen-changelog@lists.xenproject.org;
 Mon, 28 Apr 2025 07:55:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9JKj-002ete-2P
 for xen-changelog@lists.xenproject.org;
 Mon, 28 Apr 2025 07: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=JqhXujwEK9SJAy/Exp66g9LLAGmVara9fgCsKj38sa4=; b=BnO5zPtUIxyNzVo3dbN5Z+gSyn
	NjlBStymSy4wQq7MVPJaRt76JZjRNTlCt2KWJRaKGyP/h4OLuDcQqW7LNe3ozbKCQl8hrXFVWIZfC
	fPgSb+s/Z4G9QqUi5fkWYe0/vv0UosTAlHxlTQY56KPFFNfOM1hQylQq1ijk0iNPXaZE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: constrain sub-page access length in mmio_ro_emulated_write()
Message-Id: <E1u9JKj-002ete-2P@xenbits.xenproject.org>
Date: Mon, 28 Apr 2025 07:55:21 +0000

commit 8dbd9966f82f95b017f06e9397fc78064b688d61
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 28 09:48:14 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 28 09:48:14 2025 +0200

    x86: constrain sub-page access length in mmio_ro_emulated_write()
    
    Without doing so we could trigger the ASSERT_UNREACHABLE() in
    subpage_mmio_write_emulate(). A comment there actually says this
    validation would already have been done ...
    
    Fixes: 8847d6e23f97 ("x86/mm: add API for marking only part of a MMIO page read only")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/mm.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 1cf2365167..ac5b51d17a 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5195,8 +5195,13 @@ int cf_check mmio_ro_emulated_write(
         return X86EMUL_UNHANDLEABLE;
     }
 
-    subpage_mmio_write_emulate(mmio_ro_ctxt->mfn, PAGE_OFFSET(offset),
-                               p_data, bytes);
+    if ( bytes <= 8 )
+        subpage_mmio_write_emulate(mmio_ro_ctxt->mfn, PAGE_OFFSET(offset),
+                                   p_data, bytes);
+    else if ( subpage_mmio_find_page(mmio_ro_ctxt->mfn) )
+        gprintk(XENLOG_WARNING,
+                "unsupported %u-byte write to R/O MMIO 0x%"PRI_mfn"%03lx\n",
+                bytes, mfn_x(mmio_ro_ctxt->mfn), PAGE_OFFSET(offset));
 
     return X86EMUL_OKAY;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 28 09:11:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Apr 2025 09:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.970359.1359069 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9KW0-0003KW-2g; Mon, 28 Apr 2025 09:11:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 970359.1359069; Mon, 28 Apr 2025 09: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 1u9KW0-0003KO-0A; Mon, 28 Apr 2025 09:11:04 +0000
Received: by outflank-mailman (input) for mailman id 970359;
 Mon, 28 Apr 2025 09: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 1u9KVy-0003KA-DG
 for xen-changelog@lists.xenproject.org; Mon, 28 Apr 2025 09: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 1u9KVy-00ALcc-0P
 for xen-changelog@lists.xenproject.org;
 Mon, 28 Apr 2025 09:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9KVy-003YEj-0D
 for xen-changelog@lists.xenproject.org;
 Mon, 28 Apr 2025 09: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=VGUQt+5AqlUSxOFz8Yzr9oAl9uTwKz32D/+llpEscXc=; b=qf8JB0DI7xp3QoL9dqIX6IJ+HO
	w1vyGxp8OpBVCfVrkWDiiwQr7GiKrtaPoXXn99hs0zO2Rub1IN2rIR4K36KKBKdddgsBMPiOp+aPc
	BMxS7LnPW4YvXTIE+D33GZKr5X1HS3OMrjmefS9Nd5M/4+OzGRP4d5pWXiNnmE2K48EU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] SUPPORT.md: make Linux based stubdom fully supported
Message-Id: <E1u9KVy-003YEj-0D@xenbits.xenproject.org>
Date: Mon, 28 Apr 2025 09:11:02 +0000

commit 62daba3b6c70c0b68bfba61629b6ee34cf03823c
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Apr 28 09:47:15 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 28 09:47:15 2025 +0200

    SUPPORT.md: make Linux based stubdom fully supported
    
    All patches needed for running with a Linux stubdom device model are
    in the tree and QubesOS is using and testing Linux stubdoms nowadays.
    
    Switch support from "Tech Preview" to "Supported, with caveats".
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-By: Oleksii Kurochko<oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 CHANGELOG.md | 1 +
 SUPPORT.md   | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index d3dd31dea2..1ea06524db 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
  - The minimum toolchain requirements have increased for some architectures:
    - For x86, GCC 5.1 and Binutils 2.25, or Clang/LLVM 11
    - For ARM32 and ARM64, GCC 5.1 and Binutils 2.25
+ - Linux based device model stubdomains are now fully supported.
 
 ### Added
  - On x86:
diff --git a/SUPPORT.md b/SUPPORT.md
index 91cb6f8ed2..e8fd0c251e 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -260,7 +260,10 @@ Go (golang) bindings for libxl
 
 Support for running qemu-xen device model in a linux stubdomain.
 
-    Status: Tech Preview
+    Status: Supported, with caveats
+
+Any issue in the stubdomain affecting only the guest it is servicing
+or itself will not be regarded a security issue.
 
 ## Xenstore
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 28 09:11:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Apr 2025 09:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.970360.1359073 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9KW9-0003TD-42; Mon, 28 Apr 2025 09:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 970360.1359073; Mon, 28 Apr 2025 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 1u9KW9-0003T6-1b; Mon, 28 Apr 2025 09:11:13 +0000
Received: by outflank-mailman (input) for mailman id 970360;
 Mon, 28 Apr 2025 09: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 1u9KW8-0003Sz-8m
 for xen-changelog@lists.xenproject.org; Mon, 28 Apr 2025 09: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 1u9KW8-00ALcg-0k
 for xen-changelog@lists.xenproject.org;
 Mon, 28 Apr 2025 09:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9KW8-003YQS-0a
 for xen-changelog@lists.xenproject.org;
 Mon, 28 Apr 2025 09: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=7q+kpYm5w4i+t94yE1vxpXa9KiY/baaIvlVIiv2HCco=; b=FbUEsm//loa00uHRXVdeeF+88W
	I8HoZy9NapfE6aU7G2YjFC91DHu1FUicHco+OpIc9Uslk0wjBJJfntWv8l6UGUie8JHC14+aeL1jL
	5+LyG+9kyf2oCgbLnHPcWTv9S2jhDuWFrNTOP95Za07rI5qALCKbCQ4i7wSAbyjb6obc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] stubdom: remove ancient stubdom-dm script
Message-Id: <E1u9KW8-003YQS-0a@xenbits.xenproject.org>
Date: Mon, 28 Apr 2025 09:11:12 +0000

commit 4ad0f0d417b2e62e1edc47a823da5e3a1bee041d
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Apr 28 09:47:30 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 28 09:47:30 2025 +0200

    stubdom: remove ancient stubdom-dm script
    
    The stubdom-dm script is still using "xm" instead of "xl", so it is
    probably unused since more than 10 years now.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 stubdom/stubdom-dm | 182 -----------------------------------------------------
 1 file changed, 182 deletions(-)

diff --git a/stubdom/stubdom-dm b/stubdom/stubdom-dm
deleted file mode 100644
index 05d07ac0d1..0000000000
--- a/stubdom/stubdom-dm
+++ /dev/null
@@ -1,182 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2007-2008 Samuel Thibault <samuel.thibault@eu.citrix.net>
-#
-# dm script around stubdomains.
-#
-
-DIR=`dirname $0`
-. "${DIR}/stubdompath.sh"
-stubdom_configdir="${XEN_CONFIG_DIR}/stubdoms"
-
-# To fit xterms nicely
-height=339
-
-# Parse arguments
-
-domid=
-domname=
-vncviewer=0
-vncpid=
-extra=
-sdl=0
-opengl=1
-vnc=0
-vncunused=0
-while [ "$#" -gt 0 ];
-do
-    if [ "$#" -ge 2 ];
-    then
-	case "$1" in
-	    -d)
-                domid=$2;
-                extra="$extra -d $domid";
-                shift
-                ;;
-	    -domain-name)
-                domname=$2;
-                shift
-                ;;
-	    -vnc)
-                vnc=1
-                op=${2%,*}
-		ip=${op%:*};
-		vnc_port=${op#*:};
-		shift
-		;;
-            -vncunused)
-                vncunused=1
-                shift
-                ;;
-            -loadvm)
-                extra="$extra -loadvm $2";
-                shift
-                ;;
-            -k)
-                keymap=$2
-                shift
-                ;;
-	    -serial)
-		serial="$2"
-		shift
-		;;
-            -monitor)
-		monitor="$2"
-		shift
-		;;
-	esac
-    fi
-    case "$1" in
-	-vncviewer) vncviewer=1 ;;
-        -sdl) sdl=1 ;;
-        -disable-opengl) opengl=0 ;;
-    esac
-    shift
-done
-
-[ -z "$domid"   ] && { echo "couldn't find domain ID" ; exit 1; }
-[ -z "$domname" ] && { echo "couldn't find domain name" ; exit 1; }
-
-# Termination handler
-
-term() {
-    [ -n "$vncpid" ] && kill -9 $vncpid
-    rm -f /tmp/domname-dm
-    rm ${stubdom_configdir}/$domname-dm
-    exit 0
-}
-
-trap term SIGHUP
-
-############
-# stubdomain
-# Wait for any previous stubdom to terminate
-while xm list | grep -w $domname-dm
-do
-	sleep 1
-done
-
-# Generate stubdom config file
-mkdir -p ${stubdom_configdir} &>/dev/null
-echo "#This file is autogenerated, edit $domname instead!" > ${stubdom_configdir}/$domname-dm
-echo "kernel = '${XENFIRMWAREDIR}/ioemu-stubdom.gz'" >> ${stubdom_configdir}/$domname-dm
-
-vfb="sdl=$sdl, opengl=$opengl"
-test "$DISPLAY" && vfb="$vfb, display=$DISPLAY"
-test "$XAUTHORITY" && vfb="$vfb, xauthority=$XAUTHORITY"
-test $vnc != 0 && vfb="$vfb, vnc=$vnc, vncdisplay=$vnc_port, vnclisten=$ip, vncunused=$vncunused"
-vncpasswd=`xenstore-read /local/domain/0/backend/vfb/$domid/0/vncpasswd 2>/dev/null`
-test "$vncpasswd" && vfb="$vfb, vncpasswd=$vncpasswd"
-test "$keymap" && vfb="$vfb, keymap=$keymap"
-test "$monitor" && vfb="$vfb, monitor=$monitor"
-test "$serial" && vfb="$vfb, serial=$serial"
-echo "vfb = ['$vfb']" >> ${stubdom_configdir}/$domname-dm
-
-echo -n "disk = [ " >> ${stubdom_configdir}/$domname-dm
-j=0
-for i in `xenstore-ls /local/domain/$domid/device/vbd | grep 'backend =' | awk '{print $3}'`
-do
-    i=${i%\"}
-    i=${i#\"}
-    vbd_mode=`xenstore-read $i/mode`
-    vbd_disk=`xenstore-read $i/params`
-    vbd_type=`xenstore-read $i/type`
-    vbd_dev=`xenstore-read $i/dev`
-    vbd_front=`xenstore-read $i/frontend`
-    vbd_devtype=`xenstore-read $vbd_front/device-type`
-    if [ $j -ne 0 ]
-    then
-        echo -n "," >> ${stubdom_configdir}/$domname-dm
-    fi
-    echo -n "'$vbd_type:$vbd_disk,$vbd_dev:$vbd_devtype,$vbd_mode'" >> ${stubdom_configdir}/$domname-dm
-    j=$(( $j + 1 ))
-done
-echo " ] " >> ${stubdom_configdir}/$domname-dm
-echo -n "vif = [ " >> ${stubdom_configdir}/$domname-dm
-j=0
-for i in `xenstore-ls /local/domain/$domid/device/vif | grep 'backend =' | awk '{print $3}'`
-do
-    i=${i%\"}
-    i=${i#\"}
-    vif_mac=`xenstore-read $i/mac`
-    vif_bridge=`xenstore-read $i/bridge`
-    if [ $j -ne 0 ]
-    then
-        echo -n "," >> ${stubdom_configdir}/$domname-dm
-    fi
-    echo -n "'mac=$vif_mac" >> ${stubdom_configdir}/$domname-dm
-    if [ "$vif_bridge" ]
-    then
-        echo -n ",bridge=$vif_bridge'" >> ${stubdom_configdir}/$domname-dm
-    else
-        echo -n "'" >> ${stubdom_configdir}/$domname-dm
-    fi
-    j=$(( $j + 1 ))
-done
-echo " ] " >> ${stubdom_configdir}/$domname-dm
-
-mkfifo /tmp/$domname-dm
-xm create -c ${stubdom_configdir}/$domname-dm target=$domid memory=32 extra="$extra" < /tmp/$domname-dm &
-exec 4>/tmp/$domname-dm
-
-
-###########
-# vncviewer
-if [ "$vncviewer" = 1 ]
-then
-    # Wait for vnc server to appear
-    while ! vnc_port=`xenstore-read /local/domain/$domid/console/vnc-port`
-    do
-        # Check that the stubdom job is still alive
-        kill -0 $consolepid || term
-	sleep 1
-    done
-
-    vncviewer $ip:$vnc_port &
-    vncpid=$!
-fi
-
-# wait for SIGHUP or stubdom termination
-wait
-
-term
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 28 09:11:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Apr 2025 09:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.970361.1359077 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9KWJ-0003bC-5r; Mon, 28 Apr 2025 09:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 970361.1359077; Mon, 28 Apr 2025 09:11:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9KWJ-0003b4-31; Mon, 28 Apr 2025 09:11:23 +0000
Received: by outflank-mailman (input) for mailman id 970361;
 Mon, 28 Apr 2025 09: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 1u9KWI-0003aw-DP
 for xen-changelog@lists.xenproject.org; Mon, 28 Apr 2025 09: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 1u9KWI-00ALd3-1F
 for xen-changelog@lists.xenproject.org;
 Mon, 28 Apr 2025 09:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9KWI-003YWx-0w
 for xen-changelog@lists.xenproject.org;
 Mon, 28 Apr 2025 09: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=0K1u2ylLI0lD/14QQzYDJUUX6Xbl5tLXkXnemOileTE=; b=BqJzyHwLNpP4SV2sAcznqnkfVW
	38l/hI4PaPkLMvYUAK+n8AXWYgs/rmp+gmcjGP6nBoq5WN87V9/Mds1n91PW6F2AR5j3BvFhsiWR6
	i3xX+d2u50fzz9B7h9wcrsDO+v2dub7icuE7KdNyxm16Ono2YGXaSOcNuLYKPhj67yds=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: constrain sub-page access length in mmio_ro_emulated_write()
Message-Id: <E1u9KWI-003YWx-0w@xenbits.xenproject.org>
Date: Mon, 28 Apr 2025 09:11:22 +0000

commit 8dbd9966f82f95b017f06e9397fc78064b688d61
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 28 09:48:14 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 28 09:48:14 2025 +0200

    x86: constrain sub-page access length in mmio_ro_emulated_write()
    
    Without doing so we could trigger the ASSERT_UNREACHABLE() in
    subpage_mmio_write_emulate(). A comment there actually says this
    validation would already have been done ...
    
    Fixes: 8847d6e23f97 ("x86/mm: add API for marking only part of a MMIO page read only")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/mm.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 1cf2365167..ac5b51d17a 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5195,8 +5195,13 @@ int cf_check mmio_ro_emulated_write(
         return X86EMUL_UNHANDLEABLE;
     }
 
-    subpage_mmio_write_emulate(mmio_ro_ctxt->mfn, PAGE_OFFSET(offset),
-                               p_data, bytes);
+    if ( bytes <= 8 )
+        subpage_mmio_write_emulate(mmio_ro_ctxt->mfn, PAGE_OFFSET(offset),
+                                   p_data, bytes);
+    else if ( subpage_mmio_find_page(mmio_ro_ctxt->mfn) )
+        gprintk(XENLOG_WARNING,
+                "unsupported %u-byte write to R/O MMIO 0x%"PRI_mfn"%03lx\n",
+                bytes, mfn_x(mmio_ro_ctxt->mfn), PAGE_OFFSET(offset));
 
     return X86EMUL_OKAY;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 28 18:55:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Apr 2025 18:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.970986.1359494 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9Td9-0005ux-Lk; Mon, 28 Apr 2025 18:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 970986.1359494; Mon, 28 Apr 2025 18:55:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9Td9-0005up-IG; Mon, 28 Apr 2025 18:55:03 +0000
Received: by outflank-mailman (input) for mailman id 970986;
 Mon, 28 Apr 2025 18:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u9Td8-0005uj-Kn
 for xen-changelog@lists.xenproject.org; Mon, 28 Apr 2025 18:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9Td8-00AgMH-0Z
 for xen-changelog@lists.xenproject.org;
 Mon, 28 Apr 2025 18:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9Td8-009hU9-0S
 for xen-changelog@lists.xenproject.org;
 Mon, 28 Apr 2025 18:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=p4yhPz47sMhOfUwaooYcNDRsIQZZEVXeaBP1Bl0sRyM=; b=DBpzuM2zdxqx3AVRey8dLIVsc3
	zovhykgNAdh6pJGDTip8D4IZKvSURCobZf5e3BWL79JDDQpVUI4dupT/ifKZGSvI4mv8gP/qSD901
	E+9V1UQVJn2VirA1b9JiAqS1We8g9EqsNgrl94QUyto0ZFzCvJ7/OLUAOolhPYoZ83dc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/link: Include .debug_str_offsets in DWARF2_DEBUG_SECTIONS
Message-Id: <E1u9Td8-009hU9-0S@xenbits.xenproject.org>
Date: Mon, 28 Apr 2025 18:55:02 +0000

commit a88b99300aedea103884b4ef8c66a5a94206feb5
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 22 12:30:19 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 28 19:46:46 2025 +0100

    xen/link: Include .debug_str_offsets in DWARF2_DEBUG_SECTIONS
    
    Building Xen with Clang-17 yields the following warning:
    
      ld: warning: orphan section `.debug_str_offsets' from `prelink.o' being placed in section `.debug_str_offsets'
      ld: ./.xen.efi.0xffff82d040000000.0:/4: section below image base
      ld: ./.xen.efi.0xffff82d040000000.1:/4: section below image base
      ld: warning: orphan section `.debug_str_offsets' from `prelink.o' being placed in section `.debug_str_offsets'
      ld: xen.efi:/4: section below image base
    
    Set the alignment to 4 as it holds 4-byte values, despite the fact that Clang
    appears to only use 1.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/xen/xen.lds.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/include/xen/xen.lds.h b/xen/include/xen/xen.lds.h
index 16a9b1ba03..793d0e1145 100644
--- a/xen/include/xen/xen.lds.h
+++ b/xen/include/xen/xen.lds.h
@@ -56,6 +56,7 @@
   DECL_DEBUG2(.debug_info, .gnu.linkonce.wi.*, 1) \
   DECL_DEBUG(.debug_types, 1)                     \
   DECL_DEBUG(.debug_str, 1)                       \
+  DECL_DEBUG(.debug_str_offsets, 4)               \
   DECL_DEBUG2(.debug_line, .debug_line.*, 1)      \
   DECL_DEBUG(.debug_line_str, 1)                  \
   DECL_DEBUG(.debug_names, 4)                     \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 28 19:55:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Apr 2025 19:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971049.1359547 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9UZD-0007tT-NE; Mon, 28 Apr 2025 19:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971049.1359547; Mon, 28 Apr 2025 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 1u9UZD-0007tL-Ke; Mon, 28 Apr 2025 19:55:03 +0000
Received: by outflank-mailman (input) for mailman id 971049;
 Mon, 28 Apr 2025 19: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 1u9UZB-0007tF-Tc
 for xen-changelog@lists.xenproject.org; Mon, 28 Apr 2025 19: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 1u9UZB-00AioF-1Y
 for xen-changelog@lists.xenproject.org;
 Mon, 28 Apr 2025 19:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9UZB-00AH5R-1G
 for xen-changelog@lists.xenproject.org;
 Mon, 28 Apr 2025 19: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=UOpjkfXsLFz8PMawd2CyHqsICRiN3u5XJvIme8CvLiI=; b=mK+4YSOKe77TtNu7RlpIBL9eQ/
	NKyfcnrVwNoNqX4qgviMGeKYOzG1unLhHK/2qrdFCFOubB7NCwUBnlCrD5dEhbH7ZgysLSvWGRW5I
	PMXvfxEwrJOXTk+0YX/it+Z/L0gOO70+vV2ZiFU92DXvfwgOUPeOEU67b2i77GUjQ1qU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/link: Include .debug_str_offsets in DWARF2_DEBUG_SECTIONS
Message-Id: <E1u9UZB-00AH5R-1G@xenbits.xenproject.org>
Date: Mon, 28 Apr 2025 19:55:01 +0000

commit a88b99300aedea103884b4ef8c66a5a94206feb5
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 22 12:30:19 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 28 19:46:46 2025 +0100

    xen/link: Include .debug_str_offsets in DWARF2_DEBUG_SECTIONS
    
    Building Xen with Clang-17 yields the following warning:
    
      ld: warning: orphan section `.debug_str_offsets' from `prelink.o' being placed in section `.debug_str_offsets'
      ld: ./.xen.efi.0xffff82d040000000.0:/4: section below image base
      ld: ./.xen.efi.0xffff82d040000000.1:/4: section below image base
      ld: warning: orphan section `.debug_str_offsets' from `prelink.o' being placed in section `.debug_str_offsets'
      ld: xen.efi:/4: section below image base
    
    Set the alignment to 4 as it holds 4-byte values, despite the fact that Clang
    appears to only use 1.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/xen/xen.lds.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/include/xen/xen.lds.h b/xen/include/xen/xen.lds.h
index 16a9b1ba03..793d0e1145 100644
--- a/xen/include/xen/xen.lds.h
+++ b/xen/include/xen/xen.lds.h
@@ -56,6 +56,7 @@
   DECL_DEBUG2(.debug_info, .gnu.linkonce.wi.*, 1) \
   DECL_DEBUG(.debug_types, 1)                     \
   DECL_DEBUG(.debug_str, 1)                       \
+  DECL_DEBUG(.debug_str_offsets, 4)               \
   DECL_DEBUG2(.debug_line, .debug_line.*, 1)      \
   DECL_DEBUG(.debug_line_str, 1)                  \
   DECL_DEBUG(.debug_names, 4)                     \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 28 21:11:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Apr 2025 21:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971187.1359661 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9Vkl-0007Rh-Gv; Mon, 28 Apr 2025 21:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971187.1359661; Mon, 28 Apr 2025 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 1u9Vkl-0007RZ-E2; Mon, 28 Apr 2025 21:11:03 +0000
Received: by outflank-mailman (input) for mailman id 971187;
 Mon, 28 Apr 2025 21: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 1u9Vkk-0007Q2-9g
 for xen-changelog@lists.xenproject.org; Mon, 28 Apr 2025 21: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 1u9Vkk-00AlpW-03
 for xen-changelog@lists.xenproject.org;
 Mon, 28 Apr 2025 21:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9Vkj-00CKPV-38
 for xen-changelog@lists.xenproject.org;
 Mon, 28 Apr 2025 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=FpBh+nG8fdxfZWGEJxZtPN8mxjOBzWdtNBPahM/gWlg=; b=z6ypU1J2Ek6pwzHrC5Wq0Xzzbs
	QiG6E2piUw3uBIPCejV29w3mpGA9G0Uvm29wF1dnGnqvT0GrinhBRbnuznBT8paxrcTEfxpZDTeA9
	V4itP9eHLrsTG+boGk93e5uffO4TvFlG/L/6+XiqfMDn9wjdBS/ro1AHt5Xc+Pjc0z4U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/vmx: Introduce vmread()
Message-Id: <E1u9Vkj-00CKPV-38@xenbits.xenproject.org>
Date: Mon, 28 Apr 2025 21:11:01 +0000

commit 881e5993dff7d8f372efeed7e5a9f255207805ed
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Sat Apr 26 07:27:29 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 28 21:01:20 2025 +0100

    x86/vmx: Introduce vmread()
    
    The current implementation of __vmread() is void and returns the result via
    pointer argument which leads to excess code in some places.
    
    Introduce a new vmread() function, and implement __vmread() in terms of it.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/include/asm/hvm/vmx/vmx.h | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmx.h b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
index 33d3d43a38..cc8c53fab1 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
@@ -320,16 +320,25 @@ static always_inline void __vmpclear(u64 addr)
     BUG();
 }
 
-static always_inline void __vmread(unsigned long field, unsigned long *value)
+static always_inline unsigned long vmread(unsigned long field)
 {
-    asm volatile ( "vmread %1, %0\n\t"
+    unsigned long value;
+
+    asm volatile ( "vmread %[field], %[value]\n\t"
                    /* CF==1 or ZF==1 --> BUG() */
                    UNLIKELY_START(be, vmread)
                    _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION
-                   : "=rm" (*value)
-                   : "r" (field),
+                   : [value] "=rm" (value)
+                   : [field] "r" (field),
                      _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0) );
+
+    return value;
+}
+
+static always_inline void __vmread(unsigned long field, unsigned long *value)
+{
+    *value = vmread(field);
 }
 
 static always_inline void __vmwrite(unsigned long field, unsigned long value)
@@ -363,7 +372,7 @@ static inline enum vmx_insn_errno vmread_safe(unsigned long field,
     if ( unlikely(fail_invalid) )
         ret = VMX_INSN_FAIL_INVALID;
     else if ( unlikely(fail_valid) )
-        __vmread(VM_INSTRUCTION_ERROR, &ret);
+        ret = vmread(VM_INSTRUCTION_ERROR);
 
     return ret;
 }
@@ -371,8 +380,6 @@ static inline enum vmx_insn_errno vmread_safe(unsigned long field,
 static inline enum vmx_insn_errno vmwrite_safe(unsigned long field,
                                                unsigned long value)
 {
-    unsigned long ret;
-
     asm goto ( "vmwrite %[value], %[field]\n\t"
                "jc %l[vmfail_invalid]\n\t"
                "jz %l[vmfail_error]"
@@ -386,8 +393,7 @@ static inline enum vmx_insn_errno vmwrite_safe(unsigned long field,
     return VMX_INSN_FAIL_INVALID;
 
  vmfail_error:
-    __vmread(VM_INSTRUCTION_ERROR, &ret);
-    return ret;
+    return vmread(VM_INSTRUCTION_ERROR);
 }
 
 static always_inline void __invept(unsigned long type, uint64_t eptp)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 28 21:11:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Apr 2025 21:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971188.1359666 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9Vkw-0007eD-I7; Mon, 28 Apr 2025 21:11:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971188.1359666; Mon, 28 Apr 2025 21: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 1u9Vkw-0007e5-FU; Mon, 28 Apr 2025 21:11:14 +0000
Received: by outflank-mailman (input) for mailman id 971188;
 Mon, 28 Apr 2025 21: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 1u9Vku-0007dn-IJ
 for xen-changelog@lists.xenproject.org; Mon, 28 Apr 2025 21: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 1u9Vku-00Alpc-1i
 for xen-changelog@lists.xenproject.org;
 Mon, 28 Apr 2025 21:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9Vku-00CL0j-19
 for xen-changelog@lists.xenproject.org;
 Mon, 28 Apr 2025 21: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=N7BR3fVG0vwjogwHOQS+V8c4k9Vkx9mCU/4cVzmfy8w=; b=I2MeQOyU3eYUOtRacktSbJWtwK
	3I2S9MWyufPDpPHb4FdfRH1dqlaGOUmPQGhBwrwAWh+crin0/CCyGtnaYYBDc7vMcjtdvce1r5kG3
	jhTXHnT8qBx6heA4nq+LxSqG9Ucz0nXDaIrXcmhhRdVO1s1AH9xMfVIE+khVPtCm0MCk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/vmx: Update DR7 type
Message-Id: <E1u9Vku-00CL0j-19@xenbits.xenproject.org>
Date: Mon, 28 Apr 2025 21:11:12 +0000

commit 48c9e67594496e1ab030c17b6bc136afe9f48e7f
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Sat Apr 26 07:27:44 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 28 21:01:24 2025 +0100

    x86/vmx: Update DR7 type
    
    Use the new vmread() accessor and shrink dr7 to it's preferred size.
    
    No functional change.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/vmx/vmx.c        | 2 +-
 xen/arch/x86/include/asm/domain.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 4883bd823d..827db6bdd8 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -926,7 +926,7 @@ static void vmx_save_dr(struct vcpu *v)
     v->arch.dr[3] = read_debugreg(3);
     v->arch.dr6   = read_debugreg(6);
     /* DR7 must be saved as it is used by vmx_restore_dr(). */
-    __vmread(GUEST_DR7, &v->arch.dr7);
+    v->arch.dr7   = vmread(GUEST_DR7);
 }
 
 static void __restore_debug_registers(struct vcpu *v)
diff --git a/xen/arch/x86/include/asm/domain.h b/xen/arch/x86/include/asm/domain.h
index 5fc1d1e5d0..8c0dea12a5 100644
--- a/xen/arch/x86/include/asm/domain.h
+++ b/xen/arch/x86/include/asm/domain.h
@@ -595,8 +595,8 @@ struct arch_vcpu
 
     /* Debug registers. */
     unsigned long dr[4];
-    unsigned long dr7; /* Ideally int, but __vmread() needs long. */
     unsigned int dr6;
+    unsigned int dr7;
 
     /* other state */
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 28 21:55:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Apr 2025 21:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971228.1359690 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9WRM-0005zc-0V; Mon, 28 Apr 2025 21:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971228.1359690; Mon, 28 Apr 2025 21: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 1u9WRL-0005zV-UL; Mon, 28 Apr 2025 21:55:03 +0000
Received: by outflank-mailman (input) for mailman id 971228;
 Mon, 28 Apr 2025 21: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 1u9WRK-0005zP-NE
 for xen-changelog@lists.xenproject.org; Mon, 28 Apr 2025 21: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 1u9WRK-00An24-14
 for xen-changelog@lists.xenproject.org;
 Mon, 28 Apr 2025 21:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9WRK-00Duuy-0k
 for xen-changelog@lists.xenproject.org;
 Mon, 28 Apr 2025 21: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=8ww7D4ng4C8xduLBKlne4rQhhCk0G1e6AoGgQZOSOC8=; b=qrNy5yX9JKTGWLvE0TtldcJaar
	eiPDlILrqDOD5VyOKGfiLy8Et31r7dKGf8OFjRx4bmaCBty5gBdPkqaj8+MZyC0C6ADkX1fvGuVFN
	aFwir7sVsNqo11qhuOPbrbS1YGCfI5fP+NmyU3Oa8lTw7aZ1HBGQhE7Dq9TSku84w57s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/vmx: Introduce vmread()
Message-Id: <E1u9WRK-00Duuy-0k@xenbits.xenproject.org>
Date: Mon, 28 Apr 2025 21:55:02 +0000

commit 881e5993dff7d8f372efeed7e5a9f255207805ed
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Sat Apr 26 07:27:29 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 28 21:01:20 2025 +0100

    x86/vmx: Introduce vmread()
    
    The current implementation of __vmread() is void and returns the result via
    pointer argument which leads to excess code in some places.
    
    Introduce a new vmread() function, and implement __vmread() in terms of it.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/include/asm/hvm/vmx/vmx.h | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmx.h b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
index 33d3d43a38..cc8c53fab1 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
@@ -320,16 +320,25 @@ static always_inline void __vmpclear(u64 addr)
     BUG();
 }
 
-static always_inline void __vmread(unsigned long field, unsigned long *value)
+static always_inline unsigned long vmread(unsigned long field)
 {
-    asm volatile ( "vmread %1, %0\n\t"
+    unsigned long value;
+
+    asm volatile ( "vmread %[field], %[value]\n\t"
                    /* CF==1 or ZF==1 --> BUG() */
                    UNLIKELY_START(be, vmread)
                    _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION
-                   : "=rm" (*value)
-                   : "r" (field),
+                   : [value] "=rm" (value)
+                   : [field] "r" (field),
                      _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0) );
+
+    return value;
+}
+
+static always_inline void __vmread(unsigned long field, unsigned long *value)
+{
+    *value = vmread(field);
 }
 
 static always_inline void __vmwrite(unsigned long field, unsigned long value)
@@ -363,7 +372,7 @@ static inline enum vmx_insn_errno vmread_safe(unsigned long field,
     if ( unlikely(fail_invalid) )
         ret = VMX_INSN_FAIL_INVALID;
     else if ( unlikely(fail_valid) )
-        __vmread(VM_INSTRUCTION_ERROR, &ret);
+        ret = vmread(VM_INSTRUCTION_ERROR);
 
     return ret;
 }
@@ -371,8 +380,6 @@ static inline enum vmx_insn_errno vmread_safe(unsigned long field,
 static inline enum vmx_insn_errno vmwrite_safe(unsigned long field,
                                                unsigned long value)
 {
-    unsigned long ret;
-
     asm goto ( "vmwrite %[value], %[field]\n\t"
                "jc %l[vmfail_invalid]\n\t"
                "jz %l[vmfail_error]"
@@ -386,8 +393,7 @@ static inline enum vmx_insn_errno vmwrite_safe(unsigned long field,
     return VMX_INSN_FAIL_INVALID;
 
  vmfail_error:
-    __vmread(VM_INSTRUCTION_ERROR, &ret);
-    return ret;
+    return vmread(VM_INSTRUCTION_ERROR);
 }
 
 static always_inline void __invept(unsigned long type, uint64_t eptp)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 28 21:55:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Apr 2025 21:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971229.1359693 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9WRW-00061W-20; Mon, 28 Apr 2025 21:55:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971229.1359693; Mon, 28 Apr 2025 21: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 1u9WRV-00061O-Vi; Mon, 28 Apr 2025 21:55:13 +0000
Received: by outflank-mailman (input) for mailman id 971229;
 Mon, 28 Apr 2025 21: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 1u9WRU-00061A-HX
 for xen-changelog@lists.xenproject.org; Mon, 28 Apr 2025 21: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 1u9WRU-00An2A-1c
 for xen-changelog@lists.xenproject.org;
 Mon, 28 Apr 2025 21:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9WRU-00DvKo-1T
 for xen-changelog@lists.xenproject.org;
 Mon, 28 Apr 2025 21: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=pXRX/t44MdOztq5+hh2U8UvpMeBy/T5++YBQ3lEmRbo=; b=udsgj4zaINoS+LC8ImiqZG6DO4
	v0Q1fvcTqzx5K0Zfs5hgUZY1SKuGxr93xScM3BLdczaMPvEATSm7gWl9yM23sxd8YmqxaR38xIUvV
	L3g7lIvvlp6a8U3VOjKXV0JduUrh0majRC8mNbI8HVyvM4zfxcyUUomFG7ENBx2/dkHA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/vmx: Update DR7 type
Message-Id: <E1u9WRU-00DvKo-1T@xenbits.xenproject.org>
Date: Mon, 28 Apr 2025 21:55:12 +0000

commit 48c9e67594496e1ab030c17b6bc136afe9f48e7f
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Sat Apr 26 07:27:44 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Apr 28 21:01:24 2025 +0100

    x86/vmx: Update DR7 type
    
    Use the new vmread() accessor and shrink dr7 to it's preferred size.
    
    No functional change.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/vmx/vmx.c        | 2 +-
 xen/arch/x86/include/asm/domain.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 4883bd823d..827db6bdd8 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -926,7 +926,7 @@ static void vmx_save_dr(struct vcpu *v)
     v->arch.dr[3] = read_debugreg(3);
     v->arch.dr6   = read_debugreg(6);
     /* DR7 must be saved as it is used by vmx_restore_dr(). */
-    __vmread(GUEST_DR7, &v->arch.dr7);
+    v->arch.dr7   = vmread(GUEST_DR7);
 }
 
 static void __restore_debug_registers(struct vcpu *v)
diff --git a/xen/arch/x86/include/asm/domain.h b/xen/arch/x86/include/asm/domain.h
index 5fc1d1e5d0..8c0dea12a5 100644
--- a/xen/arch/x86/include/asm/domain.h
+++ b/xen/arch/x86/include/asm/domain.h
@@ -595,8 +595,8 @@ struct arch_vcpu
 
     /* Debug registers. */
     unsigned long dr[4];
-    unsigned long dr7; /* Ideally int, but __vmread() needs long. */
     unsigned int dr6;
+    unsigned int dr7;
 
     /* other state */
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 09:55:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 09:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971739.1360048 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hg6-0006no-SW; Tue, 29 Apr 2025 09:55:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971739.1360048; Tue, 29 Apr 2025 09: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 1u9hg6-0006ng-Ps; Tue, 29 Apr 2025 09:55:02 +0000
Received: by outflank-mailman (input) for mailman id 971739;
 Tue, 29 Apr 2025 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 1u9hg6-0006na-3h
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 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 1u9hg5-00Cl9J-2c
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9hg5-00EDEG-2U
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09: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=y1ZCwSvokTzUmkZ575C65+FFhGexow4L2nzBFZ3hsWQ=; b=2HFIsA6BVtIDQfgshupDExMrb8
	Xlmh9+5gX1Bmoa273nANbHBIgw3q089rzEdDyPlO7hzslHEZJEnzw5IHYTYBztvfJtBkiPC2j/3sb
	cvX1QXThr0CfN9NVpq570nyqBMFWPIpp0uBt+GumGLepvNy/1pJcJLROyUFtrYfB2l54=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/MTRR: hook mtrr_bp_restore() back up
Message-Id: <E1u9hg5-00EDEG-2U@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 09:55:01 +0000

commit da24dccf533a7a7a10b27b84d952d05962bfdbdc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 11:38:58 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:38:58 2025 +0200

    x86/MTRR: hook mtrr_bp_restore() back up
    
    Unlike stated in the offending commit's description,
    load_system_tables() wasn't the only thing left to retain from the
    earlier restore_rest_processor_state(). Note that MTRR state was still
    reloaded via mtrr_aps_sync_end(), but that happens quite a bit later in
    the resume process.
    
    While there also do Misra-related tidying for the function itself: The
    function being used from assembly only means it doesn't need to have a
    declaration, but wants to be asmlinkage.
    
    Fixes: 4304ff420e51 ("x86/S3: Drop {save,restore}_rest_processor_state() completely")
    Reported-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>
    master commit: 0414dedd6fde1a1c5c5e38dcbef4dad506e1398c
    master date: 2025-04-03 09:39:13 +0200
---
 xen/arch/x86/acpi/wakeup_prot.S | 2 ++
 xen/arch/x86/cpu/mtrr/main.c    | 2 +-
 xen/arch/x86/include/asm/mtrr.h | 1 -
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/acpi/wakeup_prot.S b/xen/arch/x86/acpi/wakeup_prot.S
index 8ce57ad137..a741d58b91 100644
--- a/xen/arch/x86/acpi/wakeup_prot.S
+++ b/xen/arch/x86/acpi/wakeup_prot.S
@@ -124,6 +124,8 @@ LABEL(s3_resume)
         mov     STACK_CPUINFO_FIELD(cr4)(%rbx), %rax
         mov     %rax, %cr4
 
+        call    mtrr_bp_restore
+
 .Lsuspend_err:
         pop     %r15
         pop     %r14
diff --git a/xen/arch/x86/cpu/mtrr/main.c b/xen/arch/x86/cpu/mtrr/main.c
index 0a44ebbcb0..516c8478c6 100644
--- a/xen/arch/x86/cpu/mtrr/main.c
+++ b/xen/arch/x86/cpu/mtrr/main.c
@@ -609,7 +609,7 @@ void mtrr_aps_sync_end(void)
 	hold_mtrr_updates_on_aps = 0;
 }
 
-void mtrr_bp_restore(void)
+void asmlinkage mtrr_bp_restore(void)
 {
 	mtrr_set_all();
 }
diff --git a/xen/arch/x86/include/asm/mtrr.h b/xen/arch/x86/include/asm/mtrr.h
index 36dac0a775..48b59d2620 100644
--- a/xen/arch/x86/include/asm/mtrr.h
+++ b/xen/arch/x86/include/asm/mtrr.h
@@ -66,7 +66,6 @@ extern uint8_t pat_type_2_pte_flags(uint8_t pat_type);
 extern int hold_mtrr_updates_on_aps;
 extern void mtrr_aps_sync_begin(void);
 extern void mtrr_aps_sync_end(void);
-extern void mtrr_bp_restore(void);
 
 extern bool mtrr_var_range_msr_set(struct domain *d, struct mtrr_state *m,
                                    uint32_t msr, uint64_t msr_content);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 09:55:12 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 09:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971740.1360052 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hgG-0006pZ-V5; Tue, 29 Apr 2025 09:55:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971740.1360052; Tue, 29 Apr 2025 09: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 1u9hgG-0006pR-RR; Tue, 29 Apr 2025 09:55:12 +0000
Received: by outflank-mailman (input) for mailman id 971740;
 Tue, 29 Apr 2025 09: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 1u9hgF-0006pF-UD
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 09: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 1u9hgF-00Cl9N-2v
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09:55:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9hgF-00EDd0-2n
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09: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=i7IQGDokA3bMespdU6jMTpwPHGju/hlc9Egs4QuDRfA=; b=t2qNqStqDetOJbpX60kNQDv9qZ
	a6Ql5f5muH2tX71SRGL23Li+zwxDAGTdqBoV8XKgzuELsRUmiQ6qIAQ/SbwmMnHvqtMK4BN0CQzZ/
	Lf/lpHjwbcs/6ISRd8NrCHrZae5dyoCxIDL1ETwLMWDiS3bT1WTg2IjUYdF7JNR7K00k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] sched/null: avoid another crash after failed domU creation
Message-Id: <E1u9hgF-00EDd0-2n@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 09:55:11 +0000

commit 5b5a11c6c846e9908c9dcce12ff436106e3c5b87
Author:     Stewart Hildebrand <stewart.hildebrand@amd.com>
AuthorDate: Tue Apr 29 11:40:06 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:40:06 2025 +0200

    sched/null: avoid another crash after failed domU creation
    
    The following sequence of events may lead a debug build of Xen to crash
    when using the null scheduler:
    
    1. domain creation (e.g. d1) failed due to bad configuration
    2. complete_domain_destroy() was deferred
    3. domain creation (e.g. d2) succeeds
    
    At this point, d2 is running, while the zombie d1 is not fully cleaned
    up:
    
    (XEN) Online Cpus: 0-3
    (XEN) Cpupool 0:
    (XEN) Cpus: 0-3
    (XEN) Scheduling granularity: cpu, 1 CPU per sched-resource
    (XEN) Scheduler: null Scheduler (null)
    (XEN)   cpus_free = 3
    (XEN) Domain info:
    (XEN)   Domain: 0
    (XEN)     1: [0.0] pcpu=0
    (XEN)     2: [0.1] pcpu=1
    (XEN)   Domain: 1
    (XEN)     3: [1.0] pcpu=2
    (XEN)   Domain: 2
    (XEN)     4: [2.0] pcpu=2
    
    4. complete_domain_destroy() gets called for d1 and triggers the
    following:
    
    (XEN) Xen call trace:
    (XEN)    [<00000a0000322ed4>] null.c#unit_deassign+0x2d8/0xb70 (PC)
    (XEN)    [<00000a000032457c>] null.c#null_unit_remove+0x670/0xba8 (LR)
    (XEN)    [<00000a000032457c>] null.c#null_unit_remove+0x670/0xba8
    (XEN)    [<00000a0000336404>] sched_destroy_vcpu+0x354/0x8fc
    (XEN)    [<00000a0000227324>] domain.c#complete_domain_destroy+0x11c/0x49c
    (XEN)    [<00000a000029fbd0>] rcupdate.c#rcu_do_batch+0x94/0x3d0
    (XEN)    [<00000a00002a10c0>] rcupdate.c#__rcu_process_callbacks+0x160/0x5f4
    (XEN)    [<00000a00002a1e60>] rcupdate.c#rcu_process_callbacks+0xcc/0x1b0
    (XEN)    [<00000a00002a3460>] softirq.c#__do_softirq+0x1f4/0x3d8
    (XEN)    [<00000a00002a37c4>] do_softirq+0x14/0x1c
    (XEN)    [<00000a0000465260>] traps.c#check_for_pcpu_work+0x30/0xb8
    (XEN)    [<00000a000046bb08>] leave_hypervisor_to_guest+0x28/0x198
    (XEN)    [<00000a0000409c84>] entry.o#guest_sync_slowpath+0xac/0xd8
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 0:
    (XEN) Assertion 'npc->unit == unit' failed at common/sched/null.c:383
    (XEN) ****************************************
    
    Fix by skipping unit_deassign() when the unit to be removed does not
    match the pcpu's currently assigned unit.
    
    Fixes: c2eae2614c8f ("sched/null: avoid crash after failed domU creation")
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    master commit: 54fe207f29f86c4226a62a4dd289f10d9d2abc40
    master date: 2025-04-07 12:17:31 +0200
---
 xen/common/sched/null.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/sched/null.c b/xen/common/sched/null.c
index 7e31440e5b..c8e327e3cd 100644
--- a/xen/common/sched/null.c
+++ b/xen/common/sched/null.c
@@ -557,7 +557,7 @@ static void cf_check null_unit_remove(
 
     cpu = sched_unit_master(unit);
     npc = get_sched_res(cpu)->sched_priv;
-    if ( npc->unit )
+    if ( npc->unit == unit )
         unit_deassign(prv, unit);
 
  out:
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 09:55:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 09:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971741.1360056 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hgR-0006so-0h; Tue, 29 Apr 2025 09:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971741.1360056; Tue, 29 Apr 2025 09: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 1u9hgQ-0006sg-UM; Tue, 29 Apr 2025 09:55:22 +0000
Received: by outflank-mailman (input) for mailman id 971741;
 Tue, 29 Apr 2025 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 1u9hgQ-0006sV-4b
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 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 1u9hgQ-00Cl9R-0M
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9hgQ-00EDvW-0D
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 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=/2XXuVGR7HJQFVmNWy7i7YejtMFhwsEzLX/rxWDTNvA=; b=j08ovhL9UHjwBUlTQcKvEQ+w55
	a3jUucnjhzb4Tc2ekXb72rszjrwdB3IrIUQ0b4Fv3Rxs4rRno5NSn7BR3jA+4T/KX/3hlVTQswFr1
	F5I5jdlPElhlavfagpLoJ6ztidUViTUFKSVavaljmndj5EdxDhfhJRLQtMLKBZ23BDh8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] xen: vm_event: do not do vm_event_op for an invalid domain
Message-Id: <E1u9hgQ-00EDvW-0D@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 09:55:22 +0000

commit e0d9137ae77d7673719007352037eb730ad52fa2
Author:     Volodymyr Babchuk <volodymyr_babchuk@epam.com>
AuthorDate: Tue Apr 29 11:40:40 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:40:40 2025 +0200

    xen: vm_event: do not do vm_event_op for an invalid domain
    
    A privileged domain can issue XEN_DOMCTL_vm_event_op with
    op->domain == DOMID_INVALID. In this case vm_event_domctl()
    function will get NULL as the first parameter and this will
    cause hypervisor panic, as it tries to derefer this pointer.
    
    Fix the issue by checking if valid domain is passed in.
    
    Fixes: 48b84249459f ("xen/vm-event: Drop unused u_domctl parameter from vm_event_domctl()")
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
    master commit: 6a884750f3b86a45ee5ffbd825c346fcbce86080
    master date: 2025-04-08 09:36:38 +0200
---
 xen/common/vm_event.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/common/vm_event.c b/xen/common/vm_event.c
index fbf1aa0848..1666ff615f 100644
--- a/xen/common/vm_event.c
+++ b/xen/common/vm_event.c
@@ -600,6 +600,10 @@ int vm_event_domctl(struct domain *d, struct xen_domctl_vm_event_op *vec)
         return 0;
     }
 
+    /* All other subops need to target a real domain. */
+    if ( unlikely(d == NULL) )
+        return -ESRCH;
+
     rc = xsm_vm_event_control(XSM_PRIV, d, vec->mode, vec->op);
     if ( rc )
         return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 09:55:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 09:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971742.1360059 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hgb-0006vD-2K; Tue, 29 Apr 2025 09:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971742.1360059; Tue, 29 Apr 2025 09: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 1u9hga-0006v5-Vi; Tue, 29 Apr 2025 09:55:32 +0000
Received: by outflank-mailman (input) for mailman id 971742;
 Tue, 29 Apr 2025 09: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 1u9hga-0006us-9L
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 09: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 1u9hga-00Cl9a-0p
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9hga-00EENB-0d
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09: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=vOhATAmIOXMF/o/iGQo2DPvC7Kna0J6teKs72rH++3o=; b=RRn7Mls5MPxAWUZ+GdkVkjxHEB
	E5aLIlY60eKmR+lbE/ZvarQkLRjEN34MluvpBhQ7MUMs+QE8imTUTnrPF832ez9zoKfWaZL16FXFB
	ykhrksw8UyLPH27mbPbXAxqmRkOgiyXphrdsEqkCy6/89NUtF6HjfzrcsaB5plTn2Lgs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/cpu: Validate CPUID leaf 0x2 EDX output
Message-Id: <E1u9hga-00EENB-0d@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 09:55:32 +0000

commit 2bd2c08a0f63d60bc1f8cc69ec9677d39f66aecf
Author:     Ahmed S. Darwish <darwi@linutronix.de>
AuthorDate: Tue Apr 29 11:41:13 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:41:13 2025 +0200

    x86/cpu: Validate CPUID leaf 0x2 EDX output
    
    CPUID leaf 0x2 emits one-byte descriptors in its four output registers
    EAX, EBX, ECX, and EDX.  For these descriptors to be valid, the most
    significant bit (MSB) of each register must be clear.
    
    Leaf 0x2 parsing at intel.c only validated the MSBs of EAX, EBX, and
    ECX, but left EDX unchecked.
    
    Validate EDX's most-significant bit as well.
    
    Fixes: 1aa6feb63bfd ("Port CPU setup code from Linux 2.6")
    Signed-off-by: Ahmed S. Darwish <darwi@linutronix.de>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Link: https://lore.kernel.org/r/20250304085152.51092-3-darwi@linutronix.de
    
    Use ARRAY_SIZE() though.
    
    Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 1881148215c6
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: a47b44a8f0a58a6015faf6465921cd203f0b51d1
    master date: 2025-04-08 09:37:38 +0200
---
 xen/arch/x86/cpu/intel_cacheinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/intel_cacheinfo.c b/xen/arch/x86/cpu/intel_cacheinfo.c
index 9cfb759be0..e88faa7545 100644
--- a/xen/arch/x86/cpu/intel_cacheinfo.c
+++ b/xen/arch/x86/cpu/intel_cacheinfo.c
@@ -186,7 +186,7 @@ void init_intel_cacheinfo(struct cpuinfo_x86 *c)
 			cpuid(2, &regs[0], &regs[1], &regs[2], &regs[3]);
 
 			/* If bit 31 is set, this is an unknown format */
-			for ( j = 0 ; j < 3 ; j++ ) {
+			for ( j = 0; j < ARRAY_SIZE(regs); j++ ) {
 				if ( regs[j] >> 31 )
 					regs[j] = 0;
 			}
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 09:55:43 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 09:55:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971743.1360064 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hgl-0006xj-3T; Tue, 29 Apr 2025 09:55:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971743.1360064; Tue, 29 Apr 2025 09:55:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hgl-0006xb-0o; Tue, 29 Apr 2025 09:55:43 +0000
Received: by outflank-mailman (input) for mailman id 971743;
 Tue, 29 Apr 2025 09: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 1u9hgk-0006xT-C7
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 09: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 1u9hgk-00Cl9z-17
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9hgk-00EEcF-10
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09: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=VPy4rkgmtor86UsOBZvXX0AfWSq2Omv8eiJk276q9mE=; b=qqJ73ZlY8c9qXl6U0Om1kBcRu3
	y/+GltcMr1BeOeGAzQjhad+CW0edQ7VcFze7MlffpamhSIPnArP63I7tRvkWWPvhAHbsD1biXqpnA
	zzF3hP4N6KGSSQX+h/q0Yf1Llb67ooEZ1yXUhinliySKh+T8DdGnKaYo0Ofx3c4QjGEk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] xen: x86: irq: initialize irq desc in create_irq()
Message-Id: <E1u9hgk-00EEcF-10@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 09:55:42 +0000

commit 1a8df8282cca556b4355d2cd7b87d598bdcf2a02
Author:     Volodymyr Babchuk <volodymyr_babchuk@epam.com>
AuthorDate: Tue Apr 29 11:41:38 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:41:38 2025 +0200

    xen: x86: irq: initialize irq desc in create_irq()
    
    While building xen with GCC 14.2.1 with "-fcondition-coverage" option
    or with "-Og", the compiler produces a false positive warning:
    
      arch/x86/irq.c: In function ‘create_irq’:
      arch/x86/irq.c:281:11: error: ‘desc’ may be used uninitialized [-Werror=maybe-uninitialized]
        281 |     ret = init_one_irq_desc(desc);
            |           ^~~~~~~~~~~~~~~~~~~~~~~
      arch/x86/irq.c:269:22: note: ‘desc’ was declared here
        269 |     struct irq_desc *desc;
            |                      ^~~~
      cc1: all warnings being treated as errors
      make[2]: *** [Rules.mk:252: arch/x86/irq.o] Error 1
    
    While we have signed/unsigned comparison both in "for" loop and in
    "if" statement, this still can't lead to use of uninitialized "desc",
    as either loop will be executed at least once, or the function will
    return early. So this is a clearly false positive warning due to a
    bug [1] in GCC.
    
    Initialize "desc" with NULL to make GCC happy.
    
    [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119665
    
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 7a4484d90b3003171f1700e424ad45b931200ba6
    master date: 2025-04-08 09:40:39 +0200
---
 xen/arch/x86/irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index ff3ac832f4..3a09ed6346 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -265,7 +265,7 @@ void __init clear_irq_vector(int irq)
 int create_irq(nodeid_t node, bool grant_access)
 {
     int irq, ret;
-    struct irq_desc *desc;
+    struct irq_desc *desc = NULL ; /* gcc14 -Og or -fcondition-coverage */
 
     for (irq = nr_irqs_gsi; irq < nr_irqs; irq++)
     {
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 09:55:53 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 09:55:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971744.1360068 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hgv-0006zs-4k; Tue, 29 Apr 2025 09:55:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971744.1360068; Tue, 29 Apr 2025 09:55:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hgv-0006zk-2A; Tue, 29 Apr 2025 09:55:53 +0000
Received: by outflank-mailman (input) for mailman id 971744;
 Tue, 29 Apr 2025 09: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 1u9hgu-0006ze-F7
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 09: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 1u9hgu-00ClDz-1Q
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09:55:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9hgu-00EEqt-1I
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09: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=ybNFJH7DEctM1y5GPVdXcX8rfO6XX30YHMXtCnCUCBc=; b=nyvTXhGRQsgZvi+rtgcZjRkdYz
	Ie14WBvEWblXUhkC6yhfhPurKvZ6+dhTFhF3KTI52dzr7wP7eFXlfbXYJZeB5Se0xQ+8kaQ6tFH8S
	0idqBoSaw1bNWfpTCftbHAMAb6uDvblOKoNFb5uMjEF1vlMuQvA9vcFUR9Seol0wR77w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86emul/test: drop check for AVX512-4FMAPS
Message-Id: <E1u9hgu-00EEqt-1I@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 09:55:52 +0000

commit f01a09d0b14c82eca982b650c6b6a8100fef2d19
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 11:42:23 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:42:23 2025 +0200

    x86emul/test: drop check for AVX512-4FMAPS
    
    Use of Xeon Phi features was dropped earlier on; this one was overlooked.
    
    Fixes: 85191cf32180 ("x86: drop Xeon Phi support")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 4bb846f32c870b19decc926f4759eac3fecfc04c
    master date: 2025-04-09 15:30:51 +0200
---
 tools/tests/x86_emulator/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/tests/x86_emulator/Makefile b/tools/tests/x86_emulator/Makefile
index 294d27ebaa..3f57ac6159 100644
--- a/tools/tests/x86_emulator/Makefile
+++ b/tools/tests/x86_emulator/Makefile
@@ -105,7 +105,7 @@ TARGET-$(shell echo 'int i;' | $(CC) -x c -c -o /dev/null -m$(1) - || echo y) :=
 endef
 
 ISA := bmi bmi2 tbm sse4.1 sse4.2 sse4a avx avx2 f16c
-ISA += $(addprefix avx512,f bw dq 4fmaps)
+ISA += $(addprefix avx512,f bw dq)
 $(foreach isa,$(ISA),$(eval $(call isa-check-cc,$(isa))))
 
 # Also explicitly check for {evex} pseudo-prefix support, which got introduced
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 09:56:03 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 09:56:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971745.1360072 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hh5-00072A-6O; Tue, 29 Apr 2025 09:56:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971745.1360072; Tue, 29 Apr 2025 09:56: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 1u9hh5-000723-3b; Tue, 29 Apr 2025 09:56:03 +0000
Received: by outflank-mailman (input) for mailman id 971745;
 Tue, 29 Apr 2025 09: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 1u9hh4-00071v-Hm
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 09: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 1u9hh4-00ClFr-1g
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09:56:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9hh4-00EFFO-1a
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09: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=wavZRtb/93pWmPqqiBZkr/vh5PEh+s184lZrBRJ+JEM=; b=iNlvyV6/z2e/JGjaYdn09K2I2l
	Th+daNewJMpQ96IWkaO97HtHPCZ6hwOSc+iu1zxSVE0GxTb4OO4N5v82Iw9BqO9U3Jxp4ydVsTS1f
	XuNzdZvsODzvxy4UPha9DA+IMg+SpC8iBt4HTGGBiWGUTJziRQ7xbocEnBneXdv/5Mnw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] include: sort $(wildcard ...) results
Message-Id: <E1u9hh4-00EFFO-1a@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 09:56:02 +0000

commit f1dd95598852d5d227aff19b0f90e7194486b6e5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 11:42:47 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:42:47 2025 +0200

    include: sort $(wildcard ...) results
    
    The order of items is stored in .*.chk.cmd, and hence variations between
    how items are ordered would result in re-invocation of the checking rule
    during "make install-xen" despite that already having successfully run
    earlier on. The difference can become noticable when building (as non-
    root) and installing (as root) use different GNU make versions: In 3.82
    the sorting was deliberately undone, just for it to be restored in 4.3.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: ff835bbc8096a14ed1bffa235e25848c993f7240
    master date: 2025-04-10 10:56:29 +0200
---
 xen/include/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/include/Makefile b/xen/include/Makefile
index 058b0a566b..41b985f4d1 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -41,8 +41,8 @@ cppflags-$(CONFIG_X86)    += -m32
 
 endif
 
-public-$(CONFIG_X86) := $(wildcard $(srcdir)/public/arch-x86/*.h $(srcdir)/public/arch-x86/*/*.h)
-public-$(CONFIG_ARM) := $(wildcard $(srcdir)/public/arch-arm/*.h $(srcdir)/public/arch-arm/*/*.h)
+public-$(CONFIG_X86) := $(sort $(wildcard $(srcdir)/public/arch-x86/*.h $(srcdir)/public/arch-x86/*/*.h))
+public-$(CONFIG_ARM) := $(sort $(wildcard $(srcdir)/public/arch-arm/*.h $(srcdir)/public/arch-arm/*/*.h))
 
 .PHONY: all
 all: $(addprefix $(obj)/,$(headers-y) $(headers-n))
@@ -130,7 +130,7 @@ all: $(obj)/headers.chk $(obj)/headers99.chk $(obj)/headers++.chk
 
 public-hdrs-path := $(srcdir)/public
 
-public-list-headers = $(wildcard $1/*.h $1/*/*.h)
+public-list-headers = $(sort $(wildcard $1/*.h $1/*/*.h))
 public-filter-headers = $(filter-out $(addprefix $(public-hdrs-path)/, $($1-filter)), $($1))
 
 public-headers := $(call public-list-headers, $(public-hdrs-path)) $(public-y)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 09:56:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 09:56:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971746.1360076 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hhG-00075E-7o; Tue, 29 Apr 2025 09:56:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971746.1360076; Tue, 29 Apr 2025 09: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 1u9hhG-000756-5C; Tue, 29 Apr 2025 09:56:14 +0000
Received: by outflank-mailman (input) for mailman id 971746;
 Tue, 29 Apr 2025 09: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 1u9hhE-00074o-Kk
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 09: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 1u9hhE-00ClFx-1x
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09:56:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9hhE-00EFke-1r
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09: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=K/Elb7K7/1JHZ37F/8hgGVwh+m13szEesJzjHE52y50=; b=o7WozmD6GAZV6JkkliRYDiNLQT
	95zYYJ2uu/BvPSvPtJvjgTe1lBY3DHbRxscTb6AX2QAPuh8imw5aGSuXCjfE+m8oyn6LOd0sIlNSB
	YvOO5zQsQv2MB57nEnJrwY7F9UNmJqVgVpfpdiOdedHFzNhDRtrDi9tOMjxRvVPX27QQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] xen/rangeset: fix incorrect subtraction
Message-Id: <E1u9hhE-00EFke-1r@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 09:56:12 +0000

commit 6b399ed19fd36cca92745a55901a89c3b5fb747f
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Apr 29 11:43:12 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:43:12 2025 +0200

    xen/rangeset: fix incorrect subtraction
    
    Given the following rangset operation:
    
    { [0, 1], [4, 5] } - { [3, 4] }
    
    The current rangeset logic will output a rangeset:
    
    { [0, 2], [5, 5] }
    
    This is incorrect, and also has the undesirable property of being bogus in
    a way that the resulting rangeset is expanded.
    
    Fix this by making sure the bounds are correctly checked before modifying
    the previous range.
    
    Fixes: 484a058c4828 ('Add auto-destructing per-domain rangeset data structure...')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: e118fc98e7ae652a188d227bd7ea22f132724150
    master date: 2025-04-11 12:20:10 +0200
---
 xen/common/rangeset.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/common/rangeset.c b/xen/common/rangeset.c
index b75590f907..e758710390 100644
--- a/xen/common/rangeset.c
+++ b/xen/common/rangeset.c
@@ -227,7 +227,8 @@ int rangeset_remove_range(
 
         if ( x->s < s )
         {
-            x->e = s - 1;
+            if ( x->e >= s )
+                x->e = s - 1;
             x = next_range(r, x);
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 09:56:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 09:56:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971747.1360080 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hhQ-00077I-9B; Tue, 29 Apr 2025 09:56:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971747.1360080; Tue, 29 Apr 2025 09: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 1u9hhQ-00077A-6V; Tue, 29 Apr 2025 09:56:24 +0000
Received: by outflank-mailman (input) for mailman id 971747;
 Tue, 29 Apr 2025 09:56: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 1u9hhO-000771-Nq
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 09: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 1u9hhO-00ClG1-2F
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09:56:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9hhO-00EGDK-29
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09: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=tiWNgI7sZfHp6HaiLzFHx53LX8fSvG9LQcc0RfI7QCY=; b=EQ+S/t7jAZO44EWoNTAbZXSTIk
	6LWPZDbIrhVG24ZZGLk7fFcmUc4haQ90SobdWo3i/u0+J6VExRLoxHEHKrqV3Dzf/IRkOBj9MgSMI
	eCsWk1rYalvr0imbPi9BYL5lrE+gtTp4urDTt4sEaJhhqxLOgdki89v8NAiA9ZAjgf2c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/mm: account for the offset when performing subpage r/o MMIO access
Message-Id: <E1u9hhO-00EGDK-29@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 09:56:22 +0000

commit dee15facf81d1f0f6e91ca52eb1f0f8f1b2a20dc
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Apr 29 11:44:04 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:44:04 2025 +0200

    x86/mm: account for the offset when performing subpage r/o MMIO access
    
    The current logic in subpage_mmio_write_emulate() doesn't take into account
    the page offset, and always performs the writes at offset 0 (start of the
    page).
    
    Fix this by accounting for the offset before performing the write.
    
    Fixes: 8847d6e23f97 ('x86/mm: add API for marking only part of a MMIO page read only')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 38d07809794e3c723a4de7e10c25c1f6cb590dc6
    master date: 2025-04-15 16:01:48 +0200
---
 xen/arch/x86/mm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index e6a61520d5..0d242739b1 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5128,6 +5128,7 @@ static void subpage_mmio_write_emulate(
         return;
     }
 
+    addr += offset;
     switch ( len )
     {
     case 1:
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 09:56:34 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 09:56:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971748.1360086 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hha-00079i-CR; Tue, 29 Apr 2025 09:56:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971748.1360086; Tue, 29 Apr 2025 09:56:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hha-00079Z-7w; Tue, 29 Apr 2025 09:56:34 +0000
Received: by outflank-mailman (input) for mailman id 971748;
 Tue, 29 Apr 2025 09:56: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 1u9hhY-00079N-QN
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 09:56: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 1u9hhY-00ClG5-2Y
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09:56:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9hhY-00EGdU-2R
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09: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=Uv8d1MNV1sYF1NqY5M5DwGwyENuXgNPBC9mupuI/RBg=; b=28qvuWkhX5hnoS1pzIQ0DmPA/x
	TYkJrOVENn/qYmgvr7APILVlLc+DeSzVrO3QGL1bftTys6DowWQp0i10eAw+1AyiQhBnKSN4EsfO5
	O9piTfVhKAIB582ulLF2dIO2a7oDrQa9cV+Vc5qPVbOpKS6iJbm6mfiN/uBE8Q434h+0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/HVM: update repeat count upon nested lin->phys failure
Message-Id: <E1u9hhY-00EGdU-2R@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 09:56:32 +0000

commit ade8230830e9bf8c891ab37d2129cd5b48f51c99
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 11:44:56 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:44:56 2025 +0200

    x86/HVM: update repeat count upon nested lin->phys failure
    
    For the X86EMUL_EXCEPTION case the repeat count must be correctly
    propagated back. Since for the recursive invocation we use a local
    helper variable, its value needs copying to the caller's one.
    
    While there also correct the off-by-1 range in the comment ahead of the
    function (strictly speaking for the "DF set" case we'd need to put
    another, different range there as well).
    
    Fixes: 53f87c03b4ea ("x86emul: generalize exception handling for rep_* hooks")
    Reported-by: Manuel Andreas <manuel.andreas@tum.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: c07b16fd6e47782ebf1ee767cd07c1e2b4140f47
    master date: 2025-04-17 10:01:19 +0200
---
 xen/arch/x86/hvm/emulate.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 23e436d7db..495c8fe3b3 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -825,7 +825,7 @@ static void hvmemul_unmap_linear_addr(
 
 /*
  * Convert addr from linear to physical form, valid over the range
- * [addr, addr + *reps * bytes_per_rep]. *reps is adjusted according to
+ * [addr, addr + *reps * bytes_per_rep). *reps is adjusted according to
  * the valid computed range. It is always >0 when X86EMUL_OKAY is returned.
  * @pfec indicates the access checks to be performed during page-table walks.
  */
@@ -865,7 +865,10 @@ static int hvmemul_linear_to_phys(
         int rc = hvmemul_linear_to_phys(
             addr, &_paddr, bytes_per_rep, &one_rep, pfec, hvmemul_ctxt);
         if ( rc != X86EMUL_OKAY )
+        {
+            *reps = one_rep;
             return rc;
+        }
         pfn = _paddr >> PAGE_SHIFT;
     }
     else if ( (pfn = paging_gva_to_gfn(curr, addr, &pfec)) == gfn_x(INVALID_GFN) )
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 09:56:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 09:56:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971749.1360088 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hhk-0007D9-D9; Tue, 29 Apr 2025 09:56:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971749.1360088; Tue, 29 Apr 2025 09:56:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hhk-0007D2-Aa; Tue, 29 Apr 2025 09:56:44 +0000
Received: by outflank-mailman (input) for mailman id 971749;
 Tue, 29 Apr 2025 09:56: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 1u9hhi-0007Cb-U2
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 09:56: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 1u9hhi-00ClGW-2u
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09:56:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9hhi-00EH2x-2n
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09:56: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=paR1wUwqyQ+a9T8ZkJexdQL9IUF11u/EJXPLt2TSkqQ=; b=XTdhYgsVI5YPvXm3d8lQFwqR6M
	AUJAoxL3LlE6hRadWP7GqFqlinc20UeyGyiHd4gaSw34seUwRhW4G8XbCzvyEQ7nW3vYQJOqKOPJJ
	kevI5xShU4WsJR52gCFMaB8r7WdYEihqdLVIDd+s2MaUnZspiQDj+hrwIh16pXKpV5Lc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86emul: also clip repetition count for STOS
Message-Id: <E1u9hhi-00EH2x-2n@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 09:56:42 +0000

commit 23a02992edb88e200fb0e722be6229729309c1d5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 11:45:28 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:45:28 2025 +0200

    x86emul: also clip repetition count for STOS
    
    Like MOVS, INS, and OUTS, STOS also has a special purpose hook, where
    the hook function may legitimately have the same expectation as to the
    request not straddling address space start/end.
    
    Fixes: 5dfe4aa4eeb6 ("x86_emulate: Do not request emulation of REP instructions beyond the")
    Reported-by: Fabian Specht <f.specht@tum.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 8c5636b6c87777e6c2e4ffae28bffe1cfc189bfd
    master date: 2025-04-22 11:24:20 +0200
---
 xen/arch/x86/x86_emulate/x86_emulate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 535d803588..e8cba5a27f 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -2221,7 +2221,7 @@ x86_emulate(
 
         dst.bytes = src.bytes;
         dst.mem.seg = x86_seg_es;
-        dst.mem.off = truncate_ea(_regs.r(di));
+        dst.mem.off = truncate_ea_and_reps(_regs.r(di), nr_reps, dst.bytes);
         if ( (nr_reps == 1) || !ops->rep_stos ||
              ((rc = ops->rep_stos(&src.val,
                                   dst.mem.seg, dst.mem.off, dst.bytes,
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 09:56:54 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 09:56:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971750.1360092 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hhu-0007Fd-Ew; Tue, 29 Apr 2025 09:56:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971750.1360092; Tue, 29 Apr 2025 09:56: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 1u9hhu-0007FT-CC; Tue, 29 Apr 2025 09:56:54 +0000
Received: by outflank-mailman (input) for mailman id 971750;
 Tue, 29 Apr 2025 09:56: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 1u9hht-0007FC-0K
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 09:56: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 1u9hhs-00ClGd-3B
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09:56:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9hhs-00EHNm-35
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09:56: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=FpNC+w3iy5FgwUj5sluqXeaqSo8eO9hfkBk6Wryi0ng=; b=bGhn0OKhG6HGa4JmFWuUO6WGp3
	ireVFxkU9pxMvh/XopVepql5HEViAWIeqxJz5sgMla2ilQ4o9rfmxXWpGCuYXMHMgK7NUEozLU4Vr
	Ni7zSsdpGAfFbZEpVxyKGgjmDap8xn27DBAYn+Rz6dM4ntxjQtpVrgFgGF4Yf9Ejq5U0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] compat/memory: avoid UB shifts in XENMEM_exchange handling
Message-Id: <E1u9hhs-00EHNm-35@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 09:56:52 +0000

commit 7d9bbb8ba81f96a7c36777f9d0b6e21e272113c0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 11:45:59 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:45:59 2025 +0200

    compat/memory: avoid UB shifts in XENMEM_exchange handling
    
    Add an early basic check, yielding the same error code as the more
    thorough one the main handler would produce.
    
    Fixes: b8a7efe8528a ("Enable compatibility mode operation for HYPERVISOR_memory_op")
    Reported-by: Manuel Andreas <manuel.andreas@tum.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 560c51be8f6a88cde43c0a7c8be60158b5725982
    master date: 2025-04-22 11:25:23 +0200
---
 xen/common/compat/memory.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c
index 45e5fb0e5d..e3eb3c01a1 100644
--- a/xen/common/compat/memory.c
+++ b/xen/common/compat/memory.c
@@ -161,6 +161,11 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
             if ( copy_from_guest(&cmp.xchg, arg, 1) )
                 return -EFAULT;
 
+            /* Early coarse check, as max_order() isn't available here. */
+            if ( cmp.xchg.in.extent_order >= 32 ||
+                 cmp.xchg.out.extent_order >= 32 )
+                return -EPERM;
+
             order_delta = cmp.xchg.out.extent_order - cmp.xchg.in.extent_order;
             /* Various sanity checks. */
             if ( (cmp.xchg.nr_exchanged > cmp.xchg.in.nr_extents) ||
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 09:57:04 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 09:57:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971751.1360096 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hi4-0007Hs-GH; Tue, 29 Apr 2025 09:57:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971751.1360096; Tue, 29 Apr 2025 09:57: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 1u9hi4-0007Hk-DZ; Tue, 29 Apr 2025 09:57:04 +0000
Received: by outflank-mailman (input) for mailman id 971751;
 Tue, 29 Apr 2025 09:57: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 1u9hi3-0007HX-39
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 09:57: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 1u9hi3-00ClGs-0E
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09:57:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9hi3-00EHiK-08
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09:57: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=0djA68Zgaw458H0RGT7hj9CPBMGDJjbDdXsNrtCSLLM=; b=P75M3aJNxksldLzWxt/VOqMtUQ
	0sxWUFdoeyOteGlRRacrgrdfWDsLdRl/81yHUzzfihWGo8EKF6lRRMbzPjjuF5dhIi9tSos483D4x
	zofWA/MeK2kHwN15PTyKjKEbIXrz4/YtEXF+QgbouVs5Wd4cL+71N0jhjyUuM4LqtRZ4=;
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 mkreloc header (field) reading
Message-Id: <E1u9hi3-00EHiK-08@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 09:57:03 +0000

commit fc07876bea831edde71d62273bd7a5596b241be0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 11:46:37 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:46:37 2025 +0200

    x86/EFI: correct mkreloc header (field) reading
    
    With us now reading the full combined optional and NT headers, the
    subsequent reading of (and seeking to) NT header fields is wrong. Since
    PE32 and PE32+ NT headers are different anyway (beyond the image base
    oddity extending across both headers), switch to using a union. This
    allows to fetch the image base more directly then.
    
    Additionally add checking to map_section(), which would have caught at
    least the wrong (zero) image size that we previously used.
    
    Fixes: f7f42accbbbb ("x86/efi: Use generic PE/COFF structures")
    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>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    master commit: 042e9616f2e67476635487f2cd530406c6e3c0c1
    master date: 2025-04-23 09:39:44 +0200
---
 xen/arch/x86/efi/mkreloc.c | 70 ++++++++++++++++++++++++++++++++--------------
 1 file changed, 49 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/efi/mkreloc.c b/xen/arch/x86/efi/mkreloc.c
index 375cb79d69..4b3b2dd7ea 100644
--- a/xen/arch/x86/efi/mkreloc.c
+++ b/xen/arch/x86/efi/mkreloc.c
@@ -28,14 +28,16 @@ static void usage(const char *cmd, int rc)
 static unsigned int load(const char *name, int *handle,
                          struct section_header **sections,
                          uint_fast64_t *image_base,
-                         uint32_t *image_size,
+                         uint_fast32_t *image_size,
                          unsigned int *width)
 {
     int in = open(name, O_RDONLY);
     struct mz_hdr mz_hdr;
     struct pe_hdr pe_hdr;
-    struct pe32_opt_hdr pe32_opt_hdr;
-    uint32_t base;
+    union {
+        struct pe32_opt_hdr pe;
+        struct pe32plus_opt_hdr pep;
+    } pe32_opt_hdr;
 
     if ( in < 0 ||
          read(in, &mz_hdr, sizeof(mz_hdr)) != sizeof(mz_hdr) )
@@ -54,31 +56,40 @@ static unsigned int load(const char *name, int *handle,
 
     if ( lseek(in, mz_hdr.peaddr, SEEK_SET) < 0 ||
          read(in, &pe_hdr, sizeof(pe_hdr)) != sizeof(pe_hdr) ||
-         read(in, &pe32_opt_hdr, sizeof(pe32_opt_hdr)) != sizeof(pe32_opt_hdr) ||
-         read(in, &base, sizeof(base)) != sizeof(base) ||
-         /*
-          * Luckily the image size field lives at the
-          * same offset for both formats.
-          */
-         lseek(in, 24, SEEK_CUR) < 0 ||
-         read(in, image_size, sizeof(*image_size)) != sizeof(*image_size) )
+         (read(in, &pe32_opt_hdr.pe, sizeof(pe32_opt_hdr.pe)) !=
+          sizeof(pe32_opt_hdr.pe)) )
     {
         perror(name);
         exit(3);
     }
 
     switch ( (pe_hdr.magic == PE_MAGIC &&
-              pe_hdr.opt_hdr_size > sizeof(pe32_opt_hdr)) *
-              pe32_opt_hdr.magic )
+              pe_hdr.opt_hdr_size > sizeof(pe32_opt_hdr.pe)) *
+              pe32_opt_hdr.pe.magic )
     {
     case PE_OPT_MAGIC_PE32:
         *width = 32;
-        *image_base = base;
+        *image_base = pe32_opt_hdr.pe.image_base;
+        *image_size = pe32_opt_hdr.pe.image_size;
         break;
     case PE_OPT_MAGIC_PE32PLUS:
-        *width = 64;
-        *image_base = ((uint64_t)base << 32) | pe32_opt_hdr.data_base;
-        break;
+        if ( pe_hdr.opt_hdr_size > sizeof(pe32_opt_hdr.pep) )
+        {
+            if ( read(in,
+                      &pe32_opt_hdr.pe + 1,
+                      sizeof(pe32_opt_hdr.pep) - sizeof(pe32_opt_hdr.pe)) !=
+                 sizeof(pe32_opt_hdr.pep) - sizeof(pe32_opt_hdr.pe) )
+            {
+                perror(name);
+                exit(3);
+            }
+
+            *width = 64;
+            *image_base = pe32_opt_hdr.pep.image_base;
+            *image_size = pe32_opt_hdr.pep.image_size;
+            break;
+        }
+        /* Fall through. */
     default:
         fprintf(stderr, "%s: Wrong PE file format\n", name);
         exit(3);
@@ -108,11 +119,28 @@ static unsigned int load(const char *name, int *handle,
 static long page_size;
 
 static const void *map_section(const struct section_header *sec, int in,
-                               const char *name)
+                               const char *name, uint_fast32_t image_size)
 {
     const char *ptr;
     unsigned long offs;
 
+    if ( sec->rva > image_size )
+    {
+        fprintf(stderr,
+                "%s: section %.8s @ %08"PRIx32" beyond image size %08"PRIxFAST32"\n",
+                name, sec->name, sec->rva, image_size);
+        exit(6);
+    }
+
+    if ( (uint_fast64_t)sec->rva + sec->virtual_size > image_size )
+    {
+        fprintf(stderr,
+                "%s: section %.8s @ [%09"PRIx32",%09"PRIxFAST64") extends beyond image size %09"PRIxFAST32"\n",
+                name, sec->name, sec->rva,
+                (uint_fast64_t)sec->rva + sec->virtual_size, image_size);
+        exit(6);
+    }
+
     if ( !page_size )
         page_size = sysconf(_SC_PAGESIZE);
     offs = sec->data_addr & (page_size - 1);
@@ -233,7 +261,7 @@ int main(int argc, char *argv[])
     int in1, in2;
     unsigned int i, nsec, width1, width2;
     uint_fast64_t base1, base2;
-    uint32_t size1, size2;
+    uint_fast32_t size1, size2;
     struct section_header *sec1, *sec2;
 
     if ( argc == 1 ||
@@ -308,8 +336,8 @@ int main(int argc, char *argv[])
             sec1[i].raw_data_size = sec1[i].virtual_size;
             sec2[i].raw_data_size = sec2[i].virtual_size;
         }
-        ptr1 = map_section(sec1 + i, in1, argv[1]);
-        ptr2 = map_section(sec2 + i, in2, argv[2]);
+        ptr1 = map_section(sec1 + i, in1, argv[1], size1);
+        ptr2 = map_section(sec2 + i, in2, argv[2], size1);
 
         diff_sections(ptr1, ptr2, sec1 + i, base2 - base1, width1,
                       base1, base1 + size1);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 09:57:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 09:57:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971752.1360100 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hiE-0007Ll-HT; Tue, 29 Apr 2025 09:57:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971752.1360100; Tue, 29 Apr 2025 09:57: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 1u9hiE-0007LY-F0; Tue, 29 Apr 2025 09:57:14 +0000
Received: by outflank-mailman (input) for mailman id 971752;
 Tue, 29 Apr 2025 09:57: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 1u9hiD-0007LM-9G
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 09:57: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 1u9hiD-00ClGw-0n
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09:57:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9hiD-00EICX-0i
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09:57: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=91/3e+aJ+N0gshwcpPYVhUwPrm+XKhSwuwhFe/4ltC8=; b=NJJIg8qb0OKOriCHSOWMiugQt7
	iBTiZnO/J0jjrdo9CGArGITcVgJgBp+jMLerJ02b9QHWFQwW+AMJxIbNd6x28Qr886I2mrt/io/tB
	HwvZ/+ddqw1PqAjyyVpTrLu47mRuOYwDJ+FkNbXNz93iaJATOUFQgr9SsyiDym0gp64Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/intel: workaround several MONITOR/MWAIT errata
Message-Id: <E1u9hiD-00EICX-0i@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 09:57:13 +0000

commit a05e4817f9fa9fd770647db9ce5052fec8e973ac
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Apr 29 11:47:11 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:47:11 2025 +0200

    x86/intel: workaround several MONITOR/MWAIT errata
    
    There are several errata on Intel regarding the usage of the MONITOR/MWAIT
    instructions, all having in common that stores to the monitored region
    might not wake up the CPU.
    
    Fix them by forcing the sending of an IPI for the affected models.
    
    The Ice Lake issue has been reproduced internally on XenServer hardware,
    and the fix does seem to prevent it.  The symptom was APs getting stuck in
    the idle loop immediately after bring up, which in turn prevented the BSP
    from making progress.  This would happen before the watchdog was
    initialized, and hence the whole system would get stuck.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 4aae4452efeee3d3bba092b875e37d1e7c8f6db9
    master date: 2025-04-23 16:12:25 +0200
---
 xen/arch/x86/acpi/cpu_idle.c     |  6 ++++++
 xen/arch/x86/cpu/intel.c         | 36 +++++++++++++++++++++++++++++++++++-
 xen/arch/x86/include/asm/mwait.h |  3 +++
 3 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index 420198406d..1dbf15b01e 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -441,8 +441,14 @@ void cpuidle_wakeup_mwait(cpumask_t *mask)
     cpumask_andnot(mask, mask, &target);
 }
 
+/* Force sending of a wakeup IPI regardless of mwait usage. */
+bool __ro_after_init force_mwait_ipi_wakeup;
+
 bool arch_skip_send_event_check(unsigned int cpu)
 {
+    if ( force_mwait_ipi_wakeup )
+        return false;
+
     /*
      * This relies on softirq_pending() and mwait_wakeup() to access data
      * on the same cache line.
diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index 6a680ba38d..63f65ea5b0 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -8,6 +8,7 @@
 #include <asm/intel-family.h>
 #include <asm/processor.h>
 #include <asm/msr.h>
+#include <asm/mwait.h>
 #include <asm/uaccess.h>
 #include <asm/mpspec.h>
 #include <asm/apic.h>
@@ -368,7 +369,6 @@ static void probe_c3_errata(const struct cpuinfo_x86 *c)
         INTEL_FAM6_MODEL(0x25),
         { }
     };
-#undef INTEL_FAM6_MODEL
 
     /* Serialized by the AP bringup code. */
     if ( max_cstate > 1 && (c->apicid & (c->x86_num_siblings - 1)) &&
@@ -380,6 +380,38 @@ static void probe_c3_errata(const struct cpuinfo_x86 *c)
     }
 }
 
+/*
+ * APL30: One use of the MONITOR/MWAIT instruction pair is to allow a logical
+ * processor to wait in a sleep state until a store to the armed address range
+ * occurs. Due to this erratum, stores to the armed address range may not
+ * trigger MWAIT to resume execution.
+ *
+ * ICX143: Under complex microarchitectural conditions, a monitor that is armed
+ * with the MWAIT instruction may not be triggered, leading to a processor
+ * hang.
+ *
+ * LNL030: Problem P-cores may not exit power state Core C6 on monitor hit.
+ *
+ * Force the sending of an IPI in those cases.
+ */
+static void __init probe_mwait_errata(void)
+{
+    static const struct x86_cpu_id __initconst models[] = {
+        INTEL_FAM6_MODEL(INTEL_FAM6_ATOM_GOLDMONT), /* APL30  */
+        INTEL_FAM6_MODEL(INTEL_FAM6_ICELAKE_X),     /* ICX143 */
+        INTEL_FAM6_MODEL(INTEL_FAM6_LUNARLAKE_M),   /* LNL030 */
+        { }
+    };
+#undef INTEL_FAM6_MODEL
+
+    if ( boot_cpu_has(X86_FEATURE_MONITOR) && x86_match_cpu(models) )
+    {
+        printk(XENLOG_WARNING
+               "Forcing IPI MWAIT wakeup due to CPU erratum\n");
+        force_mwait_ipi_wakeup = true;
+    }
+}
+
 /*
  * P4 Xeon errata 037 workaround.
  * Hardware prefetcher may cause stale data to be loaded into the cache.
@@ -406,6 +438,8 @@ static void Intel_errata_workarounds(struct cpuinfo_x86 *c)
 		__set_bit(X86_FEATURE_CLFLUSH_MONITOR, c->x86_capability);
 
 	probe_c3_errata(c);
+	if (system_state < SYS_STATE_smp_boot)
+		probe_mwait_errata();
 }
 
 
diff --git a/xen/arch/x86/include/asm/mwait.h b/xen/arch/x86/include/asm/mwait.h
index 000a692f6d..c52cd3f510 100644
--- a/xen/arch/x86/include/asm/mwait.h
+++ b/xen/arch/x86/include/asm/mwait.h
@@ -13,6 +13,9 @@
 
 #define MWAIT_ECX_INTERRUPT_BREAK	0x1
 
+/* Force sending of a wakeup IPI regardless of mwait usage. */
+extern bool force_mwait_ipi_wakeup;
+
 void mwait_idle_with_hints(unsigned int eax, unsigned int ecx);
 #ifdef CONFIG_INTEL
 bool mwait_pc10_supported(void);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 09:57:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 09:57:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971753.1360104 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hiO-0007OL-JZ; Tue, 29 Apr 2025 09:57:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971753.1360104; Tue, 29 Apr 2025 09:57: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 1u9hiO-0007OD-GQ; Tue, 29 Apr 2025 09:57:24 +0000
Received: by outflank-mailman (input) for mailman id 971753;
 Tue, 29 Apr 2025 09:57: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 1u9hiN-0007Nv-CY
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 09:57: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 1u9hiN-00ClH0-1B
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09:57:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9hiN-00EIhu-15
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09:57: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=lt1a1vOSOSRjjPZOfByCmTFbR0DKeThyfFh1ONDwKIg=; b=Ekw8t2TUlRRR5PbK1W+5cn0me+
	lnT1RpL2dAK/hWLWI8wrlCwbNE1wbzBjyWTTP++tgBXRJdM6R59kYv3Y5xz+BSNxxtWDFpN0eTDNT
	74xLv8fyIZ3J6yrmDkgz6Sdz+KD3pVHfR8ktukF/Wc/jLWAgTGMdi8g1A2n3q4U3Li9Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] xen: remove -N from the linker command line
Message-Id: <E1u9hiN-00EIhu-15@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 09:57:23 +0000

commit f1e8b37f50914474f675226f0fed1d1b1508333d
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Apr 29 11:47:35 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:47:35 2025 +0200

    xen: remove -N from the linker command line
    
    It's unclear why -N is being used in the first place.  It was added by
    commit 4676bbf96dc8 back in 2002 without any justification.
    
    When building a PE image it's actually detrimental to forcefully set the
    .text section as writable.  The GNU LD man page contains the following
    warning regarding the -N option:
    
    > Note: Although a writable text section is allowed for PE-COFF targets, it
    > does not conform to the format specification published by Microsoft.
    
    Remove the usage of -N uniformly on all architectures, assuming that the
    addition was simply done as a copy and paste of the original x86 linking
    rune.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: d444763f8ca556d0a67a4b933be303d346baef02
    master date: 2025-04-23 16:12:25 +0200
---
 xen/arch/arm/Makefile   |  6 +++---
 xen/arch/ppc/Makefile   |  6 +++---
 xen/arch/riscv/Makefile |  6 +++---
 xen/arch/x86/Makefile   | 12 ++++++------
 4 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 43ab5e8f25..54e3905e01 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -96,19 +96,19 @@ ifeq ($(CONFIG_ARM_64),y)
 endif
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
 	    $(dot-target).0.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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).1.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
diff --git a/xen/arch/ppc/Makefile b/xen/arch/ppc/Makefile
index 655d212f66..cf27bcebb2 100644
--- a/xen/arch/ppc/Makefile
+++ b/xen/arch/ppc/Makefile
@@ -12,19 +12,19 @@ $(TARGET): $(TARGET)-syms
 	cp -f $< $@
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
 	    $(dot-target).0.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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).1.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index a5eb2aed4b..80f75bed8a 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -15,19 +15,19 @@ $(TARGET): $(TARGET)-syms
 	$(OBJCOPY) -O binary -S $< $@
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
 	    $(dot-target).0.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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).1.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index b35fd5196c..0ded68d069 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -138,19 +138,19 @@ $(TARGET): $(TARGET)-syms $(efi-y) $(obj)/boot/mkelf32
 CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).0.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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(orphan-handling-y) $(dot-target).1.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
@@ -211,7 +211,7 @@ ifeq ($(CONFIG_DEBUG_INFO),y)
 	$(if $(filter --strip-debug,$(EFI_LDFLAGS)),echo,:) "Will strip debug info from $(@F)"
 endif
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
-	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds -N $< $(relocs-dummy) \
+	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< $(relocs-dummy) \
 	                $(objtree)/common/symbols-dummy.o $(note_file_option) \
 	                -o $(dot-target).$(base).0 &&) :
 	$(MKRELOC) $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(dot-target).$(base).0) \
@@ -221,7 +221,7 @@ endif
 		> $(dot-target).0s.S
 	$(MAKE) $(build)=$(@D) .$(@F).0r.o .$(@F).0s.o
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
-	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds -N $< \
+	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< \
 	                $(dot-target).0r.o $(dot-target).0s.o $(note_file_option) \
 	                -o $(dot-target).$(base).1 &&) :
 	$(MKRELOC) $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(dot-target).$(base).1) \
@@ -230,7 +230,7 @@ endif
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(dot-target).1s.S
 	$(MAKE) $(build)=$(@D) .$(@F).1r.o .$(@F).1s.o
-	$(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds -N $< \
+	$(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds $< \
 	      $(dot-target).1r.o $(dot-target).1s.o $(orphan-handling-y) \
 	      $(note_file_option) -o $@
 	$(NM) -pa --format=sysv $@ \
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 09:57:34 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 09:57:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971754.1360108 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hiY-0007RD-Mi; Tue, 29 Apr 2025 09:57:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971754.1360108; Tue, 29 Apr 2025 09:57: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 1u9hiY-0007R5-K3; Tue, 29 Apr 2025 09:57:34 +0000
Received: by outflank-mailman (input) for mailman id 971754;
 Tue, 29 Apr 2025 09:57: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 1u9hiX-0007Qx-Jq
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 09:57: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 1u9hiX-00ClH8-1t
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09:57:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9hiX-00EJ1u-1l
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 09:57: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=lIpDZ+QI9hvVD+m0CVgeQNTId6jks7inFU+JqFl5v7U=; b=zIChjcPsb2jrjSI8zYF8LaLTxR
	txpSQrKKBQRTdqCp9UQwlKr6RfY0/p75TAgh7brT8hZtAFFwfE4+qF5oVzgeMDLsbMYTE6Amay2JT
	ziNd6hezE8HskzScSuAy6AF2VOGJnC+KmWwTqrWtyF9avKl2iWR1ZjjclCZuRKnPAw6s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86: constrain sub-page access length in mmio_ro_emulated_write()
Message-Id: <E1u9hiX-00EJ1u-1l@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 09:57:33 +0000

commit 35cb38b2220b15e1229214255a430f9e99f07aa1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 11:47:50 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:47:50 2025 +0200

    x86: constrain sub-page access length in mmio_ro_emulated_write()
    
    Without doing so we could trigger the ASSERT_UNREACHABLE() in
    subpage_mmio_write_emulate(). A comment there actually says this
    validation would already have been done ...
    
    Fixes: 8847d6e23f97 ("x86/mm: add API for marking only part of a MMIO page read only")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    master commit: 8dbd9966f82f95b017f06e9397fc78064b688d61
    master date: 2025-04-28 09:48:14 +0200
---
 xen/arch/x86/mm.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 0d242739b1..3f43cbabe1 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5192,8 +5192,13 @@ int cf_check mmio_ro_emulated_write(
         return X86EMUL_UNHANDLEABLE;
     }
 
-    subpage_mmio_write_emulate(mmio_ro_ctxt->mfn, PAGE_OFFSET(offset),
-                               p_data, bytes);
+    if ( bytes <= 8 )
+        subpage_mmio_write_emulate(mmio_ro_ctxt->mfn, PAGE_OFFSET(offset),
+                                   p_data, bytes);
+    else if ( subpage_mmio_find_page(mmio_ro_ctxt->mfn) )
+        gprintk(XENLOG_WARNING,
+                "unsupported %u-byte write to R/O MMIO 0x%"PRI_mfn"%03lx\n",
+                bytes, mfn_x(mmio_ro_ctxt->mfn), PAGE_OFFSET(offset));
 
     return X86EMUL_OKAY;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 10:11:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 10:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971767.1360122 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hvc-00027T-Rw; Tue, 29 Apr 2025 10:11:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971767.1360122; Tue, 29 Apr 2025 10: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 1u9hvc-00027K-Os; Tue, 29 Apr 2025 10:11:04 +0000
Received: by outflank-mailman (input) for mailman id 971767;
 Tue, 29 Apr 2025 10:11: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 1u9hva-00025F-VF
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 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 1u9hva-00Clmk-2P
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9hva-00Enyh-2G
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 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=HKmqEBxtg22ZfRVgvoVWOprYhro5OOsjyTZxggup/38=; b=zqDfcAmUdLCbKtL8fL45NaJefn
	uF4XrslJRICpezorpUvvmMl+hux0twHrXpEsg0A6Ip689sKnUboeWO1Pk/j9qI+8E+wptedPqFgg8
	6iwj6ECKOp90vGSzNtLON+tfV6JI8IRmfgfSbBB2t1PaJgjDzcaIB1ip53FVkWTMFs8U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] update Xen version to 4.19.3-pre
Message-Id: <E1u9hva-00Enyh-2G@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 10:11:02 +0000

commit 7d827892389459a8665d3486f3e90e74d17c134e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 11:51:42 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:51:42 2025 +0200

    update Xen version to 4.19.3-pre
---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Makefile b/xen/Makefile
index 26907392bb..a346568743 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -6,7 +6,7 @@ this-makefile := $(call lastword,$(MAKEFILE_LIST))
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 19
-export XEN_EXTRAVERSION ?= .2$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .3-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 10:11:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 10:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971769.1360126 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hvm-0002DT-T8; Tue, 29 Apr 2025 10:11:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971769.1360126; Tue, 29 Apr 2025 10: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 1u9hvm-0002DL-QX; Tue, 29 Apr 2025 10:11:14 +0000
Received: by outflank-mailman (input) for mailman id 971769;
 Tue, 29 Apr 2025 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 1u9hvk-0002D6-SU
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 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 1u9hvk-00Clmo-2k
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9hvk-00EoJv-2d
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 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=6bkgwZqiP/zbhE/A7K9KUEUmdsPI/xOmBstOn9Q84Ms=; b=f4+dWCglwzHVEWY5Q6I8Z/rtah
	FBzvA+Q10O+pkPpFVLWH1HBKzR5hlGhApWhLnUCBsKNCBYxvudjs/LQmycqkVOky+kWQoOtQ2lkuj
	TQHJ6/TzzMtJFGC79qaXhq7EWPhk8H0Ug48ymU0zsglAA50H2mHrS9wsLh5cnBWdG/BM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/MTRR: hook mtrr_bp_restore() back up
Message-Id: <E1u9hvk-00EoJv-2d@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 10:11:12 +0000

commit ae562bee695b84240f35739374a013a1520b93e5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 11:52:22 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:52:22 2025 +0200

    x86/MTRR: hook mtrr_bp_restore() back up
    
    Unlike stated in the offending commit's description,
    load_system_tables() wasn't the only thing left to retain from the
    earlier restore_rest_processor_state(). Note that MTRR state was still
    reloaded via mtrr_aps_sync_end(), but that happens quite a bit later in
    the resume process.
    
    While there also do Misra-related tidying for the function itself: The
    function being used from assembly only means it doesn't need to have a
    declaration, but wants to be asmlinkage.
    
    Fixes: 4304ff420e51 ("x86/S3: Drop {save,restore}_rest_processor_state() completely")
    Reported-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>
    master commit: 0414dedd6fde1a1c5c5e38dcbef4dad506e1398c
    master date: 2025-04-03 09:39:13 +0200
---
 xen/arch/x86/acpi/wakeup_prot.S | 2 ++
 xen/arch/x86/cpu/mtrr/main.c    | 2 +-
 xen/arch/x86/include/asm/mtrr.h | 1 -
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/acpi/wakeup_prot.S b/xen/arch/x86/acpi/wakeup_prot.S
index 3855ff1ddb..66f7993399 100644
--- a/xen/arch/x86/acpi/wakeup_prot.S
+++ b/xen/arch/x86/acpi/wakeup_prot.S
@@ -124,6 +124,8 @@ ENTRY(s3_resume)
         mov     STACK_CPUINFO_FIELD(cr4)(%rbx), %rax
         mov     %rax, %cr4
 
+        call    mtrr_bp_restore
+
 .Lsuspend_err:
         pop     %r15
         pop     %r14
diff --git a/xen/arch/x86/cpu/mtrr/main.c b/xen/arch/x86/cpu/mtrr/main.c
index 0a44ebbcb0..516c8478c6 100644
--- a/xen/arch/x86/cpu/mtrr/main.c
+++ b/xen/arch/x86/cpu/mtrr/main.c
@@ -609,7 +609,7 @@ void mtrr_aps_sync_end(void)
 	hold_mtrr_updates_on_aps = 0;
 }
 
-void mtrr_bp_restore(void)
+void asmlinkage mtrr_bp_restore(void)
 {
 	mtrr_set_all();
 }
diff --git a/xen/arch/x86/include/asm/mtrr.h b/xen/arch/x86/include/asm/mtrr.h
index 36dac0a775..48b59d2620 100644
--- a/xen/arch/x86/include/asm/mtrr.h
+++ b/xen/arch/x86/include/asm/mtrr.h
@@ -66,7 +66,6 @@ extern uint8_t pat_type_2_pte_flags(uint8_t pat_type);
 extern int hold_mtrr_updates_on_aps;
 extern void mtrr_aps_sync_begin(void);
 extern void mtrr_aps_sync_end(void);
-extern void mtrr_bp_restore(void);
 
 extern bool mtrr_var_range_msr_set(struct domain *d, struct mtrr_state *m,
                                    uint32_t msr, uint64_t msr_content);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 10:11:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 10:11:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971771.1360129 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hvw-0002IU-UR; Tue, 29 Apr 2025 10:11:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971771.1360129; Tue, 29 Apr 2025 10: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 1u9hvw-0002IM-Rs; Tue, 29 Apr 2025 10:11:24 +0000
Received: by outflank-mailman (input) for mailman id 971771;
 Tue, 29 Apr 2025 10: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 1u9hvu-0002I3-VN
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 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 1u9hvu-00Clmv-33
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9hvu-00EoaV-2v
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 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=L0XAR944vjAqHPVMt/9BDgGwDvE4Zh3o8/BuT0vfjM4=; b=YVlOslIC5v3nBk9sYVFA86D01L
	1M4uA2TmaZaj+RRcXbTNR4E/K/b36WLKe6clCEqacyLI3ARmY4AiJkxXGoF07JMUi2i6G/QAktB6b
	aahQ7lbswDm85XQPrbcaJnIv/Rda2G9quqJxntZTsjjdbG+rleMKbEGuw/kF5PpM6y2Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] sched/null: avoid another crash after failed domU creation
Message-Id: <E1u9hvu-00EoaV-2v@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 10:11:22 +0000

commit f6b37861bcc4e6ce51d366268861c4590e6951e3
Author:     Stewart Hildebrand <stewart.hildebrand@amd.com>
AuthorDate: Tue Apr 29 11:53:16 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:53:16 2025 +0200

    sched/null: avoid another crash after failed domU creation
    
    The following sequence of events may lead a debug build of Xen to crash
    when using the null scheduler:
    
    1. domain creation (e.g. d1) failed due to bad configuration
    2. complete_domain_destroy() was deferred
    3. domain creation (e.g. d2) succeeds
    
    At this point, d2 is running, while the zombie d1 is not fully cleaned
    up:
    
    (XEN) Online Cpus: 0-3
    (XEN) Cpupool 0:
    (XEN) Cpus: 0-3
    (XEN) Scheduling granularity: cpu, 1 CPU per sched-resource
    (XEN) Scheduler: null Scheduler (null)
    (XEN)   cpus_free = 3
    (XEN) Domain info:
    (XEN)   Domain: 0
    (XEN)     1: [0.0] pcpu=0
    (XEN)     2: [0.1] pcpu=1
    (XEN)   Domain: 1
    (XEN)     3: [1.0] pcpu=2
    (XEN)   Domain: 2
    (XEN)     4: [2.0] pcpu=2
    
    4. complete_domain_destroy() gets called for d1 and triggers the
    following:
    
    (XEN) Xen call trace:
    (XEN)    [<00000a0000322ed4>] null.c#unit_deassign+0x2d8/0xb70 (PC)
    (XEN)    [<00000a000032457c>] null.c#null_unit_remove+0x670/0xba8 (LR)
    (XEN)    [<00000a000032457c>] null.c#null_unit_remove+0x670/0xba8
    (XEN)    [<00000a0000336404>] sched_destroy_vcpu+0x354/0x8fc
    (XEN)    [<00000a0000227324>] domain.c#complete_domain_destroy+0x11c/0x49c
    (XEN)    [<00000a000029fbd0>] rcupdate.c#rcu_do_batch+0x94/0x3d0
    (XEN)    [<00000a00002a10c0>] rcupdate.c#__rcu_process_callbacks+0x160/0x5f4
    (XEN)    [<00000a00002a1e60>] rcupdate.c#rcu_process_callbacks+0xcc/0x1b0
    (XEN)    [<00000a00002a3460>] softirq.c#__do_softirq+0x1f4/0x3d8
    (XEN)    [<00000a00002a37c4>] do_softirq+0x14/0x1c
    (XEN)    [<00000a0000465260>] traps.c#check_for_pcpu_work+0x30/0xb8
    (XEN)    [<00000a000046bb08>] leave_hypervisor_to_guest+0x28/0x198
    (XEN)    [<00000a0000409c84>] entry.o#guest_sync_slowpath+0xac/0xd8
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 0:
    (XEN) Assertion 'npc->unit == unit' failed at common/sched/null.c:383
    (XEN) ****************************************
    
    Fix by skipping unit_deassign() when the unit to be removed does not
    match the pcpu's currently assigned unit.
    
    Fixes: c2eae2614c8f ("sched/null: avoid crash after failed domU creation")
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    master commit: 54fe207f29f86c4226a62a4dd289f10d9d2abc40
    master date: 2025-04-07 12:17:31 +0200
---
 xen/common/sched/null.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/sched/null.c b/xen/common/sched/null.c
index 7e31440e5b..c8e327e3cd 100644
--- a/xen/common/sched/null.c
+++ b/xen/common/sched/null.c
@@ -557,7 +557,7 @@ static void cf_check null_unit_remove(
 
     cpu = sched_unit_master(unit);
     npc = get_sched_res(cpu)->sched_priv;
-    if ( npc->unit )
+    if ( npc->unit == unit )
         unit_deassign(prv, unit);
 
  out:
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 10:11:35 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 10:11:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971772.1360133 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hw6-0002Nc-Vp; Tue, 29 Apr 2025 10:11:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971772.1360133; Tue, 29 Apr 2025 10: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 1u9hw6-0002NU-TH; Tue, 29 Apr 2025 10:11:34 +0000
Received: by outflank-mailman (input) for mailman id 971772;
 Tue, 29 Apr 2025 10: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 1u9hw5-0002NK-2I
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 10: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 1u9hw5-00Clmz-07
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:11:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9hw5-00EpCM-00
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10: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=hhlMNM8dKk4ucsyM/pX/lGK0ZOItDEgtcokXQmiKPNc=; b=jLQwLQXADGb7IqRFTMM+zCitCj
	dwwI6UPfqkwykilzqAXAEJd6VtJ4MgV2RkU/rra/jwTQTp4znHw6EKOWSJqtzhxCTPi9GGt3SIaoN
	KHZ40OzKXft7NtDNzyGV0QLQtJahm/POYPmZKb3EspNRdQlEfYk52xEM0xHcwLsz6ulQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] xen: vm_event: do not do vm_event_op for an invalid domain
Message-Id: <E1u9hw5-00EpCM-00@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 10:11:33 +0000

commit 3721c345b9637ef564932539689e99338c8b2187
Author:     Volodymyr Babchuk <volodymyr_babchuk@epam.com>
AuthorDate: Tue Apr 29 11:53:56 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:53:56 2025 +0200

    xen: vm_event: do not do vm_event_op for an invalid domain
    
    A privileged domain can issue XEN_DOMCTL_vm_event_op with
    op->domain == DOMID_INVALID. In this case vm_event_domctl()
    function will get NULL as the first parameter and this will
    cause hypervisor panic, as it tries to derefer this pointer.
    
    Fix the issue by checking if valid domain is passed in.
    
    Fixes: 48b84249459f ("xen/vm-event: Drop unused u_domctl parameter from vm_event_domctl()")
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
    master commit: 6a884750f3b86a45ee5ffbd825c346fcbce86080
    master date: 2025-04-08 09:36:38 +0200
---
 xen/common/vm_event.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/common/vm_event.c b/xen/common/vm_event.c
index fbf1aa0848..1666ff615f 100644
--- a/xen/common/vm_event.c
+++ b/xen/common/vm_event.c
@@ -600,6 +600,10 @@ int vm_event_domctl(struct domain *d, struct xen_domctl_vm_event_op *vec)
         return 0;
     }
 
+    /* All other subops need to target a real domain. */
+    if ( unlikely(d == NULL) )
+        return -ESRCH;
+
     rc = xsm_vm_event_control(XSM_PRIV, d, vec->mode, vec->op);
     if ( rc )
         return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 10:11:45 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 10:11:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971773.1360138 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hwH-0002QO-16; Tue, 29 Apr 2025 10:11:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971773.1360138; Tue, 29 Apr 2025 10:11: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 1u9hwG-0002QD-Uk; Tue, 29 Apr 2025 10:11:44 +0000
Received: by outflank-mailman (input) for mailman id 971773;
 Tue, 29 Apr 2025 10: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 1u9hwF-0002Q0-9T
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 10: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 1u9hwF-00ClnV-0r
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:11:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9hwF-00Epik-0e
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10: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=VV2FhvFHsMJRKeqbsdSw56MAUllavPmT0ega2o9dT7I=; b=ozYNBtDAu51hEj00zffbPqb+rL
	Tc6su/maHQEdiXyAewPFQH+dmNQGNQVNA9rhY2/Zd8ENiG/d85sozIvFr63JCsivCEQdTBkoKcHxs
	bxLtUX+ndSrZTD0GyyunTnD0AXw8MJPbNkwl9hrlhD656v8LrwnLfhcUrbvSOLlTg/A8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/cpu: Validate CPUID leaf 0x2 EDX output
Message-Id: <E1u9hwF-00Epik-0e@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 10:11:43 +0000

commit 7abb2300fd43294fe827eec4c680bf6dce0bd1f4
Author:     Ahmed S. Darwish <darwi@linutronix.de>
AuthorDate: Tue Apr 29 11:54:35 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:54:35 2025 +0200

    x86/cpu: Validate CPUID leaf 0x2 EDX output
    
    CPUID leaf 0x2 emits one-byte descriptors in its four output registers
    EAX, EBX, ECX, and EDX.  For these descriptors to be valid, the most
    significant bit (MSB) of each register must be clear.
    
    Leaf 0x2 parsing at intel.c only validated the MSBs of EAX, EBX, and
    ECX, but left EDX unchecked.
    
    Validate EDX's most-significant bit as well.
    
    Fixes: 1aa6feb63bfd ("Port CPU setup code from Linux 2.6")
    Signed-off-by: Ahmed S. Darwish <darwi@linutronix.de>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Link: https://lore.kernel.org/r/20250304085152.51092-3-darwi@linutronix.de
    
    Use ARRAY_SIZE() though.
    
    Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 1881148215c6
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: a47b44a8f0a58a6015faf6465921cd203f0b51d1
    master date: 2025-04-08 09:37:38 +0200
---
 xen/arch/x86/cpu/intel_cacheinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/intel_cacheinfo.c b/xen/arch/x86/cpu/intel_cacheinfo.c
index 9cfb759be0..e88faa7545 100644
--- a/xen/arch/x86/cpu/intel_cacheinfo.c
+++ b/xen/arch/x86/cpu/intel_cacheinfo.c
@@ -186,7 +186,7 @@ void init_intel_cacheinfo(struct cpuinfo_x86 *c)
 			cpuid(2, &regs[0], &regs[1], &regs[2], &regs[3]);
 
 			/* If bit 31 is set, this is an unknown format */
-			for ( j = 0 ; j < 3 ; j++ ) {
+			for ( j = 0; j < ARRAY_SIZE(regs); j++ ) {
 				if ( regs[j] >> 31 )
 					regs[j] = 0;
 			}
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 10:11:55 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 10:11:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971774.1360142 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hwR-0002Sq-2m; Tue, 29 Apr 2025 10:11:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971774.1360142; Tue, 29 Apr 2025 10:11: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 1u9hwQ-0002Si-W8; Tue, 29 Apr 2025 10:11:54 +0000
Received: by outflank-mailman (input) for mailman id 971774;
 Tue, 29 Apr 2025 10: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 1u9hwP-0002SR-Ce
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 10: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 1u9hwP-00Clnc-1A
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:11:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9hwP-00Eq1C-13
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10: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=eR1HcjJhpWvX8E54rd8Y+Kj4nzHKDNBJJfQQe1dxnLU=; b=lO5j+3/Eorvb18vU8qHwnRcDa9
	BY9zIbSXrhyWb5zPqJO9Dwd8nq7ux19TiWx7CKRDeuGNszEj8mFnCUVkTZU8sUUtm1kx0NYFHhte/
	MHi6yN4DKFl8C21i9JtuBt0xvVdM3Ey7uEQliLCXyaM5vJiQAwgJC9hN5H9QcyPRgZpA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] xen: x86: irq: initialize irq desc in create_irq()
Message-Id: <E1u9hwP-00Eq1C-13@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 10:11:53 +0000

commit 3450fe0dd9b57364f305dcf90176ab31a3dbc0bb
Author:     Volodymyr Babchuk <volodymyr_babchuk@epam.com>
AuthorDate: Tue Apr 29 11:54:59 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:54:59 2025 +0200

    xen: x86: irq: initialize irq desc in create_irq()
    
    While building xen with GCC 14.2.1 with "-fcondition-coverage" option
    or with "-Og", the compiler produces a false positive warning:
    
      arch/x86/irq.c: In function ‘create_irq’:
      arch/x86/irq.c:281:11: error: ‘desc’ may be used uninitialized [-Werror=maybe-uninitialized]
        281 |     ret = init_one_irq_desc(desc);
            |           ^~~~~~~~~~~~~~~~~~~~~~~
      arch/x86/irq.c:269:22: note: ‘desc’ was declared here
        269 |     struct irq_desc *desc;
            |                      ^~~~
      cc1: all warnings being treated as errors
      make[2]: *** [Rules.mk:252: arch/x86/irq.o] Error 1
    
    While we have signed/unsigned comparison both in "for" loop and in
    "if" statement, this still can't lead to use of uninitialized "desc",
    as either loop will be executed at least once, or the function will
    return early. So this is a clearly false positive warning due to a
    bug [1] in GCC.
    
    Initialize "desc" with NULL to make GCC happy.
    
    [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119665
    
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 7a4484d90b3003171f1700e424ad45b931200ba6
    master date: 2025-04-08 09:40:39 +0200
---
 xen/arch/x86/irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 0001e93ba8..ce390b0422 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -261,7 +261,7 @@ void __init clear_irq_vector(int irq)
 int create_irq(nodeid_t node, bool grant_access)
 {
     int irq, ret;
-    struct irq_desc *desc;
+    struct irq_desc *desc = NULL ; /* gcc14 -Og or -fcondition-coverage */
 
     for (irq = nr_irqs_gsi; irq < nr_irqs; irq++)
     {
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 10:12:04 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 10:12:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971775.1360146 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hwa-0002V7-4P; Tue, 29 Apr 2025 10:12:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971775.1360146; Tue, 29 Apr 2025 10: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 1u9hwa-0002Uw-1E; Tue, 29 Apr 2025 10:12:04 +0000
Received: by outflank-mailman (input) for mailman id 971775;
 Tue, 29 Apr 2025 10: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 1u9hwZ-0002Ul-LU
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 10: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 1u9hwZ-00Clnr-23
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:12:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9hwZ-00EqYJ-1q
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10: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=re/xpWX8en1rhc8x7XaPPGsr6wIjnmP+S0xGi6bNVPI=; b=pMQ0otHkPA/eUZFpp+YLvkcu5U
	1PkRyzxw/iFIjO0ehlby6NPAsQUHQjXygPBuBX4weg9gsr2wLRh2tRFP6/iRfpgk10PyzfFifataj
	+tJPR1YVmMk/b8rVR1kjydGKQwvInOQaT5FkbnSZ567qj9ZLOOY+y6qOQT7D+yWxCJwE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] include: sort $(wildcard ...) results
Message-Id: <E1u9hwZ-00EqYJ-1q@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 10:12:03 +0000

commit 593c4377789c239ebce1f2c79164367d70f3b278
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 11:55:16 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:55:16 2025 +0200

    include: sort $(wildcard ...) results
    
    The order of items is stored in .*.chk.cmd, and hence variations between
    how items are ordered would result in re-invocation of the checking rule
    during "make install-xen" despite that already having successfully run
    earlier on. The difference can become noticable when building (as non-
    root) and installing (as root) use different GNU make versions: In 3.82
    the sorting was deliberately undone, just for it to be restored in 4.3.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: ff835bbc8096a14ed1bffa235e25848c993f7240
    master date: 2025-04-10 10:56:29 +0200
---
 xen/include/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/include/Makefile b/xen/include/Makefile
index 2e61b50139..33f069f417 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -41,8 +41,8 @@ cppflags-$(CONFIG_X86)    += -m32
 
 endif
 
-public-$(CONFIG_X86) := $(wildcard $(srcdir)/public/arch-x86/*.h $(srcdir)/public/arch-x86/*/*.h)
-public-$(CONFIG_ARM) := $(wildcard $(srcdir)/public/arch-arm/*.h $(srcdir)/public/arch-arm/*/*.h)
+public-$(CONFIG_X86) := $(sort $(wildcard $(srcdir)/public/arch-x86/*.h $(srcdir)/public/arch-x86/*/*.h))
+public-$(CONFIG_ARM) := $(sort $(wildcard $(srcdir)/public/arch-arm/*.h $(srcdir)/public/arch-arm/*/*.h))
 
 .PHONY: all
 all: $(addprefix $(obj)/,$(headers-y) $(headers-n))
@@ -130,7 +130,7 @@ all: $(obj)/headers.chk $(obj)/headers99.chk $(obj)/headers++.chk
 
 public-hdrs-path := $(srcdir)/public
 
-public-list-headers = $(wildcard $1/*.h $1/*/*.h)
+public-list-headers = $(sort $(wildcard $1/*.h $1/*/*.h))
 public-filter-headers = $(filter-out $(addprefix $(public-hdrs-path)/, $($1-filter)), $($1))
 
 public-headers := $(call public-list-headers, $(public-hdrs-path)) $(public-y)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 10:12:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 10:12:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971776.1360149 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hwk-0002Zh-6h; Tue, 29 Apr 2025 10:12:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971776.1360149; Tue, 29 Apr 2025 10: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 1u9hwk-0002Za-4H; Tue, 29 Apr 2025 10:12:14 +0000
Received: by outflank-mailman (input) for mailman id 971776;
 Tue, 29 Apr 2025 10: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 1u9hwj-0002ZU-Oj
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 10: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 1u9hwj-00Clnv-2O
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:12:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9hwj-00Er6M-2H
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10: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=E03GDgA5eW4/wDLpxVsTEyL7HwK8TSNXTAAEBXyWSDE=; b=RUGyvVHSe1NxEeYRycfauKuR2S
	BW0ipSPj2cP4MpGJIKEssZrpvyhkjpmbPmvcaTrpxRqZEQRo1MdlpOQysaVphYwBQCqQeHYfquL3X
	BReaAvXFjjC92DnRcXiCSHd/q90c93V3ZDjZe3OrENor9XNyvK2o91ZpySMGmotJvYA0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] xen/rangeset: fix incorrect subtraction
Message-Id: <E1u9hwj-00Er6M-2H@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 10:12:13 +0000

commit c7e5683085466b378347f9fa68010c7778cc8e4d
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Apr 29 11:55:34 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:55:34 2025 +0200

    xen/rangeset: fix incorrect subtraction
    
    Given the following rangset operation:
    
    { [0, 1], [4, 5] } - { [3, 4] }
    
    The current rangeset logic will output a rangeset:
    
    { [0, 2], [5, 5] }
    
    This is incorrect, and also has the undesirable property of being bogus in
    a way that the resulting rangeset is expanded.
    
    Fix this by making sure the bounds are correctly checked before modifying
    the previous range.
    
    Fixes: 484a058c4828 ('Add auto-destructing per-domain rangeset data structure...')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: e118fc98e7ae652a188d227bd7ea22f132724150
    master date: 2025-04-11 12:20:10 +0200
---
 xen/common/rangeset.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/common/rangeset.c b/xen/common/rangeset.c
index b75590f907..e758710390 100644
--- a/xen/common/rangeset.c
+++ b/xen/common/rangeset.c
@@ -227,7 +227,8 @@ int rangeset_remove_range(
 
         if ( x->s < s )
         {
-            x->e = s - 1;
+            if ( x->e >= s )
+                x->e = s - 1;
             x = next_range(r, x);
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 10:12:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 10:12:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971777.1360154 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hwu-0002c9-8Q; Tue, 29 Apr 2025 10:12:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971777.1360154; Tue, 29 Apr 2025 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 1u9hwu-0002bz-5m; Tue, 29 Apr 2025 10:12:24 +0000
Received: by outflank-mailman (input) for mailman id 971777;
 Tue, 29 Apr 2025 10: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 1u9hwt-0002bs-SK
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 10: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 1u9hwt-00Clnz-2k
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:12:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9hwt-00ErbK-2e
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10: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=1TUNbjdItn7bFtwqcP/Kcmx60OJeqEVbdpl1+BjyudQ=; b=4f7+H66YL4I30rc6yAbRAPE2Tp
	Nzfc5TWq+wD6Wbs4LKQC0j+KcSN7DbW7BFvjtfT4t10KYcRknIixERmCFloSGcbxm12rJxgDA0cLA
	JTwvxW/BtIAy3hlBdyL4SQkCA8PJSpwR/eTXLadDXPg7BLuyModHLWg5EODm3hcBCvHU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/HVM: update repeat count upon nested lin->phys failure
Message-Id: <E1u9hwt-00ErbK-2e@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 10:12:23 +0000

commit 7ffef37f55317ffcd01840a2302dfe1c02e0c064
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 11:56:25 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:56:25 2025 +0200

    x86/HVM: update repeat count upon nested lin->phys failure
    
    For the X86EMUL_EXCEPTION case the repeat count must be correctly
    propagated back. Since for the recursive invocation we use a local
    helper variable, its value needs copying to the caller's one.
    
    While there also correct the off-by-1 range in the comment ahead of the
    function (strictly speaking for the "DF set" case we'd need to put
    another, different range there as well).
    
    Fixes: 53f87c03b4ea ("x86emul: generalize exception handling for rep_* hooks")
    Reported-by: Manuel Andreas <manuel.andreas@tum.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: c07b16fd6e47782ebf1ee767cd07c1e2b4140f47
    master date: 2025-04-17 10:01:19 +0200
---
 xen/arch/x86/hvm/emulate.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index f4b9352c39..03e40ab9ff 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -826,7 +826,7 @@ static void hvmemul_unmap_linear_addr(
 
 /*
  * Convert addr from linear to physical form, valid over the range
- * [addr, addr + *reps * bytes_per_rep]. *reps is adjusted according to
+ * [addr, addr + *reps * bytes_per_rep). *reps is adjusted according to
  * the valid computed range. It is always >0 when X86EMUL_OKAY is returned.
  * @pfec indicates the access checks to be performed during page-table walks.
  */
@@ -866,7 +866,10 @@ static int hvmemul_linear_to_phys(
         int rc = hvmemul_linear_to_phys(
             addr, &_paddr, bytes_per_rep, &one_rep, pfec, hvmemul_ctxt);
         if ( rc != X86EMUL_OKAY )
+        {
+            *reps = one_rep;
             return rc;
+        }
         pfn = _paddr >> PAGE_SHIFT;
     }
     else if ( (pfn = paging_gva_to_gfn(curr, addr, &pfec)) == gfn_x(INVALID_GFN) )
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 10:12:35 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 10:12:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971778.1360157 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hx5-0002eV-9f; Tue, 29 Apr 2025 10:12:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971778.1360157; Tue, 29 Apr 2025 10:12:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hx5-0002eN-7B; Tue, 29 Apr 2025 10:12:35 +0000
Received: by outflank-mailman (input) for mailman id 971778;
 Tue, 29 Apr 2025 10:12: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 1u9hx3-0002eD-VD
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 10: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 1u9hx3-00Clo5-31
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:12:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9hx3-00ErzM-2w
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10: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=5auWJ3ZgLNcomi0KeZPB8PsSOdFWGskTET9qANoehGs=; b=kIxdKj8yBVzRsSwpQDCbdkFwuB
	FdAlM13BD1wJZMsYS6odQ/7NjdzbqsR7K1OOVMbs1zL5OuWlK5UZOAcEM433KYM5vzz4GSwQ0c/IA
	aT/6be5hxhV+WltFTxZdK2FII9acnqxfENO1wnFEaxDwEfusit6/F8C33A1jZHNFaois=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86emul: also clip repetition count for STOS
Message-Id: <E1u9hx3-00ErzM-2w@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 10:12:33 +0000

commit 9466bb1dc863485aee14808f787c95daa926490b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 11:56:44 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:56:44 2025 +0200

    x86emul: also clip repetition count for STOS
    
    Like MOVS, INS, and OUTS, STOS also has a special purpose hook, where
    the hook function may legitimately have the same expectation as to the
    request not straddling address space start/end.
    
    Fixes: 5dfe4aa4eeb6 ("x86_emulate: Do not request emulation of REP instructions beyond the")
    Reported-by: Fabian Specht <f.specht@tum.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 8c5636b6c87777e6c2e4ffae28bffe1cfc189bfd
    master date: 2025-04-22 11:24:20 +0200
---
 xen/arch/x86/x86_emulate/x86_emulate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 3d837f7e9e..b1d192cbbf 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -2217,7 +2217,7 @@ x86_emulate(
 
         dst.bytes = src.bytes;
         dst.mem.seg = x86_seg_es;
-        dst.mem.off = truncate_ea(_regs.r(di));
+        dst.mem.off = truncate_ea_and_reps(_regs.r(di), nr_reps, dst.bytes);
         if ( (nr_reps == 1) || !ops->rep_stos ||
              ((rc = ops->rep_stos(&src.val,
                                   dst.mem.seg, dst.mem.off, dst.bytes,
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 10:12:45 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 10:12:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971779.1360162 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hxF-0002h6-BK; Tue, 29 Apr 2025 10:12:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971779.1360162; Tue, 29 Apr 2025 10:12: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 1u9hxF-0002gy-8e; Tue, 29 Apr 2025 10:12:45 +0000
Received: by outflank-mailman (input) for mailman id 971779;
 Tue, 29 Apr 2025 10:12: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 1u9hxE-0002gk-1Z
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 10:12: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 1u9hxE-00CloP-03
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:12:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9hxD-00EsQM-3C
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10: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=qkVO+MEWXG+daJCZfLNbLfLzvyBCOuls8acvuK4JhZM=; b=QHXbNTVUTC5Sjzpb4sDvxsxShI
	wJ86QU3GkKLePcCpazRDF/9pVStpqm7z/uYWp8Cq5dCJHE+k39rlU+Sfvu4PqETLTRCyvN7WPf4pD
	lF10TukXizEryYfxBTSbr70Cy0Weq5KEiuCFvK67XUinD5bTJx/+aC+0TSMSUdvI7uv0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] compat/memory: avoid UB shifts in XENMEM_exchange handling
Message-Id: <E1u9hxD-00EsQM-3C@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 10:12:43 +0000

commit e2adda16e010d23b9b790f0be4de9c6e6c2793f1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 11:57:07 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:57:07 2025 +0200

    compat/memory: avoid UB shifts in XENMEM_exchange handling
    
    Add an early basic check, yielding the same error code as the more
    thorough one the main handler would produce.
    
    Fixes: b8a7efe8528a ("Enable compatibility mode operation for HYPERVISOR_memory_op")
    Reported-by: Manuel Andreas <manuel.andreas@tum.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 560c51be8f6a88cde43c0a7c8be60158b5725982
    master date: 2025-04-22 11:25:23 +0200
---
 xen/common/compat/memory.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c
index 45e5fb0e5d..e3eb3c01a1 100644
--- a/xen/common/compat/memory.c
+++ b/xen/common/compat/memory.c
@@ -161,6 +161,11 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
             if ( copy_from_guest(&cmp.xchg, arg, 1) )
                 return -EFAULT;
 
+            /* Early coarse check, as max_order() isn't available here. */
+            if ( cmp.xchg.in.extent_order >= 32 ||
+                 cmp.xchg.out.extent_order >= 32 )
+                return -EPERM;
+
             order_delta = cmp.xchg.out.extent_order - cmp.xchg.in.extent_order;
             /* Various sanity checks. */
             if ( (cmp.xchg.nr_exchanged > cmp.xchg.in.nr_extents) ||
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 10:12:55 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 10:12:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971780.1360167 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hxP-0002jO-DH; Tue, 29 Apr 2025 10:12:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971780.1360167; Tue, 29 Apr 2025 10:12: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 1u9hxP-0002jG-A5; Tue, 29 Apr 2025 10:12:55 +0000
Received: by outflank-mailman (input) for mailman id 971780;
 Tue, 29 Apr 2025 10:12: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 1u9hxO-0002j3-4i
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 10:12: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 1u9hxO-00CloT-0O
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:12:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9hxO-00EsmK-0I
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:12: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=3N1wyrP6yB5ST8LH+CsJayes+8ZL+HC5zlG2ob1J7Nw=; b=q2kOAvlpysMMwHpTHgEhvYJPms
	kWXpKAMMLEifoiFa3aq5J1E/tRNI6bfngcA9o6slDa5ncJyNogQj6MROB+BgnsO9kTrolQdui829z
	5DRKInoIsRtOKhAVzPn6FKX6y3Ot6dwmyixsVgyhyOLWiZINTDydfpRJAk6295mK90xI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/intel: workaround several MONITOR/MWAIT errata
Message-Id: <E1u9hxO-00EsmK-0I@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 10:12:54 +0000

commit 0f74a33deae06ebba8c5c998d74c1e3dfd46d6ea
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Apr 29 11:57:31 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:57:31 2025 +0200

    x86/intel: workaround several MONITOR/MWAIT errata
    
    There are several errata on Intel regarding the usage of the MONITOR/MWAIT
    instructions, all having in common that stores to the monitored region
    might not wake up the CPU.
    
    Fix them by forcing the sending of an IPI for the affected models.
    
    The Ice Lake issue has been reproduced internally on XenServer hardware,
    and the fix does seem to prevent it.  The symptom was APs getting stuck in
    the idle loop immediately after bring up, which in turn prevented the BSP
    from making progress.  This would happen before the watchdog was
    initialized, and hence the whole system would get stuck.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 4aae4452efeee3d3bba092b875e37d1e7c8f6db9
    master date: 2025-04-23 16:12:25 +0200
---
 xen/arch/x86/acpi/cpu_idle.c     |  6 ++++++
 xen/arch/x86/cpu/intel.c         | 36 +++++++++++++++++++++++++++++++++++-
 xen/arch/x86/include/asm/mwait.h |  3 +++
 3 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index 52808f9809..d0607d8a69 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -453,8 +453,14 @@ void cpuidle_wakeup_mwait(cpumask_t *mask)
     cpumask_andnot(mask, mask, &target);
 }
 
+/* Force sending of a wakeup IPI regardless of mwait usage. */
+bool __ro_after_init force_mwait_ipi_wakeup;
+
 bool arch_skip_send_event_check(unsigned int cpu)
 {
+    if ( force_mwait_ipi_wakeup )
+        return false;
+
     /*
      * This relies on softirq_pending() and mwait_wakeup() to access data
      * on the same cache line.
diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index bb9c6220de..74d10c93d8 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -8,6 +8,7 @@
 #include <asm/intel-family.h>
 #include <asm/processor.h>
 #include <asm/msr.h>
+#include <asm/mwait.h>
 #include <asm/uaccess.h>
 #include <asm/mpspec.h>
 #include <asm/apic.h>
@@ -368,7 +369,6 @@ static void probe_c3_errata(const struct cpuinfo_x86 *c)
         INTEL_FAM6_MODEL(0x25),
         { }
     };
-#undef INTEL_FAM6_MODEL
 
     /* Serialized by the AP bringup code. */
     if ( max_cstate > 1 && (c->apicid & (c->x86_num_siblings - 1)) &&
@@ -380,6 +380,38 @@ static void probe_c3_errata(const struct cpuinfo_x86 *c)
     }
 }
 
+/*
+ * APL30: One use of the MONITOR/MWAIT instruction pair is to allow a logical
+ * processor to wait in a sleep state until a store to the armed address range
+ * occurs. Due to this erratum, stores to the armed address range may not
+ * trigger MWAIT to resume execution.
+ *
+ * ICX143: Under complex microarchitectural conditions, a monitor that is armed
+ * with the MWAIT instruction may not be triggered, leading to a processor
+ * hang.
+ *
+ * LNL030: Problem P-cores may not exit power state Core C6 on monitor hit.
+ *
+ * Force the sending of an IPI in those cases.
+ */
+static void __init probe_mwait_errata(void)
+{
+    static const struct x86_cpu_id __initconst models[] = {
+        INTEL_FAM6_MODEL(INTEL_FAM6_ATOM_GOLDMONT), /* APL30  */
+        INTEL_FAM6_MODEL(INTEL_FAM6_ICELAKE_X),     /* ICX143 */
+        INTEL_FAM6_MODEL(INTEL_FAM6_LUNARLAKE_M),   /* LNL030 */
+        { }
+    };
+#undef INTEL_FAM6_MODEL
+
+    if ( boot_cpu_has(X86_FEATURE_MONITOR) && x86_match_cpu(models) )
+    {
+        printk(XENLOG_WARNING
+               "Forcing IPI MWAIT wakeup due to CPU erratum\n");
+        force_mwait_ipi_wakeup = true;
+    }
+}
+
 /*
  * P4 Xeon errata 037 workaround.
  * Hardware prefetcher may cause stale data to be loaded into the cache.
@@ -406,6 +438,8 @@ static void Intel_errata_workarounds(struct cpuinfo_x86 *c)
 		__set_bit(X86_FEATURE_CLFLUSH_MONITOR, c->x86_capability);
 
 	probe_c3_errata(c);
+	if (system_state < SYS_STATE_smp_boot)
+		probe_mwait_errata();
 }
 
 
diff --git a/xen/arch/x86/include/asm/mwait.h b/xen/arch/x86/include/asm/mwait.h
index 9298f987c4..1f1e39775b 100644
--- a/xen/arch/x86/include/asm/mwait.h
+++ b/xen/arch/x86/include/asm/mwait.h
@@ -13,6 +13,9 @@
 
 #define MWAIT_ECX_INTERRUPT_BREAK	0x1
 
+/* Force sending of a wakeup IPI regardless of mwait usage. */
+extern bool force_mwait_ipi_wakeup;
+
 void mwait_idle_with_hints(unsigned int eax, unsigned int ecx);
 bool mwait_pc10_supported(void);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 10:13:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 10:13:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971784.1360201 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9hxa-0003VO-Dj; Tue, 29 Apr 2025 10:13:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971784.1360201; Tue, 29 Apr 2025 10:13: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 1u9hxa-0003VD-8M; Tue, 29 Apr 2025 10:13:06 +0000
Received: by outflank-mailman (input) for mailman id 971784;
 Tue, 29 Apr 2025 10:13: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 1u9hxY-0003Ex-AD
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 10:13: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 1u9hxY-00Clor-0w
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:13:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9hxY-00Et8s-0p
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:13: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=H4JPh8rag/4hPISnn1RfzSO1yUrcIdg+trZ+bau3/U0=; b=p4VaNZbnN/NHmyv/PLUkf7amWY
	g2ECKIbWgbP0TVIJJZf/pQlUIcYJWMq05sFNslEO22anSX0NwuCuyinTl7QqqLOD0+XOaq3iN7YkX
	ujMS1ZWNerOOk48u04QB46fMtnSC1wytpz9pmEaXfWx+5VxLAMw2kA98Mmo/tjw0za0Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] xen: remove -N from the linker command line
Message-Id: <E1u9hxY-00Et8s-0p@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 10:13:04 +0000

commit cd0fa8381d3389f21305df7b726e7da3b56e1b3c
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Apr 29 11:58:03 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:58:03 2025 +0200

    xen: remove -N from the linker command line
    
    It's unclear why -N is being used in the first place.  It was added by
    commit 4676bbf96dc8 back in 2002 without any justification.
    
    When building a PE image it's actually detrimental to forcefully set the
    .text section as writable.  The GNU LD man page contains the following
    warning regarding the -N option:
    
    > Note: Although a writable text section is allowed for PE-COFF targets, it
    > does not conform to the format specification published by Microsoft.
    
    Remove the usage of -N uniformly on all architectures, assuming that the
    addition was simply done as a copy and paste of the original x86 linking
    rune.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: d444763f8ca556d0a67a4b933be303d346baef02
    master date: 2025-04-23 16:12:25 +0200
---
 xen/arch/arm/Makefile   |  6 +++---
 xen/arch/ppc/Makefile   |  6 +++---
 xen/arch/riscv/Makefile |  2 +-
 xen/arch/x86/Makefile   | 12 ++++++------
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 45dc29ea53..940de246b5 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -97,19 +97,19 @@ ifeq ($(CONFIG_ARM_64),y)
 endif
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
 	    $(dot-target).0.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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).1.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
diff --git a/xen/arch/ppc/Makefile b/xen/arch/ppc/Makefile
index 71feb5e2c4..b9d61a7856 100644
--- a/xen/arch/ppc/Makefile
+++ b/xen/arch/ppc/Makefile
@@ -11,19 +11,19 @@ $(TARGET): $(TARGET)-syms
 	cp -f $< $@
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
 	    $(dot-target).0.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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).1.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index 1ed1a8369b..28b5809dac 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -11,7 +11,7 @@ $(TARGET): $(TARGET)-syms
 	$(OBJCOPY) -O binary -S $< $@
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) -o $@
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) -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 d902fb7acc..c1e64278ce 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -137,19 +137,19 @@ $(TARGET): $(TARGET)-syms $(efi-y) $(obj)/boot/mkelf32
 CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).0.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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(orphan-handling-y) $(dot-target).1.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
@@ -210,7 +210,7 @@ ifeq ($(CONFIG_DEBUG_INFO),y)
 	$(if $(filter --strip-debug,$(EFI_LDFLAGS)),echo,:) "Will strip debug info from $(@F)"
 endif
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
-	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds -N $< $(relocs-dummy) \
+	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< $(relocs-dummy) \
 	                $(objtree)/common/symbols-dummy.o $(note_file_option) \
 	                -o $(dot-target).$(base).0 &&) :
 	$(MKRELOC) $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(dot-target).$(base).0) \
@@ -220,7 +220,7 @@ endif
 		> $(dot-target).0s.S
 	$(MAKE) $(build)=$(@D) .$(@F).0r.o .$(@F).0s.o
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
-	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds -N $< \
+	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< \
 	                $(dot-target).0r.o $(dot-target).0s.o $(note_file_option) \
 	                -o $(dot-target).$(base).1 &&) :
 	$(MKRELOC) $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(dot-target).$(base).1) \
@@ -229,7 +229,7 @@ endif
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(dot-target).1s.S
 	$(MAKE) $(build)=$(@D) .$(@F).1r.o .$(@F).1s.o
-	$(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds -N $< \
+	$(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds $< \
 	      $(dot-target).1r.o $(dot-target).1s.o $(orphan-handling-y) \
 	      $(note_file_option) -o $@
 	$(NM) -pa --format=sysv $@ \
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 10:22:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 10:22:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971844.1360234 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9i6I-0007Ln-0q; Tue, 29 Apr 2025 10:22:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971844.1360234; Tue, 29 Apr 2025 10:22: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 1u9i6H-0007Lf-UQ; Tue, 29 Apr 2025 10:22:05 +0000
Received: by outflank-mailman (input) for mailman id 971844;
 Tue, 29 Apr 2025 10:22: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 1u9i6G-0007LW-8t
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 10:22: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 1u9i6G-00Cm77-0D
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:22:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9i6G-00FCZ8-03
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:22: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=yjkPSVk63h/Bv1zinRU0yQGl+NSe2whdGGJdpM0foNg=; b=ahjXT4MUqDtodQLZihy72+sMR9
	DQa/xnd96cLwgvWUbiPf09ZXZrIqcA1U7Pn30wQwdLiNikYTYraJxCiThVZnKsyqf1kRGp6+Rql9E
	XXYAIHgoJ8p6hARzdgLKCVrHvYLS9l83jZolQm6gq3jrRIQ7sMaIcT6pa6klcUaOxVtg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] x86/MTRR: hook mtrr_bp_restore() back up
Message-Id: <E1u9i6G-00FCZ8-03@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 10:22:04 +0000

commit a2b5eafb624357df3aaf8c203c6d520b613b00b0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 12:05:37 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 12:05:37 2025 +0200

    x86/MTRR: hook mtrr_bp_restore() back up
    
    Unlike stated in the offending commit's description,
    load_system_tables() wasn't the only thing left to retain from the
    earlier restore_rest_processor_state(). Note that MTRR state was still
    reloaded via mtrr_aps_sync_end(), but that happens quite a bit later in
    the resume process.
    
    While there also do Misra-related tidying for the function itself: The
    function being used from assembly only means it doesn't need to have a
    declaration.
    
    Fixes: 4304ff420e51 ("x86/S3: Drop {save,restore}_rest_processor_state() completely")
    Reported-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>
    master commit: 0414dedd6fde1a1c5c5e38dcbef4dad506e1398c
    master date: 2025-04-03 09:39:13 +0200
---
 xen/arch/x86/acpi/wakeup_prot.S | 2 ++
 xen/arch/x86/include/asm/mtrr.h | 1 -
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/acpi/wakeup_prot.S b/xen/arch/x86/acpi/wakeup_prot.S
index 3855ff1ddb..66f7993399 100644
--- a/xen/arch/x86/acpi/wakeup_prot.S
+++ b/xen/arch/x86/acpi/wakeup_prot.S
@@ -124,6 +124,8 @@ ENTRY(s3_resume)
         mov     STACK_CPUINFO_FIELD(cr4)(%rbx), %rax
         mov     %rax, %cr4
 
+        call    mtrr_bp_restore
+
 .Lsuspend_err:
         pop     %r15
         pop     %r14
diff --git a/xen/arch/x86/include/asm/mtrr.h b/xen/arch/x86/include/asm/mtrr.h
index 14246e3387..a8d3944d1c 100644
--- a/xen/arch/x86/include/asm/mtrr.h
+++ b/xen/arch/x86/include/asm/mtrr.h
@@ -66,7 +66,6 @@ extern uint8_t pat_type_2_pte_flags(uint8_t pat_type);
 extern int hold_mtrr_updates_on_aps;
 extern void mtrr_aps_sync_begin(void);
 extern void mtrr_aps_sync_end(void);
-extern void mtrr_bp_restore(void);
 
 extern bool_t mtrr_var_range_msr_set(struct domain *, struct mtrr_state *,
                                      uint32_t msr, uint64_t msr_content);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 10:22:16 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 10:22:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971845.1360238 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9i6S-0007PH-2M; Tue, 29 Apr 2025 10:22:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971845.1360238; Tue, 29 Apr 2025 10:22: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 1u9i6R-0007P9-Vu; Tue, 29 Apr 2025 10:22:15 +0000
Received: by outflank-mailman (input) for mailman id 971845;
 Tue, 29 Apr 2025 10:22: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 1u9i6Q-0007Ow-6r
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 10:22: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 1u9i6Q-00Cm7B-0b
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:22:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9i6Q-00FCzu-0S
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:22: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=g1kJz/8Uf2GnJk2EfPcjqbehfT5kbkNo9j/q+9Ccn3I=; b=wnLSmAeVF9v+hWV1W6wFNR/pDM
	pwnqD+ygPi5w/U71gqmzfluOeeED1LEk2JoHOM8TOGe2oNYHzNfQIN8fQjaAxLQirfs48seVSVYbb
	wjGJgLQ48GVdjwGX6d4v9lxg2e5ut6ueY9o/06BubY97kmBOOSHnwwYJDfebpE6sVZUU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] sched/null: avoid another crash after failed domU creation
Message-Id: <E1u9i6Q-00FCzu-0S@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 10:22:14 +0000

commit 72a60dfe4e8b1a7aaa34e77a380233295529f120
Author:     Stewart Hildebrand <stewart.hildebrand@amd.com>
AuthorDate: Tue Apr 29 12:06:31 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 12:06:31 2025 +0200

    sched/null: avoid another crash after failed domU creation
    
    The following sequence of events may lead a debug build of Xen to crash
    when using the null scheduler:
    
    1. domain creation (e.g. d1) failed due to bad configuration
    2. complete_domain_destroy() was deferred
    3. domain creation (e.g. d2) succeeds
    
    At this point, d2 is running, while the zombie d1 is not fully cleaned
    up:
    
    (XEN) Online Cpus: 0-3
    (XEN) Cpupool 0:
    (XEN) Cpus: 0-3
    (XEN) Scheduling granularity: cpu, 1 CPU per sched-resource
    (XEN) Scheduler: null Scheduler (null)
    (XEN)   cpus_free = 3
    (XEN) Domain info:
    (XEN)   Domain: 0
    (XEN)     1: [0.0] pcpu=0
    (XEN)     2: [0.1] pcpu=1
    (XEN)   Domain: 1
    (XEN)     3: [1.0] pcpu=2
    (XEN)   Domain: 2
    (XEN)     4: [2.0] pcpu=2
    
    4. complete_domain_destroy() gets called for d1 and triggers the
    following:
    
    (XEN) Xen call trace:
    (XEN)    [<00000a0000322ed4>] null.c#unit_deassign+0x2d8/0xb70 (PC)
    (XEN)    [<00000a000032457c>] null.c#null_unit_remove+0x670/0xba8 (LR)
    (XEN)    [<00000a000032457c>] null.c#null_unit_remove+0x670/0xba8
    (XEN)    [<00000a0000336404>] sched_destroy_vcpu+0x354/0x8fc
    (XEN)    [<00000a0000227324>] domain.c#complete_domain_destroy+0x11c/0x49c
    (XEN)    [<00000a000029fbd0>] rcupdate.c#rcu_do_batch+0x94/0x3d0
    (XEN)    [<00000a00002a10c0>] rcupdate.c#__rcu_process_callbacks+0x160/0x5f4
    (XEN)    [<00000a00002a1e60>] rcupdate.c#rcu_process_callbacks+0xcc/0x1b0
    (XEN)    [<00000a00002a3460>] softirq.c#__do_softirq+0x1f4/0x3d8
    (XEN)    [<00000a00002a37c4>] do_softirq+0x14/0x1c
    (XEN)    [<00000a0000465260>] traps.c#check_for_pcpu_work+0x30/0xb8
    (XEN)    [<00000a000046bb08>] leave_hypervisor_to_guest+0x28/0x198
    (XEN)    [<00000a0000409c84>] entry.o#guest_sync_slowpath+0xac/0xd8
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 0:
    (XEN) Assertion 'npc->unit == unit' failed at common/sched/null.c:383
    (XEN) ****************************************
    
    Fix by skipping unit_deassign() when the unit to be removed does not
    match the pcpu's currently assigned unit.
    
    Fixes: c2eae2614c8f ("sched/null: avoid crash after failed domU creation")
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    master commit: 54fe207f29f86c4226a62a4dd289f10d9d2abc40
    master date: 2025-04-07 12:17:31 +0200
---
 xen/common/sched/null.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/sched/null.c b/xen/common/sched/null.c
index 2091337fcd..c2dfbb81d0 100644
--- a/xen/common/sched/null.c
+++ b/xen/common/sched/null.c
@@ -551,7 +551,7 @@ static void cf_check null_unit_remove(
 
     cpu = sched_unit_master(unit);
     npc = get_sched_res(cpu)->sched_priv;
-    if ( npc->unit )
+    if ( npc->unit == unit )
         unit_deassign(prv, unit);
 
  out:
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 10:22:26 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 10:22:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971846.1360241 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9i6c-0007Rj-3i; Tue, 29 Apr 2025 10:22:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971846.1360241; Tue, 29 Apr 2025 10:22: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 1u9i6c-0007Rc-19; Tue, 29 Apr 2025 10:22:26 +0000
Received: by outflank-mailman (input) for mailman id 971846;
 Tue, 29 Apr 2025 10:22: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 1u9i6a-0007RM-Bb
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 10:22: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 1u9i6a-00Cm7H-0t
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:22:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9i6a-00FDXg-0m
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:22: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=5d520xELd19UBx0GqqlvxbJB+KYrqXlZKqe/n0Ni5wU=; b=k6FfWoFiN3ZWIyyWY76MsoWQM8
	nxpjK8Y1hhVHw6hN7UBvkHTMgG//6EqWcMG3AlRODcPREeHwei+rteFVLbPTdfp+VKUGUAr6Em2GQ
	1qiTgCzewY53haxkhaRJJ2FRKZ647Zdrjj20JniM0qZN3fLTmykz2p1If7ksp0+E0G24=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] xen: vm_event: do not do vm_event_op for an invalid domain
Message-Id: <E1u9i6a-00FDXg-0m@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 10:22:24 +0000

commit 398e2a7a15b02b545c17ffe99541fe7e621cf2c7
Author:     Volodymyr Babchuk <volodymyr_babchuk@epam.com>
AuthorDate: Tue Apr 29 12:06:59 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 12:06:59 2025 +0200

    xen: vm_event: do not do vm_event_op for an invalid domain
    
    A privileged domain can issue XEN_DOMCTL_vm_event_op with
    op->domain == DOMID_INVALID. In this case vm_event_domctl()
    function will get NULL as the first parameter and this will
    cause hypervisor panic, as it tries to derefer this pointer.
    
    Fix the issue by checking if valid domain is passed in.
    
    Fixes: 48b84249459f ("xen/vm-event: Drop unused u_domctl parameter from vm_event_domctl()")
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
    master commit: 6a884750f3b86a45ee5ffbd825c346fcbce86080
    master date: 2025-04-08 09:36:38 +0200
---
 xen/common/vm_event.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/common/vm_event.c b/xen/common/vm_event.c
index ecf49c38a9..71d2898174 100644
--- a/xen/common/vm_event.c
+++ b/xen/common/vm_event.c
@@ -600,6 +600,10 @@ int vm_event_domctl(struct domain *d, struct xen_domctl_vm_event_op *vec)
         return 0;
     }
 
+    /* All other subops need to target a real domain. */
+    if ( unlikely(d == NULL) )
+        return -ESRCH;
+
     rc = xsm_vm_event_control(XSM_PRIV, d, vec->mode, vec->op);
     if ( rc )
         return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 10:22:36 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 10:22:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971847.1360246 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9i6m-0007UQ-5I; Tue, 29 Apr 2025 10:22:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971847.1360246; Tue, 29 Apr 2025 10:22: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 1u9i6m-0007UI-2e; Tue, 29 Apr 2025 10:22:36 +0000
Received: by outflank-mailman (input) for mailman id 971847;
 Tue, 29 Apr 2025 10:22: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 1u9i6k-0007Tn-DR
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 10:22: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 1u9i6k-00Cm7N-1G
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:22:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9i6k-00FDq0-18
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:22: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=FHbAwbt36q8l/1FVfGEGxhfPGhEqUo2S8UBdcnfJ/RI=; b=VXY6n3oDeCQRO0xUZSa0JazSJK
	qWz+BAJKsDRG/G3UV+TO/x1MSsE3dvaHcDyuarjoGgUZWRMUhTb/ww5BM8eehvVvB7DDxxyXLOSSX
	eICHZInHdRYsp0ErRKuvvk4bWcqzdxjhtBLhKBG9YcM8UFDxrXR6D0twsn/2l4iMhFSM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] x86/cpu: Validate CPUID leaf 0x2 EDX output
Message-Id: <E1u9i6k-00FDq0-18@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 10:22:34 +0000

commit 5aa2d238448288fd986a74759ec9e838775b5dc3
Author:     Ahmed S. Darwish <darwi@linutronix.de>
AuthorDate: Tue Apr 29 12:07:30 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 12:07:30 2025 +0200

    x86/cpu: Validate CPUID leaf 0x2 EDX output
    
    CPUID leaf 0x2 emits one-byte descriptors in its four output registers
    EAX, EBX, ECX, and EDX.  For these descriptors to be valid, the most
    significant bit (MSB) of each register must be clear.
    
    Leaf 0x2 parsing at intel.c only validated the MSBs of EAX, EBX, and
    ECX, but left EDX unchecked.
    
    Validate EDX's most-significant bit as well.
    
    Fixes: 1aa6feb63bfd ("Port CPU setup code from Linux 2.6")
    Signed-off-by: Ahmed S. Darwish <darwi@linutronix.de>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Link: https://lore.kernel.org/r/20250304085152.51092-3-darwi@linutronix.de
    
    Use ARRAY_SIZE() though.
    
    Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 1881148215c6
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: a47b44a8f0a58a6015faf6465921cd203f0b51d1
    master date: 2025-04-08 09:37:38 +0200
---
 xen/arch/x86/cpu/intel_cacheinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/intel_cacheinfo.c b/xen/arch/x86/cpu/intel_cacheinfo.c
index 9cfb759be0..e88faa7545 100644
--- a/xen/arch/x86/cpu/intel_cacheinfo.c
+++ b/xen/arch/x86/cpu/intel_cacheinfo.c
@@ -186,7 +186,7 @@ void init_intel_cacheinfo(struct cpuinfo_x86 *c)
 			cpuid(2, &regs[0], &regs[1], &regs[2], &regs[3]);
 
 			/* If bit 31 is set, this is an unknown format */
-			for ( j = 0 ; j < 3 ; j++ ) {
+			for ( j = 0; j < ARRAY_SIZE(regs); j++ ) {
 				if ( regs[j] >> 31 )
 					regs[j] = 0;
 			}
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 10:22:45 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 10:22:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971848.1360249 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9i6v-0007Wi-6S; Tue, 29 Apr 2025 10:22:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971848.1360249; Tue, 29 Apr 2025 10:22:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9i6v-0007Wa-3z; Tue, 29 Apr 2025 10:22:45 +0000
Received: by outflank-mailman (input) for mailman id 971848;
 Tue, 29 Apr 2025 10:22: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 1u9i6u-0007WT-Gf
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 10:22: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 1u9i6u-00Cm7h-1a
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:22:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9i6u-00FEFK-1R
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:22: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=jVffU8DGTeOYbG3km4gk4+AnRv77EmFkmzjkWZwZ+CQ=; b=Yw6RXBpHqGmOQaVmBrv/vXpIUQ
	GtIL9wf3kiZOvLv+AjBz5xpM79cQ04s/XOoAbkOWutMgX2nm4z1PtAcx3dFMHP+A/GR0jC+z+z0H3
	HQ2TGc0V3CyYkqZR5OLWQ4ja4lhFEekG8LM9/Bcu09tWlgkku2VbzbIBQDXhlC1wjHv0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] xen: x86: irq: initialize irq desc in create_irq()
Message-Id: <E1u9i6u-00FEFK-1R@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 10:22:44 +0000

commit 4e7c9494037aa19f54c93a8c080077deda615f73
Author:     Volodymyr Babchuk <volodymyr_babchuk@epam.com>
AuthorDate: Tue Apr 29 12:07:53 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 12:07:53 2025 +0200

    xen: x86: irq: initialize irq desc in create_irq()
    
    While building xen with GCC 14.2.1 with "-fcondition-coverage" option
    or with "-Og", the compiler produces a false positive warning:
    
      arch/x86/irq.c: In function ‘create_irq’:
      arch/x86/irq.c:281:11: error: ‘desc’ may be used uninitialized [-Werror=maybe-uninitialized]
        281 |     ret = init_one_irq_desc(desc);
            |           ^~~~~~~~~~~~~~~~~~~~~~~
      arch/x86/irq.c:269:22: note: ‘desc’ was declared here
        269 |     struct irq_desc *desc;
            |                      ^~~~
      cc1: all warnings being treated as errors
      make[2]: *** [Rules.mk:252: arch/x86/irq.o] Error 1
    
    While we have signed/unsigned comparison both in "for" loop and in
    "if" statement, this still can't lead to use of uninitialized "desc",
    as either loop will be executed at least once, or the function will
    return early. So this is a clearly false positive warning due to a
    bug [1] in GCC.
    
    Initialize "desc" with NULL to make GCC happy.
    
    [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119665
    
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 7a4484d90b3003171f1700e424ad45b931200ba6
    master date: 2025-04-08 09:40:39 +0200
---
 xen/arch/x86/irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 6b1f338eae..db2d574680 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -261,7 +261,7 @@ void __init clear_irq_vector(int irq)
 int create_irq(nodeid_t node, bool grant_access)
 {
     int irq, ret;
-    struct irq_desc *desc;
+    struct irq_desc *desc = NULL ; /* gcc14 -Og or -fcondition-coverage */
 
     for (irq = nr_irqs_gsi; irq < nr_irqs; irq++)
     {
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 10:22:55 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 10:22:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971849.1360254 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9i75-0007ZC-7y; Tue, 29 Apr 2025 10:22:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971849.1360254; Tue, 29 Apr 2025 10:22:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9i75-0007Z4-5R; Tue, 29 Apr 2025 10:22:55 +0000
Received: by outflank-mailman (input) for mailman id 971849;
 Tue, 29 Apr 2025 10:22: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 1u9i74-0007Yv-JV
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 10:22: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 1u9i74-00Cm7l-1r
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:22:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9i74-00FEgO-1k
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:22: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=Eu7z5k2r2W3FWHUr/XIzcJrsR1QZUfjAUnBpYAc5/Tk=; b=y0UZS/hSRRR2lN48bQanUvvg7e
	f3JoMgzLfoKcVbBwpxDWJEl926VBpl8wPdAO73uvD1OX2HGpMFcuawki1MPK1aQYmmriCa7xMq7zO
	lKBKWIjKobrrt+3MrWPOIe3cq0ZzcdedozlKPdHNrn0ltshwPj51879GKd3of1dcm4hg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] include: sort $(wildcard ...) results
Message-Id: <E1u9i74-00FEgO-1k@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 10:22:54 +0000

commit fe03eba4903bd496200f8826002eb051baf4cc31
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 12:08:25 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 12:08:25 2025 +0200

    include: sort $(wildcard ...) results
    
    The order of items is stored in .*.chk.cmd, and hence variations between
    how items are ordered would result in re-invocation of the checking rule
    during "make install-xen" despite that already having successfully run
    earlier on. The difference can become noticable when building (as non-
    root) and installing (as root) use different GNU make versions: In 3.82
    the sorting was deliberately undone, just for it to be restored in 4.3.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: ff835bbc8096a14ed1bffa235e25848c993f7240
    master date: 2025-04-10 10:56:29 +0200
---
 xen/include/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/include/Makefile b/xen/include/Makefile
index 2e61b50139..33f069f417 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -41,8 +41,8 @@ cppflags-$(CONFIG_X86)    += -m32
 
 endif
 
-public-$(CONFIG_X86) := $(wildcard $(srcdir)/public/arch-x86/*.h $(srcdir)/public/arch-x86/*/*.h)
-public-$(CONFIG_ARM) := $(wildcard $(srcdir)/public/arch-arm/*.h $(srcdir)/public/arch-arm/*/*.h)
+public-$(CONFIG_X86) := $(sort $(wildcard $(srcdir)/public/arch-x86/*.h $(srcdir)/public/arch-x86/*/*.h))
+public-$(CONFIG_ARM) := $(sort $(wildcard $(srcdir)/public/arch-arm/*.h $(srcdir)/public/arch-arm/*/*.h))
 
 .PHONY: all
 all: $(addprefix $(obj)/,$(headers-y) $(headers-n))
@@ -130,7 +130,7 @@ all: $(obj)/headers.chk $(obj)/headers99.chk $(obj)/headers++.chk
 
 public-hdrs-path := $(srcdir)/public
 
-public-list-headers = $(wildcard $1/*.h $1/*/*.h)
+public-list-headers = $(sort $(wildcard $1/*.h $1/*/*.h))
 public-filter-headers = $(filter-out $(addprefix $(public-hdrs-path)/, $($1-filter)), $($1))
 
 public-headers := $(call public-list-headers, $(public-hdrs-path)) $(public-y)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 10:23:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 10:23:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971850.1360258 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9i7F-0007bd-9R; Tue, 29 Apr 2025 10:23:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971850.1360258; Tue, 29 Apr 2025 10: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 1u9i7F-0007bW-6x; Tue, 29 Apr 2025 10:23:05 +0000
Received: by outflank-mailman (input) for mailman id 971850;
 Tue, 29 Apr 2025 10:23: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 1u9i7E-0007bQ-Mw
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 10:23: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 1u9i7E-00Cm83-2C
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:23:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9i7E-00FExU-24
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:23: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=2lnDCisyyKq/yIfaDEoUtOzPhaQILnVI7pqo5qDdo5g=; b=Ov81/buEvTmOYdrCu3g2b/BYx6
	W8D6u/XU4qRS7wu7aynUFHO7gT2egsu9lRjshYwAI1ssP5AJvgk8SUlfUfUDi1bEwzebYNXV2l655
	5rDmbDCpT/8yloBeFQ/a3ksqdoQyaqcJ+g2R2KSmw2/eFGRriU/FvA0/GUg20QrpVCeA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] x86/HVM: update repeat count upon nested lin->phys failure
Message-Id: <E1u9i7E-00FExU-24@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 10:23:04 +0000

commit 73570ceb9bd131d64757e30365b3ead44d3af0bd
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 12:08:55 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 12:08:55 2025 +0200

    x86/HVM: update repeat count upon nested lin->phys failure
    
    For the X86EMUL_EXCEPTION case the repeat count must be correctly
    propagated back. Since for the recursive invocation we use a local
    helper variable, its value needs copying to the caller's one.
    
    While there also correct the off-by-1 range in the comment ahead of the
    function (strictly speaking for the "DF set" case we'd need to put
    another, different range there as well).
    
    Fixes: 53f87c03b4ea ("x86emul: generalize exception handling for rep_* hooks")
    Reported-by: Manuel Andreas <manuel.andreas@tum.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: c07b16fd6e47782ebf1ee767cd07c1e2b4140f47
    master date: 2025-04-17 10:01:19 +0200
---
 xen/arch/x86/hvm/emulate.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 2e6ebcbf36..aa77466a77 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -754,7 +754,7 @@ static void hvmemul_unmap_linear_addr(
 
 /*
  * Convert addr from linear to physical form, valid over the range
- * [addr, addr + *reps * bytes_per_rep]. *reps is adjusted according to
+ * [addr, addr + *reps * bytes_per_rep). *reps is adjusted according to
  * the valid computed range. It is always >0 when X86EMUL_OKAY is returned.
  * @pfec indicates the access checks to be performed during page-table walks.
  */
@@ -794,7 +794,10 @@ static int hvmemul_linear_to_phys(
         int rc = hvmemul_linear_to_phys(
             addr, &_paddr, bytes_per_rep, &one_rep, pfec, hvmemul_ctxt);
         if ( rc != X86EMUL_OKAY )
+        {
+            *reps = one_rep;
             return rc;
+        }
         pfn = _paddr >> PAGE_SHIFT;
     }
     else if ( (pfn = paging_gva_to_gfn(curr, addr, &pfec)) == gfn_x(INVALID_GFN) )
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 10:23:15 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 10:23:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971851.1360262 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9i7P-0007e3-B2; Tue, 29 Apr 2025 10:23:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971851.1360262; Tue, 29 Apr 2025 10:23: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 1u9i7P-0007dw-8M; Tue, 29 Apr 2025 10:23:15 +0000
Received: by outflank-mailman (input) for mailman id 971851;
 Tue, 29 Apr 2025 10:23: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 1u9i7O-0007dq-Pl
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 10:23: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 1u9i7O-00Cm8B-2U
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:23:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9i7O-00FFEr-2O
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:23: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=guFsjUVePr2WmGljYmK1tBtfXnLNFqv3C8qMq5kGBB8=; b=tRKXpUUIgvLfAGfdzuxVr5+UIq
	lFWDqJAffvyviAbbH34rI1gag5mvT5F5vVcc1k1aigF+9FmaxTRE/0cF1zg5kDKnw6YZTpvN5dX3V
	VQWasyHJYDEkjLh5oLYjfPF4tuOyYQGsxW0Giu0E4abzapbAZo3OEufDCIWAmZEhvZbM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] x86emul: also clip repetition count for STOS
Message-Id: <E1u9i7O-00FFEr-2O@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 10:23:14 +0000

commit a677964cbe8753d9a3f302a12a0cd446ac8c2306
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 12:09:45 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 12:09:45 2025 +0200

    x86emul: also clip repetition count for STOS
    
    Like MOVS, INS, and OUTS, STOS also has a special purpose hook, where
    the hook function may legitimately have the same expectation as to the
    request not straddling address space start/end.
    
    Fixes: 5dfe4aa4eeb6 ("x86_emulate: Do not request emulation of REP instructions beyond the")
    Reported-by: Fabian Specht <f.specht@tum.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 8c5636b6c87777e6c2e4ffae28bffe1cfc189bfd
    master date: 2025-04-22 11:24:20 +0200
---
 xen/arch/x86/x86_emulate/x86_emulate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index af0a308814..ef2598d4ca 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -2217,7 +2217,7 @@ x86_emulate(
 
         dst.bytes = src.bytes;
         dst.mem.seg = x86_seg_es;
-        dst.mem.off = truncate_ea(_regs.r(di));
+        dst.mem.off = truncate_ea_and_reps(_regs.r(di), nr_reps, dst.bytes);
         if ( (nr_reps == 1) || !ops->rep_stos ||
              ((rc = ops->rep_stos(&src.val,
                                   dst.mem.seg, dst.mem.off, dst.bytes,
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 10:23:25 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 10:23:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971853.1360276 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9i7Z-0007xR-Od; Tue, 29 Apr 2025 10:23:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971853.1360276; Tue, 29 Apr 2025 10:23:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9i7Z-0007xI-Lv; Tue, 29 Apr 2025 10:23:25 +0000
Received: by outflank-mailman (input) for mailman id 971853;
 Tue, 29 Apr 2025 10:23: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 1u9i7Y-0007wk-V6
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 10:23: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 1u9i7Y-00Cm8L-32
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:23:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9i7Y-00FFmT-2u
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:23: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=kC2dncWavmc62NxCcFDF0RBNp0rIBWVhgyJroY7MXIM=; b=mPtHZt8P58S0wR56TXJzFnj8K3
	yB9O95MWo+XTiJjm5pr27r6xUBe+KCxwS+g3gU3y/Msb6AX9LMkDN46q+C72c1H59TOECS6skbCJw
	UivsNL/wMpk2+ANC/KlXCRhN8tRZZjywZk7FRQbjryAUEqEG9IwObRVjVwcm6SPJoNls=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] compat/memory: avoid UB shifts in XENMEM_exchange handling
Message-Id: <E1u9i7Y-00FFmT-2u@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 10:23:24 +0000

commit d980886fd7f1626d42f766fbb0868a2c35813ae7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 12:10:30 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 12:10:30 2025 +0200

    compat/memory: avoid UB shifts in XENMEM_exchange handling
    
    Add an early basic check, yielding the same error code as the more
    thorough one the main handler would produce.
    
    Fixes: b8a7efe8528a ("Enable compatibility mode operation for HYPERVISOR_memory_op")
    Reported-by: Manuel Andreas <manuel.andreas@tum.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 560c51be8f6a88cde43c0a7c8be60158b5725982
    master date: 2025-04-22 11:25:23 +0200
---
 xen/common/compat/memory.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c
index 45e5fb0e5d..e3eb3c01a1 100644
--- a/xen/common/compat/memory.c
+++ b/xen/common/compat/memory.c
@@ -161,6 +161,11 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
             if ( copy_from_guest(&cmp.xchg, arg, 1) )
                 return -EFAULT;
 
+            /* Early coarse check, as max_order() isn't available here. */
+            if ( cmp.xchg.in.extent_order >= 32 ||
+                 cmp.xchg.out.extent_order >= 32 )
+                return -EPERM;
+
             order_delta = cmp.xchg.out.extent_order - cmp.xchg.in.extent_order;
             /* Various sanity checks. */
             if ( (cmp.xchg.nr_exchanged > cmp.xchg.in.nr_extents) ||
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 10:23:35 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 10:23:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971857.1360279 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9i7j-00085l-Pp; Tue, 29 Apr 2025 10:23:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971857.1360279; Tue, 29 Apr 2025 10:23:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9i7j-00085e-NO; Tue, 29 Apr 2025 10:23:35 +0000
Received: by outflank-mailman (input) for mailman id 971857;
 Tue, 29 Apr 2025 10:23:35 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u9i7j-00083u-20
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 10:23:35 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9i7j-00Cm8P-07
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:23:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9i7j-00FG7E-01
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:23:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xUYak9+4Ze9Ean7XtDe50n31oLIz3sLL8xvIaqnPgQ4=; b=fvwNpN1QivIHjMk79au7p81lx3
	VzLrepGJYQixKc9IdD9zHqxYO8yyP/sZSt86ZbHQ2C7sYUf1sL8frisOPAjmEO9uzpC8020YKSM9k
	BspCq667XNRJzIXnmlF34T2UtLetE1TjXZP9BmnWW5zpNfme1L+9fMm/MORMU/kf9beg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] x86/intel: workaround several MONITOR/MWAIT errata
Message-Id: <E1u9i7j-00FG7E-01@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 10:23:35 +0000

commit 62513194e13ee19a70086fdf3dbc6540ecea52f7
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Apr 29 12:10:46 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 12:10:46 2025 +0200

    x86/intel: workaround several MONITOR/MWAIT errata
    
    There are several errata on Intel regarding the usage of the MONITOR/MWAIT
    instructions, all having in common that stores to the monitored region
    might not wake up the CPU.
    
    Fix them by forcing the sending of an IPI for the affected models.
    
    The Ice Lake issue has been reproduced internally on XenServer hardware,
    and the fix does seem to prevent it.  The symptom was APs getting stuck in
    the idle loop immediately after bring up, which in turn prevented the BSP
    from making progress.  This would happen before the watchdog was
    initialized, and hence the whole system would get stuck.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 4aae4452efeee3d3bba092b875e37d1e7c8f6db9
    master date: 2025-04-23 16:12:25 +0200
---
 xen/arch/x86/acpi/cpu_idle.c     |  6 ++++++
 xen/arch/x86/cpu/intel.c         | 36 +++++++++++++++++++++++++++++++++++-
 xen/arch/x86/include/asm/mwait.h |  3 +++
 3 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index bf796e4688..040bab60b6 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -453,8 +453,14 @@ void cpuidle_wakeup_mwait(cpumask_t *mask)
     cpumask_andnot(mask, mask, &target);
 }
 
+/* Force sending of a wakeup IPI regardless of mwait usage. */
+bool __ro_after_init force_mwait_ipi_wakeup;
+
 bool arch_skip_send_event_check(unsigned int cpu)
 {
+    if ( force_mwait_ipi_wakeup )
+        return false;
+
     /*
      * This relies on softirq_pending() and mwait_wakeup() to access data
      * on the same cache line.
diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index 31f68cd6bd..076faaa980 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -8,6 +8,7 @@
 #include <asm/intel-family.h>
 #include <asm/processor.h>
 #include <asm/msr.h>
+#include <asm/mwait.h>
 #include <asm/uaccess.h>
 #include <asm/mpspec.h>
 #include <asm/apic.h>
@@ -368,7 +369,6 @@ static void probe_c3_errata(const struct cpuinfo_x86 *c)
         INTEL_FAM6_MODEL(0x25),
         { }
     };
-#undef INTEL_FAM6_MODEL
 
     /* Serialized by the AP bringup code. */
     if ( max_cstate > 1 && (c->apicid & (c->x86_num_siblings - 1)) &&
@@ -380,6 +380,38 @@ static void probe_c3_errata(const struct cpuinfo_x86 *c)
     }
 }
 
+/*
+ * APL30: One use of the MONITOR/MWAIT instruction pair is to allow a logical
+ * processor to wait in a sleep state until a store to the armed address range
+ * occurs. Due to this erratum, stores to the armed address range may not
+ * trigger MWAIT to resume execution.
+ *
+ * ICX143: Under complex microarchitectural conditions, a monitor that is armed
+ * with the MWAIT instruction may not be triggered, leading to a processor
+ * hang.
+ *
+ * LNL030: Problem P-cores may not exit power state Core C6 on monitor hit.
+ *
+ * Force the sending of an IPI in those cases.
+ */
+static void __init probe_mwait_errata(void)
+{
+    static const struct x86_cpu_id __initconst models[] = {
+        INTEL_FAM6_MODEL(INTEL_FAM6_ATOM_GOLDMONT), /* APL30  */
+        INTEL_FAM6_MODEL(INTEL_FAM6_ICELAKE_X),     /* ICX143 */
+        INTEL_FAM6_MODEL(INTEL_FAM6_LUNARLAKE_M),   /* LNL030 */
+        { }
+    };
+#undef INTEL_FAM6_MODEL
+
+    if ( boot_cpu_has(X86_FEATURE_MONITOR) && x86_match_cpu(models) )
+    {
+        printk(XENLOG_WARNING
+               "Forcing IPI MWAIT wakeup due to CPU erratum\n");
+        force_mwait_ipi_wakeup = true;
+    }
+}
+
 /*
  * P4 Xeon errata 037 workaround.
  * Hardware prefetcher may cause stale data to be loaded into the cache.
@@ -406,6 +438,8 @@ static void Intel_errata_workarounds(struct cpuinfo_x86 *c)
 		__set_bit(X86_FEATURE_CLFLUSH_MONITOR, c->x86_capability);
 
 	probe_c3_errata(c);
+	if (system_state < SYS_STATE_smp_boot)
+		probe_mwait_errata();
 }
 
 
diff --git a/xen/arch/x86/include/asm/mwait.h b/xen/arch/x86/include/asm/mwait.h
index f377d9fdca..97bf361505 100644
--- a/xen/arch/x86/include/asm/mwait.h
+++ b/xen/arch/x86/include/asm/mwait.h
@@ -13,6 +13,9 @@
 
 #define MWAIT_ECX_INTERRUPT_BREAK	0x1
 
+/* Force sending of a wakeup IPI regardless of mwait usage. */
+extern bool force_mwait_ipi_wakeup;
+
 void mwait_idle_with_hints(unsigned int eax, unsigned int ecx);
 bool mwait_pc10_supported(void);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 10:23:46 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 10:23:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.971860.1360284 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9i7u-0008FP-RX; Tue, 29 Apr 2025 10:23:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 971860.1360284; Tue, 29 Apr 2025 10:23: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 1u9i7u-0008FH-Ot; Tue, 29 Apr 2025 10:23:46 +0000
Received: by outflank-mailman (input) for mailman id 971860;
 Tue, 29 Apr 2025 10:23:45 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u9i7t-0008EK-6Y
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 10:23:45 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9i7t-00Cm8p-0Y
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:23:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9i7t-00FGP6-0H
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 10:23:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JgNt1eniGz0hUi2h/nwxQhu408jFPgWxPw6tVOET/YI=; b=0FfTWNpJs9uOn55KeOw6SX8hbX
	OaYKBn7VkCgIaQOERdQjgWQooQfO+URIZF02lVSO2NKze27xYOUPPzv5Simxw10eJzfFy5kJN31Fg
	htOvxfDHP26r0Lt36sAZQ7B6OpD2vhGQCIxIetwrAIjwAmlVetE0eU+E+2wrc79UBVqU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] xen: remove -N from the linker command line
Message-Id: <E1u9i7t-00FGP6-0H@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 10:23:45 +0000

commit a9754615cb1e615d92efc40d2f725553236bcf5e
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Apr 29 12:11:06 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 12:11:06 2025 +0200

    xen: remove -N from the linker command line
    
    It's unclear why -N is being used in the first place.  It was added by
    commit 4676bbf96dc8 back in 2002 without any justification.
    
    When building a PE image it's actually detrimental to forcefully set the
    .text section as writable.  The GNU LD man page contains the following
    warning regarding the -N option:
    
    > Note: Although a writable text section is allowed for PE-COFF targets, it
    > does not conform to the format specification published by Microsoft.
    
    Remove the usage of -N uniformly on all architectures, assuming that the
    addition was simply done as a copy and paste of the original x86 linking
    rune.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: d444763f8ca556d0a67a4b933be303d346baef02
    master date: 2025-04-23 16:12:25 +0200
---
 xen/arch/arm/Makefile   |  6 +++---
 xen/arch/ppc/Makefile   |  6 +++---
 xen/arch/riscv/Makefile |  2 +-
 xen/arch/x86/Makefile   | 12 ++++++------
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 7bf07e9920..7c1d82c294 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -92,19 +92,19 @@ ifeq ($(CONFIG_ARM_64),y)
 endif
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
 	    $(dot-target).0.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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).1.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
diff --git a/xen/arch/ppc/Makefile b/xen/arch/ppc/Makefile
index 71feb5e2c4..b9d61a7856 100644
--- a/xen/arch/ppc/Makefile
+++ b/xen/arch/ppc/Makefile
@@ -11,19 +11,19 @@ $(TARGET): $(TARGET)-syms
 	cp -f $< $@
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
 	    $(dot-target).0.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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).1.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index 2fefe14e7c..c8f1896b2b 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -10,7 +10,7 @@ $(TARGET): $(TARGET)-syms
 	$(OBJCOPY) -O binary -S $< $@
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) -o $@
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) -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 85b3f85608..e8a4bf59c3 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -138,19 +138,19 @@ $(TARGET): $(TARGET)-syms $(efi-y) $(obj)/boot/mkelf32
 CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).0.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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(orphan-handling-y) $(dot-target).1.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
@@ -211,7 +211,7 @@ ifeq ($(CONFIG_DEBUG_INFO),y)
 	$(if $(filter --strip-debug,$(EFI_LDFLAGS)),echo,:) "Will strip debug info from $(@F)"
 endif
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
-	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds -N $< $(relocs-dummy) \
+	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< $(relocs-dummy) \
 	                $(objtree)/common/symbols-dummy.o $(note_file_option) \
 	                -o $(dot-target).$(base).0 &&) :
 	$(MKRELOC) $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(dot-target).$(base).0) \
@@ -221,7 +221,7 @@ endif
 		> $(dot-target).0s.S
 	$(MAKE) $(build)=$(@D) .$(@F).0r.o .$(@F).0s.o
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
-	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds -N $< \
+	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< \
 	                $(dot-target).0r.o $(dot-target).0s.o $(note_file_option) \
 	                -o $(dot-target).$(base).1 &&) :
 	$(MKRELOC) $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(dot-target).$(base).1) \
@@ -230,7 +230,7 @@ endif
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(dot-target).1s.S
 	$(MAKE) $(build)=$(@D) .$(@F).1r.o .$(@F).1s.o
-	$(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds -N $< \
+	$(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds $< \
 	      $(dot-target).1r.o $(dot-target).1s.o $(orphan-handling-y) \
 	      $(note_file_option) -o $@
 	$(NM) -pa --format=sysv $@ \
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 11:11:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 11:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972010.1360392 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9irg-0005XP-P3; Tue, 29 Apr 2025 11:11:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972010.1360392; Tue, 29 Apr 2025 11: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 1u9irg-0005XI-Mb; Tue, 29 Apr 2025 11:11:04 +0000
Received: by outflank-mailman (input) for mailman id 972010;
 Tue, 29 Apr 2025 11:11: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 1u9irf-0005UB-1y
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 11:11: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 1u9ire-00CnjB-2I
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9ire-00Gtio-28
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 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=UnphIiIkrDWSVsMoncdP4qdf0pm838XtR4zZCD4syUo=; b=6NIOyT2BMW7d76RjGAeo/SxlyJ
	z5AWlwXFUoeXWIQ5oOy/UeQgpKPe7s8T0d0CDFwonB54mq18MMRI+LK3e+CMUgRQV0X6nKReVjvmn
	IWnVq3/eQIhr5JEcKewgkntEcE07YguQ7ol8F0b32BFX2F0M2MwK9FrXMMjz5kh5AxSM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/MTRR: hook mtrr_bp_restore() back up
Message-Id: <E1u9ire-00Gtio-28@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 11:11:02 +0000

commit da24dccf533a7a7a10b27b84d952d05962bfdbdc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 11:38:58 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:38:58 2025 +0200

    x86/MTRR: hook mtrr_bp_restore() back up
    
    Unlike stated in the offending commit's description,
    load_system_tables() wasn't the only thing left to retain from the
    earlier restore_rest_processor_state(). Note that MTRR state was still
    reloaded via mtrr_aps_sync_end(), but that happens quite a bit later in
    the resume process.
    
    While there also do Misra-related tidying for the function itself: The
    function being used from assembly only means it doesn't need to have a
    declaration, but wants to be asmlinkage.
    
    Fixes: 4304ff420e51 ("x86/S3: Drop {save,restore}_rest_processor_state() completely")
    Reported-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>
    master commit: 0414dedd6fde1a1c5c5e38dcbef4dad506e1398c
    master date: 2025-04-03 09:39:13 +0200
---
 xen/arch/x86/acpi/wakeup_prot.S | 2 ++
 xen/arch/x86/cpu/mtrr/main.c    | 2 +-
 xen/arch/x86/include/asm/mtrr.h | 1 -
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/acpi/wakeup_prot.S b/xen/arch/x86/acpi/wakeup_prot.S
index 8ce57ad137..a741d58b91 100644
--- a/xen/arch/x86/acpi/wakeup_prot.S
+++ b/xen/arch/x86/acpi/wakeup_prot.S
@@ -124,6 +124,8 @@ LABEL(s3_resume)
         mov     STACK_CPUINFO_FIELD(cr4)(%rbx), %rax
         mov     %rax, %cr4
 
+        call    mtrr_bp_restore
+
 .Lsuspend_err:
         pop     %r15
         pop     %r14
diff --git a/xen/arch/x86/cpu/mtrr/main.c b/xen/arch/x86/cpu/mtrr/main.c
index 0a44ebbcb0..516c8478c6 100644
--- a/xen/arch/x86/cpu/mtrr/main.c
+++ b/xen/arch/x86/cpu/mtrr/main.c
@@ -609,7 +609,7 @@ void mtrr_aps_sync_end(void)
 	hold_mtrr_updates_on_aps = 0;
 }
 
-void mtrr_bp_restore(void)
+void asmlinkage mtrr_bp_restore(void)
 {
 	mtrr_set_all();
 }
diff --git a/xen/arch/x86/include/asm/mtrr.h b/xen/arch/x86/include/asm/mtrr.h
index 36dac0a775..48b59d2620 100644
--- a/xen/arch/x86/include/asm/mtrr.h
+++ b/xen/arch/x86/include/asm/mtrr.h
@@ -66,7 +66,6 @@ extern uint8_t pat_type_2_pte_flags(uint8_t pat_type);
 extern int hold_mtrr_updates_on_aps;
 extern void mtrr_aps_sync_begin(void);
 extern void mtrr_aps_sync_end(void);
-extern void mtrr_bp_restore(void);
 
 extern bool mtrr_var_range_msr_set(struct domain *d, struct mtrr_state *m,
                                    uint32_t msr, uint64_t msr_content);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 11:11:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 11:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972011.1360396 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9irq-0005cP-QT; Tue, 29 Apr 2025 11:11:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972011.1360396; Tue, 29 Apr 2025 11: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 1u9irq-0005cI-O3; Tue, 29 Apr 2025 11:11:14 +0000
Received: by outflank-mailman (input) for mailman id 972011;
 Tue, 29 Apr 2025 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 1u9iro-0005c5-SE
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 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 1u9iro-00CnjF-2j
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9iro-00Gu8P-2U
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 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=KhW6U2ecPDxE0Tehliz8SBdqdDhxtniLkf/hOlrN6tk=; b=5cVLc9uPgaWDCgAp1ctn7hxMYd
	OMuUAON3sx12qO2+Yw580+6sBrYyGF0NYYjI4bnNaJXazSZS+gAZ8StS0siTW+xP8Iq0zBb7p9eQS
	IIiOCmG8GjZh2RJQDhxuQV799biknbu2dAOomYercnaYiiWvuOKJu12IIRd02oeLwOgI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] sched/null: avoid another crash after failed domU creation
Message-Id: <E1u9iro-00Gu8P-2U@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 11:11:12 +0000

commit 5b5a11c6c846e9908c9dcce12ff436106e3c5b87
Author:     Stewart Hildebrand <stewart.hildebrand@amd.com>
AuthorDate: Tue Apr 29 11:40:06 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:40:06 2025 +0200

    sched/null: avoid another crash after failed domU creation
    
    The following sequence of events may lead a debug build of Xen to crash
    when using the null scheduler:
    
    1. domain creation (e.g. d1) failed due to bad configuration
    2. complete_domain_destroy() was deferred
    3. domain creation (e.g. d2) succeeds
    
    At this point, d2 is running, while the zombie d1 is not fully cleaned
    up:
    
    (XEN) Online Cpus: 0-3
    (XEN) Cpupool 0:
    (XEN) Cpus: 0-3
    (XEN) Scheduling granularity: cpu, 1 CPU per sched-resource
    (XEN) Scheduler: null Scheduler (null)
    (XEN)   cpus_free = 3
    (XEN) Domain info:
    (XEN)   Domain: 0
    (XEN)     1: [0.0] pcpu=0
    (XEN)     2: [0.1] pcpu=1
    (XEN)   Domain: 1
    (XEN)     3: [1.0] pcpu=2
    (XEN)   Domain: 2
    (XEN)     4: [2.0] pcpu=2
    
    4. complete_domain_destroy() gets called for d1 and triggers the
    following:
    
    (XEN) Xen call trace:
    (XEN)    [<00000a0000322ed4>] null.c#unit_deassign+0x2d8/0xb70 (PC)
    (XEN)    [<00000a000032457c>] null.c#null_unit_remove+0x670/0xba8 (LR)
    (XEN)    [<00000a000032457c>] null.c#null_unit_remove+0x670/0xba8
    (XEN)    [<00000a0000336404>] sched_destroy_vcpu+0x354/0x8fc
    (XEN)    [<00000a0000227324>] domain.c#complete_domain_destroy+0x11c/0x49c
    (XEN)    [<00000a000029fbd0>] rcupdate.c#rcu_do_batch+0x94/0x3d0
    (XEN)    [<00000a00002a10c0>] rcupdate.c#__rcu_process_callbacks+0x160/0x5f4
    (XEN)    [<00000a00002a1e60>] rcupdate.c#rcu_process_callbacks+0xcc/0x1b0
    (XEN)    [<00000a00002a3460>] softirq.c#__do_softirq+0x1f4/0x3d8
    (XEN)    [<00000a00002a37c4>] do_softirq+0x14/0x1c
    (XEN)    [<00000a0000465260>] traps.c#check_for_pcpu_work+0x30/0xb8
    (XEN)    [<00000a000046bb08>] leave_hypervisor_to_guest+0x28/0x198
    (XEN)    [<00000a0000409c84>] entry.o#guest_sync_slowpath+0xac/0xd8
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 0:
    (XEN) Assertion 'npc->unit == unit' failed at common/sched/null.c:383
    (XEN) ****************************************
    
    Fix by skipping unit_deassign() when the unit to be removed does not
    match the pcpu's currently assigned unit.
    
    Fixes: c2eae2614c8f ("sched/null: avoid crash after failed domU creation")
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    master commit: 54fe207f29f86c4226a62a4dd289f10d9d2abc40
    master date: 2025-04-07 12:17:31 +0200
---
 xen/common/sched/null.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/sched/null.c b/xen/common/sched/null.c
index 7e31440e5b..c8e327e3cd 100644
--- a/xen/common/sched/null.c
+++ b/xen/common/sched/null.c
@@ -557,7 +557,7 @@ static void cf_check null_unit_remove(
 
     cpu = sched_unit_master(unit);
     npc = get_sched_res(cpu)->sched_priv;
-    if ( npc->unit )
+    if ( npc->unit == unit )
         unit_deassign(prv, unit);
 
  out:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 11:11:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 11:11:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972017.1360400 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9is0-0005nb-SZ; Tue, 29 Apr 2025 11:11:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972017.1360400; Tue, 29 Apr 2025 11: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 1u9is0-0005nT-PV; Tue, 29 Apr 2025 11:11:24 +0000
Received: by outflank-mailman (input) for mailman id 972017;
 Tue, 29 Apr 2025 11: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 1u9irz-0005hQ-0J
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 11: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 1u9iry-00CnjJ-2z
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9iry-00GuU2-2u
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11: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=bYrt28uxcKtWWrRKn/Q6JixTjN7kA9yIX17nkm8XXJc=; b=j1pBesY+cYYOULpWSAvaNXyc5N
	D7tXc666GNBuXQXIgi8ensTknluWnGq17mgr0gclEqIPH6gDa8LFAd9zLP7fHwl/FK0zaPumgw0NC
	/P7r1qt/lfDebcmoXrj4qCPeSQ65d6dQBAqN41SgXvF9CpIxd+Mbsylq2v1ceYCJR35s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] xen: vm_event: do not do vm_event_op for an invalid domain
Message-Id: <E1u9iry-00GuU2-2u@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 11:11:22 +0000

commit e0d9137ae77d7673719007352037eb730ad52fa2
Author:     Volodymyr Babchuk <volodymyr_babchuk@epam.com>
AuthorDate: Tue Apr 29 11:40:40 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:40:40 2025 +0200

    xen: vm_event: do not do vm_event_op for an invalid domain
    
    A privileged domain can issue XEN_DOMCTL_vm_event_op with
    op->domain == DOMID_INVALID. In this case vm_event_domctl()
    function will get NULL as the first parameter and this will
    cause hypervisor panic, as it tries to derefer this pointer.
    
    Fix the issue by checking if valid domain is passed in.
    
    Fixes: 48b84249459f ("xen/vm-event: Drop unused u_domctl parameter from vm_event_domctl()")
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
    master commit: 6a884750f3b86a45ee5ffbd825c346fcbce86080
    master date: 2025-04-08 09:36:38 +0200
---
 xen/common/vm_event.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/common/vm_event.c b/xen/common/vm_event.c
index fbf1aa0848..1666ff615f 100644
--- a/xen/common/vm_event.c
+++ b/xen/common/vm_event.c
@@ -600,6 +600,10 @@ int vm_event_domctl(struct domain *d, struct xen_domctl_vm_event_op *vec)
         return 0;
     }
 
+    /* All other subops need to target a real domain. */
+    if ( unlikely(d == NULL) )
+        return -ESRCH;
+
     rc = xsm_vm_event_control(XSM_PRIV, d, vec->mode, vec->op);
     if ( rc )
         return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 11:11:35 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 11:11:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972025.1360406 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9isA-0005yv-Vf; Tue, 29 Apr 2025 11:11:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972025.1360406; Tue, 29 Apr 2025 11: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 1u9isA-0005yl-SV; Tue, 29 Apr 2025 11:11:34 +0000
Received: by outflank-mailman (input) for mailman id 972025;
 Tue, 29 Apr 2025 11: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 1u9is9-0005tr-1Z
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 11: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 1u9is9-00CnjR-04
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:11:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9is8-00GunI-3A
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 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=e33vynJAAX6Aqe/rZHK0DN6teqXPZWBJco0gXaUrOlo=; b=Rq8NawlJ3LfSQ2NKxkkyeFxnW7
	gVSgm7y5SBraqZOAuhqc5M1wMxGPR9eVFMBLY1HCNBlKRmHT9/uToaWc2iGNOaxtWpJnNCLHFQPwU
	xzf9WNASnCKnkAnYCSPcJTxR8RHRmVQUJ45nsAMFQ4Yi12KSaCIJ6wFEAif1kFm0nNEw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/cpu: Validate CPUID leaf 0x2 EDX output
Message-Id: <E1u9is8-00GunI-3A@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 11:11:32 +0000

commit 2bd2c08a0f63d60bc1f8cc69ec9677d39f66aecf
Author:     Ahmed S. Darwish <darwi@linutronix.de>
AuthorDate: Tue Apr 29 11:41:13 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:41:13 2025 +0200

    x86/cpu: Validate CPUID leaf 0x2 EDX output
    
    CPUID leaf 0x2 emits one-byte descriptors in its four output registers
    EAX, EBX, ECX, and EDX.  For these descriptors to be valid, the most
    significant bit (MSB) of each register must be clear.
    
    Leaf 0x2 parsing at intel.c only validated the MSBs of EAX, EBX, and
    ECX, but left EDX unchecked.
    
    Validate EDX's most-significant bit as well.
    
    Fixes: 1aa6feb63bfd ("Port CPU setup code from Linux 2.6")
    Signed-off-by: Ahmed S. Darwish <darwi@linutronix.de>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Link: https://lore.kernel.org/r/20250304085152.51092-3-darwi@linutronix.de
    
    Use ARRAY_SIZE() though.
    
    Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 1881148215c6
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: a47b44a8f0a58a6015faf6465921cd203f0b51d1
    master date: 2025-04-08 09:37:38 +0200
---
 xen/arch/x86/cpu/intel_cacheinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/intel_cacheinfo.c b/xen/arch/x86/cpu/intel_cacheinfo.c
index 9cfb759be0..e88faa7545 100644
--- a/xen/arch/x86/cpu/intel_cacheinfo.c
+++ b/xen/arch/x86/cpu/intel_cacheinfo.c
@@ -186,7 +186,7 @@ void init_intel_cacheinfo(struct cpuinfo_x86 *c)
 			cpuid(2, &regs[0], &regs[1], &regs[2], &regs[3]);
 
 			/* If bit 31 is set, this is an unknown format */
-			for ( j = 0 ; j < 3 ; j++ ) {
+			for ( j = 0; j < ARRAY_SIZE(regs); j++ ) {
 				if ( regs[j] >> 31 )
 					regs[j] = 0;
 			}
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 11:11:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 11:11:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972030.1360409 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9isK-00066M-0P; Tue, 29 Apr 2025 11:11:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972030.1360409; Tue, 29 Apr 2025 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 1u9isJ-00066E-Tq; Tue, 29 Apr 2025 11:11:43 +0000
Received: by outflank-mailman (input) for mailman id 972030;
 Tue, 29 Apr 2025 11: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 1u9isJ-00065W-6x
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 11: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 1u9isJ-00Cnjv-0a
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:11:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9isJ-00Gv7U-0Q
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11: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=bhsmeSgbVX34TksC2+tqcyNAfe5n/KKKzOQ1anj2fW8=; b=p+a0q6Y2mZahcH4iQXd8Fq/4zu
	/iC73H+JvI0b8ToriCQsjc9JmpqSiFUSxlX9KR43Qj4MjNFi9tbe12YYE3htYJFj7gNyWON6j7kUs
	KHB5XxL1R1plmYjwKF+UrFd+CKWpN9PWw/bpnfRf8kKbC2RXwv9Xp8vR8OnJwSoeGUS8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] xen: x86: irq: initialize irq desc in create_irq()
Message-Id: <E1u9isJ-00Gv7U-0Q@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 11:11:43 +0000

commit 1a8df8282cca556b4355d2cd7b87d598bdcf2a02
Author:     Volodymyr Babchuk <volodymyr_babchuk@epam.com>
AuthorDate: Tue Apr 29 11:41:38 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:41:38 2025 +0200

    xen: x86: irq: initialize irq desc in create_irq()
    
    While building xen with GCC 14.2.1 with "-fcondition-coverage" option
    or with "-Og", the compiler produces a false positive warning:
    
      arch/x86/irq.c: In function ‘create_irq’:
      arch/x86/irq.c:281:11: error: ‘desc’ may be used uninitialized [-Werror=maybe-uninitialized]
        281 |     ret = init_one_irq_desc(desc);
            |           ^~~~~~~~~~~~~~~~~~~~~~~
      arch/x86/irq.c:269:22: note: ‘desc’ was declared here
        269 |     struct irq_desc *desc;
            |                      ^~~~
      cc1: all warnings being treated as errors
      make[2]: *** [Rules.mk:252: arch/x86/irq.o] Error 1
    
    While we have signed/unsigned comparison both in "for" loop and in
    "if" statement, this still can't lead to use of uninitialized "desc",
    as either loop will be executed at least once, or the function will
    return early. So this is a clearly false positive warning due to a
    bug [1] in GCC.
    
    Initialize "desc" with NULL to make GCC happy.
    
    [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119665
    
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 7a4484d90b3003171f1700e424ad45b931200ba6
    master date: 2025-04-08 09:40:39 +0200
---
 xen/arch/x86/irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index ff3ac832f4..3a09ed6346 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -265,7 +265,7 @@ void __init clear_irq_vector(int irq)
 int create_irq(nodeid_t node, bool grant_access)
 {
     int irq, ret;
-    struct irq_desc *desc;
+    struct irq_desc *desc = NULL ; /* gcc14 -Og or -fcondition-coverage */
 
     for (irq = nr_irqs_gsi; irq < nr_irqs; irq++)
     {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 11:11:54 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 11:11:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972032.1360413 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9isU-0006EL-1d; Tue, 29 Apr 2025 11:11:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972032.1360413; Tue, 29 Apr 2025 11: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 1u9isT-0006ED-VG; Tue, 29 Apr 2025 11:11:53 +0000
Received: by outflank-mailman (input) for mailman id 972032;
 Tue, 29 Apr 2025 11: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 1u9isT-0006E0-E3
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 11: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 1u9isT-00Cnk2-1J
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:11:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9isT-00Gvcc-1D
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11: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=c2pgEyruNzue8ZIroBA00oKXepJUlmlyOl9HYGrw8gs=; b=X/oVsjLOG97SJQFxw4GyaRqQFu
	pvNVBqnQ8iTuuw9ppbKQPLs+dzA31tJJNLgvmYR8cYh81il4nP70pMfZYHMtmbO1PoxO1XhsiNHeW
	OD5I9zWBnZIdFqDkO06xV0ED/Vm9ujI3ThgzWusrAx3YG8ocxBRjbDpgtzuc7TPC0PnM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86emul/test: drop check for AVX512-4FMAPS
Message-Id: <E1u9isT-00Gvcc-1D@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 11:11:53 +0000

commit f01a09d0b14c82eca982b650c6b6a8100fef2d19
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 11:42:23 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:42:23 2025 +0200

    x86emul/test: drop check for AVX512-4FMAPS
    
    Use of Xeon Phi features was dropped earlier on; this one was overlooked.
    
    Fixes: 85191cf32180 ("x86: drop Xeon Phi support")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 4bb846f32c870b19decc926f4759eac3fecfc04c
    master date: 2025-04-09 15:30:51 +0200
---
 tools/tests/x86_emulator/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/tests/x86_emulator/Makefile b/tools/tests/x86_emulator/Makefile
index 294d27ebaa..3f57ac6159 100644
--- a/tools/tests/x86_emulator/Makefile
+++ b/tools/tests/x86_emulator/Makefile
@@ -105,7 +105,7 @@ TARGET-$(shell echo 'int i;' | $(CC) -x c -c -o /dev/null -m$(1) - || echo y) :=
 endef
 
 ISA := bmi bmi2 tbm sse4.1 sse4.2 sse4a avx avx2 f16c
-ISA += $(addprefix avx512,f bw dq 4fmaps)
+ISA += $(addprefix avx512,f bw dq)
 $(foreach isa,$(ISA),$(eval $(call isa-check-cc,$(isa))))
 
 # Also explicitly check for {evex} pseudo-prefix support, which got introduced
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 11:12:04 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 11:12:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972033.1360417 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9ise-0006Gm-32; Tue, 29 Apr 2025 11:12:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972033.1360417; Tue, 29 Apr 2025 11: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 1u9ise-0006Gf-0M; Tue, 29 Apr 2025 11:12:04 +0000
Received: by outflank-mailman (input) for mailman id 972033;
 Tue, 29 Apr 2025 11: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 1u9isd-0006GX-H5
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 11: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 1u9isd-00CnkI-1c
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:12:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9isd-00Gvrn-1U
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11: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=wjUdpAWQYk4+rqCLhgipFAXclYS3tt6IZXbQWES2zKo=; b=rE61kEbjWPaS5Ac4TtC2AXO32A
	YyL+J76i1vXH5xsNiLuHHnvJY/7whZFWNae6VirT0Vc81rw4/7olo82AQk90hRUJjJoV7tidmjLeF
	56Zg95fFq9PLb5ZK/qvSoxW0faj6M+iJHTjV3FKITx+paNOpc84qgM4o7Tv+BkeE7g+o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] include: sort $(wildcard ...) results
Message-Id: <E1u9isd-00Gvrn-1U@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 11:12:03 +0000

commit f1dd95598852d5d227aff19b0f90e7194486b6e5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 11:42:47 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:42:47 2025 +0200

    include: sort $(wildcard ...) results
    
    The order of items is stored in .*.chk.cmd, and hence variations between
    how items are ordered would result in re-invocation of the checking rule
    during "make install-xen" despite that already having successfully run
    earlier on. The difference can become noticable when building (as non-
    root) and installing (as root) use different GNU make versions: In 3.82
    the sorting was deliberately undone, just for it to be restored in 4.3.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: ff835bbc8096a14ed1bffa235e25848c993f7240
    master date: 2025-04-10 10:56:29 +0200
---
 xen/include/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/include/Makefile b/xen/include/Makefile
index 058b0a566b..41b985f4d1 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -41,8 +41,8 @@ cppflags-$(CONFIG_X86)    += -m32
 
 endif
 
-public-$(CONFIG_X86) := $(wildcard $(srcdir)/public/arch-x86/*.h $(srcdir)/public/arch-x86/*/*.h)
-public-$(CONFIG_ARM) := $(wildcard $(srcdir)/public/arch-arm/*.h $(srcdir)/public/arch-arm/*/*.h)
+public-$(CONFIG_X86) := $(sort $(wildcard $(srcdir)/public/arch-x86/*.h $(srcdir)/public/arch-x86/*/*.h))
+public-$(CONFIG_ARM) := $(sort $(wildcard $(srcdir)/public/arch-arm/*.h $(srcdir)/public/arch-arm/*/*.h))
 
 .PHONY: all
 all: $(addprefix $(obj)/,$(headers-y) $(headers-n))
@@ -130,7 +130,7 @@ all: $(obj)/headers.chk $(obj)/headers99.chk $(obj)/headers++.chk
 
 public-hdrs-path := $(srcdir)/public
 
-public-list-headers = $(wildcard $1/*.h $1/*/*.h)
+public-list-headers = $(sort $(wildcard $1/*.h $1/*/*.h))
 public-filter-headers = $(filter-out $(addprefix $(public-hdrs-path)/, $($1-filter)), $($1))
 
 public-headers := $(call public-list-headers, $(public-hdrs-path)) $(public-y)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 11:12:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 11:12:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972034.1360421 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9iso-0006Ke-4x; Tue, 29 Apr 2025 11:12:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972034.1360421; Tue, 29 Apr 2025 11: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 1u9iso-0006KW-25; Tue, 29 Apr 2025 11:12:14 +0000
Received: by outflank-mailman (input) for mailman id 972034;
 Tue, 29 Apr 2025 11: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 1u9isn-0006KQ-KT
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 11: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 1u9isn-00CnkP-1w
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:12:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9isn-00GwAJ-1p
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11: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=NhyZT3qCPMspwYio4Y0YrQhHn48IuGZYOwI/Lnl4PdY=; b=TtCOksE2hMmZwytykTH47ZiFnB
	aXIxa7erYntxnczaT4nR1hUV2ZdIyRgFQ76WGZPNT3v9SKpbmr7wDxz4YVfiQPcIIj1KAtQnVDlCh
	XDQyV7sUJza1vYVGug05O/AwnReWtAOp3vee4Llpa1tvYMadBoAMakQUegnnb6aFk5e4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] xen/rangeset: fix incorrect subtraction
Message-Id: <E1u9isn-00GwAJ-1p@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 11:12:13 +0000

commit 6b399ed19fd36cca92745a55901a89c3b5fb747f
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Apr 29 11:43:12 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:43:12 2025 +0200

    xen/rangeset: fix incorrect subtraction
    
    Given the following rangset operation:
    
    { [0, 1], [4, 5] } - { [3, 4] }
    
    The current rangeset logic will output a rangeset:
    
    { [0, 2], [5, 5] }
    
    This is incorrect, and also has the undesirable property of being bogus in
    a way that the resulting rangeset is expanded.
    
    Fix this by making sure the bounds are correctly checked before modifying
    the previous range.
    
    Fixes: 484a058c4828 ('Add auto-destructing per-domain rangeset data structure...')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: e118fc98e7ae652a188d227bd7ea22f132724150
    master date: 2025-04-11 12:20:10 +0200
---
 xen/common/rangeset.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/common/rangeset.c b/xen/common/rangeset.c
index b75590f907..e758710390 100644
--- a/xen/common/rangeset.c
+++ b/xen/common/rangeset.c
@@ -227,7 +227,8 @@ int rangeset_remove_range(
 
         if ( x->s < s )
         {
-            x->e = s - 1;
+            if ( x->e >= s )
+                x->e = s - 1;
             x = next_range(r, x);
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 11:12:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 11:12:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972035.1360424 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9isy-0006My-63; Tue, 29 Apr 2025 11:12:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972035.1360424; Tue, 29 Apr 2025 11: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 1u9isy-0006Mq-3T; Tue, 29 Apr 2025 11:12:24 +0000
Received: by outflank-mailman (input) for mailman id 972035;
 Tue, 29 Apr 2025 11: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 1u9isx-0006Mk-Nd
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 11: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 1u9isx-00CnkT-2H
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:12:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9isx-00GwWl-2B
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11: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=gLq6BGLka8WCk/T9qr9B8hQY9/fWDvOqg/8WgCupVi0=; b=C3szrIby8Y4R4u2TdYarZ9R/NX
	u/+L248B+xS0qTBpe+XVYXfJeMeEP4UhZN8DBiU8jgOP0nsJi7/UmZTjmA17WoOdx5Q1LZWrZo0d8
	UVfKROHFMtyoTo9Uotxz0+S2/eIas1T85uWCsdTsngdeeBNQDp3h66eef8YVu+YTECew=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/mm: account for the offset when performing subpage r/o MMIO access
Message-Id: <E1u9isx-00GwWl-2B@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 11:12:23 +0000

commit dee15facf81d1f0f6e91ca52eb1f0f8f1b2a20dc
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Apr 29 11:44:04 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:44:04 2025 +0200

    x86/mm: account for the offset when performing subpage r/o MMIO access
    
    The current logic in subpage_mmio_write_emulate() doesn't take into account
    the page offset, and always performs the writes at offset 0 (start of the
    page).
    
    Fix this by accounting for the offset before performing the write.
    
    Fixes: 8847d6e23f97 ('x86/mm: add API for marking only part of a MMIO page read only')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 38d07809794e3c723a4de7e10c25c1f6cb590dc6
    master date: 2025-04-15 16:01:48 +0200
---
 xen/arch/x86/mm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index e6a61520d5..0d242739b1 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5128,6 +5128,7 @@ static void subpage_mmio_write_emulate(
         return;
     }
 
+    addr += offset;
     switch ( len )
     {
     case 1:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 11:12:34 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 11:12:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972036.1360428 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9it8-0006PI-7J; Tue, 29 Apr 2025 11:12:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972036.1360428; Tue, 29 Apr 2025 11: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 1u9it8-0006PB-4t; Tue, 29 Apr 2025 11:12:34 +0000
Received: by outflank-mailman (input) for mailman id 972036;
 Tue, 29 Apr 2025 11: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 1u9it7-0006P5-QZ
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 11: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 1u9it7-00CnkZ-2Y
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:12:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9it7-00Gwpb-2S
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11: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=sEVwybae+htm1AKBH2m8T8GS5GwRR7tjATmlKPeqJFM=; b=1aCnO7wSOEApPIfUoGHnRPGP2U
	IILvY8i6C+htun4ps3JLM7ntAYPz7EVo2a6CRBegQJ6XM6webWEfKFBtmoSHFdFXgg9vzFrgTcI9M
	lJ/RRVka15vIRbDIpnsqnmf4A2JdIVoJ4oiHAdySUCx51dF3laoH3+24eTqztyUb4q3E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/HVM: update repeat count upon nested lin->phys failure
Message-Id: <E1u9it7-00Gwpb-2S@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 11:12:33 +0000

commit ade8230830e9bf8c891ab37d2129cd5b48f51c99
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 11:44:56 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:44:56 2025 +0200

    x86/HVM: update repeat count upon nested lin->phys failure
    
    For the X86EMUL_EXCEPTION case the repeat count must be correctly
    propagated back. Since for the recursive invocation we use a local
    helper variable, its value needs copying to the caller's one.
    
    While there also correct the off-by-1 range in the comment ahead of the
    function (strictly speaking for the "DF set" case we'd need to put
    another, different range there as well).
    
    Fixes: 53f87c03b4ea ("x86emul: generalize exception handling for rep_* hooks")
    Reported-by: Manuel Andreas <manuel.andreas@tum.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: c07b16fd6e47782ebf1ee767cd07c1e2b4140f47
    master date: 2025-04-17 10:01:19 +0200
---
 xen/arch/x86/hvm/emulate.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 23e436d7db..495c8fe3b3 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -825,7 +825,7 @@ static void hvmemul_unmap_linear_addr(
 
 /*
  * Convert addr from linear to physical form, valid over the range
- * [addr, addr + *reps * bytes_per_rep]. *reps is adjusted according to
+ * [addr, addr + *reps * bytes_per_rep). *reps is adjusted according to
  * the valid computed range. It is always >0 when X86EMUL_OKAY is returned.
  * @pfec indicates the access checks to be performed during page-table walks.
  */
@@ -865,7 +865,10 @@ static int hvmemul_linear_to_phys(
         int rc = hvmemul_linear_to_phys(
             addr, &_paddr, bytes_per_rep, &one_rep, pfec, hvmemul_ctxt);
         if ( rc != X86EMUL_OKAY )
+        {
+            *reps = one_rep;
             return rc;
+        }
         pfn = _paddr >> PAGE_SHIFT;
     }
     else if ( (pfn = paging_gva_to_gfn(curr, addr, &pfec)) == gfn_x(INVALID_GFN) )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 11:12:45 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 11:12:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972038.1360433 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9itJ-0006SC-8o; Tue, 29 Apr 2025 11:12:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972038.1360433; Tue, 29 Apr 2025 11:12: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 1u9itJ-0006S5-6O; Tue, 29 Apr 2025 11:12:45 +0000
Received: by outflank-mailman (input) for mailman id 972038;
 Tue, 29 Apr 2025 11: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 1u9itH-0006Rp-Ue
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 11: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 1u9itH-00Cnkt-2y
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:12:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9itH-00GxCs-2o
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11: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=eG/JOX62uao5bKImkAbFB153T9k8J14L9TQaGk9TH94=; b=4Odqq+YUL/Z5UqFcpn8bTf5JPB
	HfLDcIraJW9CJ8msXSNeD3chiFVmHSOoD8l1gGVqQW32vdZVC7Xm/0nqExjThM8DmaEBtyRNAEW3+
	l94CCaBxdxb/3DfenlirLiwdkQcaLn20RXSOZNhfexP3zXw8bDY+ZGbl6JWC52DYn2sw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86emul: also clip repetition count for STOS
Message-Id: <E1u9itH-00GxCs-2o@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 11:12:43 +0000

commit 23a02992edb88e200fb0e722be6229729309c1d5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 11:45:28 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:45:28 2025 +0200

    x86emul: also clip repetition count for STOS
    
    Like MOVS, INS, and OUTS, STOS also has a special purpose hook, where
    the hook function may legitimately have the same expectation as to the
    request not straddling address space start/end.
    
    Fixes: 5dfe4aa4eeb6 ("x86_emulate: Do not request emulation of REP instructions beyond the")
    Reported-by: Fabian Specht <f.specht@tum.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 8c5636b6c87777e6c2e4ffae28bffe1cfc189bfd
    master date: 2025-04-22 11:24:20 +0200
---
 xen/arch/x86/x86_emulate/x86_emulate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 535d803588..e8cba5a27f 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -2221,7 +2221,7 @@ x86_emulate(
 
         dst.bytes = src.bytes;
         dst.mem.seg = x86_seg_es;
-        dst.mem.off = truncate_ea(_regs.r(di));
+        dst.mem.off = truncate_ea_and_reps(_regs.r(di), nr_reps, dst.bytes);
         if ( (nr_reps == 1) || !ops->rep_stos ||
              ((rc = ops->rep_stos(&src.val,
                                   dst.mem.seg, dst.mem.off, dst.bytes,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 11:12:55 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 11:12:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972039.1360436 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9itT-0006V3-Bk; Tue, 29 Apr 2025 11:12:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972039.1360436; Tue, 29 Apr 2025 11:12: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 1u9itT-0006Uw-9I; Tue, 29 Apr 2025 11:12:55 +0000
Received: by outflank-mailman (input) for mailman id 972039;
 Tue, 29 Apr 2025 11:12: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 1u9itS-0006Uj-1v
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 11:12: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 1u9itS-00Cnkx-05
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:12:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9itR-00GxYP-3A
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11: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=1mEBAXYail3EPDIT+W/E5Rc4zt9A/yu1aRVAFX19DfQ=; b=OXc4I/m0hEdwu/HyfxC3Vn838z
	N+TJE4mCtBxjvUn+KlX94vSW8wuNAN5meamnuaKLl7Y9M71SFYHKu94LuIApuOHI7aACryUBE/S+Y
	8mQ0n/MyFCcdJv7KvWlITsUqVV+1AWae0NY9FGoE1vwCNBL+sk1DmLVQHJr4OcElE/ek=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] compat/memory: avoid UB shifts in XENMEM_exchange handling
Message-Id: <E1u9itR-00GxYP-3A@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 11:12:53 +0000

commit 7d9bbb8ba81f96a7c36777f9d0b6e21e272113c0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 11:45:59 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:45:59 2025 +0200

    compat/memory: avoid UB shifts in XENMEM_exchange handling
    
    Add an early basic check, yielding the same error code as the more
    thorough one the main handler would produce.
    
    Fixes: b8a7efe8528a ("Enable compatibility mode operation for HYPERVISOR_memory_op")
    Reported-by: Manuel Andreas <manuel.andreas@tum.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 560c51be8f6a88cde43c0a7c8be60158b5725982
    master date: 2025-04-22 11:25:23 +0200
---
 xen/common/compat/memory.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c
index 45e5fb0e5d..e3eb3c01a1 100644
--- a/xen/common/compat/memory.c
+++ b/xen/common/compat/memory.c
@@ -161,6 +161,11 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
             if ( copy_from_guest(&cmp.xchg, arg, 1) )
                 return -EFAULT;
 
+            /* Early coarse check, as max_order() isn't available here. */
+            if ( cmp.xchg.in.extent_order >= 32 ||
+                 cmp.xchg.out.extent_order >= 32 )
+                return -EPERM;
+
             order_delta = cmp.xchg.out.extent_order - cmp.xchg.in.extent_order;
             /* Various sanity checks. */
             if ( (cmp.xchg.nr_exchanged > cmp.xchg.in.nr_extents) ||
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 11:13:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 11:13:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972040.1360440 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9itd-0006XX-DE; Tue, 29 Apr 2025 11:13:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972040.1360440; Tue, 29 Apr 2025 11:13: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 1u9itd-0006XQ-Am; Tue, 29 Apr 2025 11:13:05 +0000
Received: by outflank-mailman (input) for mailman id 972040;
 Tue, 29 Apr 2025 11:13: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 1u9itc-0006X9-56
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 11:13: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 1u9itc-00CnlC-0Q
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:13:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9itc-00GxyQ-0H
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:13: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=eu5lrN3PdjTchlA8cI3BoHBIw/YKRga7UUznij9pATg=; b=4rMkN1GzM55pyG0kS6HS4yfMmr
	QbxJ35pqi3SbcOYy6vN+YeP6oyVD29aGklBM43AvPtNYQ8KYaXwPm6sUnGMugJMicK9+BEDXaANR6
	IKTILmWAvMY6+1Pfv94xnJobq5Vz057pfMSzoFSow2S4+AsOC9I175AR4XvrhkNA3gtY=;
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 mkreloc header (field) reading
Message-Id: <E1u9itc-00GxyQ-0H@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 11:13:04 +0000

commit fc07876bea831edde71d62273bd7a5596b241be0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 11:46:37 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:46:37 2025 +0200

    x86/EFI: correct mkreloc header (field) reading
    
    With us now reading the full combined optional and NT headers, the
    subsequent reading of (and seeking to) NT header fields is wrong. Since
    PE32 and PE32+ NT headers are different anyway (beyond the image base
    oddity extending across both headers), switch to using a union. This
    allows to fetch the image base more directly then.
    
    Additionally add checking to map_section(), which would have caught at
    least the wrong (zero) image size that we previously used.
    
    Fixes: f7f42accbbbb ("x86/efi: Use generic PE/COFF structures")
    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>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    master commit: 042e9616f2e67476635487f2cd530406c6e3c0c1
    master date: 2025-04-23 09:39:44 +0200
---
 xen/arch/x86/efi/mkreloc.c | 70 ++++++++++++++++++++++++++++++++--------------
 1 file changed, 49 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/efi/mkreloc.c b/xen/arch/x86/efi/mkreloc.c
index 375cb79d69..4b3b2dd7ea 100644
--- a/xen/arch/x86/efi/mkreloc.c
+++ b/xen/arch/x86/efi/mkreloc.c
@@ -28,14 +28,16 @@ static void usage(const char *cmd, int rc)
 static unsigned int load(const char *name, int *handle,
                          struct section_header **sections,
                          uint_fast64_t *image_base,
-                         uint32_t *image_size,
+                         uint_fast32_t *image_size,
                          unsigned int *width)
 {
     int in = open(name, O_RDONLY);
     struct mz_hdr mz_hdr;
     struct pe_hdr pe_hdr;
-    struct pe32_opt_hdr pe32_opt_hdr;
-    uint32_t base;
+    union {
+        struct pe32_opt_hdr pe;
+        struct pe32plus_opt_hdr pep;
+    } pe32_opt_hdr;
 
     if ( in < 0 ||
          read(in, &mz_hdr, sizeof(mz_hdr)) != sizeof(mz_hdr) )
@@ -54,31 +56,40 @@ static unsigned int load(const char *name, int *handle,
 
     if ( lseek(in, mz_hdr.peaddr, SEEK_SET) < 0 ||
          read(in, &pe_hdr, sizeof(pe_hdr)) != sizeof(pe_hdr) ||
-         read(in, &pe32_opt_hdr, sizeof(pe32_opt_hdr)) != sizeof(pe32_opt_hdr) ||
-         read(in, &base, sizeof(base)) != sizeof(base) ||
-         /*
-          * Luckily the image size field lives at the
-          * same offset for both formats.
-          */
-         lseek(in, 24, SEEK_CUR) < 0 ||
-         read(in, image_size, sizeof(*image_size)) != sizeof(*image_size) )
+         (read(in, &pe32_opt_hdr.pe, sizeof(pe32_opt_hdr.pe)) !=
+          sizeof(pe32_opt_hdr.pe)) )
     {
         perror(name);
         exit(3);
     }
 
     switch ( (pe_hdr.magic == PE_MAGIC &&
-              pe_hdr.opt_hdr_size > sizeof(pe32_opt_hdr)) *
-              pe32_opt_hdr.magic )
+              pe_hdr.opt_hdr_size > sizeof(pe32_opt_hdr.pe)) *
+              pe32_opt_hdr.pe.magic )
     {
     case PE_OPT_MAGIC_PE32:
         *width = 32;
-        *image_base = base;
+        *image_base = pe32_opt_hdr.pe.image_base;
+        *image_size = pe32_opt_hdr.pe.image_size;
         break;
     case PE_OPT_MAGIC_PE32PLUS:
-        *width = 64;
-        *image_base = ((uint64_t)base << 32) | pe32_opt_hdr.data_base;
-        break;
+        if ( pe_hdr.opt_hdr_size > sizeof(pe32_opt_hdr.pep) )
+        {
+            if ( read(in,
+                      &pe32_opt_hdr.pe + 1,
+                      sizeof(pe32_opt_hdr.pep) - sizeof(pe32_opt_hdr.pe)) !=
+                 sizeof(pe32_opt_hdr.pep) - sizeof(pe32_opt_hdr.pe) )
+            {
+                perror(name);
+                exit(3);
+            }
+
+            *width = 64;
+            *image_base = pe32_opt_hdr.pep.image_base;
+            *image_size = pe32_opt_hdr.pep.image_size;
+            break;
+        }
+        /* Fall through. */
     default:
         fprintf(stderr, "%s: Wrong PE file format\n", name);
         exit(3);
@@ -108,11 +119,28 @@ static unsigned int load(const char *name, int *handle,
 static long page_size;
 
 static const void *map_section(const struct section_header *sec, int in,
-                               const char *name)
+                               const char *name, uint_fast32_t image_size)
 {
     const char *ptr;
     unsigned long offs;
 
+    if ( sec->rva > image_size )
+    {
+        fprintf(stderr,
+                "%s: section %.8s @ %08"PRIx32" beyond image size %08"PRIxFAST32"\n",
+                name, sec->name, sec->rva, image_size);
+        exit(6);
+    }
+
+    if ( (uint_fast64_t)sec->rva + sec->virtual_size > image_size )
+    {
+        fprintf(stderr,
+                "%s: section %.8s @ [%09"PRIx32",%09"PRIxFAST64") extends beyond image size %09"PRIxFAST32"\n",
+                name, sec->name, sec->rva,
+                (uint_fast64_t)sec->rva + sec->virtual_size, image_size);
+        exit(6);
+    }
+
     if ( !page_size )
         page_size = sysconf(_SC_PAGESIZE);
     offs = sec->data_addr & (page_size - 1);
@@ -233,7 +261,7 @@ int main(int argc, char *argv[])
     int in1, in2;
     unsigned int i, nsec, width1, width2;
     uint_fast64_t base1, base2;
-    uint32_t size1, size2;
+    uint_fast32_t size1, size2;
     struct section_header *sec1, *sec2;
 
     if ( argc == 1 ||
@@ -308,8 +336,8 @@ int main(int argc, char *argv[])
             sec1[i].raw_data_size = sec1[i].virtual_size;
             sec2[i].raw_data_size = sec2[i].virtual_size;
         }
-        ptr1 = map_section(sec1 + i, in1, argv[1]);
-        ptr2 = map_section(sec2 + i, in2, argv[2]);
+        ptr1 = map_section(sec1 + i, in1, argv[1], size1);
+        ptr2 = map_section(sec2 + i, in2, argv[2], size1);
 
         diff_sections(ptr1, ptr2, sec1 + i, base2 - base1, width1,
                       base1, base1 + size1);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 11:13:15 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 11:13:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972041.1360444 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9itn-0006Zw-En; Tue, 29 Apr 2025 11:13:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972041.1360444; Tue, 29 Apr 2025 11:13: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 1u9itn-0006Zo-CF; Tue, 29 Apr 2025 11:13:15 +0000
Received: by outflank-mailman (input) for mailman id 972041;
 Tue, 29 Apr 2025 11:13: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 1u9itm-0006Zc-7x
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 11:13: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 1u9itm-00CnlK-0i
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:13:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9itm-00GyNy-0c
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:13: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=G3mbCdfgfggZrqpE8InJBSBdE8wC6SL7PfLjJRfweTU=; b=5BvwA4jaIHTG2jx4UY/H9rqn9J
	8x55RUW7lYnpSr7oLD6ttq6gSQTzFMQQ8KBiXWMLxwQTuu/uprGHe8ezmsZ6jgpMlpyyELFLAZJkO
	WYNxW1mxFi6fEXL11G7Znk3uTgqhYO12jO4ccYeBiMG6jcqSGi9zwqLaYX7vLQGm8fLg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/intel: workaround several MONITOR/MWAIT errata
Message-Id: <E1u9itm-00GyNy-0c@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 11:13:14 +0000

commit a05e4817f9fa9fd770647db9ce5052fec8e973ac
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Apr 29 11:47:11 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:47:11 2025 +0200

    x86/intel: workaround several MONITOR/MWAIT errata
    
    There are several errata on Intel regarding the usage of the MONITOR/MWAIT
    instructions, all having in common that stores to the monitored region
    might not wake up the CPU.
    
    Fix them by forcing the sending of an IPI for the affected models.
    
    The Ice Lake issue has been reproduced internally on XenServer hardware,
    and the fix does seem to prevent it.  The symptom was APs getting stuck in
    the idle loop immediately after bring up, which in turn prevented the BSP
    from making progress.  This would happen before the watchdog was
    initialized, and hence the whole system would get stuck.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 4aae4452efeee3d3bba092b875e37d1e7c8f6db9
    master date: 2025-04-23 16:12:25 +0200
---
 xen/arch/x86/acpi/cpu_idle.c     |  6 ++++++
 xen/arch/x86/cpu/intel.c         | 36 +++++++++++++++++++++++++++++++++++-
 xen/arch/x86/include/asm/mwait.h |  3 +++
 3 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index 420198406d..1dbf15b01e 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -441,8 +441,14 @@ void cpuidle_wakeup_mwait(cpumask_t *mask)
     cpumask_andnot(mask, mask, &target);
 }
 
+/* Force sending of a wakeup IPI regardless of mwait usage. */
+bool __ro_after_init force_mwait_ipi_wakeup;
+
 bool arch_skip_send_event_check(unsigned int cpu)
 {
+    if ( force_mwait_ipi_wakeup )
+        return false;
+
     /*
      * This relies on softirq_pending() and mwait_wakeup() to access data
      * on the same cache line.
diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index 6a680ba38d..63f65ea5b0 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -8,6 +8,7 @@
 #include <asm/intel-family.h>
 #include <asm/processor.h>
 #include <asm/msr.h>
+#include <asm/mwait.h>
 #include <asm/uaccess.h>
 #include <asm/mpspec.h>
 #include <asm/apic.h>
@@ -368,7 +369,6 @@ static void probe_c3_errata(const struct cpuinfo_x86 *c)
         INTEL_FAM6_MODEL(0x25),
         { }
     };
-#undef INTEL_FAM6_MODEL
 
     /* Serialized by the AP bringup code. */
     if ( max_cstate > 1 && (c->apicid & (c->x86_num_siblings - 1)) &&
@@ -380,6 +380,38 @@ static void probe_c3_errata(const struct cpuinfo_x86 *c)
     }
 }
 
+/*
+ * APL30: One use of the MONITOR/MWAIT instruction pair is to allow a logical
+ * processor to wait in a sleep state until a store to the armed address range
+ * occurs. Due to this erratum, stores to the armed address range may not
+ * trigger MWAIT to resume execution.
+ *
+ * ICX143: Under complex microarchitectural conditions, a monitor that is armed
+ * with the MWAIT instruction may not be triggered, leading to a processor
+ * hang.
+ *
+ * LNL030: Problem P-cores may not exit power state Core C6 on monitor hit.
+ *
+ * Force the sending of an IPI in those cases.
+ */
+static void __init probe_mwait_errata(void)
+{
+    static const struct x86_cpu_id __initconst models[] = {
+        INTEL_FAM6_MODEL(INTEL_FAM6_ATOM_GOLDMONT), /* APL30  */
+        INTEL_FAM6_MODEL(INTEL_FAM6_ICELAKE_X),     /* ICX143 */
+        INTEL_FAM6_MODEL(INTEL_FAM6_LUNARLAKE_M),   /* LNL030 */
+        { }
+    };
+#undef INTEL_FAM6_MODEL
+
+    if ( boot_cpu_has(X86_FEATURE_MONITOR) && x86_match_cpu(models) )
+    {
+        printk(XENLOG_WARNING
+               "Forcing IPI MWAIT wakeup due to CPU erratum\n");
+        force_mwait_ipi_wakeup = true;
+    }
+}
+
 /*
  * P4 Xeon errata 037 workaround.
  * Hardware prefetcher may cause stale data to be loaded into the cache.
@@ -406,6 +438,8 @@ static void Intel_errata_workarounds(struct cpuinfo_x86 *c)
 		__set_bit(X86_FEATURE_CLFLUSH_MONITOR, c->x86_capability);
 
 	probe_c3_errata(c);
+	if (system_state < SYS_STATE_smp_boot)
+		probe_mwait_errata();
 }
 
 
diff --git a/xen/arch/x86/include/asm/mwait.h b/xen/arch/x86/include/asm/mwait.h
index 000a692f6d..c52cd3f510 100644
--- a/xen/arch/x86/include/asm/mwait.h
+++ b/xen/arch/x86/include/asm/mwait.h
@@ -13,6 +13,9 @@
 
 #define MWAIT_ECX_INTERRUPT_BREAK	0x1
 
+/* Force sending of a wakeup IPI regardless of mwait usage. */
+extern bool force_mwait_ipi_wakeup;
+
 void mwait_idle_with_hints(unsigned int eax, unsigned int ecx);
 #ifdef CONFIG_INTEL
 bool mwait_pc10_supported(void);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 11:13:25 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 11:13:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972042.1360449 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9itx-0006cP-Gd; Tue, 29 Apr 2025 11:13:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972042.1360449; Tue, 29 Apr 2025 11:13:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9itx-0006cH-Dj; Tue, 29 Apr 2025 11:13:25 +0000
Received: by outflank-mailman (input) for mailman id 972042;
 Tue, 29 Apr 2025 11:13: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 1u9itw-0006c9-EI
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 11:13: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 1u9itw-00CnlQ-1L
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:13:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9itw-00Gytz-18
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:13: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=qUPr6jXmqTSR2TC7C/GuBKIuFQwAkaMzFMMJcVECuOQ=; b=Y1SlgSwrVSkgZD0HQ/I+rriGb9
	TsGGcFQugiN2biP5eawGQmtBIOrrLC7nPLLUVqXOPszk2f3yl2seaujeRchR6LKH4qe4kqW4QE1Aw
	4VkjcWXUM95sVw6+iH9bAxx5yaySlG6SFStEgf3jIpEW2pgfkwUWNFoUqB1Q3r5uOji8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] xen: remove -N from the linker command line
Message-Id: <E1u9itw-00Gytz-18@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 11:13:24 +0000

commit f1e8b37f50914474f675226f0fed1d1b1508333d
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Apr 29 11:47:35 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:47:35 2025 +0200

    xen: remove -N from the linker command line
    
    It's unclear why -N is being used in the first place.  It was added by
    commit 4676bbf96dc8 back in 2002 without any justification.
    
    When building a PE image it's actually detrimental to forcefully set the
    .text section as writable.  The GNU LD man page contains the following
    warning regarding the -N option:
    
    > Note: Although a writable text section is allowed for PE-COFF targets, it
    > does not conform to the format specification published by Microsoft.
    
    Remove the usage of -N uniformly on all architectures, assuming that the
    addition was simply done as a copy and paste of the original x86 linking
    rune.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: d444763f8ca556d0a67a4b933be303d346baef02
    master date: 2025-04-23 16:12:25 +0200
---
 xen/arch/arm/Makefile   |  6 +++---
 xen/arch/ppc/Makefile   |  6 +++---
 xen/arch/riscv/Makefile |  6 +++---
 xen/arch/x86/Makefile   | 12 ++++++------
 4 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 43ab5e8f25..54e3905e01 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -96,19 +96,19 @@ ifeq ($(CONFIG_ARM_64),y)
 endif
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
 	    $(dot-target).0.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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).1.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
diff --git a/xen/arch/ppc/Makefile b/xen/arch/ppc/Makefile
index 655d212f66..cf27bcebb2 100644
--- a/xen/arch/ppc/Makefile
+++ b/xen/arch/ppc/Makefile
@@ -12,19 +12,19 @@ $(TARGET): $(TARGET)-syms
 	cp -f $< $@
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
 	    $(dot-target).0.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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).1.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index a5eb2aed4b..80f75bed8a 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -15,19 +15,19 @@ $(TARGET): $(TARGET)-syms
 	$(OBJCOPY) -O binary -S $< $@
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
 	    $(dot-target).0.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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).1.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index b35fd5196c..0ded68d069 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -138,19 +138,19 @@ $(TARGET): $(TARGET)-syms $(efi-y) $(obj)/boot/mkelf32
 CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).0.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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(orphan-handling-y) $(dot-target).1.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
@@ -211,7 +211,7 @@ ifeq ($(CONFIG_DEBUG_INFO),y)
 	$(if $(filter --strip-debug,$(EFI_LDFLAGS)),echo,:) "Will strip debug info from $(@F)"
 endif
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
-	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds -N $< $(relocs-dummy) \
+	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< $(relocs-dummy) \
 	                $(objtree)/common/symbols-dummy.o $(note_file_option) \
 	                -o $(dot-target).$(base).0 &&) :
 	$(MKRELOC) $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(dot-target).$(base).0) \
@@ -221,7 +221,7 @@ endif
 		> $(dot-target).0s.S
 	$(MAKE) $(build)=$(@D) .$(@F).0r.o .$(@F).0s.o
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
-	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds -N $< \
+	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< \
 	                $(dot-target).0r.o $(dot-target).0s.o $(note_file_option) \
 	                -o $(dot-target).$(base).1 &&) :
 	$(MKRELOC) $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(dot-target).$(base).1) \
@@ -230,7 +230,7 @@ endif
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(dot-target).1s.S
 	$(MAKE) $(build)=$(@D) .$(@F).1r.o .$(@F).1s.o
-	$(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds -N $< \
+	$(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds $< \
 	      $(dot-target).1r.o $(dot-target).1s.o $(orphan-handling-y) \
 	      $(note_file_option) -o $@
 	$(NM) -pa --format=sysv $@ \
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 11:13:35 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 11:13:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972043.1360453 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9iu7-0006ei-Hm; Tue, 29 Apr 2025 11:13:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972043.1360453; Tue, 29 Apr 2025 11:13:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9iu7-0006ea-FA; Tue, 29 Apr 2025 11:13:35 +0000
Received: by outflank-mailman (input) for mailman id 972043;
 Tue, 29 Apr 2025 11:13: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 1u9iu6-0006eQ-Ha
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 11:13: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 1u9iu6-00CnlU-1g
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:13:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9iu6-00GzWG-1a
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:13: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=waM452XNPaX5OsnnkpTcEETvK3ae13MNkUc1bZGG3SM=; b=S6+leNe12D0P9ytvgja99u7OCW
	yUo77kSH7sRNenfzbu0WqKSq1U5qcIfmUPvZACYYGpbd5xxFXdGGSusILCaRGU1aKfqxU/enAGZrj
	GQLdsh6R/QqaPqKg+xyytOiUKjGdYr0RYLzR00kHrQA3nbMAaUVUvTT7Oll2UWYAAe1Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86: constrain sub-page access length in mmio_ro_emulated_write()
Message-Id: <E1u9iu6-00GzWG-1a@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 11:13:34 +0000

commit 35cb38b2220b15e1229214255a430f9e99f07aa1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 11:47:50 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:47:50 2025 +0200

    x86: constrain sub-page access length in mmio_ro_emulated_write()
    
    Without doing so we could trigger the ASSERT_UNREACHABLE() in
    subpage_mmio_write_emulate(). A comment there actually says this
    validation would already have been done ...
    
    Fixes: 8847d6e23f97 ("x86/mm: add API for marking only part of a MMIO page read only")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    master commit: 8dbd9966f82f95b017f06e9397fc78064b688d61
    master date: 2025-04-28 09:48:14 +0200
---
 xen/arch/x86/mm.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 0d242739b1..3f43cbabe1 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5192,8 +5192,13 @@ int cf_check mmio_ro_emulated_write(
         return X86EMUL_UNHANDLEABLE;
     }
 
-    subpage_mmio_write_emulate(mmio_ro_ctxt->mfn, PAGE_OFFSET(offset),
-                               p_data, bytes);
+    if ( bytes <= 8 )
+        subpage_mmio_write_emulate(mmio_ro_ctxt->mfn, PAGE_OFFSET(offset),
+                                   p_data, bytes);
+    else if ( subpage_mmio_find_page(mmio_ro_ctxt->mfn) )
+        gprintk(XENLOG_WARNING,
+                "unsupported %u-byte write to R/O MMIO 0x%"PRI_mfn"%03lx\n",
+                bytes, mfn_x(mmio_ro_ctxt->mfn), PAGE_OFFSET(offset));
 
     return X86EMUL_OKAY;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 11:33:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 11:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972081.1360477 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9jCz-0002wE-FK; Tue, 29 Apr 2025 11:33:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972081.1360477; Tue, 29 Apr 2025 11:33: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 1u9jCz-0002w4-CR; Tue, 29 Apr 2025 11:33:05 +0000
Received: by outflank-mailman (input) for mailman id 972081;
 Tue, 29 Apr 2025 11:33: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 1u9jCx-0002vy-RG
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 11:33: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 1u9jCx-00CoL6-2D
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:33:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9jCx-0005t9-1r
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:33: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=8f7jcEcWltZsGO/KEhCg9pTOmR7alPmtBQor2u3XRbw=; b=ywcCiZIHbVh3g6aFZVECFyWhd9
	6+8fNiLx0wjSqbZqZwOd/DpUDPAgZsLLE2GKD2XcUtCygNTuTPdcAzQVCcp24TMJgMt4DsLnn8llJ
	LWEyo1wTmux1gvovvUw31N8oDMUT+nLktZQcaRhLJCl9waG8gAnNmWJiUKLCEMsax+T0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] x86/MTRR: hook mtrr_bp_restore() back up
Message-Id: <E1u9jCx-0005t9-1r@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 11:33:03 +0000

commit a2b5eafb624357df3aaf8c203c6d520b613b00b0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 12:05:37 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 12:05:37 2025 +0200

    x86/MTRR: hook mtrr_bp_restore() back up
    
    Unlike stated in the offending commit's description,
    load_system_tables() wasn't the only thing left to retain from the
    earlier restore_rest_processor_state(). Note that MTRR state was still
    reloaded via mtrr_aps_sync_end(), but that happens quite a bit later in
    the resume process.
    
    While there also do Misra-related tidying for the function itself: The
    function being used from assembly only means it doesn't need to have a
    declaration.
    
    Fixes: 4304ff420e51 ("x86/S3: Drop {save,restore}_rest_processor_state() completely")
    Reported-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>
    master commit: 0414dedd6fde1a1c5c5e38dcbef4dad506e1398c
    master date: 2025-04-03 09:39:13 +0200
---
 xen/arch/x86/acpi/wakeup_prot.S | 2 ++
 xen/arch/x86/include/asm/mtrr.h | 1 -
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/acpi/wakeup_prot.S b/xen/arch/x86/acpi/wakeup_prot.S
index 3855ff1ddb..66f7993399 100644
--- a/xen/arch/x86/acpi/wakeup_prot.S
+++ b/xen/arch/x86/acpi/wakeup_prot.S
@@ -124,6 +124,8 @@ ENTRY(s3_resume)
         mov     STACK_CPUINFO_FIELD(cr4)(%rbx), %rax
         mov     %rax, %cr4
 
+        call    mtrr_bp_restore
+
 .Lsuspend_err:
         pop     %r15
         pop     %r14
diff --git a/xen/arch/x86/include/asm/mtrr.h b/xen/arch/x86/include/asm/mtrr.h
index 14246e3387..a8d3944d1c 100644
--- a/xen/arch/x86/include/asm/mtrr.h
+++ b/xen/arch/x86/include/asm/mtrr.h
@@ -66,7 +66,6 @@ extern uint8_t pat_type_2_pte_flags(uint8_t pat_type);
 extern int hold_mtrr_updates_on_aps;
 extern void mtrr_aps_sync_begin(void);
 extern void mtrr_aps_sync_end(void);
-extern void mtrr_bp_restore(void);
 
 extern bool_t mtrr_var_range_msr_set(struct domain *, struct mtrr_state *,
                                      uint32_t msr, uint64_t msr_content);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 11:33:15 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 11:33:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972082.1360480 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9jD9-0002y6-GI; Tue, 29 Apr 2025 11:33:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972082.1360480; Tue, 29 Apr 2025 11:33: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 1u9jD9-0002xz-Ds; Tue, 29 Apr 2025 11:33:15 +0000
Received: by outflank-mailman (input) for mailman id 972082;
 Tue, 29 Apr 2025 11:33: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 1u9jD7-0002xq-Vr
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 11:33: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 1u9jD7-00CoLA-34
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:33:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9jD7-0006EL-2s
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:33: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=jW65oZeJnSaL/c7XV5fgEgmfS/2Atiuy5zlfFrNVM9M=; b=18Q1zd4DLJ8A6rD7qMXtnrV07S
	JDB/PR6hnuod6N2dl5EpXMq1gwruEW360a4YLlkyDmbO79oI1OiroSQVcc55PjY8Fl9hAWluuK3i6
	WCRSL00jq58kh93piWt+XBgnd8i+EE9Qgu35TIunLMu4jn4PE5AheTSuaevGQMzfm60M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] sched/null: avoid another crash after failed domU creation
Message-Id: <E1u9jD7-0006EL-2s@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 11:33:13 +0000

commit 72a60dfe4e8b1a7aaa34e77a380233295529f120
Author:     Stewart Hildebrand <stewart.hildebrand@amd.com>
AuthorDate: Tue Apr 29 12:06:31 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 12:06:31 2025 +0200

    sched/null: avoid another crash after failed domU creation
    
    The following sequence of events may lead a debug build of Xen to crash
    when using the null scheduler:
    
    1. domain creation (e.g. d1) failed due to bad configuration
    2. complete_domain_destroy() was deferred
    3. domain creation (e.g. d2) succeeds
    
    At this point, d2 is running, while the zombie d1 is not fully cleaned
    up:
    
    (XEN) Online Cpus: 0-3
    (XEN) Cpupool 0:
    (XEN) Cpus: 0-3
    (XEN) Scheduling granularity: cpu, 1 CPU per sched-resource
    (XEN) Scheduler: null Scheduler (null)
    (XEN)   cpus_free = 3
    (XEN) Domain info:
    (XEN)   Domain: 0
    (XEN)     1: [0.0] pcpu=0
    (XEN)     2: [0.1] pcpu=1
    (XEN)   Domain: 1
    (XEN)     3: [1.0] pcpu=2
    (XEN)   Domain: 2
    (XEN)     4: [2.0] pcpu=2
    
    4. complete_domain_destroy() gets called for d1 and triggers the
    following:
    
    (XEN) Xen call trace:
    (XEN)    [<00000a0000322ed4>] null.c#unit_deassign+0x2d8/0xb70 (PC)
    (XEN)    [<00000a000032457c>] null.c#null_unit_remove+0x670/0xba8 (LR)
    (XEN)    [<00000a000032457c>] null.c#null_unit_remove+0x670/0xba8
    (XEN)    [<00000a0000336404>] sched_destroy_vcpu+0x354/0x8fc
    (XEN)    [<00000a0000227324>] domain.c#complete_domain_destroy+0x11c/0x49c
    (XEN)    [<00000a000029fbd0>] rcupdate.c#rcu_do_batch+0x94/0x3d0
    (XEN)    [<00000a00002a10c0>] rcupdate.c#__rcu_process_callbacks+0x160/0x5f4
    (XEN)    [<00000a00002a1e60>] rcupdate.c#rcu_process_callbacks+0xcc/0x1b0
    (XEN)    [<00000a00002a3460>] softirq.c#__do_softirq+0x1f4/0x3d8
    (XEN)    [<00000a00002a37c4>] do_softirq+0x14/0x1c
    (XEN)    [<00000a0000465260>] traps.c#check_for_pcpu_work+0x30/0xb8
    (XEN)    [<00000a000046bb08>] leave_hypervisor_to_guest+0x28/0x198
    (XEN)    [<00000a0000409c84>] entry.o#guest_sync_slowpath+0xac/0xd8
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 0:
    (XEN) Assertion 'npc->unit == unit' failed at common/sched/null.c:383
    (XEN) ****************************************
    
    Fix by skipping unit_deassign() when the unit to be removed does not
    match the pcpu's currently assigned unit.
    
    Fixes: c2eae2614c8f ("sched/null: avoid crash after failed domU creation")
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    master commit: 54fe207f29f86c4226a62a4dd289f10d9d2abc40
    master date: 2025-04-07 12:17:31 +0200
---
 xen/common/sched/null.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/sched/null.c b/xen/common/sched/null.c
index 2091337fcd..c2dfbb81d0 100644
--- a/xen/common/sched/null.c
+++ b/xen/common/sched/null.c
@@ -551,7 +551,7 @@ static void cf_check null_unit_remove(
 
     cpu = sched_unit_master(unit);
     npc = get_sched_res(cpu)->sched_priv;
-    if ( npc->unit )
+    if ( npc->unit == unit )
         unit_deassign(prv, unit);
 
  out:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 11:33:25 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 11:33:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972083.1360485 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9jDJ-00030Q-Ht; Tue, 29 Apr 2025 11:33:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972083.1360485; Tue, 29 Apr 2025 11:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9jDJ-00030G-FG; Tue, 29 Apr 2025 11:33:25 +0000
Received: by outflank-mailman (input) for mailman id 972083;
 Tue, 29 Apr 2025 11:33: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 1u9jDI-000308-4I
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 11:33: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 1u9jDI-00CoLK-0L
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:33:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9jDI-0006mL-02
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:33: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=7rPnt0FLpwswM/tbajyhcUtC7+GEoplm4epbYXNW3N4=; b=21xHCqOVCW9RfoXjHJjhLmhXhp
	U++8vAO04hPLGOqcN1KopYSkWoyJJtxhuyBFxiGJ8j6DYqePv9hAEmvvTqKNeEhqq4q+w6vR12pqR
	7WytVA/8+ZOOU/9lxRep3OLBuxrEgbyBS27IUWMmWWqCeRZmXgqWsJb53qZjsWYyPzoQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] xen: vm_event: do not do vm_event_op for an invalid domain
Message-Id: <E1u9jDI-0006mL-02@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 11:33:24 +0000

commit 398e2a7a15b02b545c17ffe99541fe7e621cf2c7
Author:     Volodymyr Babchuk <volodymyr_babchuk@epam.com>
AuthorDate: Tue Apr 29 12:06:59 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 12:06:59 2025 +0200

    xen: vm_event: do not do vm_event_op for an invalid domain
    
    A privileged domain can issue XEN_DOMCTL_vm_event_op with
    op->domain == DOMID_INVALID. In this case vm_event_domctl()
    function will get NULL as the first parameter and this will
    cause hypervisor panic, as it tries to derefer this pointer.
    
    Fix the issue by checking if valid domain is passed in.
    
    Fixes: 48b84249459f ("xen/vm-event: Drop unused u_domctl parameter from vm_event_domctl()")
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
    master commit: 6a884750f3b86a45ee5ffbd825c346fcbce86080
    master date: 2025-04-08 09:36:38 +0200
---
 xen/common/vm_event.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/common/vm_event.c b/xen/common/vm_event.c
index ecf49c38a9..71d2898174 100644
--- a/xen/common/vm_event.c
+++ b/xen/common/vm_event.c
@@ -600,6 +600,10 @@ int vm_event_domctl(struct domain *d, struct xen_domctl_vm_event_op *vec)
         return 0;
     }
 
+    /* All other subops need to target a real domain. */
+    if ( unlikely(d == NULL) )
+        return -ESRCH;
+
     rc = xsm_vm_event_control(XSM_PRIV, d, vec->mode, vec->op);
     if ( rc )
         return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 11:33:35 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 11:33:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972084.1360489 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9jDT-00032T-JD; Tue, 29 Apr 2025 11:33:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972084.1360489; Tue, 29 Apr 2025 11:33:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9jDT-00032L-Gf; Tue, 29 Apr 2025 11:33:35 +0000
Received: by outflank-mailman (input) for mailman id 972084;
 Tue, 29 Apr 2025 11:33: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 1u9jDS-00032D-7d
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 11:33: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 1u9jDS-00CoLQ-0f
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:33:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9jDS-00077k-0W
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:33: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=9P51tTFitVKz/STdG8thGWWj5gEYIgHWHD5ByibvFfA=; b=OCNh2XS6Zsxwn96CFG8mYFOiQW
	NFwGqV36NQw3okVYQo4LyVfZbHAKIu9UEr3be6M2DL72H5QWGlE//E5uKyWo9W1izwgmVfr3r6vZB
	yxCVe8jSJILUVzo7IZ4fK+VqAahPw1icgCvQoriJNys68aHMP05AjZqcIgsK7+KaYkQY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] x86/cpu: Validate CPUID leaf 0x2 EDX output
Message-Id: <E1u9jDS-00077k-0W@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 11:33:34 +0000

commit 5aa2d238448288fd986a74759ec9e838775b5dc3
Author:     Ahmed S. Darwish <darwi@linutronix.de>
AuthorDate: Tue Apr 29 12:07:30 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 12:07:30 2025 +0200

    x86/cpu: Validate CPUID leaf 0x2 EDX output
    
    CPUID leaf 0x2 emits one-byte descriptors in its four output registers
    EAX, EBX, ECX, and EDX.  For these descriptors to be valid, the most
    significant bit (MSB) of each register must be clear.
    
    Leaf 0x2 parsing at intel.c only validated the MSBs of EAX, EBX, and
    ECX, but left EDX unchecked.
    
    Validate EDX's most-significant bit as well.
    
    Fixes: 1aa6feb63bfd ("Port CPU setup code from Linux 2.6")
    Signed-off-by: Ahmed S. Darwish <darwi@linutronix.de>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Link: https://lore.kernel.org/r/20250304085152.51092-3-darwi@linutronix.de
    
    Use ARRAY_SIZE() though.
    
    Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 1881148215c6
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: a47b44a8f0a58a6015faf6465921cd203f0b51d1
    master date: 2025-04-08 09:37:38 +0200
---
 xen/arch/x86/cpu/intel_cacheinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/intel_cacheinfo.c b/xen/arch/x86/cpu/intel_cacheinfo.c
index 9cfb759be0..e88faa7545 100644
--- a/xen/arch/x86/cpu/intel_cacheinfo.c
+++ b/xen/arch/x86/cpu/intel_cacheinfo.c
@@ -186,7 +186,7 @@ void init_intel_cacheinfo(struct cpuinfo_x86 *c)
 			cpuid(2, &regs[0], &regs[1], &regs[2], &regs[3]);
 
 			/* If bit 31 is set, this is an unknown format */
-			for ( j = 0 ; j < 3 ; j++ ) {
+			for ( j = 0; j < ARRAY_SIZE(regs); j++ ) {
 				if ( regs[j] >> 31 )
 					regs[j] = 0;
 			}
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 11:33:45 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 11:33:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972085.1360493 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9jDd-00035H-L5; Tue, 29 Apr 2025 11:33:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972085.1360493; Tue, 29 Apr 2025 11:33: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 1u9jDd-00035A-I2; Tue, 29 Apr 2025 11:33:45 +0000
Received: by outflank-mailman (input) for mailman id 972085;
 Tue, 29 Apr 2025 11:33: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 1u9jDc-00034z-Ar
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 11:33: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 1u9jDc-00CoLs-0z
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:33:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9jDc-0007MN-0q
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:33: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=spcEG4yTXv+OSsOCJ5poI1KSOKuCGaJLapq+s3Pt2hQ=; b=AgtGoNFpn5GFcvuK6BRoHfS7+k
	W2IgOCD3vKPa8lk47huuGUKS1ZeOCzhcQgE2N/MKMvTIkA2yC4ooZlJSWjSj6Mknh3OT62y5HJi5x
	rSAZuINpJlXRxzLnypAcGeBNyKubo6SjFA+RF3p7vOzNaIrhztHi8MTk8L4O2ZqGr+/w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] xen: x86: irq: initialize irq desc in create_irq()
Message-Id: <E1u9jDc-0007MN-0q@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 11:33:44 +0000

commit 4e7c9494037aa19f54c93a8c080077deda615f73
Author:     Volodymyr Babchuk <volodymyr_babchuk@epam.com>
AuthorDate: Tue Apr 29 12:07:53 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 12:07:53 2025 +0200

    xen: x86: irq: initialize irq desc in create_irq()
    
    While building xen with GCC 14.2.1 with "-fcondition-coverage" option
    or with "-Og", the compiler produces a false positive warning:
    
      arch/x86/irq.c: In function ‘create_irq’:
      arch/x86/irq.c:281:11: error: ‘desc’ may be used uninitialized [-Werror=maybe-uninitialized]
        281 |     ret = init_one_irq_desc(desc);
            |           ^~~~~~~~~~~~~~~~~~~~~~~
      arch/x86/irq.c:269:22: note: ‘desc’ was declared here
        269 |     struct irq_desc *desc;
            |                      ^~~~
      cc1: all warnings being treated as errors
      make[2]: *** [Rules.mk:252: arch/x86/irq.o] Error 1
    
    While we have signed/unsigned comparison both in "for" loop and in
    "if" statement, this still can't lead to use of uninitialized "desc",
    as either loop will be executed at least once, or the function will
    return early. So this is a clearly false positive warning due to a
    bug [1] in GCC.
    
    Initialize "desc" with NULL to make GCC happy.
    
    [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119665
    
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 7a4484d90b3003171f1700e424ad45b931200ba6
    master date: 2025-04-08 09:40:39 +0200
---
 xen/arch/x86/irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 6b1f338eae..db2d574680 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -261,7 +261,7 @@ void __init clear_irq_vector(int irq)
 int create_irq(nodeid_t node, bool grant_access)
 {
     int irq, ret;
-    struct irq_desc *desc;
+    struct irq_desc *desc = NULL ; /* gcc14 -Og or -fcondition-coverage */
 
     for (irq = nr_irqs_gsi; irq < nr_irqs; irq++)
     {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 11:33:55 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 11:33:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972086.1360496 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9jDn-00037Y-M6; Tue, 29 Apr 2025 11:33:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972086.1360496; Tue, 29 Apr 2025 11:33: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 1u9jDn-00037Q-Jd; Tue, 29 Apr 2025 11:33:55 +0000
Received: by outflank-mailman (input) for mailman id 972086;
 Tue, 29 Apr 2025 11:33: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 1u9jDm-00037E-Dz
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 11:33: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 1u9jDm-00CoLx-1I
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:33:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9jDm-0007na-1A
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:33: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=Ibgk+qv/3oUqGlhpLvyQekEpsQo3ThkYG9GMBSKTIZ0=; b=Pznw1WxlS/NWvLiTapfIGMKZ9v
	gyVblJW0UIukqw593HlsRcguM5TwPSJKHwVPyeZr1+7TUsr7EcAJ8ajgKmEdJf6YQee1TrWWz7dzY
	7GofOoVg3XEf4wuHl3ssG3DYbfV3ZU4oHMTvOxueWbTnxVpFK1hVWyl0W1qOBg6JQ2OY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] include: sort $(wildcard ...) results
Message-Id: <E1u9jDm-0007na-1A@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 11:33:54 +0000

commit fe03eba4903bd496200f8826002eb051baf4cc31
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 12:08:25 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 12:08:25 2025 +0200

    include: sort $(wildcard ...) results
    
    The order of items is stored in .*.chk.cmd, and hence variations between
    how items are ordered would result in re-invocation of the checking rule
    during "make install-xen" despite that already having successfully run
    earlier on. The difference can become noticable when building (as non-
    root) and installing (as root) use different GNU make versions: In 3.82
    the sorting was deliberately undone, just for it to be restored in 4.3.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: ff835bbc8096a14ed1bffa235e25848c993f7240
    master date: 2025-04-10 10:56:29 +0200
---
 xen/include/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/include/Makefile b/xen/include/Makefile
index 2e61b50139..33f069f417 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -41,8 +41,8 @@ cppflags-$(CONFIG_X86)    += -m32
 
 endif
 
-public-$(CONFIG_X86) := $(wildcard $(srcdir)/public/arch-x86/*.h $(srcdir)/public/arch-x86/*/*.h)
-public-$(CONFIG_ARM) := $(wildcard $(srcdir)/public/arch-arm/*.h $(srcdir)/public/arch-arm/*/*.h)
+public-$(CONFIG_X86) := $(sort $(wildcard $(srcdir)/public/arch-x86/*.h $(srcdir)/public/arch-x86/*/*.h))
+public-$(CONFIG_ARM) := $(sort $(wildcard $(srcdir)/public/arch-arm/*.h $(srcdir)/public/arch-arm/*/*.h))
 
 .PHONY: all
 all: $(addprefix $(obj)/,$(headers-y) $(headers-n))
@@ -130,7 +130,7 @@ all: $(obj)/headers.chk $(obj)/headers99.chk $(obj)/headers++.chk
 
 public-hdrs-path := $(srcdir)/public
 
-public-list-headers = $(wildcard $1/*.h $1/*/*.h)
+public-list-headers = $(sort $(wildcard $1/*.h $1/*/*.h))
 public-filter-headers = $(filter-out $(addprefix $(public-hdrs-path)/, $($1-filter)), $($1))
 
 public-headers := $(call public-list-headers, $(public-hdrs-path)) $(public-y)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 11:34:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 11:34:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972087.1360501 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9jDx-00039y-Nl; Tue, 29 Apr 2025 11:34:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972087.1360501; Tue, 29 Apr 2025 11:34: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 1u9jDx-00039q-L2; Tue, 29 Apr 2025 11:34:05 +0000
Received: by outflank-mailman (input) for mailman id 972087;
 Tue, 29 Apr 2025 11:34: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 1u9jDw-00039j-Jp
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 11:34: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 1u9jDw-00CoMC-1t
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:34:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9jDw-0008KC-1i
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:34: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=QLIH5mOZ3GxQ2B0Kbum76qTL84jm1wGndOikN/gTLkQ=; b=TYDHhXyfT/OUTlr+SNniin4RJp
	EC59Y5ZIsjqOTKE0Tky/yeYaYXXDoY0A4Ppg6iSnhkXu/aCjoN1rdbiwQUjjxGSMpdIWWHk9L4c+j
	A7V8rGI7LrSJ/MHh6wOtDCtjbfDEe40wJmPIxdg8TP1zN17TN/X/VQtY9+ERKh17uwQM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] x86/HVM: update repeat count upon nested lin->phys failure
Message-Id: <E1u9jDw-0008KC-1i@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 11:34:04 +0000

commit 73570ceb9bd131d64757e30365b3ead44d3af0bd
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 12:08:55 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 12:08:55 2025 +0200

    x86/HVM: update repeat count upon nested lin->phys failure
    
    For the X86EMUL_EXCEPTION case the repeat count must be correctly
    propagated back. Since for the recursive invocation we use a local
    helper variable, its value needs copying to the caller's one.
    
    While there also correct the off-by-1 range in the comment ahead of the
    function (strictly speaking for the "DF set" case we'd need to put
    another, different range there as well).
    
    Fixes: 53f87c03b4ea ("x86emul: generalize exception handling for rep_* hooks")
    Reported-by: Manuel Andreas <manuel.andreas@tum.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: c07b16fd6e47782ebf1ee767cd07c1e2b4140f47
    master date: 2025-04-17 10:01:19 +0200
---
 xen/arch/x86/hvm/emulate.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 2e6ebcbf36..aa77466a77 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -754,7 +754,7 @@ static void hvmemul_unmap_linear_addr(
 
 /*
  * Convert addr from linear to physical form, valid over the range
- * [addr, addr + *reps * bytes_per_rep]. *reps is adjusted according to
+ * [addr, addr + *reps * bytes_per_rep). *reps is adjusted according to
  * the valid computed range. It is always >0 when X86EMUL_OKAY is returned.
  * @pfec indicates the access checks to be performed during page-table walks.
  */
@@ -794,7 +794,10 @@ static int hvmemul_linear_to_phys(
         int rc = hvmemul_linear_to_phys(
             addr, &_paddr, bytes_per_rep, &one_rep, pfec, hvmemul_ctxt);
         if ( rc != X86EMUL_OKAY )
+        {
+            *reps = one_rep;
             return rc;
+        }
         pfn = _paddr >> PAGE_SHIFT;
     }
     else if ( (pfn = paging_gva_to_gfn(curr, addr, &pfec)) == gfn_x(INVALID_GFN) )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 11:34:15 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 11:34:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972088.1360505 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9jE7-0003Ct-Oy; Tue, 29 Apr 2025 11:34:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972088.1360505; Tue, 29 Apr 2025 11:34:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9jE7-0003Cl-MO; Tue, 29 Apr 2025 11:34:15 +0000
Received: by outflank-mailman (input) for mailman id 972088;
 Tue, 29 Apr 2025 11:34: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 1u9jE6-0003CZ-Nz
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 11:34: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 1u9jE6-00CoMM-2I
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:34:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9jE6-0008rt-2B
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:34: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=ang+0BcJlV4Mf4uUjb6v1xj6GRd347mjBTrMtjGygyA=; b=j5lkuiw+Z25wK7mLK5BFU402UW
	kb08H0BCiezJXv0Two7tz4EcLz+DrR1cU27DHyygfHAC37lpY2eAz/sw93GfaYljMRhonaYOrgSWR
	ydCnaeTmzQi0xuGHd5n7E6aVKxXPFU7TjTaFo8NN3cvfJX9ql3tIHcUK7VJmDy18/sE4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] x86emul: also clip repetition count for STOS
Message-Id: <E1u9jE6-0008rt-2B@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 11:34:14 +0000

commit a677964cbe8753d9a3f302a12a0cd446ac8c2306
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 12:09:45 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 12:09:45 2025 +0200

    x86emul: also clip repetition count for STOS
    
    Like MOVS, INS, and OUTS, STOS also has a special purpose hook, where
    the hook function may legitimately have the same expectation as to the
    request not straddling address space start/end.
    
    Fixes: 5dfe4aa4eeb6 ("x86_emulate: Do not request emulation of REP instructions beyond the")
    Reported-by: Fabian Specht <f.specht@tum.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 8c5636b6c87777e6c2e4ffae28bffe1cfc189bfd
    master date: 2025-04-22 11:24:20 +0200
---
 xen/arch/x86/x86_emulate/x86_emulate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index af0a308814..ef2598d4ca 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -2217,7 +2217,7 @@ x86_emulate(
 
         dst.bytes = src.bytes;
         dst.mem.seg = x86_seg_es;
-        dst.mem.off = truncate_ea(_regs.r(di));
+        dst.mem.off = truncate_ea_and_reps(_regs.r(di), nr_reps, dst.bytes);
         if ( (nr_reps == 1) || !ops->rep_stos ||
              ((rc = ops->rep_stos(&src.val,
                                   dst.mem.seg, dst.mem.off, dst.bytes,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 11:34:25 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 11:34:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972089.1360509 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9jEH-0003Fm-Rt; Tue, 29 Apr 2025 11:34:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972089.1360509; Tue, 29 Apr 2025 11:34:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9jEH-0003Fd-PC; Tue, 29 Apr 2025 11:34:25 +0000
Received: by outflank-mailman (input) for mailman id 972089;
 Tue, 29 Apr 2025 11:34: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 1u9jEG-0003FU-U5
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 11:34: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 1u9jEG-00CoMU-2u
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:34:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9jEG-0009Mi-2i
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:34: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=MIbMRAgYTyyfX1/NQr5IiNri7hptiCSk9MkaWNbE+xU=; b=dmcHymBsGyfybdKYHUel1SMr6S
	/RGnop1rNtS/Jh+4oQkgHnZtGa3IoAacd0m2lnLttsEAxGv4KuALxdeWQJh2Lbawie3KOgbMm1fw0
	FhdGefnPvza8lOSvHAP1VHqHeXCGn23vRdhzqdECAnQzsLh5PFcwyvdgRccTIe/jtcuc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] compat/memory: avoid UB shifts in XENMEM_exchange handling
Message-Id: <E1u9jEG-0009Mi-2i@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 11:34:24 +0000

commit d980886fd7f1626d42f766fbb0868a2c35813ae7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 12:10:30 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 12:10:30 2025 +0200

    compat/memory: avoid UB shifts in XENMEM_exchange handling
    
    Add an early basic check, yielding the same error code as the more
    thorough one the main handler would produce.
    
    Fixes: b8a7efe8528a ("Enable compatibility mode operation for HYPERVISOR_memory_op")
    Reported-by: Manuel Andreas <manuel.andreas@tum.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 560c51be8f6a88cde43c0a7c8be60158b5725982
    master date: 2025-04-22 11:25:23 +0200
---
 xen/common/compat/memory.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c
index 45e5fb0e5d..e3eb3c01a1 100644
--- a/xen/common/compat/memory.c
+++ b/xen/common/compat/memory.c
@@ -161,6 +161,11 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
             if ( copy_from_guest(&cmp.xchg, arg, 1) )
                 return -EFAULT;
 
+            /* Early coarse check, as max_order() isn't available here. */
+            if ( cmp.xchg.in.extent_order >= 32 ||
+                 cmp.xchg.out.extent_order >= 32 )
+                return -EPERM;
+
             order_delta = cmp.xchg.out.extent_order - cmp.xchg.in.extent_order;
             /* Various sanity checks. */
             if ( (cmp.xchg.nr_exchanged > cmp.xchg.in.nr_extents) ||
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 11:34:35 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 11:34:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972090.1360513 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9jER-0003I8-T3; Tue, 29 Apr 2025 11:34:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972090.1360513; Tue, 29 Apr 2025 11:34:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9jER-0003I0-Qa; Tue, 29 Apr 2025 11:34:35 +0000
Received: by outflank-mailman (input) for mailman id 972090;
 Tue, 29 Apr 2025 11:34:35 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u9jER-0003Hs-2q
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 11:34:35 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9jER-00CoMc-0C
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:34:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9jER-0009np-01
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:34:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=10N/DYwMrv3J4SH+4eR5YBk1gi138x1ed3vhNJTqYgU=; b=jz2OU6tfEWdLS+QXQK8YPqpFGG
	sZ0mkEhl8nmqoXU0jXe1Z3AsZkYYqLZmIrzYVtWRzceoH+OEqREoCK7X+v2xuK8p5/iujWpil8gV3
	5uaEhVeoIdl4JnL3jqZf8udc8J9K0txHeJGUcevPhF2JTuxnOyMtduRX1oEeYt+TYUlc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] x86/intel: workaround several MONITOR/MWAIT errata
Message-Id: <E1u9jER-0009np-01@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 11:34:35 +0000

commit 62513194e13ee19a70086fdf3dbc6540ecea52f7
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Apr 29 12:10:46 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 12:10:46 2025 +0200

    x86/intel: workaround several MONITOR/MWAIT errata
    
    There are several errata on Intel regarding the usage of the MONITOR/MWAIT
    instructions, all having in common that stores to the monitored region
    might not wake up the CPU.
    
    Fix them by forcing the sending of an IPI for the affected models.
    
    The Ice Lake issue has been reproduced internally on XenServer hardware,
    and the fix does seem to prevent it.  The symptom was APs getting stuck in
    the idle loop immediately after bring up, which in turn prevented the BSP
    from making progress.  This would happen before the watchdog was
    initialized, and hence the whole system would get stuck.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 4aae4452efeee3d3bba092b875e37d1e7c8f6db9
    master date: 2025-04-23 16:12:25 +0200
---
 xen/arch/x86/acpi/cpu_idle.c     |  6 ++++++
 xen/arch/x86/cpu/intel.c         | 36 +++++++++++++++++++++++++++++++++++-
 xen/arch/x86/include/asm/mwait.h |  3 +++
 3 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index bf796e4688..040bab60b6 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -453,8 +453,14 @@ void cpuidle_wakeup_mwait(cpumask_t *mask)
     cpumask_andnot(mask, mask, &target);
 }
 
+/* Force sending of a wakeup IPI regardless of mwait usage. */
+bool __ro_after_init force_mwait_ipi_wakeup;
+
 bool arch_skip_send_event_check(unsigned int cpu)
 {
+    if ( force_mwait_ipi_wakeup )
+        return false;
+
     /*
      * This relies on softirq_pending() and mwait_wakeup() to access data
      * on the same cache line.
diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index 31f68cd6bd..076faaa980 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -8,6 +8,7 @@
 #include <asm/intel-family.h>
 #include <asm/processor.h>
 #include <asm/msr.h>
+#include <asm/mwait.h>
 #include <asm/uaccess.h>
 #include <asm/mpspec.h>
 #include <asm/apic.h>
@@ -368,7 +369,6 @@ static void probe_c3_errata(const struct cpuinfo_x86 *c)
         INTEL_FAM6_MODEL(0x25),
         { }
     };
-#undef INTEL_FAM6_MODEL
 
     /* Serialized by the AP bringup code. */
     if ( max_cstate > 1 && (c->apicid & (c->x86_num_siblings - 1)) &&
@@ -380,6 +380,38 @@ static void probe_c3_errata(const struct cpuinfo_x86 *c)
     }
 }
 
+/*
+ * APL30: One use of the MONITOR/MWAIT instruction pair is to allow a logical
+ * processor to wait in a sleep state until a store to the armed address range
+ * occurs. Due to this erratum, stores to the armed address range may not
+ * trigger MWAIT to resume execution.
+ *
+ * ICX143: Under complex microarchitectural conditions, a monitor that is armed
+ * with the MWAIT instruction may not be triggered, leading to a processor
+ * hang.
+ *
+ * LNL030: Problem P-cores may not exit power state Core C6 on monitor hit.
+ *
+ * Force the sending of an IPI in those cases.
+ */
+static void __init probe_mwait_errata(void)
+{
+    static const struct x86_cpu_id __initconst models[] = {
+        INTEL_FAM6_MODEL(INTEL_FAM6_ATOM_GOLDMONT), /* APL30  */
+        INTEL_FAM6_MODEL(INTEL_FAM6_ICELAKE_X),     /* ICX143 */
+        INTEL_FAM6_MODEL(INTEL_FAM6_LUNARLAKE_M),   /* LNL030 */
+        { }
+    };
+#undef INTEL_FAM6_MODEL
+
+    if ( boot_cpu_has(X86_FEATURE_MONITOR) && x86_match_cpu(models) )
+    {
+        printk(XENLOG_WARNING
+               "Forcing IPI MWAIT wakeup due to CPU erratum\n");
+        force_mwait_ipi_wakeup = true;
+    }
+}
+
 /*
  * P4 Xeon errata 037 workaround.
  * Hardware prefetcher may cause stale data to be loaded into the cache.
@@ -406,6 +438,8 @@ static void Intel_errata_workarounds(struct cpuinfo_x86 *c)
 		__set_bit(X86_FEATURE_CLFLUSH_MONITOR, c->x86_capability);
 
 	probe_c3_errata(c);
+	if (system_state < SYS_STATE_smp_boot)
+		probe_mwait_errata();
 }
 
 
diff --git a/xen/arch/x86/include/asm/mwait.h b/xen/arch/x86/include/asm/mwait.h
index f377d9fdca..97bf361505 100644
--- a/xen/arch/x86/include/asm/mwait.h
+++ b/xen/arch/x86/include/asm/mwait.h
@@ -13,6 +13,9 @@
 
 #define MWAIT_ECX_INTERRUPT_BREAK	0x1
 
+/* Force sending of a wakeup IPI regardless of mwait usage. */
+extern bool force_mwait_ipi_wakeup;
+
 void mwait_idle_with_hints(unsigned int eax, unsigned int ecx);
 bool mwait_pc10_supported(void);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 11:34:45 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 11:34:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972091.1360516 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9jEb-0003Kq-UU; Tue, 29 Apr 2025 11:34:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972091.1360516; Tue, 29 Apr 2025 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 1u9jEb-0003Ki-Rz; Tue, 29 Apr 2025 11:34:45 +0000
Received: by outflank-mailman (input) for mailman id 972091;
 Tue, 29 Apr 2025 11:34:45 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u9jEb-0003Kc-5j
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 11:34:45 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9jEb-00CoMz-0T
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:34:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9jEb-000A5w-0N
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 11:34:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=33hfFiOGbtApn/Mi2uOTJa4rPSXHHFoyM6GYXxRZ63k=; b=OUciwrOY+tqpZkh7lmS2es3MN/
	N0jfAw35vfdCWrPF0JAN2Hto1QYCSUClueZwmvTtEAZv3E1853T14lXsYtwxFYz+pTX4osqx+Llvq
	AqCcRiH/CjVTAbwHWjwxbvjEejrRszvUExgcLV9NRzust7ynD96fB5IrPeBpBlCGsasw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] xen: remove -N from the linker command line
Message-Id: <E1u9jEb-000A5w-0N@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 11:34:45 +0000

commit a9754615cb1e615d92efc40d2f725553236bcf5e
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Apr 29 12:11:06 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 12:11:06 2025 +0200

    xen: remove -N from the linker command line
    
    It's unclear why -N is being used in the first place.  It was added by
    commit 4676bbf96dc8 back in 2002 without any justification.
    
    When building a PE image it's actually detrimental to forcefully set the
    .text section as writable.  The GNU LD man page contains the following
    warning regarding the -N option:
    
    > Note: Although a writable text section is allowed for PE-COFF targets, it
    > does not conform to the format specification published by Microsoft.
    
    Remove the usage of -N uniformly on all architectures, assuming that the
    addition was simply done as a copy and paste of the original x86 linking
    rune.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: d444763f8ca556d0a67a4b933be303d346baef02
    master date: 2025-04-23 16:12:25 +0200
---
 xen/arch/arm/Makefile   |  6 +++---
 xen/arch/ppc/Makefile   |  6 +++---
 xen/arch/riscv/Makefile |  2 +-
 xen/arch/x86/Makefile   | 12 ++++++------
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 7bf07e9920..7c1d82c294 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -92,19 +92,19 @@ ifeq ($(CONFIG_ARM_64),y)
 endif
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
 	    $(dot-target).0.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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).1.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
diff --git a/xen/arch/ppc/Makefile b/xen/arch/ppc/Makefile
index 71feb5e2c4..b9d61a7856 100644
--- a/xen/arch/ppc/Makefile
+++ b/xen/arch/ppc/Makefile
@@ -11,19 +11,19 @@ $(TARGET): $(TARGET)-syms
 	cp -f $< $@
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
 	    $(dot-target).0.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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).1.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index 2fefe14e7c..c8f1896b2b 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -10,7 +10,7 @@ $(TARGET): $(TARGET)-syms
 	$(OBJCOPY) -O binary -S $< $@
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) -o $@
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) -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 85b3f85608..e8a4bf59c3 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -138,19 +138,19 @@ $(TARGET): $(TARGET)-syms $(efi-y) $(obj)/boot/mkelf32
 CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).0.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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(orphan-handling-y) $(dot-target).1.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
@@ -211,7 +211,7 @@ ifeq ($(CONFIG_DEBUG_INFO),y)
 	$(if $(filter --strip-debug,$(EFI_LDFLAGS)),echo,:) "Will strip debug info from $(@F)"
 endif
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
-	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds -N $< $(relocs-dummy) \
+	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< $(relocs-dummy) \
 	                $(objtree)/common/symbols-dummy.o $(note_file_option) \
 	                -o $(dot-target).$(base).0 &&) :
 	$(MKRELOC) $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(dot-target).$(base).0) \
@@ -221,7 +221,7 @@ endif
 		> $(dot-target).0s.S
 	$(MAKE) $(build)=$(@D) .$(@F).0r.o .$(@F).0s.o
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
-	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds -N $< \
+	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< \
 	                $(dot-target).0r.o $(dot-target).0s.o $(note_file_option) \
 	                -o $(dot-target).$(base).1 &&) :
 	$(MKRELOC) $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(dot-target).$(base).1) \
@@ -230,7 +230,7 @@ endif
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(dot-target).1s.S
 	$(MAKE) $(build)=$(@D) .$(@F).1r.o .$(@F).1s.o
-	$(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds -N $< \
+	$(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds $< \
 	      $(dot-target).1r.o $(dot-target).1s.o $(orphan-handling-y) \
 	      $(note_file_option) -o $@
 	$(NM) -pa --format=sysv $@ \
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 13:22:08 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 13:22:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972612.1360891 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9kuQ-0002eG-Jg; Tue, 29 Apr 2025 13:22:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972612.1360891; Tue, 29 Apr 2025 13:22:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9kuQ-0002e8-H4; Tue, 29 Apr 2025 13:22:02 +0000
Received: by outflank-mailman (input) for mailman id 972612;
 Tue, 29 Apr 2025 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 1u9kuP-0002cL-Vw
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 13:22:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9kuP-00Crjb-2t
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 13:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9kuP-0023qU-2j
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 13:22:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=T92RpiLAz2Z4aCLenCEA2x2DH7pynrIotI2igifhUZ8=; b=tUH0ejFbwbNQKHO7V07cs/cptW
	8HTsFIOUlg1VqbyQi88BvZo8Y6l4X35pUSwau5N1QGrr+SgQrmAbIbIfhYGD45BNm1y562NArYR98
	JjpWoFcckSKwY0/kSIRTTvr3pHUgUhQtx/TmX/rRXgL0EoDKWJK8ola9ilRDDXJhkVgY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] update Xen version to 4.19.3-pre
Message-Id: <E1u9kuP-0023qU-2j@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 13:22:01 +0000

commit 7d827892389459a8665d3486f3e90e74d17c134e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 11:51:42 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:51:42 2025 +0200

    update Xen version to 4.19.3-pre
---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Makefile b/xen/Makefile
index 26907392bb..a346568743 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -6,7 +6,7 @@ this-makefile := $(call lastword,$(MAKEFILE_LIST))
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 19
-export XEN_EXTRAVERSION ?= .2$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .3-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 13:22:12 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 13:22:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972613.1360895 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9kua-0002kQ-L3; Tue, 29 Apr 2025 13:22:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972613.1360895; Tue, 29 Apr 2025 13: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 1u9kua-0002kI-IX; Tue, 29 Apr 2025 13:22:12 +0000
Received: by outflank-mailman (input) for mailman id 972613;
 Tue, 29 Apr 2025 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 1u9kua-0002k8-16
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 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 1u9kua-00Crjh-00
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 13:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9kuZ-0023xE-35
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 13: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=nEkSa4l/iXCFwdU1VZaxBZzSxWAa1hpAKvA8n1JyoPI=; b=I4/+DYUa+MxSngP+XBp7Cmir6D
	W0dDf65i430/438aiHk2Q6FBtpt41tKJXGhxlNmERkqgGThJebzyXKPintoHSDO7K77ifC8KCipmG
	sZd9/YzjgAT7/Lb40wOF1TvcVBi5GB2b99MvMr/ZOUX3YjT0vN9ymlXxe//qzHawyTjk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/MTRR: hook mtrr_bp_restore() back up
Message-Id: <E1u9kuZ-0023xE-35@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 13:22:11 +0000

commit ae562bee695b84240f35739374a013a1520b93e5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 11:52:22 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:52:22 2025 +0200

    x86/MTRR: hook mtrr_bp_restore() back up
    
    Unlike stated in the offending commit's description,
    load_system_tables() wasn't the only thing left to retain from the
    earlier restore_rest_processor_state(). Note that MTRR state was still
    reloaded via mtrr_aps_sync_end(), but that happens quite a bit later in
    the resume process.
    
    While there also do Misra-related tidying for the function itself: The
    function being used from assembly only means it doesn't need to have a
    declaration, but wants to be asmlinkage.
    
    Fixes: 4304ff420e51 ("x86/S3: Drop {save,restore}_rest_processor_state() completely")
    Reported-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>
    master commit: 0414dedd6fde1a1c5c5e38dcbef4dad506e1398c
    master date: 2025-04-03 09:39:13 +0200
---
 xen/arch/x86/acpi/wakeup_prot.S | 2 ++
 xen/arch/x86/cpu/mtrr/main.c    | 2 +-
 xen/arch/x86/include/asm/mtrr.h | 1 -
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/acpi/wakeup_prot.S b/xen/arch/x86/acpi/wakeup_prot.S
index 3855ff1ddb..66f7993399 100644
--- a/xen/arch/x86/acpi/wakeup_prot.S
+++ b/xen/arch/x86/acpi/wakeup_prot.S
@@ -124,6 +124,8 @@ ENTRY(s3_resume)
         mov     STACK_CPUINFO_FIELD(cr4)(%rbx), %rax
         mov     %rax, %cr4
 
+        call    mtrr_bp_restore
+
 .Lsuspend_err:
         pop     %r15
         pop     %r14
diff --git a/xen/arch/x86/cpu/mtrr/main.c b/xen/arch/x86/cpu/mtrr/main.c
index 0a44ebbcb0..516c8478c6 100644
--- a/xen/arch/x86/cpu/mtrr/main.c
+++ b/xen/arch/x86/cpu/mtrr/main.c
@@ -609,7 +609,7 @@ void mtrr_aps_sync_end(void)
 	hold_mtrr_updates_on_aps = 0;
 }
 
-void mtrr_bp_restore(void)
+void asmlinkage mtrr_bp_restore(void)
 {
 	mtrr_set_all();
 }
diff --git a/xen/arch/x86/include/asm/mtrr.h b/xen/arch/x86/include/asm/mtrr.h
index 36dac0a775..48b59d2620 100644
--- a/xen/arch/x86/include/asm/mtrr.h
+++ b/xen/arch/x86/include/asm/mtrr.h
@@ -66,7 +66,6 @@ extern uint8_t pat_type_2_pte_flags(uint8_t pat_type);
 extern int hold_mtrr_updates_on_aps;
 extern void mtrr_aps_sync_begin(void);
 extern void mtrr_aps_sync_end(void);
-extern void mtrr_bp_restore(void);
 
 extern bool mtrr_var_range_msr_set(struct domain *d, struct mtrr_state *m,
                                    uint32_t msr, uint64_t msr_content);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 13:22:22 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 13:22:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972614.1360898 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9kuk-0002rP-MO; Tue, 29 Apr 2025 13:22:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972614.1360898; Tue, 29 Apr 2025 13: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 1u9kuk-0002rI-Ju; Tue, 29 Apr 2025 13:22:22 +0000
Received: by outflank-mailman (input) for mailman id 972614;
 Tue, 29 Apr 2025 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 1u9kuk-0002pi-4Y
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 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 1u9kuk-00Crjl-0J
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 13:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9kuk-0024Bu-0B
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 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=ipNNVOwb+/xwUUy63Rr+0ubYqwOlhevQgXLQ2rRHIEs=; b=qZo0dPqmPo7Zgjfd3QMNmLRmrz
	xB2PsDaAJ9UziyLR0sv1beJ7wqz2buRxhjJL7+GAZe3X6ii3kEep83WD9612LoBFawhwAVAwy3G4y
	Q7QGt1OyzFWxVNVoKm9ZBY21HVlYrIhbroiNjv43FDwhHhaM1JL3N0M5uZNBOncq9MqM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] sched/null: avoid another crash after failed domU creation
Message-Id: <E1u9kuk-0024Bu-0B@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 13:22:22 +0000

commit f6b37861bcc4e6ce51d366268861c4590e6951e3
Author:     Stewart Hildebrand <stewart.hildebrand@amd.com>
AuthorDate: Tue Apr 29 11:53:16 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:53:16 2025 +0200

    sched/null: avoid another crash after failed domU creation
    
    The following sequence of events may lead a debug build of Xen to crash
    when using the null scheduler:
    
    1. domain creation (e.g. d1) failed due to bad configuration
    2. complete_domain_destroy() was deferred
    3. domain creation (e.g. d2) succeeds
    
    At this point, d2 is running, while the zombie d1 is not fully cleaned
    up:
    
    (XEN) Online Cpus: 0-3
    (XEN) Cpupool 0:
    (XEN) Cpus: 0-3
    (XEN) Scheduling granularity: cpu, 1 CPU per sched-resource
    (XEN) Scheduler: null Scheduler (null)
    (XEN)   cpus_free = 3
    (XEN) Domain info:
    (XEN)   Domain: 0
    (XEN)     1: [0.0] pcpu=0
    (XEN)     2: [0.1] pcpu=1
    (XEN)   Domain: 1
    (XEN)     3: [1.0] pcpu=2
    (XEN)   Domain: 2
    (XEN)     4: [2.0] pcpu=2
    
    4. complete_domain_destroy() gets called for d1 and triggers the
    following:
    
    (XEN) Xen call trace:
    (XEN)    [<00000a0000322ed4>] null.c#unit_deassign+0x2d8/0xb70 (PC)
    (XEN)    [<00000a000032457c>] null.c#null_unit_remove+0x670/0xba8 (LR)
    (XEN)    [<00000a000032457c>] null.c#null_unit_remove+0x670/0xba8
    (XEN)    [<00000a0000336404>] sched_destroy_vcpu+0x354/0x8fc
    (XEN)    [<00000a0000227324>] domain.c#complete_domain_destroy+0x11c/0x49c
    (XEN)    [<00000a000029fbd0>] rcupdate.c#rcu_do_batch+0x94/0x3d0
    (XEN)    [<00000a00002a10c0>] rcupdate.c#__rcu_process_callbacks+0x160/0x5f4
    (XEN)    [<00000a00002a1e60>] rcupdate.c#rcu_process_callbacks+0xcc/0x1b0
    (XEN)    [<00000a00002a3460>] softirq.c#__do_softirq+0x1f4/0x3d8
    (XEN)    [<00000a00002a37c4>] do_softirq+0x14/0x1c
    (XEN)    [<00000a0000465260>] traps.c#check_for_pcpu_work+0x30/0xb8
    (XEN)    [<00000a000046bb08>] leave_hypervisor_to_guest+0x28/0x198
    (XEN)    [<00000a0000409c84>] entry.o#guest_sync_slowpath+0xac/0xd8
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 0:
    (XEN) Assertion 'npc->unit == unit' failed at common/sched/null.c:383
    (XEN) ****************************************
    
    Fix by skipping unit_deassign() when the unit to be removed does not
    match the pcpu's currently assigned unit.
    
    Fixes: c2eae2614c8f ("sched/null: avoid crash after failed domU creation")
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    master commit: 54fe207f29f86c4226a62a4dd289f10d9d2abc40
    master date: 2025-04-07 12:17:31 +0200
---
 xen/common/sched/null.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/sched/null.c b/xen/common/sched/null.c
index 7e31440e5b..c8e327e3cd 100644
--- a/xen/common/sched/null.c
+++ b/xen/common/sched/null.c
@@ -557,7 +557,7 @@ static void cf_check null_unit_remove(
 
     cpu = sched_unit_master(unit);
     npc = get_sched_res(cpu)->sched_priv;
-    if ( npc->unit )
+    if ( npc->unit == unit )
         unit_deassign(prv, unit);
 
  out:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 13:22:32 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 13:22:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972615.1360903 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9kuu-0002x8-O2; Tue, 29 Apr 2025 13:22:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972615.1360903; Tue, 29 Apr 2025 13: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 1u9kuu-0002x0-LY; Tue, 29 Apr 2025 13:22:32 +0000
Received: by outflank-mailman (input) for mailman id 972615;
 Tue, 29 Apr 2025 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 1u9kuu-0002wq-6v
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 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 1u9kuu-00Crjr-0b
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 13:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9kuu-0024GF-0T
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 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=AB55KaS96tBlGMGxlsGzCwKzVbvYvwutGJCFlBAXs1g=; b=rgM3bIaXlsmMbRGGHWmMy0Mgth
	QHg6iGg1V0F0qGKVMWb4SRkJqcFBrmMH/jLTfcBermUq4YGLpn37vZOm7bI/Q7Wt3OUZhwsTIFPzA
	u5nAYwJVia4liqe46IF8HS4eFqju0pmRVfOzexbURh74Zu0BLVqJENARjByi8wn8j63s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] xen: vm_event: do not do vm_event_op for an invalid domain
Message-Id: <E1u9kuu-0024GF-0T@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 13:22:32 +0000

commit 3721c345b9637ef564932539689e99338c8b2187
Author:     Volodymyr Babchuk <volodymyr_babchuk@epam.com>
AuthorDate: Tue Apr 29 11:53:56 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:53:56 2025 +0200

    xen: vm_event: do not do vm_event_op for an invalid domain
    
    A privileged domain can issue XEN_DOMCTL_vm_event_op with
    op->domain == DOMID_INVALID. In this case vm_event_domctl()
    function will get NULL as the first parameter and this will
    cause hypervisor panic, as it tries to derefer this pointer.
    
    Fix the issue by checking if valid domain is passed in.
    
    Fixes: 48b84249459f ("xen/vm-event: Drop unused u_domctl parameter from vm_event_domctl()")
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
    master commit: 6a884750f3b86a45ee5ffbd825c346fcbce86080
    master date: 2025-04-08 09:36:38 +0200
---
 xen/common/vm_event.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/common/vm_event.c b/xen/common/vm_event.c
index fbf1aa0848..1666ff615f 100644
--- a/xen/common/vm_event.c
+++ b/xen/common/vm_event.c
@@ -600,6 +600,10 @@ int vm_event_domctl(struct domain *d, struct xen_domctl_vm_event_op *vec)
         return 0;
     }
 
+    /* All other subops need to target a real domain. */
+    if ( unlikely(d == NULL) )
+        return -ESRCH;
+
     rc = xsm_vm_event_control(XSM_PRIV, d, vec->mode, vec->op);
     if ( rc )
         return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 13:22:42 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 13:22:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972616.1360907 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9kv4-0002ze-PZ; Tue, 29 Apr 2025 13:22:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972616.1360907; Tue, 29 Apr 2025 13: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 1u9kv4-0002zX-Mx; Tue, 29 Apr 2025 13:22:42 +0000
Received: by outflank-mailman (input) for mailman id 972616;
 Tue, 29 Apr 2025 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 1u9kv4-0002zN-9h
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 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 1u9kv4-00CrkE-0s
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 13:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9kv4-0024JJ-0m
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 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=VvzPYKuMJfyrfYukcrT6cKsSJTxg2ZC78fcR/fVO8WM=; b=gohbtQoiZLArB4q1cRAe3JA2jB
	yYnTJ5lErN9fIJ/F/lHfYBdVuIv/7+A8l+sROMwRybYR526JfnvCwzNA3kBOyRAU90C5V5/Hg7p+t
	x0PTTK16oFHXw+EN75uO2dxdXyJV6/vQOQ8m+1iU0GXUxtwkysY5ApwpeCfi6h8F/LfI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/cpu: Validate CPUID leaf 0x2 EDX output
Message-Id: <E1u9kv4-0024JJ-0m@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 13:22:42 +0000

commit 7abb2300fd43294fe827eec4c680bf6dce0bd1f4
Author:     Ahmed S. Darwish <darwi@linutronix.de>
AuthorDate: Tue Apr 29 11:54:35 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:54:35 2025 +0200

    x86/cpu: Validate CPUID leaf 0x2 EDX output
    
    CPUID leaf 0x2 emits one-byte descriptors in its four output registers
    EAX, EBX, ECX, and EDX.  For these descriptors to be valid, the most
    significant bit (MSB) of each register must be clear.
    
    Leaf 0x2 parsing at intel.c only validated the MSBs of EAX, EBX, and
    ECX, but left EDX unchecked.
    
    Validate EDX's most-significant bit as well.
    
    Fixes: 1aa6feb63bfd ("Port CPU setup code from Linux 2.6")
    Signed-off-by: Ahmed S. Darwish <darwi@linutronix.de>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Link: https://lore.kernel.org/r/20250304085152.51092-3-darwi@linutronix.de
    
    Use ARRAY_SIZE() though.
    
    Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 1881148215c6
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: a47b44a8f0a58a6015faf6465921cd203f0b51d1
    master date: 2025-04-08 09:37:38 +0200
---
 xen/arch/x86/cpu/intel_cacheinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/intel_cacheinfo.c b/xen/arch/x86/cpu/intel_cacheinfo.c
index 9cfb759be0..e88faa7545 100644
--- a/xen/arch/x86/cpu/intel_cacheinfo.c
+++ b/xen/arch/x86/cpu/intel_cacheinfo.c
@@ -186,7 +186,7 @@ void init_intel_cacheinfo(struct cpuinfo_x86 *c)
 			cpuid(2, &regs[0], &regs[1], &regs[2], &regs[3]);
 
 			/* If bit 31 is set, this is an unknown format */
-			for ( j = 0 ; j < 3 ; j++ ) {
+			for ( j = 0; j < ARRAY_SIZE(regs); j++ ) {
 				if ( regs[j] >> 31 )
 					regs[j] = 0;
 			}
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 13:22:54 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 13:22:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972618.1360921 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9kvG-0003Fy-1W; Tue, 29 Apr 2025 13:22:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972618.1360921; Tue, 29 Apr 2025 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 1u9kvF-0003Fq-V7; Tue, 29 Apr 2025 13:22:53 +0000
Received: by outflank-mailman (input) for mailman id 972618;
 Tue, 29 Apr 2025 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 1u9kvE-0003FR-Cf
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 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 1u9kvE-00CrkM-1A
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 13:22:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9kvE-0024Qn-13
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 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=xUISNBkY1TtB2ktPH46vloTpmW11jugJjAXGqbQW8BM=; b=CexdPjAjxFoc43ycocMb7XhqQp
	MG+l1n91cHa/EFHQ8XZOgZw4MsJcPqODGNdazJmT/iG1v45vbiQVM5Tseffc/iDYCqdMHjsErLCFB
	VpgTf8kvA8bDoDUBuyrvmv2r4dfuNnqsX7QnFxT3HzgKRoStYBfMtB84vMk2YwTi6qqI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] xen: x86: irq: initialize irq desc in create_irq()
Message-Id: <E1u9kvE-0024Qn-13@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 13:22:52 +0000

commit 3450fe0dd9b57364f305dcf90176ab31a3dbc0bb
Author:     Volodymyr Babchuk <volodymyr_babchuk@epam.com>
AuthorDate: Tue Apr 29 11:54:59 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:54:59 2025 +0200

    xen: x86: irq: initialize irq desc in create_irq()
    
    While building xen with GCC 14.2.1 with "-fcondition-coverage" option
    or with "-Og", the compiler produces a false positive warning:
    
      arch/x86/irq.c: In function ‘create_irq’:
      arch/x86/irq.c:281:11: error: ‘desc’ may be used uninitialized [-Werror=maybe-uninitialized]
        281 |     ret = init_one_irq_desc(desc);
            |           ^~~~~~~~~~~~~~~~~~~~~~~
      arch/x86/irq.c:269:22: note: ‘desc’ was declared here
        269 |     struct irq_desc *desc;
            |                      ^~~~
      cc1: all warnings being treated as errors
      make[2]: *** [Rules.mk:252: arch/x86/irq.o] Error 1
    
    While we have signed/unsigned comparison both in "for" loop and in
    "if" statement, this still can't lead to use of uninitialized "desc",
    as either loop will be executed at least once, or the function will
    return early. So this is a clearly false positive warning due to a
    bug [1] in GCC.
    
    Initialize "desc" with NULL to make GCC happy.
    
    [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119665
    
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 7a4484d90b3003171f1700e424ad45b931200ba6
    master date: 2025-04-08 09:40:39 +0200
---
 xen/arch/x86/irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 0001e93ba8..ce390b0422 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -261,7 +261,7 @@ void __init clear_irq_vector(int irq)
 int create_irq(nodeid_t node, bool grant_access)
 {
     int irq, ret;
-    struct irq_desc *desc;
+    struct irq_desc *desc = NULL ; /* gcc14 -Og or -fcondition-coverage */
 
     for (irq = nr_irqs_gsi; irq < nr_irqs; irq++)
     {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 13:23:04 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 13:23:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972620.1360925 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9kvQ-0003M2-3B; Tue, 29 Apr 2025 13:23:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972620.1360925; Tue, 29 Apr 2025 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 1u9kvQ-0003Lp-0K; Tue, 29 Apr 2025 13:23:04 +0000
Received: by outflank-mailman (input) for mailman id 972620;
 Tue, 29 Apr 2025 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 1u9kvO-0003Kh-Fc
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 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 1u9kvO-00Crke-1Q
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 13:23:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9kvO-0024VU-1K
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 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=gJNoXLbyEVZW3dhJD2tNXmierUWWDLPh1iTJML8Y+xE=; b=uls+3cxfedg2XHlggC1j5Ml22Z
	G+hAT9x2bZr0sngeyJu7qmrgUmJc7c8yCzUtUOz+tLNE9RFl4kHUmrKqwvZqdx56uPKHR1tYwSgXC
	7FoJ1fYNA2tv0v20w152iZ9RPCck3sQ7hICqjUYv9OJoR0qYvfIgso/iQKdiUl4W0Hvg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] include: sort $(wildcard ...) results
Message-Id: <E1u9kvO-0024VU-1K@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 13:23:02 +0000

commit 593c4377789c239ebce1f2c79164367d70f3b278
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 11:55:16 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:55:16 2025 +0200

    include: sort $(wildcard ...) results
    
    The order of items is stored in .*.chk.cmd, and hence variations between
    how items are ordered would result in re-invocation of the checking rule
    during "make install-xen" despite that already having successfully run
    earlier on. The difference can become noticable when building (as non-
    root) and installing (as root) use different GNU make versions: In 3.82
    the sorting was deliberately undone, just for it to be restored in 4.3.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: ff835bbc8096a14ed1bffa235e25848c993f7240
    master date: 2025-04-10 10:56:29 +0200
---
 xen/include/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/include/Makefile b/xen/include/Makefile
index 2e61b50139..33f069f417 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -41,8 +41,8 @@ cppflags-$(CONFIG_X86)    += -m32
 
 endif
 
-public-$(CONFIG_X86) := $(wildcard $(srcdir)/public/arch-x86/*.h $(srcdir)/public/arch-x86/*/*.h)
-public-$(CONFIG_ARM) := $(wildcard $(srcdir)/public/arch-arm/*.h $(srcdir)/public/arch-arm/*/*.h)
+public-$(CONFIG_X86) := $(sort $(wildcard $(srcdir)/public/arch-x86/*.h $(srcdir)/public/arch-x86/*/*.h))
+public-$(CONFIG_ARM) := $(sort $(wildcard $(srcdir)/public/arch-arm/*.h $(srcdir)/public/arch-arm/*/*.h))
 
 .PHONY: all
 all: $(addprefix $(obj)/,$(headers-y) $(headers-n))
@@ -130,7 +130,7 @@ all: $(obj)/headers.chk $(obj)/headers99.chk $(obj)/headers++.chk
 
 public-hdrs-path := $(srcdir)/public
 
-public-list-headers = $(wildcard $1/*.h $1/*/*.h)
+public-list-headers = $(sort $(wildcard $1/*.h $1/*/*.h))
 public-filter-headers = $(filter-out $(addprefix $(public-hdrs-path)/, $($1-filter)), $($1))
 
 public-headers := $(call public-list-headers, $(public-hdrs-path)) $(public-y)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 13:23:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 13:23:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972623.1360928 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9kva-0003UK-4F; Tue, 29 Apr 2025 13:23:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972623.1360928; Tue, 29 Apr 2025 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 1u9kva-0003UC-1d; Tue, 29 Apr 2025 13:23:14 +0000
Received: by outflank-mailman (input) for mailman id 972623;
 Tue, 29 Apr 2025 13: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 1u9kvY-0003RN-Hu
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 13: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 1u9kvY-00Crkl-1h
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 13:23:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9kvY-0024ZI-1b
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 13: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=fepUOiHPAmyY/783w7I5T2q9zHMPbXqoWim9+p7xA7k=; b=mn562YKBrgutP240Dcja13Jdw9
	xXY5BODbFTEcWPAvFj7tBM7ARsyaz9N1jk0XS+vvx3g4q+fFNwBFMbXffvQ1rNmPp9I4xi3CA+sza
	YZ0VK4fbiUuOvwf3Xfm1b61+bXztg4fCpUjFsb2Fie2A59yXJoBjUXI6mxFPbzIHV2+I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] xen/rangeset: fix incorrect subtraction
Message-Id: <E1u9kvY-0024ZI-1b@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 13:23:12 +0000

commit c7e5683085466b378347f9fa68010c7778cc8e4d
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Apr 29 11:55:34 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:55:34 2025 +0200

    xen/rangeset: fix incorrect subtraction
    
    Given the following rangset operation:
    
    { [0, 1], [4, 5] } - { [3, 4] }
    
    The current rangeset logic will output a rangeset:
    
    { [0, 2], [5, 5] }
    
    This is incorrect, and also has the undesirable property of being bogus in
    a way that the resulting rangeset is expanded.
    
    Fix this by making sure the bounds are correctly checked before modifying
    the previous range.
    
    Fixes: 484a058c4828 ('Add auto-destructing per-domain rangeset data structure...')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: e118fc98e7ae652a188d227bd7ea22f132724150
    master date: 2025-04-11 12:20:10 +0200
---
 xen/common/rangeset.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/common/rangeset.c b/xen/common/rangeset.c
index b75590f907..e758710390 100644
--- a/xen/common/rangeset.c
+++ b/xen/common/rangeset.c
@@ -227,7 +227,8 @@ int rangeset_remove_range(
 
         if ( x->s < s )
         {
-            x->e = s - 1;
+            if ( x->e >= s )
+                x->e = s - 1;
             x = next_range(r, x);
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 13:23:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 13:23:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972628.1360933 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9kvk-0003ac-7H; Tue, 29 Apr 2025 13:23:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972628.1360933; Tue, 29 Apr 2025 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 1u9kvk-0003aU-4c; Tue, 29 Apr 2025 13:23:24 +0000
Received: by outflank-mailman (input) for mailman id 972628;
 Tue, 29 Apr 2025 13: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 1u9kvi-0003aD-Km
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 13: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 1u9kvi-00Crkr-1z
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 13:23:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9kvi-0024e1-1s
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 13: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=OH6VYASC0azyxblNWDQ5MshA5RHheAr5NMxR3fts2IM=; b=jM5lO3LIiSp+4f9aYgu2CKoXJI
	wiIiSoIXu9FjMKJnVwWj3mYiXHNDLpNp/q2Hay0KzwpCmdaTuF9J9rfcywESqAbHm6WgvbFIZPbFL
	zCCFsRK1yCIisbEB0Z5tmqI+GVB4KTMFiGpbYnqEw3XRzJywPPRPR9aEeW8WeJOTv7t4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/HVM: update repeat count upon nested lin->phys failure
Message-Id: <E1u9kvi-0024e1-1s@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 13:23:22 +0000

commit 7ffef37f55317ffcd01840a2302dfe1c02e0c064
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 11:56:25 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:56:25 2025 +0200

    x86/HVM: update repeat count upon nested lin->phys failure
    
    For the X86EMUL_EXCEPTION case the repeat count must be correctly
    propagated back. Since for the recursive invocation we use a local
    helper variable, its value needs copying to the caller's one.
    
    While there also correct the off-by-1 range in the comment ahead of the
    function (strictly speaking for the "DF set" case we'd need to put
    another, different range there as well).
    
    Fixes: 53f87c03b4ea ("x86emul: generalize exception handling for rep_* hooks")
    Reported-by: Manuel Andreas <manuel.andreas@tum.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: c07b16fd6e47782ebf1ee767cd07c1e2b4140f47
    master date: 2025-04-17 10:01:19 +0200
---
 xen/arch/x86/hvm/emulate.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index f4b9352c39..03e40ab9ff 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -826,7 +826,7 @@ static void hvmemul_unmap_linear_addr(
 
 /*
  * Convert addr from linear to physical form, valid over the range
- * [addr, addr + *reps * bytes_per_rep]. *reps is adjusted according to
+ * [addr, addr + *reps * bytes_per_rep). *reps is adjusted according to
  * the valid computed range. It is always >0 when X86EMUL_OKAY is returned.
  * @pfec indicates the access checks to be performed during page-table walks.
  */
@@ -866,7 +866,10 @@ static int hvmemul_linear_to_phys(
         int rc = hvmemul_linear_to_phys(
             addr, &_paddr, bytes_per_rep, &one_rep, pfec, hvmemul_ctxt);
         if ( rc != X86EMUL_OKAY )
+        {
+            *reps = one_rep;
             return rc;
+        }
         pfn = _paddr >> PAGE_SHIFT;
     }
     else if ( (pfn = paging_gva_to_gfn(curr, addr, &pfec)) == gfn_x(INVALID_GFN) )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 13:23:34 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 13:23:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972631.1360937 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9kvu-0003ej-8X; Tue, 29 Apr 2025 13:23:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972631.1360937; Tue, 29 Apr 2025 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 1u9kvu-0003eb-5x; Tue, 29 Apr 2025 13:23:34 +0000
Received: by outflank-mailman (input) for mailman id 972631;
 Tue, 29 Apr 2025 13: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 1u9kvs-0003eR-No
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 13: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 1u9kvs-00Crkv-2I
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 13:23:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9kvs-0024lE-2C
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 13: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=oL8FX+PWnzgG84+YnXgdN+qxVu8eUP5tnfQuIPODgGI=; b=vFyxXC+UXSQeAzUxe7xwuroxQa
	sEpUHwnVzcHoHAjwON16EZk6If23aU20W1o8srkguygZJFrXgvLxFsCCLtk8GbDA2OQnmd/RO44mL
	cdmrZ8xgdpIJaboSztu44UXCtmtoPhYZjLbRa33Ia+E7xN7WC4Mgu3vXssySWDg3ULXE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86emul: also clip repetition count for STOS
Message-Id: <E1u9kvs-0024lE-2C@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 13:23:32 +0000

commit 9466bb1dc863485aee14808f787c95daa926490b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 11:56:44 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:56:44 2025 +0200

    x86emul: also clip repetition count for STOS
    
    Like MOVS, INS, and OUTS, STOS also has a special purpose hook, where
    the hook function may legitimately have the same expectation as to the
    request not straddling address space start/end.
    
    Fixes: 5dfe4aa4eeb6 ("x86_emulate: Do not request emulation of REP instructions beyond the")
    Reported-by: Fabian Specht <f.specht@tum.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 8c5636b6c87777e6c2e4ffae28bffe1cfc189bfd
    master date: 2025-04-22 11:24:20 +0200
---
 xen/arch/x86/x86_emulate/x86_emulate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 3d837f7e9e..b1d192cbbf 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -2217,7 +2217,7 @@ x86_emulate(
 
         dst.bytes = src.bytes;
         dst.mem.seg = x86_seg_es;
-        dst.mem.off = truncate_ea(_regs.r(di));
+        dst.mem.off = truncate_ea_and_reps(_regs.r(di), nr_reps, dst.bytes);
         if ( (nr_reps == 1) || !ops->rep_stos ||
              ((rc = ops->rep_stos(&src.val,
                                   dst.mem.seg, dst.mem.off, dst.bytes,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 13:23:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 13:23:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972632.1360941 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9kw4-0003hO-9z; Tue, 29 Apr 2025 13:23:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972632.1360941; Tue, 29 Apr 2025 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 1u9kw4-0003hG-7J; Tue, 29 Apr 2025 13:23:44 +0000
Received: by outflank-mailman (input) for mailman id 972632;
 Tue, 29 Apr 2025 13:23: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 1u9kw2-0003h1-QP
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 13:23: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 1u9kw2-00CrlL-2Y
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 13:23:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9kw2-0024mz-2S
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 13: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=boWs6gmAgopPJ8+GwH/cF8sXuZttWvSHm4bfC/yn4dc=; b=PXREt+I8CzKzGkrOJDPuuiXc5z
	WhZAdYDlqwzKSL3rSy4z7mJtlij5SHJwK7xh94hbftUybVrcPrNaYsVuNANYYI79Ht8doyLpUqCeu
	J+V0U7r+FiTcysh5O6vB0HyFesSGXHzGdd1/cVJrB+LhgoBWydu4r4IzACdCF8wC+3xU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] compat/memory: avoid UB shifts in XENMEM_exchange handling
Message-Id: <E1u9kw2-0024mz-2S@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 13:23:42 +0000

commit e2adda16e010d23b9b790f0be4de9c6e6c2793f1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 29 11:57:07 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:57:07 2025 +0200

    compat/memory: avoid UB shifts in XENMEM_exchange handling
    
    Add an early basic check, yielding the same error code as the more
    thorough one the main handler would produce.
    
    Fixes: b8a7efe8528a ("Enable compatibility mode operation for HYPERVISOR_memory_op")
    Reported-by: Manuel Andreas <manuel.andreas@tum.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 560c51be8f6a88cde43c0a7c8be60158b5725982
    master date: 2025-04-22 11:25:23 +0200
---
 xen/common/compat/memory.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c
index 45e5fb0e5d..e3eb3c01a1 100644
--- a/xen/common/compat/memory.c
+++ b/xen/common/compat/memory.c
@@ -161,6 +161,11 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
             if ( copy_from_guest(&cmp.xchg, arg, 1) )
                 return -EFAULT;
 
+            /* Early coarse check, as max_order() isn't available here. */
+            if ( cmp.xchg.in.extent_order >= 32 ||
+                 cmp.xchg.out.extent_order >= 32 )
+                return -EPERM;
+
             order_delta = cmp.xchg.out.extent_order - cmp.xchg.in.extent_order;
             /* Various sanity checks. */
             if ( (cmp.xchg.nr_exchanged > cmp.xchg.in.nr_extents) ||
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 13:23:54 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 13:23:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972633.1360945 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9kwE-0003kp-BW; Tue, 29 Apr 2025 13:23:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972633.1360945; Tue, 29 Apr 2025 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 1u9kwE-0003kh-8g; Tue, 29 Apr 2025 13:23:54 +0000
Received: by outflank-mailman (input) for mailman id 972633;
 Tue, 29 Apr 2025 13:23: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 1u9kwC-0003kE-T6
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 13:23: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 1u9kwC-00CrlP-2o
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 13:23:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9kwC-0024q9-2j
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 13:23: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=BNYAzfWQgXFCo/Gq5f7/G/4c6m+A7gx+BethzXlL37U=; b=lr7AtG6HpoeXMN+htiLRP2Xrir
	FjyiAeDs+5qTqWeA2ztSh8FkT4otbgcLURhZCd7pmeogquFHRm46UbxFYEORf0jmPVMZ5otJqrqBH
	/h4ILpI4qHSL+qOPtzKS9wvKn9lgKHWUK4+VELR6vZGylxy+5kB5dZDsw5rQ89rupAu0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/intel: workaround several MONITOR/MWAIT errata
Message-Id: <E1u9kwC-0024q9-2j@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 13:23:52 +0000

commit 0f74a33deae06ebba8c5c998d74c1e3dfd46d6ea
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Apr 29 11:57:31 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:57:31 2025 +0200

    x86/intel: workaround several MONITOR/MWAIT errata
    
    There are several errata on Intel regarding the usage of the MONITOR/MWAIT
    instructions, all having in common that stores to the monitored region
    might not wake up the CPU.
    
    Fix them by forcing the sending of an IPI for the affected models.
    
    The Ice Lake issue has been reproduced internally on XenServer hardware,
    and the fix does seem to prevent it.  The symptom was APs getting stuck in
    the idle loop immediately after bring up, which in turn prevented the BSP
    from making progress.  This would happen before the watchdog was
    initialized, and hence the whole system would get stuck.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 4aae4452efeee3d3bba092b875e37d1e7c8f6db9
    master date: 2025-04-23 16:12:25 +0200
---
 xen/arch/x86/acpi/cpu_idle.c     |  6 ++++++
 xen/arch/x86/cpu/intel.c         | 36 +++++++++++++++++++++++++++++++++++-
 xen/arch/x86/include/asm/mwait.h |  3 +++
 3 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index 52808f9809..d0607d8a69 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -453,8 +453,14 @@ void cpuidle_wakeup_mwait(cpumask_t *mask)
     cpumask_andnot(mask, mask, &target);
 }
 
+/* Force sending of a wakeup IPI regardless of mwait usage. */
+bool __ro_after_init force_mwait_ipi_wakeup;
+
 bool arch_skip_send_event_check(unsigned int cpu)
 {
+    if ( force_mwait_ipi_wakeup )
+        return false;
+
     /*
      * This relies on softirq_pending() and mwait_wakeup() to access data
      * on the same cache line.
diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index bb9c6220de..74d10c93d8 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -8,6 +8,7 @@
 #include <asm/intel-family.h>
 #include <asm/processor.h>
 #include <asm/msr.h>
+#include <asm/mwait.h>
 #include <asm/uaccess.h>
 #include <asm/mpspec.h>
 #include <asm/apic.h>
@@ -368,7 +369,6 @@ static void probe_c3_errata(const struct cpuinfo_x86 *c)
         INTEL_FAM6_MODEL(0x25),
         { }
     };
-#undef INTEL_FAM6_MODEL
 
     /* Serialized by the AP bringup code. */
     if ( max_cstate > 1 && (c->apicid & (c->x86_num_siblings - 1)) &&
@@ -380,6 +380,38 @@ static void probe_c3_errata(const struct cpuinfo_x86 *c)
     }
 }
 
+/*
+ * APL30: One use of the MONITOR/MWAIT instruction pair is to allow a logical
+ * processor to wait in a sleep state until a store to the armed address range
+ * occurs. Due to this erratum, stores to the armed address range may not
+ * trigger MWAIT to resume execution.
+ *
+ * ICX143: Under complex microarchitectural conditions, a monitor that is armed
+ * with the MWAIT instruction may not be triggered, leading to a processor
+ * hang.
+ *
+ * LNL030: Problem P-cores may not exit power state Core C6 on monitor hit.
+ *
+ * Force the sending of an IPI in those cases.
+ */
+static void __init probe_mwait_errata(void)
+{
+    static const struct x86_cpu_id __initconst models[] = {
+        INTEL_FAM6_MODEL(INTEL_FAM6_ATOM_GOLDMONT), /* APL30  */
+        INTEL_FAM6_MODEL(INTEL_FAM6_ICELAKE_X),     /* ICX143 */
+        INTEL_FAM6_MODEL(INTEL_FAM6_LUNARLAKE_M),   /* LNL030 */
+        { }
+    };
+#undef INTEL_FAM6_MODEL
+
+    if ( boot_cpu_has(X86_FEATURE_MONITOR) && x86_match_cpu(models) )
+    {
+        printk(XENLOG_WARNING
+               "Forcing IPI MWAIT wakeup due to CPU erratum\n");
+        force_mwait_ipi_wakeup = true;
+    }
+}
+
 /*
  * P4 Xeon errata 037 workaround.
  * Hardware prefetcher may cause stale data to be loaded into the cache.
@@ -406,6 +438,8 @@ static void Intel_errata_workarounds(struct cpuinfo_x86 *c)
 		__set_bit(X86_FEATURE_CLFLUSH_MONITOR, c->x86_capability);
 
 	probe_c3_errata(c);
+	if (system_state < SYS_STATE_smp_boot)
+		probe_mwait_errata();
 }
 
 
diff --git a/xen/arch/x86/include/asm/mwait.h b/xen/arch/x86/include/asm/mwait.h
index 9298f987c4..1f1e39775b 100644
--- a/xen/arch/x86/include/asm/mwait.h
+++ b/xen/arch/x86/include/asm/mwait.h
@@ -13,6 +13,9 @@
 
 #define MWAIT_ECX_INTERRUPT_BREAK	0x1
 
+/* Force sending of a wakeup IPI regardless of mwait usage. */
+extern bool force_mwait_ipi_wakeup;
+
 void mwait_idle_with_hints(unsigned int eax, unsigned int ecx);
 bool mwait_pc10_supported(void);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 13:24:04 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 13:24:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972635.1360949 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9kwO-0003nf-Cm; Tue, 29 Apr 2025 13:24:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972635.1360949; Tue, 29 Apr 2025 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 1u9kwO-0003nX-AA; Tue, 29 Apr 2025 13:24:04 +0000
Received: by outflank-mailman (input) for mailman id 972635;
 Tue, 29 Apr 2025 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 1u9kwM-0003nL-Vm
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 13:24: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 1u9kwM-00Crlq-35
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 13:24:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9kwM-0024uS-2z
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 13:24: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=F9otGJqVG4eC1PqQBMtiuSp7bZxcF0WztcWZjaGn6GE=; b=0LuvknTG/lWe7p3yjrRxSDPv1e
	pd49tB/cyS++s6ziu0EOjb99zu0j4BgDFyJY0eZiQTx17fK6afllwFS+/xY5JLwVLUSJyrfOdOM56
	ABKSHAIXy9HOc6iHorW2ZUSb4mCBMl9eqOQZAAmSAN0R7F8hvhLMnNKvJ7YicxdMnN3w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] xen: remove -N from the linker command line
Message-Id: <E1u9kwM-0024uS-2z@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 13:24:02 +0000

commit cd0fa8381d3389f21305df7b726e7da3b56e1b3c
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Apr 29 11:58:03 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 29 11:58:03 2025 +0200

    xen: remove -N from the linker command line
    
    It's unclear why -N is being used in the first place.  It was added by
    commit 4676bbf96dc8 back in 2002 without any justification.
    
    When building a PE image it's actually detrimental to forcefully set the
    .text section as writable.  The GNU LD man page contains the following
    warning regarding the -N option:
    
    > Note: Although a writable text section is allowed for PE-COFF targets, it
    > does not conform to the format specification published by Microsoft.
    
    Remove the usage of -N uniformly on all architectures, assuming that the
    addition was simply done as a copy and paste of the original x86 linking
    rune.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: d444763f8ca556d0a67a4b933be303d346baef02
    master date: 2025-04-23 16:12:25 +0200
---
 xen/arch/arm/Makefile   |  6 +++---
 xen/arch/ppc/Makefile   |  6 +++---
 xen/arch/riscv/Makefile |  2 +-
 xen/arch/x86/Makefile   | 12 ++++++------
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 45dc29ea53..940de246b5 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -97,19 +97,19 @@ ifeq ($(CONFIG_ARM_64),y)
 endif
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
 	    $(dot-target).0.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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).1.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
diff --git a/xen/arch/ppc/Makefile b/xen/arch/ppc/Makefile
index 71feb5e2c4..b9d61a7856 100644
--- a/xen/arch/ppc/Makefile
+++ b/xen/arch/ppc/Makefile
@@ -11,19 +11,19 @@ $(TARGET): $(TARGET)-syms
 	cp -f $< $@
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
 	    $(dot-target).0.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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).1.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index 1ed1a8369b..28b5809dac 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -11,7 +11,7 @@ $(TARGET): $(TARGET)-syms
 	$(OBJCOPY) -O binary -S $< $@
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) -o $@
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) -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 d902fb7acc..c1e64278ce 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -137,19 +137,19 @@ $(TARGET): $(TARGET)-syms $(efi-y) $(obj)/boot/mkelf32
 CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).0.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
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(orphan-handling-y) $(dot-target).1.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
@@ -210,7 +210,7 @@ ifeq ($(CONFIG_DEBUG_INFO),y)
 	$(if $(filter --strip-debug,$(EFI_LDFLAGS)),echo,:) "Will strip debug info from $(@F)"
 endif
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
-	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds -N $< $(relocs-dummy) \
+	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< $(relocs-dummy) \
 	                $(objtree)/common/symbols-dummy.o $(note_file_option) \
 	                -o $(dot-target).$(base).0 &&) :
 	$(MKRELOC) $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(dot-target).$(base).0) \
@@ -220,7 +220,7 @@ endif
 		> $(dot-target).0s.S
 	$(MAKE) $(build)=$(@D) .$(@F).0r.o .$(@F).0s.o
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
-	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds -N $< \
+	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< \
 	                $(dot-target).0r.o $(dot-target).0s.o $(note_file_option) \
 	                -o $(dot-target).$(base).1 &&) :
 	$(MKRELOC) $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(dot-target).$(base).1) \
@@ -229,7 +229,7 @@ endif
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(dot-target).1s.S
 	$(MAKE) $(build)=$(@D) .$(@F).1r.o .$(@F).1s.o
-	$(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds -N $< \
+	$(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds $< \
 	      $(dot-target).1r.o $(dot-target).1s.o $(orphan-handling-y) \
 	      $(note_file_option) -o $@
 	$(NM) -pa --format=sysv $@ \
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 13:55:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 13:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972710.1361013 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9lQO-0003g6-Pr; Tue, 29 Apr 2025 13:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972710.1361013; Tue, 29 Apr 2025 13: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 1u9lQO-0003fy-Me; Tue, 29 Apr 2025 13:55:04 +0000
Received: by outflank-mailman (input) for mailman id 972710;
 Tue, 29 Apr 2025 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 1u9lQM-0003fm-RV
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 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 1u9lQM-00CsjX-1r
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 13:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9lQM-002Q8n-1h
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 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=gaxYXeIv4OZwSoJbynQztVSpoL84SK7WVuUlNuQyBXY=; b=tCJP2BoDoykylWTEPBcxjKzMjJ
	m24ZOcXGxQb3UJebesXhndCxKe12d/vX/LLYNyn5a1SbaBNzKuYggLw7LIUW2nt3OdsgaYR4jcY8o
	06pIG8FN3JHfA/P80Y6GgkwMX8dYgEFxlBLRZslyHWaYmHJq0oY4/MLXI/LBpS0EQcRE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/io: provide helpers for multi size MMIO accesses
Message-Id: <E1u9lQM-002Q8n-1h@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 13:55:02 +0000

commit eb627dd6ea58344351e8b31d32866ae5cb127055
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Apr 10 09:26:08 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Tue Apr 29 14:49:54 2025 +0200

    xen/io: provide helpers for multi size MMIO accesses
    
    Several handlers have the same necessity of reading or writing from or to
    an MMIO region using 1, 2, 4 or 8 bytes accesses.  So far this has been
    open-coded in the function itself.  Instead provide a new set of handlers
    that encapsulate the accesses.
    
    Since the added helpers are not architecture specific, introduce a new
    generic io.h header.
    
    No functional change intended.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/vmsi.c | 47 +++------------------------------
 xen/arch/x86/mm.c       | 32 +++++++---------------
 xen/drivers/vpci/msix.c | 47 +++------------------------------
 xen/include/xen/io.h    | 70 +++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 85 insertions(+), 111 deletions(-)

diff --git a/xen/arch/x86/hvm/vmsi.c b/xen/arch/x86/hvm/vmsi.c
index fd83abb929..61b89834d9 100644
--- a/xen/arch/x86/hvm/vmsi.c
+++ b/xen/arch/x86/hvm/vmsi.c
@@ -24,6 +24,7 @@
  * Will be merged it with virtual IOAPIC logic, since most is the same
 */
 
+#include <xen/io.h>
 #include <xen/types.h>
 #include <xen/mm.h>
 #include <xen/xmalloc.h>
@@ -304,28 +305,7 @@ static void adjacent_read(
 
     hwaddr = fix_to_virt(fixmap_idx) + PAGE_OFFSET(address);
 
-    switch ( len )
-    {
-    case 1:
-        *pval = readb(hwaddr);
-        break;
-
-    case 2:
-        *pval = readw(hwaddr);
-        break;
-
-    case 4:
-        *pval = readl(hwaddr);
-        break;
-
-    case 8:
-        *pval = readq(hwaddr);
-        break;
-
-    default:
-        ASSERT_UNREACHABLE();
-        break;
-    }
+    *pval = read_mmio(hwaddr, len);
 }
 
 static void adjacent_write(
@@ -344,28 +324,7 @@ static void adjacent_write(
 
     hwaddr = fix_to_virt(fixmap_idx) + PAGE_OFFSET(address);
 
-    switch ( len )
-    {
-    case 1:
-        writeb(val, hwaddr);
-        break;
-
-    case 2:
-        writew(val, hwaddr);
-        break;
-
-    case 4:
-        writel(val, hwaddr);
-        break;
-
-    case 8:
-        writeq(val, hwaddr);
-        break;
-
-    default:
-        ASSERT_UNREACHABLE();
-        break;
-    }
+    write_mmio(hwaddr, val, len);
 }
 
 static int cf_check msixtbl_read(
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index ac5b51d17a..732ca1366f 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -95,6 +95,7 @@
 #include <xen/guest_access.h>
 #include <xen/hypercall.h>
 #include <xen/init.h>
+#include <xen/io.h>
 #include <xen/iocap.h>
 #include <xen/ioreq.h>
 #include <xen/irq.h>
@@ -116,7 +117,6 @@
 #include <asm/flushtlb.h>
 #include <asm/guest.h>
 #include <asm/idt.h>
-#include <asm/io.h>
 #include <asm/io_apic.h>
 #include <asm/ldt.h>
 #include <asm/mem_sharing.h>
@@ -5102,7 +5102,7 @@ static void __iomem *subpage_mmio_map_page(
 static void subpage_mmio_write_emulate(
     mfn_t mfn,
     unsigned int offset,
-    const void *data,
+    unsigned long data,
     unsigned int len)
 {
     struct subpage_ro_range *entry;
@@ -5131,26 +5131,8 @@ static void subpage_mmio_write_emulate(
         return;
     }
 
-    addr += offset;
-    switch ( len )
-    {
-    case 1:
-        writeb(*(const uint8_t*)data, addr);
-        break;
-    case 2:
-        writew(*(const uint16_t*)data, addr);
-        break;
-    case 4:
-        writel(*(const uint32_t*)data, addr);
-        break;
-    case 8:
-        writeq(*(const uint64_t*)data, addr);
-        break;
-    default:
-        /* mmio_ro_emulated_write() already validated the size */
-        ASSERT_UNREACHABLE();
+    if ( !write_mmio(addr + offset, data, len) )
         goto write_ignored;
-    }
 }
 
 #ifdef CONFIG_HVM
@@ -5185,6 +5167,7 @@ int cf_check mmio_ro_emulated_write(
     struct x86_emulate_ctxt *ctxt)
 {
     struct mmio_ro_emulate_ctxt *mmio_ro_ctxt = ctxt->data;
+    unsigned long data = 0;
 
     /* Only allow naturally-aligned stores at the original %cr2 address. */
     if ( ((bytes | offset) & (bytes - 1)) || !bytes ||
@@ -5195,9 +5178,12 @@ int cf_check mmio_ro_emulated_write(
         return X86EMUL_UNHANDLEABLE;
     }
 
-    if ( bytes <= 8 )
+    if ( bytes <= sizeof(data) )
+    {
+        memcpy(&data, p_data, bytes);
         subpage_mmio_write_emulate(mmio_ro_ctxt->mfn, PAGE_OFFSET(offset),
-                                   p_data, bytes);
+                                   data, bytes);
+    }
     else if ( subpage_mmio_find_page(mmio_ro_ctxt->mfn) )
         gprintk(XENLOG_WARNING,
                 "unsupported %u-byte write to R/O MMIO 0x%"PRI_mfn"%03lx\n",
diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index 3568f2a651..74211301ba 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -17,6 +17,7 @@
  * License along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <xen/io.h>
 #include <xen/sched.h>
 #include <xen/vpci.h>
 
@@ -338,28 +339,7 @@ static int adjacent_read(const struct domain *d, const struct vpci_msix *msix,
         return X86EMUL_OKAY;
     }
 
-    switch ( len )
-    {
-    case 1:
-        *data = readb(mem + PAGE_OFFSET(addr));
-        break;
-
-    case 2:
-        *data = readw(mem + PAGE_OFFSET(addr));
-        break;
-
-    case 4:
-        *data = readl(mem + PAGE_OFFSET(addr));
-        break;
-
-    case 8:
-        *data = readq(mem + PAGE_OFFSET(addr));
-        break;
-
-    default:
-        ASSERT_UNREACHABLE();
-        break;
-    }
+    *data = read_mmio(mem + PAGE_OFFSET(addr), len);
     spin_unlock(&vpci->lock);
 
     return X86EMUL_OKAY;
@@ -487,28 +467,7 @@ static int adjacent_write(const struct domain *d, const struct vpci_msix *msix,
         return X86EMUL_OKAY;
     }
 
-    switch ( len )
-    {
-    case 1:
-        writeb(data, mem + PAGE_OFFSET(addr));
-        break;
-
-    case 2:
-        writew(data, mem + PAGE_OFFSET(addr));
-        break;
-
-    case 4:
-        writel(data, mem + PAGE_OFFSET(addr));
-        break;
-
-    case 8:
-        writeq(data, mem + PAGE_OFFSET(addr));
-        break;
-
-    default:
-        ASSERT_UNREACHABLE();
-        break;
-    }
+    write_mmio(mem + PAGE_OFFSET(addr), data, len);
     spin_unlock(&vpci->lock);
 
     return X86EMUL_OKAY;
diff --git a/xen/include/xen/io.h b/xen/include/xen/io.h
new file mode 100644
index 0000000000..164a20c5d7
--- /dev/null
+++ b/xen/include/xen/io.h
@@ -0,0 +1,70 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * IO related routines.
+ *
+ * Copyright (c) 2025 Cloud Software Group
+ */
+#ifndef XEN_IO_H
+#define XEN_IO_H
+
+#include <xen/bug.h>
+
+#include <asm/io.h>
+
+static inline unsigned long read_mmio(const volatile void __iomem *mem,
+                                      unsigned int size)
+{
+    switch ( size )
+    {
+    case 1:
+        return readb(mem);
+
+    case 2:
+        return readw(mem);
+
+    case 4:
+        return readl(mem);
+
+#ifdef CONFIG_64BIT
+    case 8:
+        return readq(mem);
+#endif
+
+    default:
+        ASSERT_UNREACHABLE();
+        return ~0UL;
+    }
+}
+
+static inline bool write_mmio(volatile void __iomem *mem, unsigned long data,
+                              unsigned int size)
+{
+    switch ( size )
+    {
+    case 1:
+        writeb(data, mem);
+        break;
+
+    case 2:
+        writew(data, mem);
+        break;
+
+    case 4:
+        writel(data, mem);
+        break;
+
+#ifdef CONFIG_64BIT
+    case 8:
+        writeq(data, mem);
+        break;
+#endif
+
+    default:
+        ASSERT_UNREACHABLE();
+        return false;
+    }
+
+    return true;
+}
+
+#endif /* XEN_IO_H */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 13:55:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 13:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972712.1361017 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9lQX-0003iu-TA; Tue, 29 Apr 2025 13:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972712.1361017; Tue, 29 Apr 2025 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 1u9lQX-0003im-Pd; Tue, 29 Apr 2025 13:55:13 +0000
Received: by outflank-mailman (input) for mailman id 972712;
 Tue, 29 Apr 2025 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 1u9lQW-0003ib-Ne
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 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 1u9lQW-00Csjk-2G
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 13:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9lQW-002QCb-28
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 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=hxAlI6oe/0uzkdDT/Cv44K77evHZxPrT4i0S8sOCRcE=; b=PRvshGhwds8UakN/+uWNJ4VDVw
	QXWYdtOtRe1bx2/ge8bK+o/XPZ3HT5nrE1PtwhWGWnZCCrp6JAUgQD1af0vbxv5BRx+K8JOJ3hpT/
	BTjTNrrtONe2gVZzNusT8Cwmlj56mlhfLYBbxiEtE8pZ94cA8VgreFG0hk7C2qRQadxA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/hvm: fix handling of accesses to partial r/o MMIO pages
Message-Id: <E1u9lQW-002QCb-28@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 13:55:12 +0000

commit 8f36bde2b2a1ded193ce450c13b213ab9443f2ec
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Apr 9 18:53:00 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Tue Apr 29 14:49:54 2025 +0200

    x86/hvm: fix handling of accesses to partial r/o MMIO pages
    
    The current logic to handle accesses to MMIO pages partially read-only is
    based on the (now removed) logic used to handle accesses to the r/o MMCFG
    region(s) for PVH v1 dom0.  However that has issues when running on AMD
    hardware, as in that case the guest linear address that triggered the fault
    is not provided as part of the VM exit.  This caused
    mmio_ro_emulated_write() to always fail before calling
    subpage_mmio_write_emulate() when running on AMD and called from an HVM
    context.
    
    Take a different approach and convert the handling of partial read-only
    MMIO page accesses into an HVM MMIO ops handler, as that's the more natural
    way to handle this kind of emulation for HVM domains.
    
    This allows getting rid of hvm_emulate_one_mmio() and it's single call site
    in hvm_hap_nested_page_fault().  As part of the fix r/o MMIO accesses are
    now handled by handle_mmio_with_translation(), re-using the same logic that
    was used for other read-only types part of p2m_is_discard_write().  The
    usage of emulation for faulting p2m_mmio_direct types is limited to
    addresses in the r/o MMIO range. The page present check is dropped as type
    p2m_mmio_direct must have the present bit set in the PTE.
    
    Note a small adjustment is needed to the `pf-fixup` dom0 PVH logic: avoid
    attempting to fixup faults resulting from write accesses to read-only MMIO
    regions, as handling of those accesses is now done by handle_mmio().
    
    Fixes: 33c19df9a5a0 ('x86/PCI: intercept accesses to RO MMIO from dom0s in HVM containers')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/Makefile              |   1 +
 xen/arch/x86/hvm/emulate.c             |  54 +++------------
 xen/arch/x86/hvm/hvm.c                 |  17 ++---
 xen/arch/x86/hvm/mmio.c                | 123 +++++++++++++++++++++++++++++++++
 xen/arch/x86/include/asm/hvm/emulate.h |   1 -
 xen/arch/x86/include/asm/hvm/io.h      |   3 +
 xen/arch/x86/include/asm/mm.h          |  12 ++++
 xen/arch/x86/mm.c                      |  37 +---------
 8 files changed, 158 insertions(+), 90 deletions(-)

diff --git a/xen/arch/x86/hvm/Makefile b/xen/arch/x86/hvm/Makefile
index 4c1fa5c6c2..6ec2c8f2db 100644
--- a/xen/arch/x86/hvm/Makefile
+++ b/xen/arch/x86/hvm/Makefile
@@ -15,6 +15,7 @@ obj-y += intercept.o
 obj-y += io.o
 obj-y += ioreq.o
 obj-y += irq.o
+obj-y += mmio.o
 obj-y += monitor.o
 obj-y += mtrr.o
 obj-y += nestedhvm.o
diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 79c180b408..91f004d233 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -370,7 +370,15 @@ static int hvmemul_do_io(
         /* If there is no suitable backing DM, just ignore accesses */
         if ( !s )
         {
-            if ( is_mmio && is_hardware_domain(currd) )
+            if ( is_mmio && is_hardware_domain(currd) &&
+                 /*
+                  * Do not attempt to fixup write accesses to r/o MMIO regions,
+                  * they are expected to be terminated by the null handler
+                  * below.
+                  */
+                 (dir == IOREQ_READ ||
+                  !rangeset_contains_singleton(mmio_ro_ranges,
+                                               PFN_DOWN(addr))) )
             {
                 /*
                  * PVH dom0 is likely missing MMIO mappings on the p2m, due to
@@ -2859,50 +2867,6 @@ int hvm_emulate_one(
     return _hvm_emulate_one(hvmemul_ctxt, &hvm_emulate_ops, completion);
 }
 
-int hvm_emulate_one_mmio(unsigned long mfn, unsigned long gla)
-{
-    static const struct x86_emulate_ops hvm_ro_emulate_ops_mmio = {
-        .read       = x86emul_unhandleable_rw,
-        .insn_fetch = hvmemul_insn_fetch,
-        .write      = mmio_ro_emulated_write,
-        .validate   = hvmemul_validate,
-    };
-    struct mmio_ro_emulate_ctxt mmio_ro_ctxt = { .cr2 = gla, .mfn = _mfn(mfn) };
-    struct hvm_emulate_ctxt ctxt;
-    unsigned int seg, bdf;
-    int rc;
-
-    if ( pci_ro_mmcfg_decode(mfn, &seg, &bdf) )
-    {
-        /* Should be always handled by vPCI for PVH dom0. */
-        gdprintk(XENLOG_ERR, "unhandled MMCFG access for %pp\n",
-                 &PCI_SBDF(seg, bdf));
-        ASSERT_UNREACHABLE();
-        return X86EMUL_UNHANDLEABLE;
-    }
-
-    hvm_emulate_init_once(&ctxt, x86_insn_is_mem_write,
-                          guest_cpu_user_regs());
-    ctxt.ctxt.data = &mmio_ro_ctxt;
-
-    switch ( rc = _hvm_emulate_one(&ctxt, &hvm_ro_emulate_ops_mmio,
-                                   VIO_no_completion) )
-    {
-    case X86EMUL_UNHANDLEABLE:
-    case X86EMUL_UNIMPLEMENTED:
-        hvm_dump_emulation_state(XENLOG_G_WARNING, "r/o MMIO", &ctxt, rc);
-        break;
-    case X86EMUL_EXCEPTION:
-        hvm_inject_event(&ctxt.ctxt.event);
-        /* fallthrough */
-    default:
-        hvm_emulate_writeback(&ctxt);
-        break;
-    }
-
-    return rc;
-}
-
 void hvm_emulate_one_vm_event(enum emul_kind kind, unsigned int trapnr,
     unsigned int errcode)
 {
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 6f1174c512..6b998387e3 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -8,6 +8,7 @@
  */
 
 #include <xen/init.h>
+#include <xen/io.h>
 #include <xen/ioreq.h>
 #include <xen/lib.h>
 #include <xen/trace.h>
@@ -35,7 +36,6 @@
 #include <asm/current.h>
 #include <asm/debugreg.h>
 #include <asm/e820.h>
-#include <asm/io.h>
 #include <asm/regs.h>
 #include <asm/cpufeature.h>
 #include <asm/processor.h>
@@ -692,6 +692,8 @@ int hvm_domain_initialise(struct domain *d,
 
     register_portio_handler(d, XEN_HVM_DEBUGCONS_IOPORT, 1, hvm_print_line);
 
+    register_subpage_ro_handler(d);
+
     if ( hvm_tsc_scaling_supported )
         d->arch.hvm.tsc_scaling_ratio = hvm_default_tsc_scaling_ratio;
 
@@ -1981,7 +1983,10 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
      */
     if ( (p2mt == p2m_mmio_dm) ||
          (npfec.write_access &&
-          (p2m_is_discard_write(p2mt) || (p2mt == p2m_ioreq_server))) )
+          (p2m_is_discard_write(p2mt) || (p2mt == p2m_ioreq_server) ||
+           /* MMIO entries can be r/o if the target mfn is in mmio_ro_ranges. */
+           (p2mt == p2m_mmio_direct &&
+            rangeset_contains_singleton(mmio_ro_ranges, mfn_x(mfn))))) )
     {
         if ( !handle_mmio_with_translation(gla, gfn, npfec) )
             hvm_inject_hw_exception(X86_EXC_GP, 0);
@@ -2033,14 +2038,6 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
         goto out_put_gfn;
     }
 
-    if ( (p2mt == p2m_mmio_direct) && npfec.write_access && npfec.present &&
-         (is_hardware_domain(currd) || subpage_mmio_write_accept(mfn, gla)) &&
-         (hvm_emulate_one_mmio(mfn_x(mfn), gla) == X86EMUL_OKAY) )
-    {
-        rc = 1;
-        goto out_put_gfn;
-    }
-
     /* If we fell through, the vcpu will retry now that access restrictions have
      * been removed. It may fault again if the p2m entry type still requires so.
      * Otherwise, this is an error condition. */
diff --git a/xen/arch/x86/hvm/mmio.c b/xen/arch/x86/hvm/mmio.c
new file mode 100644
index 0000000000..0fc492f854
--- /dev/null
+++ b/xen/arch/x86/hvm/mmio.c
@@ -0,0 +1,123 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * MMIO related routines.
+ *
+ * Copyright (c) 2025 Cloud Software Group
+ */
+
+#include <xen/io.h>
+#include <xen/mm.h>
+
+#include <asm/p2m.h>
+
+static int cf_check subpage_mmio_accept(struct vcpu *v, unsigned long addr)
+{
+    p2m_type_t t;
+    mfn_t mfn = get_gfn_query_unlocked(v->domain, PFN_DOWN(addr), &t);
+
+    return !mfn_eq(mfn, INVALID_MFN) && t == p2m_mmio_direct &&
+           subpage_mmio_find_page(mfn);
+}
+
+/*
+ * The guest has read access to those regions, and consequently read accesses
+ * shouldn't fault.  However read-modify-write operations may take this path,
+ * so handling of reads is necessary.
+ */
+static int cf_check subpage_mmio_read(
+    struct vcpu *v, unsigned long addr, unsigned int len, unsigned long *data)
+{
+    struct domain *d = v->domain;
+    unsigned long gfn = PFN_DOWN(addr);
+    p2m_type_t t;
+    mfn_t mfn;
+    struct subpage_ro_range *entry;
+    volatile void __iomem *mem;
+
+    *data = ~0UL;
+
+    if ( !len || len > 8 || (len & (len - 1)) || !IS_ALIGNED(addr, len) )
+    {
+        gprintk(XENLOG_ERR, "ignoring read to r/o MMIO subpage %#lx size %u\n",
+                addr, len);
+        return X86EMUL_OKAY;
+    }
+
+    mfn = get_gfn_query(d, gfn, &t);
+    if ( mfn_eq(mfn, INVALID_MFN) || t != p2m_mmio_direct )
+    {
+        put_gfn(d, gfn);
+        return X86EMUL_RETRY;
+    }
+
+    entry = subpage_mmio_find_page(mfn);
+    if ( !entry )
+    {
+        put_gfn(d, gfn);
+        return X86EMUL_OKAY;
+    }
+
+    mem = subpage_mmio_map_page(entry);
+    if ( !mem )
+    {
+        put_gfn(d, gfn);
+        gprintk(XENLOG_ERR,
+                "Failed to map page for MMIO read at %#lx -> %#lx\n",
+                addr, mfn_to_maddr(mfn) + PAGE_OFFSET(addr));
+        return X86EMUL_OKAY;
+    }
+
+    *data = read_mmio(mem + PAGE_OFFSET(addr), len);
+
+    put_gfn(d, gfn);
+    return X86EMUL_OKAY;
+}
+
+static int cf_check subpage_mmio_write(
+    struct vcpu *v, unsigned long addr, unsigned int len, unsigned long data)
+{
+    struct domain *d = v->domain;
+    unsigned long gfn = PFN_DOWN(addr);
+    p2m_type_t t;
+    mfn_t mfn;
+
+    if ( !len || len > 8 || (len & (len - 1)) || !IS_ALIGNED(addr, len) )
+    {
+        gprintk(XENLOG_ERR, "ignoring write to r/o MMIO subpage %#lx size %u\n",
+                addr, len);
+        return X86EMUL_OKAY;
+    }
+
+    mfn = get_gfn_query(d, gfn, &t);
+    if ( mfn_eq(mfn, INVALID_MFN) || t != p2m_mmio_direct )
+    {
+        put_gfn(d, gfn);
+        return X86EMUL_RETRY;
+    }
+
+    subpage_mmio_write_emulate(mfn, PAGE_OFFSET(addr), data, len);
+
+    put_gfn(d, gfn);
+    return X86EMUL_OKAY;
+}
+
+void register_subpage_ro_handler(struct domain *d)
+{
+    static const struct hvm_mmio_ops subpage_mmio_ops = {
+        .check = subpage_mmio_accept,
+        .read = subpage_mmio_read,
+        .write = subpage_mmio_write,
+    };
+
+    register_mmio_handler(d, &subpage_mmio_ops);
+}
+
+/*
+ * 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/include/asm/hvm/emulate.h b/xen/arch/x86/include/asm/hvm/emulate.h
index c7a2d2a5be..178ac32e15 100644
--- a/xen/arch/x86/include/asm/hvm/emulate.h
+++ b/xen/arch/x86/include/asm/hvm/emulate.h
@@ -86,7 +86,6 @@ void hvmemul_cancel(struct vcpu *v);
 struct segment_register *hvmemul_get_seg_reg(
     enum x86_segment seg,
     struct hvm_emulate_ctxt *hvmemul_ctxt);
-int hvm_emulate_one_mmio(unsigned long mfn, unsigned long gla);
 
 static inline bool handle_mmio(void)
 {
diff --git a/xen/arch/x86/include/asm/hvm/io.h b/xen/arch/x86/include/asm/hvm/io.h
index 565bad300d..c12f099a03 100644
--- a/xen/arch/x86/include/asm/hvm/io.h
+++ b/xen/arch/x86/include/asm/hvm/io.h
@@ -135,6 +135,9 @@ void destroy_vpci_mmcfg(struct domain *d);
 /* Remove MMCFG regions from a domain ->iomem_caps. */
 int vpci_mmcfg_deny_access(struct domain *d);
 
+/* r/o MMIO subpage access handler. */
+void register_subpage_ro_handler(struct domain *d);
+
 #endif /* __ASM_X86_HVM_IO_H__ */
 
 
diff --git a/xen/arch/x86/include/asm/mm.h b/xen/arch/x86/include/asm/mm.h
index a1bc8cc274..c2e9ef6e50 100644
--- a/xen/arch/x86/include/asm/mm.h
+++ b/xen/arch/x86/include/asm/mm.h
@@ -554,6 +554,18 @@ int cf_check mmio_ro_emulated_write(
     enum x86_segment seg, unsigned long offset, void *p_data,
     unsigned int bytes, struct x86_emulate_ctxt *ctxt);
 
+/* r/o MMIO subpage access handlers. */
+struct subpage_ro_range {
+    struct list_head list;
+    mfn_t mfn;
+    void __iomem *mapped;
+    DECLARE_BITMAP(ro_elems, PAGE_SIZE / MMIO_RO_SUBPAGE_GRAN);
+};
+struct subpage_ro_range *subpage_mmio_find_page(mfn_t mfn);
+void __iomem *subpage_mmio_map_page(struct subpage_ro_range *entry);
+void subpage_mmio_write_emulate(
+    mfn_t mfn, unsigned int offset, unsigned long data, unsigned int len);
+
 int audit_adjust_pgtables(struct domain *d, int dir, int noisy);
 
 extern int pagefault_by_memadd(unsigned long addr, struct cpu_user_regs *regs);
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 732ca1366f..7ead2db3cb 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -157,13 +157,6 @@ struct rangeset *__read_mostly mmio_ro_ranges;
 static uint32_t __ro_after_init base_disallow_mask;
 
 /* Handling sub-page read-only MMIO regions */
-struct subpage_ro_range {
-    struct list_head list;
-    mfn_t mfn;
-    void __iomem *mapped;
-    DECLARE_BITMAP(ro_elems, PAGE_SIZE / MMIO_RO_SUBPAGE_GRAN);
-};
-
 static LIST_HEAD_RO_AFTER_INIT(subpage_ro_ranges);
 static DEFINE_SPINLOCK(subpage_ro_lock);
 
@@ -4929,7 +4922,7 @@ long arch_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     return rc;
 }
 
-static struct subpage_ro_range *subpage_mmio_find_page(mfn_t mfn)
+struct subpage_ro_range *subpage_mmio_find_page(mfn_t mfn)
 {
     struct subpage_ro_range *entry;
 
@@ -5074,7 +5067,7 @@ int __init subpage_mmio_ro_add(
     return rc;
 }
 
-static void __iomem *subpage_mmio_map_page(
+void __iomem *subpage_mmio_map_page(
     struct subpage_ro_range *entry)
 {
     void __iomem *mapped_page;
@@ -5099,7 +5092,7 @@ static void __iomem *subpage_mmio_map_page(
     return entry->mapped;
 }
 
-static void subpage_mmio_write_emulate(
+void subpage_mmio_write_emulate(
     mfn_t mfn,
     unsigned int offset,
     unsigned long data,
@@ -5135,30 +5128,6 @@ static void subpage_mmio_write_emulate(
         goto write_ignored;
 }
 
-#ifdef CONFIG_HVM
-bool subpage_mmio_write_accept(mfn_t mfn, unsigned long gla)
-{
-    unsigned int offset = PAGE_OFFSET(gla);
-    const struct subpage_ro_range *entry;
-
-    entry = subpage_mmio_find_page(mfn);
-    if ( !entry )
-        return false;
-
-    if ( !test_bit(offset / MMIO_RO_SUBPAGE_GRAN, entry->ro_elems) )
-    {
-        /*
-         * We don't know the write size at this point yet, so it could be
-         * an unaligned write, but accept it here anyway and deal with it
-         * later.
-         */
-        return true;
-    }
-
-    return false;
-}
-#endif
-
 int cf_check mmio_ro_emulated_write(
     enum x86_segment seg,
     unsigned long offset,
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 13:55:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 13:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972713.1361021 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9lQi-0003li-Tq; Tue, 29 Apr 2025 13:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972713.1361021; Tue, 29 Apr 2025 13: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 1u9lQi-0003la-RG; Tue, 29 Apr 2025 13:55:24 +0000
Received: by outflank-mailman (input) for mailman id 972713;
 Tue, 29 Apr 2025 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 1u9lQg-0003lO-SV
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 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 1u9lQg-00Csjo-2l
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 13:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9lQg-002QHA-2a
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 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=Wzqqr//J9qWvHTgf9k88tUHSkSm1Ht4TX3LyQcKsa9E=; b=vtz8LYSxK7SdfGmDcbseBqSQYT
	174ccOx3Sh+6BrNoKm7h+aGgWZdv7w4uSnLjtai6snqHFnBO9ZHWMTWdIZH1ykO7zyB08jc37QINT
	Gdw5Yi/ZPdHaFQnDPuvaGYxMt4FiCW5TxOSZmRc/P+A+r+TfilHAerxCvzZzwVOYTOOk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/hvm: only register the r/o subpage ops when needed
Message-Id: <E1u9lQg-002QHA-2a@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 13:55:22 +0000

commit 06fd6818eae5878397e36d542251e1ad17805262
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Apr 11 10:31:22 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Tue Apr 29 14:49:54 2025 +0200

    x86/hvm: only register the r/o subpage ops when needed
    
    MMIO operation handlers can be expensive to process, hence attempt to
    register only those that will be needed by the domain.
    
    Subpage r/o MMIO regions are added exclusively at boot, further limit their
    addition to strictly before the initial domain gets created, so by the time
    initial domain creation happens Xen knows whether subpage is required or
    not.  This allows only registering the MMIO handler when there are
    subpage regions to handle.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/hvm.c        |  3 ++-
 xen/arch/x86/include/asm/mm.h |  1 +
 xen/arch/x86/mm.c             | 16 ++++++++++++++++
 3 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 6b998387e3..4cb2e13046 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -692,7 +692,8 @@ int hvm_domain_initialise(struct domain *d,
 
     register_portio_handler(d, XEN_HVM_DEBUGCONS_IOPORT, 1, hvm_print_line);
 
-    register_subpage_ro_handler(d);
+    if ( subpage_ro_active() )
+        register_subpage_ro_handler(d);
 
     if ( hvm_tsc_scaling_supported )
         d->arch.hvm.tsc_scaling_ratio = hvm_default_tsc_scaling_ratio;
diff --git a/xen/arch/x86/include/asm/mm.h b/xen/arch/x86/include/asm/mm.h
index c2e9ef6e50..aeb8ebcf2d 100644
--- a/xen/arch/x86/include/asm/mm.h
+++ b/xen/arch/x86/include/asm/mm.h
@@ -561,6 +561,7 @@ struct subpage_ro_range {
     void __iomem *mapped;
     DECLARE_BITMAP(ro_elems, PAGE_SIZE / MMIO_RO_SUBPAGE_GRAN);
 };
+bool subpage_ro_active(void);
 struct subpage_ro_range *subpage_mmio_find_page(mfn_t mfn);
 void __iomem *subpage_mmio_map_page(struct subpage_ro_range *entry);
 void subpage_mmio_write_emulate(
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 7ead2db3cb..6697984507 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4922,6 +4922,11 @@ long arch_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     return rc;
 }
 
+bool subpage_ro_active(void)
+{
+    return !list_empty(&subpage_ro_ranges);
+}
+
 struct subpage_ro_range *subpage_mmio_find_page(mfn_t mfn)
 {
     struct subpage_ro_range *entry;
@@ -5011,6 +5016,17 @@ int __init subpage_mmio_ro_add(
          !IS_ALIGNED(size, MMIO_RO_SUBPAGE_GRAN) )
         return -EINVAL;
 
+    /*
+     * Force all r/o subregions to be registered before initial domain
+     * creation, so that the emulation handlers can be added only when there
+     * are pages registered.
+     */
+    if ( system_state >= SYS_STATE_smp_boot )
+    {
+        ASSERT_UNREACHABLE();
+        return -EILSEQ;
+    }
+
     if ( !size )
         return 0;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 13:55:34 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 13:55:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972714.1361025 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9lQs-0003oH-VA; Tue, 29 Apr 2025 13:55:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972714.1361025; Tue, 29 Apr 2025 13: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 1u9lQs-0003o6-Se; Tue, 29 Apr 2025 13:55:34 +0000
Received: by outflank-mailman (input) for mailman id 972714;
 Tue, 29 Apr 2025 13:55:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u9lQq-0003nw-Vr
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 13: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 1u9lQq-00Csjw-36
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 13:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9lQq-002QRW-2y
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 13: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=tIgNwbWBxDcbMvm1A31fwZ11WzuF004Mb3evNNzEWIY=; b=zEbFtOxoBqVqyGFad+pa32TPlx
	nYngJ/neROzvh14Obr/tptV+Oi572IXmc+TCiInEbVnAJ+UiBwDdAHqqEWG/Lpey9//5SCzUSRSMN
	uQlxvwQS3ViDQMoGzS5PHcZ4mb9qES3QKxEs5AnTeBDnVkDvm40sX9zbEHh6TihDJhfA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/mm: move mmio_ro_emulated_write() to PV only file
Message-Id: <E1u9lQq-002QRW-2y@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 13:55:32 +0000

commit ff3e5dfa7c2d09825dfd8545d49920830fa71243
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Apr 10 11:48:03 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Tue Apr 29 14:49:54 2025 +0200

    x86/mm: move mmio_ro_emulated_write() to PV only file
    
    mmio_ro_emulated_write() is only used in pv/ro-page-fault.c, move the
    function to that file and make it static.
    
    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/mm.h   | 12 ------------
 xen/arch/x86/mm.c               | 33 ---------------------------------
 xen/arch/x86/pv/ro-page-fault.c | 41 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 41 insertions(+), 45 deletions(-)

diff --git a/xen/arch/x86/include/asm/mm.h b/xen/arch/x86/include/asm/mm.h
index aeb8ebcf2d..2665daa6f7 100644
--- a/xen/arch/x86/include/asm/mm.h
+++ b/xen/arch/x86/include/asm/mm.h
@@ -542,18 +542,6 @@ void memguard_unguard_stack(void *p);
 int subpage_mmio_ro_add(paddr_t start, size_t size);
 bool subpage_mmio_write_accept(mfn_t mfn, unsigned long gla);
 
-struct mmio_ro_emulate_ctxt {
-        unsigned long cr2;
-        /* Used only for mmcfg case */
-        unsigned int seg, bdf;
-        /* Used only for non-mmcfg case */
-        mfn_t mfn;
-};
-
-int cf_check mmio_ro_emulated_write(
-    enum x86_segment seg, unsigned long offset, void *p_data,
-    unsigned int bytes, struct x86_emulate_ctxt *ctxt);
-
 /* r/o MMIO subpage access handlers. */
 struct subpage_ro_range {
     struct list_head list;
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 6697984507..9ac855f998 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5144,39 +5144,6 @@ void subpage_mmio_write_emulate(
         goto write_ignored;
 }
 
-int cf_check mmio_ro_emulated_write(
-    enum x86_segment seg,
-    unsigned long offset,
-    void *p_data,
-    unsigned int bytes,
-    struct x86_emulate_ctxt *ctxt)
-{
-    struct mmio_ro_emulate_ctxt *mmio_ro_ctxt = ctxt->data;
-    unsigned long data = 0;
-
-    /* Only allow naturally-aligned stores at the original %cr2 address. */
-    if ( ((bytes | offset) & (bytes - 1)) || !bytes ||
-         offset != mmio_ro_ctxt->cr2 )
-    {
-        gdprintk(XENLOG_WARNING, "bad access (cr2=%lx, addr=%lx, bytes=%u)\n",
-                mmio_ro_ctxt->cr2, offset, bytes);
-        return X86EMUL_UNHANDLEABLE;
-    }
-
-    if ( bytes <= sizeof(data) )
-    {
-        memcpy(&data, p_data, bytes);
-        subpage_mmio_write_emulate(mmio_ro_ctxt->mfn, PAGE_OFFSET(offset),
-                                   data, bytes);
-    }
-    else if ( subpage_mmio_find_page(mmio_ro_ctxt->mfn) )
-        gprintk(XENLOG_WARNING,
-                "unsupported %u-byte write to R/O MMIO 0x%"PRI_mfn"%03lx\n",
-                bytes, mfn_x(mmio_ro_ctxt->mfn), PAGE_OFFSET(offset));
-
-    return X86EMUL_OKAY;
-}
-
 /*
  * For these PTE APIs, the caller must follow the alloc-map-unmap-free
  * lifecycle, which means explicitly mapping the PTE pages before accessing
diff --git a/xen/arch/x86/pv/ro-page-fault.c b/xen/arch/x86/pv/ro-page-fault.c
index 11b01c479e..5ae7708077 100644
--- a/xen/arch/x86/pv/ro-page-fault.c
+++ b/xen/arch/x86/pv/ro-page-fault.c
@@ -298,6 +298,14 @@ static int ptwr_do_page_fault(struct x86_emulate_ctxt *ctxt,
  * fault handling for read-only MMIO pages
  */
 
+struct mmio_ro_emulate_ctxt {
+    unsigned long cr2;
+    /* Used only for mmcfg case */
+    unsigned int seg, bdf;
+    /* Used only for non-mmcfg case */
+    mfn_t mfn;
+};
+
 static int cf_check mmcfg_intercept_write(
     enum x86_segment seg,
     unsigned long offset,
@@ -329,6 +337,39 @@ static int cf_check mmcfg_intercept_write(
     return X86EMUL_OKAY;
 }
 
+int cf_check mmio_ro_emulated_write(
+    enum x86_segment seg,
+    unsigned long offset,
+    void *p_data,
+    unsigned int bytes,
+    struct x86_emulate_ctxt *ctxt)
+{
+    struct mmio_ro_emulate_ctxt *mmio_ro_ctxt = ctxt->data;
+    unsigned long data = 0;
+
+    /* Only allow naturally-aligned stores at the original %cr2 address. */
+    if ( ((bytes | offset) & (bytes - 1)) || !bytes ||
+         offset != mmio_ro_ctxt->cr2 )
+    {
+        gdprintk(XENLOG_WARNING, "bad access (cr2=%lx, addr=%lx, bytes=%u)\n",
+                mmio_ro_ctxt->cr2, offset, bytes);
+        return X86EMUL_UNHANDLEABLE;
+    }
+
+    if ( bytes <= sizeof(data) )
+    {
+        memcpy(&data, p_data, bytes);
+        subpage_mmio_write_emulate(mmio_ro_ctxt->mfn, PAGE_OFFSET(offset),
+                                   data, bytes);
+    }
+    else if ( subpage_mmio_find_page(mmio_ro_ctxt->mfn) )
+        gprintk(XENLOG_WARNING,
+                "unsupported %u-byte write to R/O MMIO 0x%"PRI_mfn"%03lx\n",
+                bytes, mfn_x(mmio_ro_ctxt->mfn), PAGE_OFFSET(offset));
+
+    return X86EMUL_OKAY;
+}
+
 static const struct x86_emulate_ops mmio_ro_emulate_ops = {
     .read       = x86emul_unhandleable_rw,
     .insn_fetch = ptwr_emulated_insn_fetch,
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 14:44:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 14:44:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972762.1361060 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9mBm-0004to-RW; Tue, 29 Apr 2025 14:44:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972762.1361060; Tue, 29 Apr 2025 14: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 1u9mBm-0004tg-OU; Tue, 29 Apr 2025 14:44:02 +0000
Received: by outflank-mailman (input) for mailman id 972762;
 Tue, 29 Apr 2025 14:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u9mBm-0004ta-2X
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 14:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9mBl-00CuHw-2e
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 14:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9mBl-002wO0-2M
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 14: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=uZvr/x08TMSEGxOiNKNSVfmGJKKdsskKKgN5/3CZBbM=; b=RCwP3JiZGJ0pXf7ZIlqgpmkch/
	c1CX3HMBXsVNZt6QvTico0gcJ0yCSW2dsda/M1RyAzuLxHNZQpB892I9L6+9/0ff/Ny675QJOi/F2
	z/uet/N2/JJgYDwkX2qfSc+Ozl7IKZYeSxsK9iOt0zPwOihmEC8zoNQ409U2iTMj/7Zk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/io: provide helpers for multi size MMIO accesses
Message-Id: <E1u9mBl-002wO0-2M@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 14:44:01 +0000

commit eb627dd6ea58344351e8b31d32866ae5cb127055
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Apr 10 09:26:08 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Tue Apr 29 14:49:54 2025 +0200

    xen/io: provide helpers for multi size MMIO accesses
    
    Several handlers have the same necessity of reading or writing from or to
    an MMIO region using 1, 2, 4 or 8 bytes accesses.  So far this has been
    open-coded in the function itself.  Instead provide a new set of handlers
    that encapsulate the accesses.
    
    Since the added helpers are not architecture specific, introduce a new
    generic io.h header.
    
    No functional change intended.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/vmsi.c | 47 +++------------------------------
 xen/arch/x86/mm.c       | 32 +++++++---------------
 xen/drivers/vpci/msix.c | 47 +++------------------------------
 xen/include/xen/io.h    | 70 +++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 85 insertions(+), 111 deletions(-)

diff --git a/xen/arch/x86/hvm/vmsi.c b/xen/arch/x86/hvm/vmsi.c
index fd83abb929..61b89834d9 100644
--- a/xen/arch/x86/hvm/vmsi.c
+++ b/xen/arch/x86/hvm/vmsi.c
@@ -24,6 +24,7 @@
  * Will be merged it with virtual IOAPIC logic, since most is the same
 */
 
+#include <xen/io.h>
 #include <xen/types.h>
 #include <xen/mm.h>
 #include <xen/xmalloc.h>
@@ -304,28 +305,7 @@ static void adjacent_read(
 
     hwaddr = fix_to_virt(fixmap_idx) + PAGE_OFFSET(address);
 
-    switch ( len )
-    {
-    case 1:
-        *pval = readb(hwaddr);
-        break;
-
-    case 2:
-        *pval = readw(hwaddr);
-        break;
-
-    case 4:
-        *pval = readl(hwaddr);
-        break;
-
-    case 8:
-        *pval = readq(hwaddr);
-        break;
-
-    default:
-        ASSERT_UNREACHABLE();
-        break;
-    }
+    *pval = read_mmio(hwaddr, len);
 }
 
 static void adjacent_write(
@@ -344,28 +324,7 @@ static void adjacent_write(
 
     hwaddr = fix_to_virt(fixmap_idx) + PAGE_OFFSET(address);
 
-    switch ( len )
-    {
-    case 1:
-        writeb(val, hwaddr);
-        break;
-
-    case 2:
-        writew(val, hwaddr);
-        break;
-
-    case 4:
-        writel(val, hwaddr);
-        break;
-
-    case 8:
-        writeq(val, hwaddr);
-        break;
-
-    default:
-        ASSERT_UNREACHABLE();
-        break;
-    }
+    write_mmio(hwaddr, val, len);
 }
 
 static int cf_check msixtbl_read(
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index ac5b51d17a..732ca1366f 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -95,6 +95,7 @@
 #include <xen/guest_access.h>
 #include <xen/hypercall.h>
 #include <xen/init.h>
+#include <xen/io.h>
 #include <xen/iocap.h>
 #include <xen/ioreq.h>
 #include <xen/irq.h>
@@ -116,7 +117,6 @@
 #include <asm/flushtlb.h>
 #include <asm/guest.h>
 #include <asm/idt.h>
-#include <asm/io.h>
 #include <asm/io_apic.h>
 #include <asm/ldt.h>
 #include <asm/mem_sharing.h>
@@ -5102,7 +5102,7 @@ static void __iomem *subpage_mmio_map_page(
 static void subpage_mmio_write_emulate(
     mfn_t mfn,
     unsigned int offset,
-    const void *data,
+    unsigned long data,
     unsigned int len)
 {
     struct subpage_ro_range *entry;
@@ -5131,26 +5131,8 @@ static void subpage_mmio_write_emulate(
         return;
     }
 
-    addr += offset;
-    switch ( len )
-    {
-    case 1:
-        writeb(*(const uint8_t*)data, addr);
-        break;
-    case 2:
-        writew(*(const uint16_t*)data, addr);
-        break;
-    case 4:
-        writel(*(const uint32_t*)data, addr);
-        break;
-    case 8:
-        writeq(*(const uint64_t*)data, addr);
-        break;
-    default:
-        /* mmio_ro_emulated_write() already validated the size */
-        ASSERT_UNREACHABLE();
+    if ( !write_mmio(addr + offset, data, len) )
         goto write_ignored;
-    }
 }
 
 #ifdef CONFIG_HVM
@@ -5185,6 +5167,7 @@ int cf_check mmio_ro_emulated_write(
     struct x86_emulate_ctxt *ctxt)
 {
     struct mmio_ro_emulate_ctxt *mmio_ro_ctxt = ctxt->data;
+    unsigned long data = 0;
 
     /* Only allow naturally-aligned stores at the original %cr2 address. */
     if ( ((bytes | offset) & (bytes - 1)) || !bytes ||
@@ -5195,9 +5178,12 @@ int cf_check mmio_ro_emulated_write(
         return X86EMUL_UNHANDLEABLE;
     }
 
-    if ( bytes <= 8 )
+    if ( bytes <= sizeof(data) )
+    {
+        memcpy(&data, p_data, bytes);
         subpage_mmio_write_emulate(mmio_ro_ctxt->mfn, PAGE_OFFSET(offset),
-                                   p_data, bytes);
+                                   data, bytes);
+    }
     else if ( subpage_mmio_find_page(mmio_ro_ctxt->mfn) )
         gprintk(XENLOG_WARNING,
                 "unsupported %u-byte write to R/O MMIO 0x%"PRI_mfn"%03lx\n",
diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index 3568f2a651..74211301ba 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -17,6 +17,7 @@
  * License along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <xen/io.h>
 #include <xen/sched.h>
 #include <xen/vpci.h>
 
@@ -338,28 +339,7 @@ static int adjacent_read(const struct domain *d, const struct vpci_msix *msix,
         return X86EMUL_OKAY;
     }
 
-    switch ( len )
-    {
-    case 1:
-        *data = readb(mem + PAGE_OFFSET(addr));
-        break;
-
-    case 2:
-        *data = readw(mem + PAGE_OFFSET(addr));
-        break;
-
-    case 4:
-        *data = readl(mem + PAGE_OFFSET(addr));
-        break;
-
-    case 8:
-        *data = readq(mem + PAGE_OFFSET(addr));
-        break;
-
-    default:
-        ASSERT_UNREACHABLE();
-        break;
-    }
+    *data = read_mmio(mem + PAGE_OFFSET(addr), len);
     spin_unlock(&vpci->lock);
 
     return X86EMUL_OKAY;
@@ -487,28 +467,7 @@ static int adjacent_write(const struct domain *d, const struct vpci_msix *msix,
         return X86EMUL_OKAY;
     }
 
-    switch ( len )
-    {
-    case 1:
-        writeb(data, mem + PAGE_OFFSET(addr));
-        break;
-
-    case 2:
-        writew(data, mem + PAGE_OFFSET(addr));
-        break;
-
-    case 4:
-        writel(data, mem + PAGE_OFFSET(addr));
-        break;
-
-    case 8:
-        writeq(data, mem + PAGE_OFFSET(addr));
-        break;
-
-    default:
-        ASSERT_UNREACHABLE();
-        break;
-    }
+    write_mmio(mem + PAGE_OFFSET(addr), data, len);
     spin_unlock(&vpci->lock);
 
     return X86EMUL_OKAY;
diff --git a/xen/include/xen/io.h b/xen/include/xen/io.h
new file mode 100644
index 0000000000..164a20c5d7
--- /dev/null
+++ b/xen/include/xen/io.h
@@ -0,0 +1,70 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * IO related routines.
+ *
+ * Copyright (c) 2025 Cloud Software Group
+ */
+#ifndef XEN_IO_H
+#define XEN_IO_H
+
+#include <xen/bug.h>
+
+#include <asm/io.h>
+
+static inline unsigned long read_mmio(const volatile void __iomem *mem,
+                                      unsigned int size)
+{
+    switch ( size )
+    {
+    case 1:
+        return readb(mem);
+
+    case 2:
+        return readw(mem);
+
+    case 4:
+        return readl(mem);
+
+#ifdef CONFIG_64BIT
+    case 8:
+        return readq(mem);
+#endif
+
+    default:
+        ASSERT_UNREACHABLE();
+        return ~0UL;
+    }
+}
+
+static inline bool write_mmio(volatile void __iomem *mem, unsigned long data,
+                              unsigned int size)
+{
+    switch ( size )
+    {
+    case 1:
+        writeb(data, mem);
+        break;
+
+    case 2:
+        writew(data, mem);
+        break;
+
+    case 4:
+        writel(data, mem);
+        break;
+
+#ifdef CONFIG_64BIT
+    case 8:
+        writeq(data, mem);
+        break;
+#endif
+
+    default:
+        ASSERT_UNREACHABLE();
+        return false;
+    }
+
+    return true;
+}
+
+#endif /* XEN_IO_H */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 14:44:12 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 14:44:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972763.1361063 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9mBw-0004wE-Tx; Tue, 29 Apr 2025 14:44:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972763.1361063; Tue, 29 Apr 2025 14: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 1u9mBw-0004w7-RJ; Tue, 29 Apr 2025 14:44:12 +0000
Received: by outflank-mailman (input) for mailman id 972763;
 Tue, 29 Apr 2025 14:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u9mBv-0004vv-V2
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 14: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 1u9mBv-00CuIF-30
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 14:44:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9mBv-002wRG-2s
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 14: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=tFqeLadp26+T9voSvVDj/rIlKivbslMUq43zMXPb/a8=; b=n3ktY+X0+b2PYEbC9gvn2KkvtT
	LA7G1oAW8f1hU8WurveNlDPwbejPtPhEa5Ejx0ZRT+vEOad+2YTTmi/8t0ATD/kv7pSMaZG8//RU+
	bVixg10Z2mcqJlUORRxqff61cR64ecCoLjjsdLvSD3hRku35D1DwfP3jMYr14rQ5aHAQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/hvm: fix handling of accesses to partial r/o MMIO pages
Message-Id: <E1u9mBv-002wRG-2s@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 14:44:11 +0000

commit 8f36bde2b2a1ded193ce450c13b213ab9443f2ec
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Apr 9 18:53:00 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Tue Apr 29 14:49:54 2025 +0200

    x86/hvm: fix handling of accesses to partial r/o MMIO pages
    
    The current logic to handle accesses to MMIO pages partially read-only is
    based on the (now removed) logic used to handle accesses to the r/o MMCFG
    region(s) for PVH v1 dom0.  However that has issues when running on AMD
    hardware, as in that case the guest linear address that triggered the fault
    is not provided as part of the VM exit.  This caused
    mmio_ro_emulated_write() to always fail before calling
    subpage_mmio_write_emulate() when running on AMD and called from an HVM
    context.
    
    Take a different approach and convert the handling of partial read-only
    MMIO page accesses into an HVM MMIO ops handler, as that's the more natural
    way to handle this kind of emulation for HVM domains.
    
    This allows getting rid of hvm_emulate_one_mmio() and it's single call site
    in hvm_hap_nested_page_fault().  As part of the fix r/o MMIO accesses are
    now handled by handle_mmio_with_translation(), re-using the same logic that
    was used for other read-only types part of p2m_is_discard_write().  The
    usage of emulation for faulting p2m_mmio_direct types is limited to
    addresses in the r/o MMIO range. The page present check is dropped as type
    p2m_mmio_direct must have the present bit set in the PTE.
    
    Note a small adjustment is needed to the `pf-fixup` dom0 PVH logic: avoid
    attempting to fixup faults resulting from write accesses to read-only MMIO
    regions, as handling of those accesses is now done by handle_mmio().
    
    Fixes: 33c19df9a5a0 ('x86/PCI: intercept accesses to RO MMIO from dom0s in HVM containers')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/Makefile              |   1 +
 xen/arch/x86/hvm/emulate.c             |  54 +++------------
 xen/arch/x86/hvm/hvm.c                 |  17 ++---
 xen/arch/x86/hvm/mmio.c                | 123 +++++++++++++++++++++++++++++++++
 xen/arch/x86/include/asm/hvm/emulate.h |   1 -
 xen/arch/x86/include/asm/hvm/io.h      |   3 +
 xen/arch/x86/include/asm/mm.h          |  12 ++++
 xen/arch/x86/mm.c                      |  37 +---------
 8 files changed, 158 insertions(+), 90 deletions(-)

diff --git a/xen/arch/x86/hvm/Makefile b/xen/arch/x86/hvm/Makefile
index 4c1fa5c6c2..6ec2c8f2db 100644
--- a/xen/arch/x86/hvm/Makefile
+++ b/xen/arch/x86/hvm/Makefile
@@ -15,6 +15,7 @@ obj-y += intercept.o
 obj-y += io.o
 obj-y += ioreq.o
 obj-y += irq.o
+obj-y += mmio.o
 obj-y += monitor.o
 obj-y += mtrr.o
 obj-y += nestedhvm.o
diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 79c180b408..91f004d233 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -370,7 +370,15 @@ static int hvmemul_do_io(
         /* If there is no suitable backing DM, just ignore accesses */
         if ( !s )
         {
-            if ( is_mmio && is_hardware_domain(currd) )
+            if ( is_mmio && is_hardware_domain(currd) &&
+                 /*
+                  * Do not attempt to fixup write accesses to r/o MMIO regions,
+                  * they are expected to be terminated by the null handler
+                  * below.
+                  */
+                 (dir == IOREQ_READ ||
+                  !rangeset_contains_singleton(mmio_ro_ranges,
+                                               PFN_DOWN(addr))) )
             {
                 /*
                  * PVH dom0 is likely missing MMIO mappings on the p2m, due to
@@ -2859,50 +2867,6 @@ int hvm_emulate_one(
     return _hvm_emulate_one(hvmemul_ctxt, &hvm_emulate_ops, completion);
 }
 
-int hvm_emulate_one_mmio(unsigned long mfn, unsigned long gla)
-{
-    static const struct x86_emulate_ops hvm_ro_emulate_ops_mmio = {
-        .read       = x86emul_unhandleable_rw,
-        .insn_fetch = hvmemul_insn_fetch,
-        .write      = mmio_ro_emulated_write,
-        .validate   = hvmemul_validate,
-    };
-    struct mmio_ro_emulate_ctxt mmio_ro_ctxt = { .cr2 = gla, .mfn = _mfn(mfn) };
-    struct hvm_emulate_ctxt ctxt;
-    unsigned int seg, bdf;
-    int rc;
-
-    if ( pci_ro_mmcfg_decode(mfn, &seg, &bdf) )
-    {
-        /* Should be always handled by vPCI for PVH dom0. */
-        gdprintk(XENLOG_ERR, "unhandled MMCFG access for %pp\n",
-                 &PCI_SBDF(seg, bdf));
-        ASSERT_UNREACHABLE();
-        return X86EMUL_UNHANDLEABLE;
-    }
-
-    hvm_emulate_init_once(&ctxt, x86_insn_is_mem_write,
-                          guest_cpu_user_regs());
-    ctxt.ctxt.data = &mmio_ro_ctxt;
-
-    switch ( rc = _hvm_emulate_one(&ctxt, &hvm_ro_emulate_ops_mmio,
-                                   VIO_no_completion) )
-    {
-    case X86EMUL_UNHANDLEABLE:
-    case X86EMUL_UNIMPLEMENTED:
-        hvm_dump_emulation_state(XENLOG_G_WARNING, "r/o MMIO", &ctxt, rc);
-        break;
-    case X86EMUL_EXCEPTION:
-        hvm_inject_event(&ctxt.ctxt.event);
-        /* fallthrough */
-    default:
-        hvm_emulate_writeback(&ctxt);
-        break;
-    }
-
-    return rc;
-}
-
 void hvm_emulate_one_vm_event(enum emul_kind kind, unsigned int trapnr,
     unsigned int errcode)
 {
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 6f1174c512..6b998387e3 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -8,6 +8,7 @@
  */
 
 #include <xen/init.h>
+#include <xen/io.h>
 #include <xen/ioreq.h>
 #include <xen/lib.h>
 #include <xen/trace.h>
@@ -35,7 +36,6 @@
 #include <asm/current.h>
 #include <asm/debugreg.h>
 #include <asm/e820.h>
-#include <asm/io.h>
 #include <asm/regs.h>
 #include <asm/cpufeature.h>
 #include <asm/processor.h>
@@ -692,6 +692,8 @@ int hvm_domain_initialise(struct domain *d,
 
     register_portio_handler(d, XEN_HVM_DEBUGCONS_IOPORT, 1, hvm_print_line);
 
+    register_subpage_ro_handler(d);
+
     if ( hvm_tsc_scaling_supported )
         d->arch.hvm.tsc_scaling_ratio = hvm_default_tsc_scaling_ratio;
 
@@ -1981,7 +1983,10 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
      */
     if ( (p2mt == p2m_mmio_dm) ||
          (npfec.write_access &&
-          (p2m_is_discard_write(p2mt) || (p2mt == p2m_ioreq_server))) )
+          (p2m_is_discard_write(p2mt) || (p2mt == p2m_ioreq_server) ||
+           /* MMIO entries can be r/o if the target mfn is in mmio_ro_ranges. */
+           (p2mt == p2m_mmio_direct &&
+            rangeset_contains_singleton(mmio_ro_ranges, mfn_x(mfn))))) )
     {
         if ( !handle_mmio_with_translation(gla, gfn, npfec) )
             hvm_inject_hw_exception(X86_EXC_GP, 0);
@@ -2033,14 +2038,6 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
         goto out_put_gfn;
     }
 
-    if ( (p2mt == p2m_mmio_direct) && npfec.write_access && npfec.present &&
-         (is_hardware_domain(currd) || subpage_mmio_write_accept(mfn, gla)) &&
-         (hvm_emulate_one_mmio(mfn_x(mfn), gla) == X86EMUL_OKAY) )
-    {
-        rc = 1;
-        goto out_put_gfn;
-    }
-
     /* If we fell through, the vcpu will retry now that access restrictions have
      * been removed. It may fault again if the p2m entry type still requires so.
      * Otherwise, this is an error condition. */
diff --git a/xen/arch/x86/hvm/mmio.c b/xen/arch/x86/hvm/mmio.c
new file mode 100644
index 0000000000..0fc492f854
--- /dev/null
+++ b/xen/arch/x86/hvm/mmio.c
@@ -0,0 +1,123 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * MMIO related routines.
+ *
+ * Copyright (c) 2025 Cloud Software Group
+ */
+
+#include <xen/io.h>
+#include <xen/mm.h>
+
+#include <asm/p2m.h>
+
+static int cf_check subpage_mmio_accept(struct vcpu *v, unsigned long addr)
+{
+    p2m_type_t t;
+    mfn_t mfn = get_gfn_query_unlocked(v->domain, PFN_DOWN(addr), &t);
+
+    return !mfn_eq(mfn, INVALID_MFN) && t == p2m_mmio_direct &&
+           subpage_mmio_find_page(mfn);
+}
+
+/*
+ * The guest has read access to those regions, and consequently read accesses
+ * shouldn't fault.  However read-modify-write operations may take this path,
+ * so handling of reads is necessary.
+ */
+static int cf_check subpage_mmio_read(
+    struct vcpu *v, unsigned long addr, unsigned int len, unsigned long *data)
+{
+    struct domain *d = v->domain;
+    unsigned long gfn = PFN_DOWN(addr);
+    p2m_type_t t;
+    mfn_t mfn;
+    struct subpage_ro_range *entry;
+    volatile void __iomem *mem;
+
+    *data = ~0UL;
+
+    if ( !len || len > 8 || (len & (len - 1)) || !IS_ALIGNED(addr, len) )
+    {
+        gprintk(XENLOG_ERR, "ignoring read to r/o MMIO subpage %#lx size %u\n",
+                addr, len);
+        return X86EMUL_OKAY;
+    }
+
+    mfn = get_gfn_query(d, gfn, &t);
+    if ( mfn_eq(mfn, INVALID_MFN) || t != p2m_mmio_direct )
+    {
+        put_gfn(d, gfn);
+        return X86EMUL_RETRY;
+    }
+
+    entry = subpage_mmio_find_page(mfn);
+    if ( !entry )
+    {
+        put_gfn(d, gfn);
+        return X86EMUL_OKAY;
+    }
+
+    mem = subpage_mmio_map_page(entry);
+    if ( !mem )
+    {
+        put_gfn(d, gfn);
+        gprintk(XENLOG_ERR,
+                "Failed to map page for MMIO read at %#lx -> %#lx\n",
+                addr, mfn_to_maddr(mfn) + PAGE_OFFSET(addr));
+        return X86EMUL_OKAY;
+    }
+
+    *data = read_mmio(mem + PAGE_OFFSET(addr), len);
+
+    put_gfn(d, gfn);
+    return X86EMUL_OKAY;
+}
+
+static int cf_check subpage_mmio_write(
+    struct vcpu *v, unsigned long addr, unsigned int len, unsigned long data)
+{
+    struct domain *d = v->domain;
+    unsigned long gfn = PFN_DOWN(addr);
+    p2m_type_t t;
+    mfn_t mfn;
+
+    if ( !len || len > 8 || (len & (len - 1)) || !IS_ALIGNED(addr, len) )
+    {
+        gprintk(XENLOG_ERR, "ignoring write to r/o MMIO subpage %#lx size %u\n",
+                addr, len);
+        return X86EMUL_OKAY;
+    }
+
+    mfn = get_gfn_query(d, gfn, &t);
+    if ( mfn_eq(mfn, INVALID_MFN) || t != p2m_mmio_direct )
+    {
+        put_gfn(d, gfn);
+        return X86EMUL_RETRY;
+    }
+
+    subpage_mmio_write_emulate(mfn, PAGE_OFFSET(addr), data, len);
+
+    put_gfn(d, gfn);
+    return X86EMUL_OKAY;
+}
+
+void register_subpage_ro_handler(struct domain *d)
+{
+    static const struct hvm_mmio_ops subpage_mmio_ops = {
+        .check = subpage_mmio_accept,
+        .read = subpage_mmio_read,
+        .write = subpage_mmio_write,
+    };
+
+    register_mmio_handler(d, &subpage_mmio_ops);
+}
+
+/*
+ * 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/include/asm/hvm/emulate.h b/xen/arch/x86/include/asm/hvm/emulate.h
index c7a2d2a5be..178ac32e15 100644
--- a/xen/arch/x86/include/asm/hvm/emulate.h
+++ b/xen/arch/x86/include/asm/hvm/emulate.h
@@ -86,7 +86,6 @@ void hvmemul_cancel(struct vcpu *v);
 struct segment_register *hvmemul_get_seg_reg(
     enum x86_segment seg,
     struct hvm_emulate_ctxt *hvmemul_ctxt);
-int hvm_emulate_one_mmio(unsigned long mfn, unsigned long gla);
 
 static inline bool handle_mmio(void)
 {
diff --git a/xen/arch/x86/include/asm/hvm/io.h b/xen/arch/x86/include/asm/hvm/io.h
index 565bad300d..c12f099a03 100644
--- a/xen/arch/x86/include/asm/hvm/io.h
+++ b/xen/arch/x86/include/asm/hvm/io.h
@@ -135,6 +135,9 @@ void destroy_vpci_mmcfg(struct domain *d);
 /* Remove MMCFG regions from a domain ->iomem_caps. */
 int vpci_mmcfg_deny_access(struct domain *d);
 
+/* r/o MMIO subpage access handler. */
+void register_subpage_ro_handler(struct domain *d);
+
 #endif /* __ASM_X86_HVM_IO_H__ */
 
 
diff --git a/xen/arch/x86/include/asm/mm.h b/xen/arch/x86/include/asm/mm.h
index a1bc8cc274..c2e9ef6e50 100644
--- a/xen/arch/x86/include/asm/mm.h
+++ b/xen/arch/x86/include/asm/mm.h
@@ -554,6 +554,18 @@ int cf_check mmio_ro_emulated_write(
     enum x86_segment seg, unsigned long offset, void *p_data,
     unsigned int bytes, struct x86_emulate_ctxt *ctxt);
 
+/* r/o MMIO subpage access handlers. */
+struct subpage_ro_range {
+    struct list_head list;
+    mfn_t mfn;
+    void __iomem *mapped;
+    DECLARE_BITMAP(ro_elems, PAGE_SIZE / MMIO_RO_SUBPAGE_GRAN);
+};
+struct subpage_ro_range *subpage_mmio_find_page(mfn_t mfn);
+void __iomem *subpage_mmio_map_page(struct subpage_ro_range *entry);
+void subpage_mmio_write_emulate(
+    mfn_t mfn, unsigned int offset, unsigned long data, unsigned int len);
+
 int audit_adjust_pgtables(struct domain *d, int dir, int noisy);
 
 extern int pagefault_by_memadd(unsigned long addr, struct cpu_user_regs *regs);
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 732ca1366f..7ead2db3cb 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -157,13 +157,6 @@ struct rangeset *__read_mostly mmio_ro_ranges;
 static uint32_t __ro_after_init base_disallow_mask;
 
 /* Handling sub-page read-only MMIO regions */
-struct subpage_ro_range {
-    struct list_head list;
-    mfn_t mfn;
-    void __iomem *mapped;
-    DECLARE_BITMAP(ro_elems, PAGE_SIZE / MMIO_RO_SUBPAGE_GRAN);
-};
-
 static LIST_HEAD_RO_AFTER_INIT(subpage_ro_ranges);
 static DEFINE_SPINLOCK(subpage_ro_lock);
 
@@ -4929,7 +4922,7 @@ long arch_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     return rc;
 }
 
-static struct subpage_ro_range *subpage_mmio_find_page(mfn_t mfn)
+struct subpage_ro_range *subpage_mmio_find_page(mfn_t mfn)
 {
     struct subpage_ro_range *entry;
 
@@ -5074,7 +5067,7 @@ int __init subpage_mmio_ro_add(
     return rc;
 }
 
-static void __iomem *subpage_mmio_map_page(
+void __iomem *subpage_mmio_map_page(
     struct subpage_ro_range *entry)
 {
     void __iomem *mapped_page;
@@ -5099,7 +5092,7 @@ static void __iomem *subpage_mmio_map_page(
     return entry->mapped;
 }
 
-static void subpage_mmio_write_emulate(
+void subpage_mmio_write_emulate(
     mfn_t mfn,
     unsigned int offset,
     unsigned long data,
@@ -5135,30 +5128,6 @@ static void subpage_mmio_write_emulate(
         goto write_ignored;
 }
 
-#ifdef CONFIG_HVM
-bool subpage_mmio_write_accept(mfn_t mfn, unsigned long gla)
-{
-    unsigned int offset = PAGE_OFFSET(gla);
-    const struct subpage_ro_range *entry;
-
-    entry = subpage_mmio_find_page(mfn);
-    if ( !entry )
-        return false;
-
-    if ( !test_bit(offset / MMIO_RO_SUBPAGE_GRAN, entry->ro_elems) )
-    {
-        /*
-         * We don't know the write size at this point yet, so it could be
-         * an unaligned write, but accept it here anyway and deal with it
-         * later.
-         */
-        return true;
-    }
-
-    return false;
-}
-#endif
-
 int cf_check mmio_ro_emulated_write(
     enum x86_segment seg,
     unsigned long offset,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 14:44:22 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 14:44:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972764.1361067 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9mC6-0004yt-VG; Tue, 29 Apr 2025 14:44:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972764.1361067; Tue, 29 Apr 2025 14: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 1u9mC6-0004yl-Sl; Tue, 29 Apr 2025 14:44:22 +0000
Received: by outflank-mailman (input) for mailman id 972764;
 Tue, 29 Apr 2025 14:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u9mC6-0004ya-2c
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 14:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9mC6-00CuIL-09
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 14:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9mC5-002wXN-3D
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 14:44:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+goO77242Y421LGdxCjTldPuBuy74uSH3rm5xeUwBP0=; b=dZH9xScWFls9/fyLhUTQDwCrC6
	NluVvi3AASLJD8DWebos7aPKBhDvMHW4E/sk+PWAeLYOawuacOGeDLCqDLkt2kg9OwGaZSCqGxvGn
	+oZW3IOuHZlPWO31P+YwfqfPWGoAw+2PUH6atC9frtdi8l99AwGYWIbofrFrd5l1UX/w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/hvm: only register the r/o subpage ops when needed
Message-Id: <E1u9mC5-002wXN-3D@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 14:44:21 +0000

commit 06fd6818eae5878397e36d542251e1ad17805262
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Apr 11 10:31:22 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Tue Apr 29 14:49:54 2025 +0200

    x86/hvm: only register the r/o subpage ops when needed
    
    MMIO operation handlers can be expensive to process, hence attempt to
    register only those that will be needed by the domain.
    
    Subpage r/o MMIO regions are added exclusively at boot, further limit their
    addition to strictly before the initial domain gets created, so by the time
    initial domain creation happens Xen knows whether subpage is required or
    not.  This allows only registering the MMIO handler when there are
    subpage regions to handle.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/hvm.c        |  3 ++-
 xen/arch/x86/include/asm/mm.h |  1 +
 xen/arch/x86/mm.c             | 16 ++++++++++++++++
 3 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 6b998387e3..4cb2e13046 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -692,7 +692,8 @@ int hvm_domain_initialise(struct domain *d,
 
     register_portio_handler(d, XEN_HVM_DEBUGCONS_IOPORT, 1, hvm_print_line);
 
-    register_subpage_ro_handler(d);
+    if ( subpage_ro_active() )
+        register_subpage_ro_handler(d);
 
     if ( hvm_tsc_scaling_supported )
         d->arch.hvm.tsc_scaling_ratio = hvm_default_tsc_scaling_ratio;
diff --git a/xen/arch/x86/include/asm/mm.h b/xen/arch/x86/include/asm/mm.h
index c2e9ef6e50..aeb8ebcf2d 100644
--- a/xen/arch/x86/include/asm/mm.h
+++ b/xen/arch/x86/include/asm/mm.h
@@ -561,6 +561,7 @@ struct subpage_ro_range {
     void __iomem *mapped;
     DECLARE_BITMAP(ro_elems, PAGE_SIZE / MMIO_RO_SUBPAGE_GRAN);
 };
+bool subpage_ro_active(void);
 struct subpage_ro_range *subpage_mmio_find_page(mfn_t mfn);
 void __iomem *subpage_mmio_map_page(struct subpage_ro_range *entry);
 void subpage_mmio_write_emulate(
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 7ead2db3cb..6697984507 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4922,6 +4922,11 @@ long arch_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     return rc;
 }
 
+bool subpage_ro_active(void)
+{
+    return !list_empty(&subpage_ro_ranges);
+}
+
 struct subpage_ro_range *subpage_mmio_find_page(mfn_t mfn)
 {
     struct subpage_ro_range *entry;
@@ -5011,6 +5016,17 @@ int __init subpage_mmio_ro_add(
          !IS_ALIGNED(size, MMIO_RO_SUBPAGE_GRAN) )
         return -EINVAL;
 
+    /*
+     * Force all r/o subregions to be registered before initial domain
+     * creation, so that the emulation handlers can be added only when there
+     * are pages registered.
+     */
+    if ( system_state >= SYS_STATE_smp_boot )
+    {
+        ASSERT_UNREACHABLE();
+        return -EILSEQ;
+    }
+
     if ( !size )
         return 0;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 29 14:44:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2025 14:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.972765.1361071 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1u9mCH-00051D-0W; Tue, 29 Apr 2025 14:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 972765.1361071; Tue, 29 Apr 2025 14:44: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 1u9mCG-000515-U6; Tue, 29 Apr 2025 14:44:32 +0000
Received: by outflank-mailman (input) for mailman id 972765;
 Tue, 29 Apr 2025 14:44:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1u9mCG-00050y-5d
 for xen-changelog@lists.xenproject.org; Tue, 29 Apr 2025 14:44:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9mCG-00CuIV-0S
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 14:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1u9mCG-002wdA-0L
 for xen-changelog@lists.xenproject.org;
 Tue, 29 Apr 2025 14:44:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1VL8WFFt87m1sDX0tzs0w34vJ2m+wIkx14OfVQ5Iq6E=; b=IlmxEwJM6wKQuwYi6Y89HyhCny
	24YZseuhlxVFvw/VZ2lo2tbR5uQkKKtmcpGndk+2qh82nAIjFkU2BZ96BKNb9r+e96iuIzMg10wYY
	7mFX7e+SbN1fn/+3F2q1duXWUIvxF4docpCrbtAPP73LdJ9ogFXdXZcRdHWavgUbo3co=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mm: move mmio_ro_emulated_write() to PV only file
Message-Id: <E1u9mCG-002wdA-0L@xenbits.xenproject.org>
Date: Tue, 29 Apr 2025 14:44:32 +0000

commit ff3e5dfa7c2d09825dfd8545d49920830fa71243
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Apr 10 11:48:03 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Tue Apr 29 14:49:54 2025 +0200

    x86/mm: move mmio_ro_emulated_write() to PV only file
    
    mmio_ro_emulated_write() is only used in pv/ro-page-fault.c, move the
    function to that file and make it static.
    
    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/mm.h   | 12 ------------
 xen/arch/x86/mm.c               | 33 ---------------------------------
 xen/arch/x86/pv/ro-page-fault.c | 41 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 41 insertions(+), 45 deletions(-)

diff --git a/xen/arch/x86/include/asm/mm.h b/xen/arch/x86/include/asm/mm.h
index aeb8ebcf2d..2665daa6f7 100644
--- a/xen/arch/x86/include/asm/mm.h
+++ b/xen/arch/x86/include/asm/mm.h
@@ -542,18 +542,6 @@ void memguard_unguard_stack(void *p);
 int subpage_mmio_ro_add(paddr_t start, size_t size);
 bool subpage_mmio_write_accept(mfn_t mfn, unsigned long gla);
 
-struct mmio_ro_emulate_ctxt {
-        unsigned long cr2;
-        /* Used only for mmcfg case */
-        unsigned int seg, bdf;
-        /* Used only for non-mmcfg case */
-        mfn_t mfn;
-};
-
-int cf_check mmio_ro_emulated_write(
-    enum x86_segment seg, unsigned long offset, void *p_data,
-    unsigned int bytes, struct x86_emulate_ctxt *ctxt);
-
 /* r/o MMIO subpage access handlers. */
 struct subpage_ro_range {
     struct list_head list;
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 6697984507..9ac855f998 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5144,39 +5144,6 @@ void subpage_mmio_write_emulate(
         goto write_ignored;
 }
 
-int cf_check mmio_ro_emulated_write(
-    enum x86_segment seg,
-    unsigned long offset,
-    void *p_data,
-    unsigned int bytes,
-    struct x86_emulate_ctxt *ctxt)
-{
-    struct mmio_ro_emulate_ctxt *mmio_ro_ctxt = ctxt->data;
-    unsigned long data = 0;
-
-    /* Only allow naturally-aligned stores at the original %cr2 address. */
-    if ( ((bytes | offset) & (bytes - 1)) || !bytes ||
-         offset != mmio_ro_ctxt->cr2 )
-    {
-        gdprintk(XENLOG_WARNING, "bad access (cr2=%lx, addr=%lx, bytes=%u)\n",
-                mmio_ro_ctxt->cr2, offset, bytes);
-        return X86EMUL_UNHANDLEABLE;
-    }
-
-    if ( bytes <= sizeof(data) )
-    {
-        memcpy(&data, p_data, bytes);
-        subpage_mmio_write_emulate(mmio_ro_ctxt->mfn, PAGE_OFFSET(offset),
-                                   data, bytes);
-    }
-    else if ( subpage_mmio_find_page(mmio_ro_ctxt->mfn) )
-        gprintk(XENLOG_WARNING,
-                "unsupported %u-byte write to R/O MMIO 0x%"PRI_mfn"%03lx\n",
-                bytes, mfn_x(mmio_ro_ctxt->mfn), PAGE_OFFSET(offset));
-
-    return X86EMUL_OKAY;
-}
-
 /*
  * For these PTE APIs, the caller must follow the alloc-map-unmap-free
  * lifecycle, which means explicitly mapping the PTE pages before accessing
diff --git a/xen/arch/x86/pv/ro-page-fault.c b/xen/arch/x86/pv/ro-page-fault.c
index 11b01c479e..5ae7708077 100644
--- a/xen/arch/x86/pv/ro-page-fault.c
+++ b/xen/arch/x86/pv/ro-page-fault.c
@@ -298,6 +298,14 @@ static int ptwr_do_page_fault(struct x86_emulate_ctxt *ctxt,
  * fault handling for read-only MMIO pages
  */
 
+struct mmio_ro_emulate_ctxt {
+    unsigned long cr2;
+    /* Used only for mmcfg case */
+    unsigned int seg, bdf;
+    /* Used only for non-mmcfg case */
+    mfn_t mfn;
+};
+
 static int cf_check mmcfg_intercept_write(
     enum x86_segment seg,
     unsigned long offset,
@@ -329,6 +337,39 @@ static int cf_check mmcfg_intercept_write(
     return X86EMUL_OKAY;
 }
 
+int cf_check mmio_ro_emulated_write(
+    enum x86_segment seg,
+    unsigned long offset,
+    void *p_data,
+    unsigned int bytes,
+    struct x86_emulate_ctxt *ctxt)
+{
+    struct mmio_ro_emulate_ctxt *mmio_ro_ctxt = ctxt->data;
+    unsigned long data = 0;
+
+    /* Only allow naturally-aligned stores at the original %cr2 address. */
+    if ( ((bytes | offset) & (bytes - 1)) || !bytes ||
+         offset != mmio_ro_ctxt->cr2 )
+    {
+        gdprintk(XENLOG_WARNING, "bad access (cr2=%lx, addr=%lx, bytes=%u)\n",
+                mmio_ro_ctxt->cr2, offset, bytes);
+        return X86EMUL_UNHANDLEABLE;
+    }
+
+    if ( bytes <= sizeof(data) )
+    {
+        memcpy(&data, p_data, bytes);
+        subpage_mmio_write_emulate(mmio_ro_ctxt->mfn, PAGE_OFFSET(offset),
+                                   data, bytes);
+    }
+    else if ( subpage_mmio_find_page(mmio_ro_ctxt->mfn) )
+        gprintk(XENLOG_WARNING,
+                "unsupported %u-byte write to R/O MMIO 0x%"PRI_mfn"%03lx\n",
+                bytes, mfn_x(mmio_ro_ctxt->mfn), PAGE_OFFSET(offset));
+
+    return X86EMUL_OKAY;
+}
+
 static const struct x86_emulate_ops mmio_ro_emulate_ops = {
     .read       = x86emul_unhandleable_rw,
     .insn_fetch = ptwr_emulated_insn_fetch,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 30 06:55:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Apr 2025 06:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.973397.1361520 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1uA1LT-0004V2-OB; Wed, 30 Apr 2025 06:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 973397.1361520; Wed, 30 Apr 2025 06: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 1uA1LT-0004Uu-L7; Wed, 30 Apr 2025 06:55:03 +0000
Received: by outflank-mailman (input) for mailman id 973397;
 Wed, 30 Apr 2025 06: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 1uA1LS-0004Um-AC
 for xen-changelog@lists.xenproject.org; Wed, 30 Apr 2025 06: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 1uA1LS-00Ezpw-0W
 for xen-changelog@lists.xenproject.org;
 Wed, 30 Apr 2025 06:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1uA1LS-002j7n-0M
 for xen-changelog@lists.xenproject.org;
 Wed, 30 Apr 2025 06: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=GTRUQjNsUTGkixRTWwgupvZOFkxfdNYis+OoUO7Dk48=; b=mYmmq9BMq5iH9kySxAiOWwKx1j
	FT0hgP+GmjZ1HZBXiacon9kJYNjRQDZkyg3UIgUbajsMMYpXlM+OBN7KFE0TImRYVjtGlzACuSReU
	XfxsV5EO/CdTVTHFH3P131LFFFz91X27Kf+aCW9AmLkdovJJ0+Su2qNtjsSxel6Nnyl4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86emul: avoid UB shifts in FLDENV/FRSTOR handling
Message-Id: <E1uA1LS-002j7n-0M@xenbits.xenproject.org>
Date: Wed, 30 Apr 2025 06:55:02 +0000

commit d00fc019b6eba68bd7f2186a6427e5a005ce989f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Apr 30 08:46:21 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 30 08:46:21 2025 +0200

    x86emul: avoid UB shifts in FLDENV/FRSTOR handling
    
    16-bit quantities, no matter whether expressed as uint16_t or as
    bitfield, will be promoted to plain int before doing any arithmetic on
    them. Shifting such values by 16 will therefore shift into the sign bit,
    which is UB if that bit becomes set. To account for all reads and all
    writes accessing opposite members of the same union, introduce yet more
    local variables to reduce the shift counts to 12.
    
    Fixes: be55ed744ed8 ("x86emul: support FLDENV and FRSTOR")
    Reported-by: Fabian Specht <f.specht@tum.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/x86_emulate/blk.c | 36 ++++++++++++++++++++----------------
 1 file changed, 20 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/blk.c b/xen/arch/x86/x86_emulate/blk.c
index 494e6c1e3b..9fddf649ee 100644
--- a/xen/arch/x86/x86_emulate/blk.c
+++ b/xen/arch/x86/x86_emulate/blk.c
@@ -81,17 +81,19 @@ int x86_emul_blk(
             if ( !s->rex_prefix )
             {
                 /* Convert 32-bit real/vm86 to 32-bit prot format. */
-                unsigned int fip = fpstate.env.mode.real.fip_lo +
-                                   (fpstate.env.mode.real.fip_hi << 16);
-                unsigned int fdp = fpstate.env.mode.real.fdp_lo +
-                                   (fpstate.env.mode.real.fdp_hi << 16);
+                unsigned int fip = fpstate.env.mode.real.fip_lo & 0xf;
+                unsigned int fcs = (fpstate.env.mode.real.fip_lo >> 4) |
+                                   (fpstate.env.mode.real.fip_hi << 12);
+                unsigned int fdp = fpstate.env.mode.real.fdp_lo & 0xf;
+                unsigned int fds = (fpstate.env.mode.real.fdp_lo >> 4) |
+                                   (fpstate.env.mode.real.fdp_hi << 12);
                 unsigned int fop = fpstate.env.mode.real.fop;
 
-                fpstate.env.mode.prot.fip = fip & 0xf;
-                fpstate.env.mode.prot.fcs = fip >> 4;
+                fpstate.env.mode.prot.fip = fip;
+                fpstate.env.mode.prot.fcs = fcs;
                 fpstate.env.mode.prot.fop = fop;
-                fpstate.env.mode.prot.fdp = fdp & 0xf;
-                fpstate.env.mode.prot.fds = fdp >> 4;
+                fpstate.env.mode.prot.fdp = fdp;
+                fpstate.env.mode.prot.fds = fds;
             }
 
             if ( bytes == sizeof(fpstate.env) )
@@ -121,17 +123,19 @@ int x86_emul_blk(
             else
             {
                 /* Convert 16-bit real/vm86 to 32-bit prot format. */
-                unsigned int fip = env->mode.real.fip_lo +
-                                   (env->mode.real.fip_hi << 16);
-                unsigned int fdp = env->mode.real.fdp_lo +
-                                   (env->mode.real.fdp_hi << 16);
+                unsigned int fip = env->mode.real.fip_lo & 0xf;
+                unsigned int fcs = (env->mode.real.fip_lo >> 4) |
+                                   (env->mode.real.fip_hi << 12);
+                unsigned int fdp = env->mode.real.fdp_lo & 0xf;
+                unsigned int fds = (env->mode.real.fdp_lo >> 4) |
+                                   (env->mode.real.fdp_hi << 12);
                 unsigned int fop = env->mode.real.fop;
 
-                fpstate.env.mode.prot.fip = fip & 0xf;
-                fpstate.env.mode.prot.fcs = fip >> 4;
+                fpstate.env.mode.prot.fip = fip;
+                fpstate.env.mode.prot.fcs = fcs;
                 fpstate.env.mode.prot.fop = fop;
-                fpstate.env.mode.prot.fdp = fdp & 0xf;
-                fpstate.env.mode.prot.fds = fdp >> 4;
+                fpstate.env.mode.prot.fdp = fdp;
+                fpstate.env.mode.prot.fds = fds;
             }
 
             if ( bytes == sizeof(*env) )
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 30 06:55:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Apr 2025 06:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.973398.1361523 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1uA1Ld-0004Xg-RH; Wed, 30 Apr 2025 06:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 973398.1361523; Wed, 30 Apr 2025 06: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 1uA1Ld-0004XY-Oo; Wed, 30 Apr 2025 06:55:13 +0000
Received: by outflank-mailman (input) for mailman id 973398;
 Wed, 30 Apr 2025 06: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 1uA1Lc-0004XJ-Iq
 for xen-changelog@lists.xenproject.org; Wed, 30 Apr 2025 06: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 1uA1Lc-00Ezq2-1k
 for xen-changelog@lists.xenproject.org;
 Wed, 30 Apr 2025 06:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1uA1Lc-002jUC-1U
 for xen-changelog@lists.xenproject.org;
 Wed, 30 Apr 2025 06: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=mQ4MQplnqpXpyQ3lPtv+xdmGqJV8jM+DdRZtwIgC1xI=; b=edrBG27Wa+UizDweRJ1Cah6Sle
	Hmyrq7M7H14H8L4ddbK9WObQBmQBcHgFBs9g02A/zOUdprrn1g0s6VF5BBzgo/h1TNhTbQLSovgYV
	1/gv3jTQ/Vro70ZSywcXY5NtoHgJ57qwyIM5LVkzHRr/ejXOlTzVRgRtKwH6UqAljlHg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: drop underscore-prefixed {maddr,virt} <=> page conversion macros
Message-Id: <E1uA1Lc-002jUC-1U@xenbits.xenproject.org>
Date: Wed, 30 Apr 2025 06:55:12 +0000

commit 16d5d2292abe7569c1cf737f04ca7308b9e489c0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Apr 30 08:46:49 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 30 08:46:49 2025 +0200

    x86: drop underscore-prefixed {maddr,virt} <=> page conversion macros
    
    Unlike the ones converting to/from frame numbers, these don't have type-
    safe overrides, and they also can't gain any within our present type
    system. Unsurprisingly we also don't have any uses of the underscore-
    prefixed variants.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/include/asm/mm.h   | 4 ++--
 xen/arch/x86/include/asm/page.h | 8 ++------
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/include/asm/mm.h b/xen/arch/x86/include/asm/mm.h
index 2665daa6f7..d6e80db71c 100644
--- a/xen/arch/x86/include/asm/mm.h
+++ b/xen/arch/x86/include/asm/mm.h
@@ -342,7 +342,7 @@ void init_frametable(void);
 #define PDX_GROUP_SHIFT L2_PAGETABLE_SHIFT
 
 /* Convert between Xen-heap virtual addresses and page-info structures. */
-static inline struct page_info *__virt_to_page(const void *v)
+static inline struct page_info *virt_to_page(const void *v)
 {
     unsigned long va = (unsigned long)v;
 
@@ -355,7 +355,7 @@ static inline struct page_info *__virt_to_page(const void *v)
     return frame_table + ((va - DIRECTMAP_VIRT_START) >> PAGE_SHIFT);
 }
 
-static inline void *__page_to_virt(const struct page_info *pg)
+static inline void *page_to_virt(const struct page_info *pg)
 {
     ASSERT((unsigned long)pg - FRAMETABLE_VIRT_START < FRAMETABLE_SIZE);
     /*
diff --git a/xen/arch/x86/include/asm/page.h b/xen/arch/x86/include/asm/page.h
index e01af28916..24135f5968 100644
--- a/xen/arch/x86/include/asm/page.h
+++ b/xen/arch/x86/include/asm/page.h
@@ -238,8 +238,8 @@ void copy_page_sse2(void *to, const void *from);
 #define page_to_mfn(pg)     pdx_to_mfn((unsigned long)((pg) - frame_table))
 
 /* Convert between machine addresses and page-info structures. */
-#define __maddr_to_page(ma) mfn_to_page(maddr_to_mfn(ma))
-#define __page_to_maddr(pg) mfn_to_maddr(page_to_mfn(pg))
+#define maddr_to_page(ma)   mfn_to_page(maddr_to_mfn(ma))
+#define page_to_maddr(pg)   mfn_to_maddr(page_to_mfn(pg))
 
 /* Convert between frame number and address formats.  */
 #define __pfn_to_paddr(pfn) ((paddr_t)(pfn) << PAGE_SHIFT)
@@ -256,10 +256,6 @@ void copy_page_sse2(void *to, const void *from);
 #define mfn_valid(mfn)      __mfn_valid(mfn_x(mfn))
 #define virt_to_mfn(va)     __virt_to_mfn(va)
 #define mfn_to_virt(mfn)    __mfn_to_virt(mfn)
-#define maddr_to_page(ma)   __maddr_to_page(ma)
-#define page_to_maddr(pg)   __page_to_maddr(pg)
-#define virt_to_page(va)    __virt_to_page(va)
-#define page_to_virt(pg)    __page_to_virt(pg)
 #define pfn_to_paddr(pfn)   __pfn_to_paddr(pfn)
 #define paddr_to_pfn(pa)    __paddr_to_pfn(pa)
 #define paddr_to_pdx(pa)    pfn_to_pdx(paddr_to_pfn(pa))
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 30 06:55:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Apr 2025 06:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.973399.1361527 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1uA1Ln-0004aH-Sq; Wed, 30 Apr 2025 06:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 973399.1361527; Wed, 30 Apr 2025 06: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 1uA1Ln-0004a9-QD; Wed, 30 Apr 2025 06:55:23 +0000
Received: by outflank-mailman (input) for mailman id 973399;
 Wed, 30 Apr 2025 06: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 1uA1Lm-0004Zz-LU
 for xen-changelog@lists.xenproject.org; Wed, 30 Apr 2025 06: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 1uA1Lm-00Ezq7-22
 for xen-changelog@lists.xenproject.org;
 Wed, 30 Apr 2025 06:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1uA1Lm-002juZ-1v
 for xen-changelog@lists.xenproject.org;
 Wed, 30 Apr 2025 06: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=LhydXE02I10iW/LjD4z3RCrj9td5gBDY2akLJQaXO2Y=; b=SS0kTUv+fDb96Qr+gd07XGA7Uw
	jW7YzGgvMBGXlSGGhGB4igm/IV3DnOfsBOUuzgCYuDG9l3fyNpJNNG1bBqREKmuMoeKm7CECAQYag
	hk/1027qYmJOfpx40VB36Yju0mAoTag1ITaCFRYejJu887GdBp/+DL9wByAj/m6JJD80=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] cpufreq: use existing local var in cpufreq_statistic_init()
Message-Id: <E1uA1Lm-002juZ-1v@xenbits.xenproject.org>
Date: Wed, 30 Apr 2025 06:55:22 +0000

commit c6e0a55396233bd7de6646a9b9be8d7c59950648
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Apr 30 08:47:15 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 30 08:47:15 2025 +0200

    cpufreq: use existing local var in cpufreq_statistic_init()
    
    ..., which actually also helps readability (imo).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/drivers/cpufreq/utility.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/cpufreq/utility.c b/xen/drivers/cpufreq/utility.c
index e690a484f1..ac2889d496 100644
--- a/xen/drivers/cpufreq/utility.c
+++ b/xen/drivers/cpufreq/utility.c
@@ -130,10 +130,10 @@ int cpufreq_statistic_init(unsigned int cpu)
         return -ENOMEM;
     }
 
-    pxpt->u.total = pmpt->perf.state_count;
-    pxpt->u.usable = pmpt->perf.state_count - pmpt->perf.platform_limit;
+    pxpt->u.total = count;
+    pxpt->u.usable = count - pmpt->perf.platform_limit;
 
-    for (i=0; i < pmpt->perf.state_count; i++)
+    for ( i = 0; i < count; i++ )
         pxpt->u.pt[i].freq = pmpt->perf.states[i].core_frequency;
 
     pxpt->prev_state_wall = NOW();
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 30 06:55:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Apr 2025 06:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.973400.1361532 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1uA1Lx-0004cw-UL; Wed, 30 Apr 2025 06:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 973400.1361532; Wed, 30 Apr 2025 06: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 1uA1Lx-0004co-Rc; Wed, 30 Apr 2025 06:55:33 +0000
Received: by outflank-mailman (input) for mailman id 973400;
 Wed, 30 Apr 2025 06: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 1uA1Lw-0004cY-Nz
 for xen-changelog@lists.xenproject.org; Wed, 30 Apr 2025 06: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 1uA1Lw-00EzqD-2J
 for xen-changelog@lists.xenproject.org;
 Wed, 30 Apr 2025 06:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1uA1Lw-002kI8-2D
 for xen-changelog@lists.xenproject.org;
 Wed, 30 Apr 2025 06: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=+UQ6z40VWIWneio96SKdw9gB/TIeG6iFt4IPl4Ooi/o=; b=tGZ07+nwoVnk32GR9408DXXfIa
	wayH7KVRyY0SFcAetTBINb5ZyhjN0xxqYJlN6IVzmY+KOi3RHwBsQB/47ThKmxejWy0crgkxr92wP
	FkGaS+dcPOl2bj+IyCh0/58JbNhHHV5Syst5KwktNV/tk7fM67Sw5QvWyd8PxqJYPgU0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] cpufreq: don't leave stale statistics pointer
Message-Id: <E1uA1Lw-002kI8-2D@xenbits.xenproject.org>
Date: Wed, 30 Apr 2025 06:55:32 +0000

commit a1ce987411f61dbf5fe64bba0cd3d36d7cc0311f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Apr 30 08:47:49 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 30 08:47:49 2025 +0200

    cpufreq: don't leave stale statistics pointer
    
    Error paths of cpufreq_statistic_init() correctly free the base
    structure pointer, but the per-CPU variable would still hold it, mis-
    guiding e.g. cpufreq_statistic_update(). Defer installing of the pointer
    there until the structure was fully populated.
    
    Fixes: 755af07edba1 ("x86/cpufreq: don't use static array for large per-CPU data structures")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/drivers/cpufreq/utility.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/cpufreq/utility.c b/xen/drivers/cpufreq/utility.c
index ac2889d496..309c0682cf 100644
--- a/xen/drivers/cpufreq/utility.c
+++ b/xen/drivers/cpufreq/utility.c
@@ -113,7 +113,6 @@ int cpufreq_statistic_init(unsigned int cpu)
         spin_unlock(cpufreq_statistic_lock);
         return -ENOMEM;
     }
-    per_cpu(cpufreq_statistic_data, cpu) = pxpt;
 
     pxpt->u.trans_pt = xzalloc_array(uint64_t, count * count);
     if (!pxpt->u.trans_pt) {
@@ -139,6 +138,8 @@ int cpufreq_statistic_init(unsigned int cpu)
     pxpt->prev_state_wall = NOW();
     pxpt->prev_idle_wall = get_cpu_idle_time(cpu);
 
+    per_cpu(cpufreq_statistic_data, cpu) = pxpt;
+
     spin_unlock(cpufreq_statistic_lock);
 
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 30 07:44:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Apr 2025 07:44:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.973475.1361589 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1uA26t-0006Tf-JO; Wed, 30 Apr 2025 07:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 973475.1361589; Wed, 30 Apr 2025 07: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 1uA26t-0006TX-Gq; Wed, 30 Apr 2025 07:44:03 +0000
Received: by outflank-mailman (input) for mailman id 973475;
 Wed, 30 Apr 2025 07:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1uA26s-0006TR-3y
 for xen-changelog@lists.xenproject.org; Wed, 30 Apr 2025 07:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1uA26r-00F1MO-2o
 for xen-changelog@lists.xenproject.org;
 Wed, 30 Apr 2025 07:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1uA26r-004NvV-2g
 for xen-changelog@lists.xenproject.org;
 Wed, 30 Apr 2025 07: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=oRxOFQkopC//HVy/e09eTmd307eqa9GLJRoC/SpnJXI=; b=Idr5kOzFHWBAEzlLspGAXJyEgl
	IVr28hKwliItFK/G++MjnTaWP0/DK5iBu8GtICnqyIkaerhwljnZdIJQNGrSzeo5YX41dcnRISCNF
	7qTaVGD+0T+xWPpYxQVimkimK89yAqbDfzs0UquleVFrLzdGl1O2dqzYKunqIJWiOWZ0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86emul: avoid UB shifts in FLDENV/FRSTOR handling
Message-Id: <E1uA26r-004NvV-2g@xenbits.xenproject.org>
Date: Wed, 30 Apr 2025 07:44:01 +0000

commit d00fc019b6eba68bd7f2186a6427e5a005ce989f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Apr 30 08:46:21 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 30 08:46:21 2025 +0200

    x86emul: avoid UB shifts in FLDENV/FRSTOR handling
    
    16-bit quantities, no matter whether expressed as uint16_t or as
    bitfield, will be promoted to plain int before doing any arithmetic on
    them. Shifting such values by 16 will therefore shift into the sign bit,
    which is UB if that bit becomes set. To account for all reads and all
    writes accessing opposite members of the same union, introduce yet more
    local variables to reduce the shift counts to 12.
    
    Fixes: be55ed744ed8 ("x86emul: support FLDENV and FRSTOR")
    Reported-by: Fabian Specht <f.specht@tum.de>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/x86_emulate/blk.c | 36 ++++++++++++++++++++----------------
 1 file changed, 20 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/blk.c b/xen/arch/x86/x86_emulate/blk.c
index 494e6c1e3b..9fddf649ee 100644
--- a/xen/arch/x86/x86_emulate/blk.c
+++ b/xen/arch/x86/x86_emulate/blk.c
@@ -81,17 +81,19 @@ int x86_emul_blk(
             if ( !s->rex_prefix )
             {
                 /* Convert 32-bit real/vm86 to 32-bit prot format. */
-                unsigned int fip = fpstate.env.mode.real.fip_lo +
-                                   (fpstate.env.mode.real.fip_hi << 16);
-                unsigned int fdp = fpstate.env.mode.real.fdp_lo +
-                                   (fpstate.env.mode.real.fdp_hi << 16);
+                unsigned int fip = fpstate.env.mode.real.fip_lo & 0xf;
+                unsigned int fcs = (fpstate.env.mode.real.fip_lo >> 4) |
+                                   (fpstate.env.mode.real.fip_hi << 12);
+                unsigned int fdp = fpstate.env.mode.real.fdp_lo & 0xf;
+                unsigned int fds = (fpstate.env.mode.real.fdp_lo >> 4) |
+                                   (fpstate.env.mode.real.fdp_hi << 12);
                 unsigned int fop = fpstate.env.mode.real.fop;
 
-                fpstate.env.mode.prot.fip = fip & 0xf;
-                fpstate.env.mode.prot.fcs = fip >> 4;
+                fpstate.env.mode.prot.fip = fip;
+                fpstate.env.mode.prot.fcs = fcs;
                 fpstate.env.mode.prot.fop = fop;
-                fpstate.env.mode.prot.fdp = fdp & 0xf;
-                fpstate.env.mode.prot.fds = fdp >> 4;
+                fpstate.env.mode.prot.fdp = fdp;
+                fpstate.env.mode.prot.fds = fds;
             }
 
             if ( bytes == sizeof(fpstate.env) )
@@ -121,17 +123,19 @@ int x86_emul_blk(
             else
             {
                 /* Convert 16-bit real/vm86 to 32-bit prot format. */
-                unsigned int fip = env->mode.real.fip_lo +
-                                   (env->mode.real.fip_hi << 16);
-                unsigned int fdp = env->mode.real.fdp_lo +
-                                   (env->mode.real.fdp_hi << 16);
+                unsigned int fip = env->mode.real.fip_lo & 0xf;
+                unsigned int fcs = (env->mode.real.fip_lo >> 4) |
+                                   (env->mode.real.fip_hi << 12);
+                unsigned int fdp = env->mode.real.fdp_lo & 0xf;
+                unsigned int fds = (env->mode.real.fdp_lo >> 4) |
+                                   (env->mode.real.fdp_hi << 12);
                 unsigned int fop = env->mode.real.fop;
 
-                fpstate.env.mode.prot.fip = fip & 0xf;
-                fpstate.env.mode.prot.fcs = fip >> 4;
+                fpstate.env.mode.prot.fip = fip;
+                fpstate.env.mode.prot.fcs = fcs;
                 fpstate.env.mode.prot.fop = fop;
-                fpstate.env.mode.prot.fdp = fdp & 0xf;
-                fpstate.env.mode.prot.fds = fdp >> 4;
+                fpstate.env.mode.prot.fdp = fdp;
+                fpstate.env.mode.prot.fds = fds;
             }
 
             if ( bytes == sizeof(*env) )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 30 07:44:12 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Apr 2025 07:44:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.973476.1361593 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1uA272-0006Vk-LN; Wed, 30 Apr 2025 07:44:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 973476.1361593; Wed, 30 Apr 2025 07: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 1uA272-0006VV-IE; Wed, 30 Apr 2025 07:44:12 +0000
Received: by outflank-mailman (input) for mailman id 973476;
 Wed, 30 Apr 2025 07:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1uA272-0006VM-03
 for xen-changelog@lists.xenproject.org; Wed, 30 Apr 2025 07:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1uA271-00F1Mb-38
 for xen-changelog@lists.xenproject.org;
 Wed, 30 Apr 2025 07:44:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1uA271-004OQj-30
 for xen-changelog@lists.xenproject.org;
 Wed, 30 Apr 2025 07: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=tRrmxwvRax2UUiEuCim4XGjkn7rNe5bjNdlZFlERB1s=; b=ARH1St5D/VvWTHdQSIeFFq06bF
	vl6/2s04nJtzlq+MdXHfwMNwnYMvcwVCZbjkMFNkvSDaYE++O7ty5rwj4js6Z78p7zNHCDBDIv7j7
	EuDXAyQXhxsxT02gpisKd4z8FrStVMl+8Pi67Ht8GNkvOJLgFyRCM9Ilp505uz1jh+Vg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: drop underscore-prefixed {maddr,virt} <=> page conversion macros
Message-Id: <E1uA271-004OQj-30@xenbits.xenproject.org>
Date: Wed, 30 Apr 2025 07:44:11 +0000

commit 16d5d2292abe7569c1cf737f04ca7308b9e489c0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Apr 30 08:46:49 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 30 08:46:49 2025 +0200

    x86: drop underscore-prefixed {maddr,virt} <=> page conversion macros
    
    Unlike the ones converting to/from frame numbers, these don't have type-
    safe overrides, and they also can't gain any within our present type
    system. Unsurprisingly we also don't have any uses of the underscore-
    prefixed variants.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/include/asm/mm.h   | 4 ++--
 xen/arch/x86/include/asm/page.h | 8 ++------
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/include/asm/mm.h b/xen/arch/x86/include/asm/mm.h
index 2665daa6f7..d6e80db71c 100644
--- a/xen/arch/x86/include/asm/mm.h
+++ b/xen/arch/x86/include/asm/mm.h
@@ -342,7 +342,7 @@ void init_frametable(void);
 #define PDX_GROUP_SHIFT L2_PAGETABLE_SHIFT
 
 /* Convert between Xen-heap virtual addresses and page-info structures. */
-static inline struct page_info *__virt_to_page(const void *v)
+static inline struct page_info *virt_to_page(const void *v)
 {
     unsigned long va = (unsigned long)v;
 
@@ -355,7 +355,7 @@ static inline struct page_info *__virt_to_page(const void *v)
     return frame_table + ((va - DIRECTMAP_VIRT_START) >> PAGE_SHIFT);
 }
 
-static inline void *__page_to_virt(const struct page_info *pg)
+static inline void *page_to_virt(const struct page_info *pg)
 {
     ASSERT((unsigned long)pg - FRAMETABLE_VIRT_START < FRAMETABLE_SIZE);
     /*
diff --git a/xen/arch/x86/include/asm/page.h b/xen/arch/x86/include/asm/page.h
index e01af28916..24135f5968 100644
--- a/xen/arch/x86/include/asm/page.h
+++ b/xen/arch/x86/include/asm/page.h
@@ -238,8 +238,8 @@ void copy_page_sse2(void *to, const void *from);
 #define page_to_mfn(pg)     pdx_to_mfn((unsigned long)((pg) - frame_table))
 
 /* Convert between machine addresses and page-info structures. */
-#define __maddr_to_page(ma) mfn_to_page(maddr_to_mfn(ma))
-#define __page_to_maddr(pg) mfn_to_maddr(page_to_mfn(pg))
+#define maddr_to_page(ma)   mfn_to_page(maddr_to_mfn(ma))
+#define page_to_maddr(pg)   mfn_to_maddr(page_to_mfn(pg))
 
 /* Convert between frame number and address formats.  */
 #define __pfn_to_paddr(pfn) ((paddr_t)(pfn) << PAGE_SHIFT)
@@ -256,10 +256,6 @@ void copy_page_sse2(void *to, const void *from);
 #define mfn_valid(mfn)      __mfn_valid(mfn_x(mfn))
 #define virt_to_mfn(va)     __virt_to_mfn(va)
 #define mfn_to_virt(mfn)    __mfn_to_virt(mfn)
-#define maddr_to_page(ma)   __maddr_to_page(ma)
-#define page_to_maddr(pg)   __page_to_maddr(pg)
-#define virt_to_page(va)    __virt_to_page(va)
-#define page_to_virt(pg)    __page_to_virt(pg)
 #define pfn_to_paddr(pfn)   __pfn_to_paddr(pfn)
 #define paddr_to_pfn(pa)    __paddr_to_pfn(pa)
 #define paddr_to_pdx(pa)    pfn_to_pdx(paddr_to_pfn(pa))
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 30 07:44:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Apr 2025 07:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.973477.1361596 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1uA27D-0006YK-MF; Wed, 30 Apr 2025 07:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 973477.1361596; Wed, 30 Apr 2025 07: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 1uA27D-0006YC-Jj; Wed, 30 Apr 2025 07:44:23 +0000
Received: by outflank-mailman (input) for mailman id 973477;
 Wed, 30 Apr 2025 07:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1uA27C-0006Xu-4L
 for xen-changelog@lists.xenproject.org; Wed, 30 Apr 2025 07:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1uA27C-00F1Mf-0L
 for xen-changelog@lists.xenproject.org;
 Wed, 30 Apr 2025 07:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1uA27C-004OoN-09
 for xen-changelog@lists.xenproject.org;
 Wed, 30 Apr 2025 07:44:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KEUoEo1ccbsbjm8KkU/KCB04K3i56wbCRhlQRgXZnFw=; b=b+EppvEE0jBlVS2uDiXZZ+xfPe
	FRF09dVh/cwUUdzx+hAHm3bcERH8HhS4GovybF3hpgwffOj5LHUUby7TkeqtLH1DFIWbMspBWugQ7
	jLE9fzv0UTgSkcY9br+VHGMQos+9Lb8pKwjm86P2C1PSoyahL+pAn4fl6Sv+Dk0dKfxw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] cpufreq: use existing local var in cpufreq_statistic_init()
Message-Id: <E1uA27C-004OoN-09@xenbits.xenproject.org>
Date: Wed, 30 Apr 2025 07:44:22 +0000

commit c6e0a55396233bd7de6646a9b9be8d7c59950648
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Apr 30 08:47:15 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 30 08:47:15 2025 +0200

    cpufreq: use existing local var in cpufreq_statistic_init()
    
    ..., which actually also helps readability (imo).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/drivers/cpufreq/utility.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/cpufreq/utility.c b/xen/drivers/cpufreq/utility.c
index e690a484f1..ac2889d496 100644
--- a/xen/drivers/cpufreq/utility.c
+++ b/xen/drivers/cpufreq/utility.c
@@ -130,10 +130,10 @@ int cpufreq_statistic_init(unsigned int cpu)
         return -ENOMEM;
     }
 
-    pxpt->u.total = pmpt->perf.state_count;
-    pxpt->u.usable = pmpt->perf.state_count - pmpt->perf.platform_limit;
+    pxpt->u.total = count;
+    pxpt->u.usable = count - pmpt->perf.platform_limit;
 
-    for (i=0; i < pmpt->perf.state_count; i++)
+    for ( i = 0; i < count; i++ )
         pxpt->u.pt[i].freq = pmpt->perf.states[i].core_frequency;
 
     pxpt->prev_state_wall = NOW();
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 30 07:44:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Apr 2025 07:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.973479.1361601 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1uA27N-0006aU-No; Wed, 30 Apr 2025 07:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 973479.1361601; Wed, 30 Apr 2025 07: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 1uA27N-0006aM-L8; Wed, 30 Apr 2025 07:44:33 +0000
Received: by outflank-mailman (input) for mailman id 973479;
 Wed, 30 Apr 2025 07:44:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1uA27M-0006aE-8w
 for xen-changelog@lists.xenproject.org; Wed, 30 Apr 2025 07:44:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1uA27M-00F1Mn-0n
 for xen-changelog@lists.xenproject.org;
 Wed, 30 Apr 2025 07:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1uA27M-004P63-0i
 for xen-changelog@lists.xenproject.org;
 Wed, 30 Apr 2025 07:44:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=chzk3EtwTcQhAZqYYFU1sZvMNVIjf5sU7eA89lGO16w=; b=kAyrYsP5Q/A3/QwQmONU2fVTaC
	/bEdze7L+J3KcvFTfso4jVx5pQiEEcngYnfcwM30pQt11+X5UwW2+4sPMGT109/mS0KtPApvHkIeI
	fIaw5LwAIIcTYi0fxx1aA5O3Mubd61uux7gj5k0VTNxfV8HCk+qf6gGhL2OinxUiBNIY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] cpufreq: don't leave stale statistics pointer
Message-Id: <E1uA27M-004P63-0i@xenbits.xenproject.org>
Date: Wed, 30 Apr 2025 07:44:32 +0000

commit a1ce987411f61dbf5fe64bba0cd3d36d7cc0311f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Apr 30 08:47:49 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 30 08:47:49 2025 +0200

    cpufreq: don't leave stale statistics pointer
    
    Error paths of cpufreq_statistic_init() correctly free the base
    structure pointer, but the per-CPU variable would still hold it, mis-
    guiding e.g. cpufreq_statistic_update(). Defer installing of the pointer
    there until the structure was fully populated.
    
    Fixes: 755af07edba1 ("x86/cpufreq: don't use static array for large per-CPU data structures")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/drivers/cpufreq/utility.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/cpufreq/utility.c b/xen/drivers/cpufreq/utility.c
index ac2889d496..309c0682cf 100644
--- a/xen/drivers/cpufreq/utility.c
+++ b/xen/drivers/cpufreq/utility.c
@@ -113,7 +113,6 @@ int cpufreq_statistic_init(unsigned int cpu)
         spin_unlock(cpufreq_statistic_lock);
         return -ENOMEM;
     }
-    per_cpu(cpufreq_statistic_data, cpu) = pxpt;
 
     pxpt->u.trans_pt = xzalloc_array(uint64_t, count * count);
     if (!pxpt->u.trans_pt) {
@@ -139,6 +138,8 @@ int cpufreq_statistic_init(unsigned int cpu)
     pxpt->prev_state_wall = NOW();
     pxpt->prev_idle_wall = get_cpu_idle_time(cpu);
 
+    per_cpu(cpufreq_statistic_data, cpu) = pxpt;
+
     spin_unlock(cpufreq_statistic_lock);
 
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 30 17:00:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Apr 2025 17:00:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.973922.1361934 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1uAAmw-0008KG-M0; Wed, 30 Apr 2025 17:00:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 973922.1361934; Wed, 30 Apr 2025 17: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 1uAAmw-0008Jw-JO; Wed, 30 Apr 2025 17:00:02 +0000
Received: by outflank-mailman (input) for mailman id 973922;
 Wed, 30 Apr 2025 17: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 1uAAmv-0008AU-Lk
 for xen-changelog@lists.xenproject.org; Wed, 30 Apr 2025 17: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 1uAAmv-00FJSP-1i
 for xen-changelog@lists.xenproject.org;
 Wed, 30 Apr 2025 17:00:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1uAAmv-00E1iY-1b
 for xen-changelog@lists.xenproject.org;
 Wed, 30 Apr 2025 17: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=ju9+4UpQLyfkXQR2CPKp7GP/NomwPJW1KmiB+Y2xGh0=; b=LERea9QKAIBznNCkj/JvwLSJKs
	Cux+u7SFFF+mtxNFsNyosu566XjggIh1+TKgiNCoLuAHeFuAt8ZIQneNo1A7lAtHK4QyeLqC1Pdz9
	swAYPE+muZVQj0d3z6BWbOQq/inClekRr4co+BKKdHnokP+VQf8UbJmEMVX0Eq3enx7Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/intel: Move mcu_opt_ctrl_* into __ro_after_init
Message-Id: <E1uAAmv-00E1iY-1b@xenbits.xenproject.org>
Date: Wed, 30 Apr 2025 17:00:01 +0000

commit 88b4ea080cd2ee502b08754ed7adbd7ee5e30a89
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Apr 30 16:18:13 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 30 17:02:09 2025 +0100

    x86/intel: Move mcu_opt_ctrl_* into __ro_after_init
    
    They're only modified by set_in_mcu_opt_ctrl() which is an __init function.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/intel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index 63f65ea5b0..12c3ff65e0 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -21,8 +21,8 @@
  * MSR_MCU_OPT_CTRL is a collection of unrelated functionality, with separate
  * enablement requirements, but which want to be consistent across the system.
  */
-static uint32_t __read_mostly mcu_opt_ctrl_mask;
-static uint32_t __read_mostly mcu_opt_ctrl_val;
+static uint32_t __ro_after_init mcu_opt_ctrl_mask;
+static uint32_t __ro_after_init mcu_opt_ctrl_val;
 
 void update_mcu_opt_ctrl(void)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 30 18:22:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Apr 2025 18:22:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.973935.1361948 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1uAC4J-0003fP-7D; Wed, 30 Apr 2025 18:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 973935.1361948; Wed, 30 Apr 2025 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 1uAC4J-0003fH-4a; Wed, 30 Apr 2025 18:22:03 +0000
Received: by outflank-mailman (input) for mailman id 973935;
 Wed, 30 Apr 2025 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 1uAC4H-0003fB-V6
 for xen-changelog@lists.xenproject.org; Wed, 30 Apr 2025 18: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 1uAC4H-00FM0K-1j
 for xen-changelog@lists.xenproject.org;
 Wed, 30 Apr 2025 18:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1uAC4H-00EFex-1X
 for xen-changelog@lists.xenproject.org;
 Wed, 30 Apr 2025 18: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=/Di+PDIVIAx8U7ccOiA3FbRRqp+bZlI1sVcIAGgftUU=; b=QDjG7glGPDtp7bmTPbl7vMrifc
	3jtVmYI3/Hwstn3oun4u4bkrvm6fdo7R9DYpBzsbY5ugnEMxsdU7Y/OrtL9VT1j0tL+6ykOh66QDG
	OxuTMCX5CMTnCvDO5kMIgnonK0ViG6HPiKbdfuKgAvW5wXbfCuddtHWBSPohu1lRpBoI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/intel: Move mcu_opt_ctrl_* into __ro_after_init
Message-Id: <E1uAC4H-00EFex-1X@xenbits.xenproject.org>
Date: Wed, 30 Apr 2025 18:22:01 +0000

commit 88b4ea080cd2ee502b08754ed7adbd7ee5e30a89
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Apr 30 16:18:13 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Apr 30 17:02:09 2025 +0100

    x86/intel: Move mcu_opt_ctrl_* into __ro_after_init
    
    They're only modified by set_in_mcu_opt_ctrl() which is an __init function.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/intel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index 63f65ea5b0..12c3ff65e0 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -21,8 +21,8 @@
  * MSR_MCU_OPT_CTRL is a collection of unrelated functionality, with separate
  * enablement requirements, but which want to be consistent across the system.
  */
-static uint32_t __read_mostly mcu_opt_ctrl_mask;
-static uint32_t __read_mostly mcu_opt_ctrl_val;
+static uint32_t __ro_after_init mcu_opt_ctrl_mask;
+static uint32_t __ro_after_init mcu_opt_ctrl_val;
 
 void update_mcu_opt_ctrl(void)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master


