Re: [RFC] xen/x86: allow overlaps with non-RAM regions

2025-04-11 Thread Roger Pau Monné
Thanks Jason for getting back, I'm intrigued by this issue :). On Thu, Apr 10, 2025 at 04:55:54PM -0400, Jason Andryuk wrote: > On 2025-04-04 06:28, Roger Pau Monné wrote: > > On Thu, Apr 03, 2025 at 06:01:42PM -0700, Stefano Stabellini wrote: > > > On one Sapphire AMD x86 board, I see this: > > >

Re: [PATCH] x86/xen: Fix __xen_hypercall_setfunc

2025-04-11 Thread Juergen Gross
On 10.04.25 21:31, Jason Andryuk wrote: Hypercall detection is failing with xen_hypercall_intel() chosen even on an AMD processor. Looking at the disassembly, the call to xen_get_vendor() was removed. The check for boot_cpu_has(X86_FEATURE_CPUID) was used as a proxy for the x86_vendor having be

[PATCH 1/2] xen/rangeset: fix incorrect subtraction

2025-04-11 Thread Roger Pau Monne
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 bou

[PATCH 2/2] tootls/tests: introduce unit tests for rangesets

2025-04-11 Thread Roger Pau Monne
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é --- tools/tests/Makefile | 1 + tools/tests/rangeset/Makefile| 45 ++ tools/tests/rangeset/harness

[PATCH 0/2] xen/rangeset: one bugfix and unit testing

2025-04-11 Thread Roger Pau Monne
Hello, Rangesets are extensively used inside of Xen, yet we had no unit tests to ensure it's correctness. rangeset_remove_range() is in fact bogus and will generate an incorrect output rangeset depending on the inputs. Patch 1 fixes the bug, patch 2 adds some basic unit testing to ensure the fix

Re: [PATCH v2 1/8] driver/pci: Get next capability without passing caps

2025-04-11 Thread Jan Beulich
On 11.04.2025 04:51, Chen, Jiqian wrote: > On 2025/4/10 20:34, Jan Beulich wrote: >> On 09.04.2025 08:45, Jiqian Chen wrote: >>> --- a/xen/drivers/pci/pci.c >>> +++ b/xen/drivers/pci/pci.c >>> @@ -40,7 +40,7 @@ unsigned int pci_find_cap_offset(pci_sbdf_t sbdf, >>> unsigned int cap) >>> } >>> >>

Re: [PATCH v2 2/8] vpci/header: Emulate legacy capability list for host

2025-04-11 Thread Jan Beulich
On 11.04.2025 04:54, Chen, Jiqian wrote: > On 2025/4/10 20:40, Jan Beulich wrote: >> On 09.04.2025 08:45, Jiqian Chen wrote: >>> Current logic of init_header() only emulates legacy capability list >>> for guest, expand it to emulate for host too. So that it will be >>> easy to hide a capability who

Re: [RFC] xen/x86: allow overlaps with non-RAM regions

2025-04-11 Thread Jan Beulich
On 10.04.2025 22:55, Jason Andryuk wrote: > On 2025-04-04 04:07, Jan Beulich wrote: >> On 04.04.2025 03:01, Stefano Stabellini wrote: >>> On one Sapphire AMD x86 board, I see this: >>> >>> >>> (XEN) [003943ca6ff2] [f000, f7ff] (reserved) >>> (XEN) [0039460886d9] [0

Re: [RFC] xen/x86: allow overlaps with non-RAM regions

2025-04-11 Thread Jan Beulich
On 11.04.2025 09:31, Roger Pau Monné wrote: > Yup, the check is independent, but pf-fixup would create additional > p2m mappings if required (note this is only available on staging). It's also in 4.19.2 and on the 4.20 branch. 4.18 is where I couldn't easily backport it to. Jan

Re: [PATCH v2 1/8] driver/pci: Get next capability without passing caps

2025-04-11 Thread Chen, Jiqian
On 2025/4/11 16:00, Jan Beulich wrote: > On 11.04.2025 04:51, Chen, Jiqian wrote: >> On 2025/4/10 20:34, Jan Beulich wrote: >>> On 09.04.2025 08:45, Jiqian Chen wrote: --- a/xen/drivers/pci/pci.c +++ b/xen/drivers/pci/pci.c @@ -40,7 +40,7 @@ unsigned int pci_find_cap_offset(pci_sbdf_

Re: [RFC] xen/x86: allow overlaps with non-RAM regions

2025-04-11 Thread Jan Beulich
On 10.04.2025 22:55, Jason Andryuk wrote: > On 2025-04-04 06:28, Roger Pau Monné wrote: >> On Thu, Apr 03, 2025 at 06:01:42PM -0700, Stefano Stabellini wrote: >>> On one Sapphire AMD x86 board, I see this: >>> >>> >>> (XEN) [003943ca6ff2] [f000, f7ff] (reserved) >>> (XE

Re: [PATCH 1/2] xen/rangeset: fix incorrect subtraction

2025-04-11 Thread Jan Beulich
On 11.04.2025 09:55, Roger Pau Monne wrote: > 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

Re: [PATCH 2/2] tootls/tests: introduce unit tests for rangesets

2025-04-11 Thread Jan Beulich
On 11.04.2025 09:55, Roger Pau Monne wrote: > 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é It's okay as is, so: Reviewed-by: Jan Beulich Nevertheless a couple of remar

Re: [PATCH 2/2] tootls/tests: introduce unit tests for rangesets

2025-04-11 Thread Roger Pau Monné
On Fri, Apr 11, 2025 at 10:21:08AM +0200, Jan Beulich wrote: > On 11.04.2025 09:55, Roger Pau Monne wrote: > > --- /dev/null > > +++ b/tools/tests/rangeset/harness.h > > @@ -0,0 +1,71 @@ > > +/* SPDX-License-Identifier: GPL-2.0-only */ > > +/* > > + * Unit tests for rangesets. > > + * > > + * Copyr

Re: [PATCH v5 2/3] xen/arm32: Create the same boot-time MPU regions as arm64

2025-04-11 Thread Ayan Kumar Halder
Hi, On 08/04/2025 10:13, Orzel, Michal wrote: On 07/04/2025 20:44, Ayan Kumar Halder wrote: We have created the same boot-time MPU protection regions as Armv8-R AArch64. Also, we have defined *_PRBAR macros for arm32. The only difference from arm64 is that XN is 1-bit for arm32. The macros hav

Re: [PATCH] x86/xen: Fix __xen_hypercall_setfunc

2025-04-11 Thread Ingo Molnar
* Juergen Gross wrote: > On 10.04.25 21:31, Jason Andryuk wrote: > > Hypercall detection is failing with xen_hypercall_intel() chosen even on > > an AMD processor. Looking at the disassembly, the call to > > xen_get_vendor() was removed. > > > > The check for boot_cpu_has(X86_FEATURE_CPUID) w

Re: [PATCH] x86/xen: Fix __xen_hypercall_setfunc

2025-04-11 Thread Jürgen Groß
On 11.04.25 11:27, Ingo Molnar wrote: * Juergen Gross wrote: On 10.04.25 21:31, Jason Andryuk wrote: Hypercall detection is failing with xen_hypercall_intel() chosen even on an AMD processor. Looking at the disassembly, the call to xen_get_vendor() was removed. The check for boot_cpu_has(X

Re: [PATCH] x86/xen: Fix __xen_hypercall_setfunc

2025-04-11 Thread Ingo Molnar
* Jürgen Groß wrote: > On 11.04.25 11:27, Ingo Molnar wrote: > > > > * Juergen Gross wrote: > > > > > On 10.04.25 21:31, Jason Andryuk wrote: > > > > Hypercall detection is failing with xen_hypercall_intel() chosen even on > > > > an AMD processor. Looking at the disassembly, the call to >

Re: [PATCH 4/8] Clean up Gitlab yaml

2025-04-11 Thread Andrew Cooper
On 11/04/2025 10:35 am, Anthony PERARD wrote: > On Thu, Apr 10, 2025 at 11:11:49AM +0100, Andrew Cooper wrote: >> Which is another thing I haven't posted, because it turns out our >> docker-in-docker only works for x86, not for ARM. > Fixed! I've installed `qemu-user-static` on the runner > which r

Re: [PATCH v5 3/3] xen/arm32: mpu: Stubs to build MPU for arm32

2025-04-11 Thread Ayan Kumar Halder
Hi, On 08/04/2025 10:54, Orzel, Michal wrote: On 07/04/2025 20:44, Ayan Kumar Halder wrote: Add stubs to enable compilation NIT: missing dot at the end of sentence. Signed-off-by: Ayan Kumar Halder --- Changes from :- v1, v2 - 1. New patch introduced in v3. 2. Should be applied on top of

[PATCH 3/3] Provide an ARM64 rootfs too

2025-04-11 Thread Andrew Cooper
The only extra package needed is libfdt. The older ARM64 rootfs configured modloop, networking and sysctl, but none of this is used in any of the testing, so is omitted here for now. Signed-off-by: Andrew Cooper --- CC: Anthony PERARD CC: Stefano Stabellini CC: Michal Orzel CC: Doug Goldstein

[PATCH TEST-ARTEFACTS 0/3] Rootfs generation (ARM and x86)

2025-04-11 Thread Andrew Cooper
Part 3 of the cleanup, reworking rootfs generation. The Xen side of the change isn't quite ready yet, but this is in a good enough state for review. Andrew Cooper (3): Rework rootfs generation to make a cpio archive Shrink the rootfs substantially Provide an ARM64 rootfs too .gitlab-ci.ym

[PATCH 2/3] Shrink the rootfs substantially

2025-04-11 Thread Andrew Cooper
bash, busybox, musl and zlib are all in the base container. python3 and ncurses are in principle used by bits of Xen, but not in anything we test in CI. argp-standlone, curl, dbus, libfdt, libgcc and sudo aren't used at all (for x86 at least). libbz2 and libuuid were pulled in transitively befor

[PATCH 1/3] Rework rootfs generation to make a cpio archive

2025-04-11 Thread Andrew Cooper
Rename the script as we're going to use it for ARM64 shortly, and have it take a tar or cpio parameter to determine the output format. Turn it into a proper bash script, and provide the cpio form under the new artefact naming scheme. No functional change. Signed-off-by: Andrew Cooper --- CC: An

[PATCH 1/5] x86/mm: account for the offset when performing subpage r/o MMIO access

2025-04-11 Thread Roger Pau Monne
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 pag

[PATCH 2/5] xen/io: provide helpers for multi size MMIO accesses

2025-04-11 Thread Roger Pau Monne
Several handlers have the same necessity of reading from 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 handler that encapsulates the accesses. Since the added helpers are not architecture specific, introduce a new

[PATCH 3/5] x86/hvm: fix handling of accesses to partial r/o MMIO pages

2025-04-11 Thread Roger Pau Monne
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

[PATCH 4/5] x86/hvm: only register the r/o subpage ops when needed

2025-04-11 Thread Roger Pau Monne
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 creati

[PATCH 5/5] x86/mm: move mmio_ro_emulated_write() to PV only file

2025-04-11 Thread Roger Pau Monne
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é --- xen/arch/x86/include/asm/mm.h | 12 xen/arch/x86/mm.c | 26 - xe

[PATCH 0/5] xen/x86: fix implementation of subpage r/o MMIO

2025-04-11 Thread Roger Pau Monne
Hello, Following series include some bugfixes and improvements to the handling of subpage r/o MMIO accesses. First patch is a bugfix that applies to subpage accesses for both PV and HVM. Patch 2 introduces a helper to reduce code duplication when performing MMIO accesses. Patch 3 is a bugfix fo

[PATCH v6 0/3] Enable early bootup of Armv8-R AArch32 systems

2025-04-11 Thread Ayan Kumar Halder
Enable early booting of Armv8-R AArch32 based systems. Added Luca's R-b in all the patches. Ayan Kumar Halder (3): xen/arm: Move some of the functions to common file xen/arm32: Create the same boot-time MPU regions as arm64 xen/arm32: mpu: Stubs to build MPU for arm32 xen/arch/arm/arm32/M

[PATCH v6 2/3] xen/arm32: Create the same boot-time MPU regions as arm64

2025-04-11 Thread Ayan Kumar Halder
Boot-time MPU protection regions (similar to Armv8-R AArch64) are created for Armv8-R AArch32. Also, defined *_PRBAR macros for arm32. The only difference from arm64 is that XN is 1-bit for arm32. Defined the system registers and macros in mpu/cpregs.h. Introduced WRITE_SYSREG_ASM() to write to sy

[PATCH v6 1/3] xen/arm: Move some of the functions to common file

2025-04-11 Thread Ayan Kumar Halder
regions.inc is added to hold the common earlyboot MPU regions configuration 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.

[PATCH v6 3/3] xen/arm32: mpu: Stubs to build MPU for arm32

2025-04-11 Thread Ayan Kumar Halder
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 Revie

Re: [PATCH 1/3] Rework rootfs generation to make a cpio archive

2025-04-11 Thread Marek Marczykowski-Górecki
On Fri, Apr 11, 2025 at 11:52:15AM +0100, Andrew Cooper wrote: > Rename the script as we're going to use it for ARM64 shortly, and have it take > a tar or cpio parameter to determine the output format. > > Turn it into a proper bash script, and provide the cpio form under the new > artefact naming

Re: [PATCH 1/3] Rework rootfs generation to make a cpio archive

2025-04-11 Thread Andrew Cooper
On 11/04/2025 12:06 pm, Marek Marczykowski-Górecki wrote: > On Fri, Apr 11, 2025 at 11:52:15AM +0100, Andrew Cooper wrote: >> diff --git a/scripts/x86_64-rootfs-alpine.sh b/scripts/alpine-rootfs.sh >> similarity index 75% >> rename from scripts/x86_64-rootfs-alpine.sh >> rename to scripts/alpine-ro

Re: [PATCH 2/4] Overhaul how Argo is built and packged

2025-04-11 Thread Andrew Cooper
On 11/04/2025 3:22 am, Denis Mukhin wrote: > On Thursday, April 10th, 2025 at 2:37 PM, Andrew Cooper > wrote: > >> >> Right now, the argo artefacts are a pile of files which the test has to turn >> back into something which resembles a filesystem. Furthermore, because we do >> not build modules f

Re: [PATCH v6 0/3] Enable early bootup of Armv8-R AArch32 systems

2025-04-11 Thread Luca Fancellu
Hi Ayan, > On 11 Apr 2025, at 12:04, Ayan Kumar Halder wrote: > > Enable early booting of Armv8-R AArch32 based systems. > > Added Luca's R-b in all the patches. > > Ayan Kumar Halder (3): > xen/arm: Move some of the functions to common file > xen/arm32: Create the same boot-time MPU regions

Re: [PATCH 1/3] Rework rootfs generation to make a cpio archive

2025-04-11 Thread Andrew Cooper
On 11/04/2025 12:09 pm, Andrew Cooper wrote: > On 11/04/2025 12:06 pm, Marek Marczykowski-Górecki wrote: >> On Fri, Apr 11, 2025 at 11:52:15AM +0100, Andrew Cooper wrote: >>> diff --git a/scripts/x86_64-rootfs-alpine.sh b/scripts/alpine-rootfs.sh >>> similarity index 75% >>> rename from scripts/x86

Re: [RFC PATCH] x86/xen: Fix PVH dom0 xen_hypercall detection

2025-04-11 Thread Ard Biesheuvel
On Thu, 10 Apr 2025 at 23:49, Andrew Cooper wrote: > > On 10/04/2025 8:50 pm, Jason Andryuk wrote: > > A Xen PVH dom0 on an AMD processor triple faults early in boot on > > 6.6.86. CPU detection appears to fail, as the faulting instruction is > > vmcall in xen_hypercall_intel() and not vmmcall in

Re: [PATCH 1/3] Rework rootfs generation to make a cpio archive

2025-04-11 Thread Marek Marczykowski-Górecki
On Fri, Apr 11, 2025 at 12:33:50PM +0100, Andrew Cooper wrote: > On 11/04/2025 12:09 pm, Andrew Cooper wrote: > > On 11/04/2025 12:06 pm, Marek Marczykowski-Górecki wrote: > >> On Fri, Apr 11, 2025 at 11:52:15AM +0100, Andrew Cooper wrote: > >>> +find $PATHS | cpio -o -H newc | gzip > > >>

Re: [PATCH 1/5] x86/mm: account for the offset when performing subpage r/o MMIO access

2025-04-11 Thread Andrew Cooper
On 11/04/2025 11:54 am, Roger Pau Monne wrote: > 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: 8847d6e

Re: [PATCH v1 0/4] mm: Fix apply_to_pte_range() vs lazy MMU mode

2025-04-11 Thread Alexander Gordeev
On Fri, Apr 11, 2025 at 05:12:28PM +1000, Nicholas Piggin wrote: ... > Huh. powerpc actually has some crazy code in __switch_to() that is > supposed to handle preemption while in lazy mmu mode. So we probably > don't even need to disable preemption, just use the raw per-cpu > accessors (or keep dis

Re: [PATCH 1/3] Rework rootfs generation to make a cpio archive

2025-04-11 Thread Frediano Ziglio
On Fri, Apr 11, 2025 at 11:52 AM Andrew Cooper wrote: > > Rename the script as we're going to use it for ARM64 shortly, and have it take > a tar or cpio parameter to determine the output format. > > Turn it into a proper bash script, and provide the cpio form under the new > artefact naming scheme

Re: [PATCH 2/3] Shrink the rootfs substantially

2025-04-11 Thread Frediano Ziglio
On Fri, Apr 11, 2025 at 11:52 AM Andrew Cooper wrote: > > bash, busybox, musl and zlib are all in the base container. > > python3 and ncurses are in principle used by bits of Xen, but not in anything > we test in CI. argp-standlone, curl, dbus, libfdt, libgcc and sudo aren't > used at all (for x8

Re: [PATCH TEST-ARTEFACTS 0/8] Cleanup and Linux ARM64 support

2025-04-11 Thread Alejandro Vallejo
On Thu Apr 10, 2025 at 10:50 PM BST, Jason Andryuk wrote: > On 2025-04-10 17:16, Jason Andryuk wrote: >> On 2025-04-10 05:17, Andrew Cooper wrote: >>> On 10/04/2025 1:09 am, Jason Andryuk wrote: On 2025-04-09 13:01, Andrew Cooper wrote: > On 09/04/2025 5:36 pm, Andrew Cooper wrote: >>> >>>

Re: [RFC PATCH] x86/xen: Fix PVH dom0 xen_hypercall detection

2025-04-11 Thread Alejandro Vallejo
On Thu Apr 10, 2025 at 8:50 PM BST, Jason Andryuk wrote: > A Xen PVH dom0 on an AMD processor triple faults early in boot on > 6.6.86. CPU detection appears to fail, as the faulting instruction is > vmcall in xen_hypercall_intel() and not vmmcall in xen_hypercall_amd(). > > Detection fails because

Re: [RFC PATCH] x86/xen: Fix PVH dom0 xen_hypercall detection

2025-04-11 Thread Alejandro Vallejo
On Fri Apr 11, 2025 at 2:08 PM BST, Jan Beulich wrote: > On 11.04.2025 14:46, Alejandro Vallejo wrote: >> On Thu Apr 10, 2025 at 8:50 PM BST, Jason Andryuk wrote: >>> A Xen PVH dom0 on an AMD processor triple faults early in boot on >>> 6.6.86. CPU detection appears to fail, as the faulting instru

Re: [RFC PATCH] x86/xen: Fix PVH dom0 xen_hypercall detection

2025-04-11 Thread Jan Beulich
On 11.04.2025 14:46, Alejandro Vallejo wrote: > On Thu Apr 10, 2025 at 8:50 PM BST, Jason Andryuk wrote: >> A Xen PVH dom0 on an AMD processor triple faults early in boot on >> 6.6.86. CPU detection appears to fail, as the faulting instruction is >> vmcall in xen_hypercall_intel() and not vmmcall

Re: [RFC PATCH] x86/xen: Fix PVH dom0 xen_hypercall detection

2025-04-11 Thread Jason Andryuk
On 2025-04-11 07:35, Ard Biesheuvel wrote: On Thu, 10 Apr 2025 at 23:49, Andrew Cooper wrote: On 10/04/2025 8:50 pm, Jason Andryuk wrote: A Xen PVH dom0 on an AMD processor triple faults early in boot on 6.6.86. CPU detection appears to fail, as the faulting instruction is vmcall in xen_h

[PATCH v3 1/7] arm/mpu: Introduce MPU memory region map structure

2025-04-11 Thread Luca Fancellu
From: Penny Zheng Introduce pr_t typedef which is a structure having the prbar and prlar members, each being structured as the registers of the aarch64 armv8-r architecture. Introduce the array 'xen_mpumap' that will store a view of the content of the MPU regions. Introduce MAX_MPU_REGIONS macr

[PATCH v3 7/7] arm/mpu: Implement setup_mpu for MPU system

2025-04-11 Thread Luca Fancellu
Implement the function setup_mpu that will logically track the MPU regions defined by hardware registers, start introducing data structures and functions to track the status from the C world. The xen_mpumap_mask bitmap is used to track which MPU region are enabled at runtime. This function is cal

[PATCH v3 4/7] arm/mpu: Provide a constructor for pr_t type

2025-04-11 Thread Luca Fancellu
Provide a function that creates a pr_t object from a memory range and some attributes. Signed-off-by: Luca Fancellu --- xen/arch/arm/include/asm/arm64/mpu.h | 11 + xen/arch/arm/include/asm/mpu.h | 4 ++ xen/arch/arm/include/asm/mpu/mm.h| 3 ++ xen/arch/arm/mpu/mm.c

[PATCH v3 0/7] First chunk for Arm R82 and MPU support

2025-04-11 Thread Luca Fancellu
Hi all, This is the first chunk of work to support MPU and R82 on Xen, this serie reaches the early boot stages until setup_pagetables() which is not used for MPU but it is just to give an idea about which stage of the boot is reached. v3 changes: - stated on each patch v2 changes for this serie

[PATCH v3 6/7] arm/mpu: Implement early_fdt_map support in MPU systems

2025-04-11 Thread Luca Fancellu
Implement early_fdt_map() function, that is responsible to map the device tree blob in the early stages of the boot process, since at this stage the MPU C data structure are not yet initialised, it is using low level APIs to write into the MPU registers at a fixed MPU region number. The MPU memory

[PATCH v3 5/7] arm/mpu: Introduce MPU memory mapping flags

2025-04-11 Thread Luca Fancellu
Introduce the MPU memory mapping flags in asm/page.h. Signed-off-by: Luca Fancellu --- xen/arch/arm/include/asm/page.h | 25 + 1 file changed, 25 insertions(+) diff --git a/xen/arch/arm/include/asm/page.h b/xen/arch/arm/include/asm/page.h index 69f817d1e68a..22f7d2c6cb30

[PATCH v3 3/7] arm/mpu: Introduce utility functions for the pr_t type

2025-04-11 Thread Luca Fancellu
Introduce few utility function to manipulate and handle the pr_t type. Signed-off-by: Luca Fancellu --- xen/arch/arm/include/asm/mpu.h | 40 ++ 1 file changed, 40 insertions(+) diff --git a/xen/arch/arm/include/asm/mpu.h b/xen/arch/arm/include/asm/mpu.h index 59f

Re: [RFC PATCH] x86/xen: Fix PVH dom0 xen_hypercall detection

2025-04-11 Thread Ard Biesheuvel
On Fri, 11 Apr 2025 at 16:28, Jason Andryuk wrote: > > > > On 2025-04-11 07:35, Ard Biesheuvel wrote: > > On Thu, 10 Apr 2025 at 23:49, Andrew Cooper > > wrote: > >> > >> On 10/04/2025 8:50 pm, Jason Andryuk wrote: > >>> A Xen PVH dom0 on an AMD processor triple faults early in boot on > >>> 6.6

Re: [PATCH 1/3] Rework rootfs generation to make a cpio archive

2025-04-11 Thread Denis Mukhin
On Friday, April 11th, 2025 at 3:52 AM, Andrew Cooper wrote: > > > Rename the script as we're going to use it for ARM64 shortly, and have it take > a tar or cpio parameter to determine the output format. > > Turn it into a proper bash script, and provide the cpio form under the new > artefact

[PATCH v3 2/7] arm/mpu: Provide access to the MPU region from the C code

2025-04-11 Thread Luca Fancellu
Implement some utility function in order to access the MPU regions from the C world. Signed-off-by: Luca Fancellu --- v3 changes: - Moved PRBAR0_EL2/PRLAR0_EL2 to arm64 specific - Modified prepare_selector() to be easily made a NOP for Arm32, which can address up to 32 region without chan

Re: [RFC PATCH v1 10/15] KVM: VMX: Use WRMSRNS or its immediate form when available

2025-04-11 Thread Xin Li
On 4/10/2025 4:24 PM, Sean Christopherson wrote: +/* + * Write EAX to MSR_IA32_SPEC_CTRL. + * + * Choose the best WRMSR instruction based on availability. + * + * Replace with 'wrmsrns' and 'wrmsrns %rax, $MSR_IA32_SPEC_CTRL' once binutils support them. + */ +.macro WRITE_EAX_TO_MSR_IA32_SPEC_CT

Linux 6.15-rc1: pvqspinlock: lock 0xffff8881029af110 has corrupted value 0x0!

2025-04-11 Thread Marek Marczykowski-Górecki
Hi, When testing 6.15-rc1 I got this warning: [ 1656.521169] xen-blkback: backend/vbd/92/51712: using 2 queues, protocol 1 (x86_64-abi) persistent grants [ 1656.527173] xen-blkback: backend/vbd/92/51728: using 2 queues, protocol 1 (x86_64-abi) persistent grants [ 1656.532240] xen-bl

Re: [PATCH 1/3] Rework rootfs generation to make a cpio archive

2025-04-11 Thread Andrew Cooper
On 11/04/2025 4:53 pm, Denis Mukhin wrote: > On Friday, April 11th, 2025 at 3:52 AM, Andrew Cooper > wrote: > >> >> Rename the script as we're going to use it for ARM64 shortly, and have it >> take >> a tar or cpio parameter to determine the output format. >> >> Turn it into a proper bash script

Re: [PATCH 1/3] Rework rootfs generation to make a cpio archive

2025-04-11 Thread Andrew Cooper
On 11/04/2025 1:25 pm, Frediano Ziglio wrote: > On Fri, Apr 11, 2025 at 11:52 AM Andrew Cooper > wrote: >> Rename the script as we're going to use it for ARM64 shortly, and have it >> take >> a tar or cpio parameter to determine the output format. >> >> Turn it into a proper bash script, and prov

Re: [PATCH 1/3] Rework rootfs generation to make a cpio archive

2025-04-11 Thread Denis Mukhin
On Friday, April 11th, 2025 at 10:50 AM, Andrew Cooper wrote: > > > On 11/04/2025 4:53 pm, Denis Mukhin wrote: > > > On Friday, April 11th, 2025 at 3:52 AM, Andrew Cooper > > andrew.coop...@citrix.com wrote: > > > > > Rename the script as we're going to use it for ARM64 shortly, and have it

Re: [PATCH 1/3] Rework rootfs generation to make a cpio archive

2025-04-11 Thread Denis Mukhin
On Friday, April 11th, 2025 at 3:52 AM, Andrew Cooper wrote: > > > Rename the script as we're going to use it for ARM64 shortly, and have it take > a tar or cpio parameter to determine the output format. > > Turn it into a proper bash script, and provide the cpio form under the new > artefact

Re: [PATCH 2/5] xen/io: provide helpers for multi size MMIO accesses

2025-04-11 Thread Denis Mukhin
On Friday, April 11th, 2025 at 3:54 AM, Roger Pau Monne wrote: > > > Several handlers have the same necessity of reading from 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 handler that encapsulates the > acce

NXP Layerscape SMMU IDs

2025-04-11 Thread Weber (US), Matthew L
Hello, We're curious if anyone else has figured out NXP Layerscape Xen support to get at least basic domains launching with minimal IO support? Started a recent discussion on it here: https://community.nxp.com/t5/Layerscape/How-to-determine-LS1088A-SMMU-Masters-and-Stream-IDs/m-p/2072157#M15560

[PATCH] Package microcode for the x86 hardware runners

2025-04-11 Thread Andrew Cooper
They are all out of date, to different degrees. Install jq into the x86_64 build container so we can parse the Github latest release information in an acceptable way. The resulting archive must be uncompressed, in order to work during early boot. Signed-off-by: Andrew Cooper --- CC: Anthony PER

[PATCH v3 0/7] Several CI cleanups and improvements around initrd/rootfs

2025-04-11 Thread Marek Marczykowski-Górecki
Some of those patches are collected from my stubdomain test series, others are made while getting the new runner working. This series initially included adding Zen4 runner, but drop it in this version as there is quite enough stuff here already, and there are few more dependencies for the new runne

[PATCH v3 2/7] CI: fix waiting for final test message

2025-04-11 Thread Marek Marczykowski-Górecki
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 ou

[PATCH test-artifacts v3 8/7] Enable CONFIG_USB_RTL8152 in kernel for hw12 runner

2025-04-11 Thread Marek Marczykowski-Górecki
It uses this USB network interface. Signed-off-by: Marek Marczykowski-Górecki --- scripts/build-linux.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/build-linux.sh b/scripts/build-linux.sh index 49b5ebe..af684d6 100755 --- a/scripts/build-linux.sh +++ b/scripts/build-linux.sh @@

[PATCH v3 7/7] CI: save toolstack artifact as cpio.gz

2025-04-11 Thread Marek Marczykowski-Górecki
This avoids the need to re-compress it in every test job. Signed-off-by: Marek Marczykowski-Górecki --- New in v2 --- automation/scripts/build | 2 +- automation/scripts/qemu-alpine-x86_64.sh | 2 +- automation/scripts/qemu-smoke-dom0-arm64.sh | 2 +- auto

[PATCH v3 1/7] CI: wait for Xen to start before waiting for test to complete

2025-04-11 Thread Marek Marczykowski-Górecki
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 h

[PATCH v3 5/7] CI: avoid repacking initrd as part of the test job

2025-04-11 Thread Marek Marczykowski-Górecki
The prerequisite for this is building rootfs.cpio.gz, not only initrd.tar.gz. That's a change in the test-artifacts repository in the "Rootfs generation" series from Andrew. Having that, do not repack the whole initrd, but only pack modified files and rely on Linux handling of concatenated archive

[PATCH v3 3/7] CI: switch qubes runners to use console.exp

2025-04-11 Thread Marek Marczykowski-Górecki
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 bo

Re: [PATCH v3 2/7] CI: fix waiting for final test message

2025-04-11 Thread Andrew Cooper
On 11/04/2025 9:32 pm, Marek Marczykowski-Górecki wrote: > 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

Re: [PATCH v3 3/7] CI: switch qubes runners to use console.exp

2025-04-11 Thread Andrew Cooper
On 11/04/2025 9:32 pm, Marek Marczykowski-Górecki wrote: > diff --git a/automation/scripts/console.exp b/automation/scripts/console.exp > index 834a08db1b95..bdb1dd982003 100755 > --- a/automation/scripts/console.exp > +++ b/automation/scripts/console.exp > @@ -45,6 +49,15 @@ if {[info exists env(B

Re: [PATCH v3 3/7] CI: switch qubes runners to use console.exp

2025-04-11 Thread Marek Marczykowski-Górecki
On Fri, Apr 11, 2025 at 09:40:31PM +0100, Andrew Cooper wrote: > On 11/04/2025 9:32 pm, Marek Marczykowski-Górecki wrote: > > diff --git a/automation/scripts/console.exp b/automation/scripts/console.exp > > index 834a08db1b95..bdb1dd982003 100755 > > --- a/automation/scripts/console.exp > > +++ b/a

Re: [RFC PATCH v1 10/15] KVM: VMX: Use WRMSRNS or its immediate form when available

2025-04-11 Thread H. Peter Anvin
On April 11, 2025 9:18:08 AM PDT, Xin Li wrote: >On 4/10/2025 4:24 PM, Sean Christopherson wrote: >>> +/* >>> + * Write EAX to MSR_IA32_SPEC_CTRL. >>> + * >>> + * Choose the best WRMSR instruction based on availability. >>> + * >>> + * Replace with 'wrmsrns' and 'wrmsrns %rax, $MSR_IA32_SPEC_CTRL'

[PATCH v3 4/7] CI: write whole etc/issue for domU initrd

2025-04-11 Thread Marek Marczykowski-Górecki
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 --- automation/scripts/qubes-x86-64.sh | 5 - automation/scripts/xilinx-smoke-

Re: [PATCH v3 1/7] CI: wait for Xen to start before waiting for test to complete

2025-04-11 Thread Andrew Cooper
On 11/04/2025 9:32 pm, Marek Marczykowski-Górecki wrote: > 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 timeo

Re: [RFC PATCH v1 10/15] KVM: VMX: Use WRMSRNS or its immediate form when available

2025-04-11 Thread Jim Mattson
On Thu, Apr 10, 2025 at 4:24 PM Sean Christopherson wrote: > > On Mon, Mar 31, 2025, Xin Li (Intel) wrote: > > Signed-off-by: Xin Li (Intel) > > --- > > arch/x86/include/asm/msr-index.h | 6 ++ > > arch/x86/kvm/vmx/vmenter.S | 28 > > 2 files changed, 30 i

Re: [PATCH v3 4/7] CI: write whole etc/issue for domU initrd

2025-04-11 Thread Andrew Cooper
On 11/04/2025 9:32 pm, Marek Marczykowski-Górecki wrote: > diff --git a/automation/scripts/qubes-x86-64.sh > b/automation/scripts/qubes-x86-64.sh > index 861e302d845b..dd88a1398f2b 100755 > --- a/automation/scripts/qubes-x86-64.sh > +++ b/automation/scripts/qubes-x86-64.sh > @@ -182,7 +182,10 @@ $

Re: [PATCH] Package microcode for the x86 hardware runners

2025-04-11 Thread Jason Andryuk
On 2025-04-11 15:59, Andrew Cooper wrote: They are all out of date, to different degrees. Install jq into the x86_64 build container so we can parse the Github latest release information in an acceptable way. The resulting archive must be uncompressed, in order to work during early boot. Signe

Re: [PATCH v3 4/7] CI: write whole etc/issue for domU initrd

2025-04-11 Thread Marek Marczykowski-Górecki
On Fri, Apr 11, 2025 at 10:07:28PM +0100, Andrew Cooper wrote: > On 11/04/2025 9:32 pm, Marek Marczykowski-Górecki wrote: > > diff --git a/automation/scripts/qubes-x86-64.sh > > b/automation/scripts/qubes-x86-64.sh > > index 861e302d845b..dd88a1398f2b 100755 > > --- a/automation/scripts/qubes-x86-

Re: [PATCH v1 0/4] mm: Fix apply_to_pte_range() vs lazy MMU mode

2025-04-11 Thread Nicholas Piggin
On Tue Apr 8, 2025 at 1:11 AM AEST, Alexander Gordeev wrote: > Hi All, > > This series is an attempt to fix the violation of lazy MMU mode context > requirement as described for arch_enter_lazy_mmu_mode(): > > This mode can only be entered and left under the protection of > the page table l

Re: [PATCH v1 4/4] mm: Allow detection of wrong arch_enter_lazy_mmu_mode() context

2025-04-11 Thread Nicholas Piggin
On Tue Apr 8, 2025 at 1:11 AM AEST, Alexander Gordeev wrote: > The lazy MMU batching may be only be entered and left under the > protection of the page table locks for all page tables which may > be modified. Yet, there were cases arch_enter_lazy_mmu_mode() > was called without the locks taken, e.g

Re: [RFC PATCH v1 10/15] KVM: VMX: Use WRMSRNS or its immediate form when available

2025-04-11 Thread Xin Li
On 4/11/2025 1:50 PM, H. Peter Anvin wrote: This is quite hideous. I have no objection to optimizing __vmx_vcpu_run(), but I would much prefer that a macro like this live in generic code, and that it be generic. It should be easy enough to provide an assembly friendly equivalent to __native_wrm

Re: [RFC PATCH v1 10/15] KVM: VMX: Use WRMSRNS or its immediate form when available

2025-04-11 Thread Xin Li
On 4/11/2025 2:12 PM, Jim Mattson wrote: Surely, any CPU that has WRMSRNS also supports "Virtualize IA32_SPEC_CTRL," right? Shouldn't we be using that feature rather than swapping host and guest values with some form of WRMSR? Good question, the simple answer is that they are irrelevant.