[PATCH v3 3/3] xen/riscv: finalize boot allocator and transition to boot state

2024-11-01 Thread Oleksii Kurochko
Add a call to end_boot_allocator() in start_xen() to finalize the boot memory allocator, moving free pages to the domain sub-allocator. After initializing the memory subsystem, update `system_state` from `SYS_STATE_early_boot` to `SYS_STATE_boot`, signifying the end of the early boot phase. Signe

[PATCH v3 0/3] Setup memory management for RISC-V

2024-11-01 Thread Oleksii Kurochko
Finish initializing the memory subsystem by mapping the direct map and frame table. In the case of RISC-V 64, which has a large virtual address space (the minimum supported MMU mode is Sv39, providing GBs of VA space), so frame table is mapped starting from physical address 0 to ram_end. This simp

Re: [PATCH v2 3/8] xen/arm: Add SCMI over SMC calls handling layer

2024-11-01 Thread Grygorii Strashko
Hi I'd be apprcieated if could consider my comments below. On 30.09.24 14:47, Andrei Cherechesu (OSS) wrote: From: Andrei Cherechesu Introduce the SCMI layer to have some basic degree of awareness about SMC calls that are based on the ARM System Control and Management Interface (SCMI) specifi

Re: [PATCH v4 4/6] xen/arm: mpu: Create boot-time MPU protection regions

2024-11-01 Thread Ayan Kumar Halder
On 01/11/2024 14:11, Julien Grall wrote: Hi Ayan, Hi Julien, On 28/10/2024 12:45, Ayan Kumar Halder wrote: Define enable_boot_cpu_mm() for the AArch64-V8R system. Like boot-time page table in MMU system, we need a boot-time MPU protection region configuration in MPU system so Xen can fetc

Re: [PATCH v4 4/6] xen/arm: mpu: Create boot-time MPU protection regions

2024-11-01 Thread Ayan Kumar Halder
On 01/11/2024 17:08, Ayan Kumar Halder wrote: On 01/11/2024 14:11, Julien Grall wrote: Hi Ayan, Hi Julien, Yes, you are correct. We need the following change. --- a/xen/arch/arm/arch.mk +++ b/xen/arch/arm/arch.mk @@ -9,7 +9,11 @@ CFLAGS-$(CONFIG_ARM_32) += -msoft-float  CFLAGS-$(CONFIG_A

Dom0 crash (BUG_ON(old_mode != XEN_LAZY_NONE) in enter_lazy()) with Linux 6.11.2

2024-11-01 Thread Marek Marczykowski-Górecki
Hi, I've got a report that starting with 6.11 (specifically 6.11.2) dom0 often crashes on a BUG_ON() like in the subject. I'm not sure where the issue is - there is i915 all over the stack trace, but in the end it crashes in a Xen-specific code. The specific crash: [10574.642243] [ c

Re: [PATCH 1/6] xen: add a domain unique id to each domain

2024-11-01 Thread Alejandro Vallejo
On Fri Nov 1, 2024 at 7:06 AM GMT, Jürgen Groß wrote: > On 31.10.24 12:58, Alejandro Vallejo wrote: > > On Wed Oct 23, 2024 at 3:27 PM BST, Juergen Gross wrote: > >> On 23.10.24 16:08, Alejandro Vallejo wrote: > >>> On Wed Oct 23, 2024 at 2:10 PM BST, Juergen Gross wrote: > Xenstore is referen

Re: [PATCH] scripts: Refine git-checkout.sh change for different branches

2024-11-01 Thread Andrew Cooper
On 01/11/2024 12:26 pm, Jason Andryuk wrote: > On 2024-10-31 18:52, Andrew Cooper wrote: >> On 31/10/2024 10:44 pm, Stefano Stabellini wrote: >>> >>> On Thu, 31 Oct 2024, Andrew Cooper wrote: >>> On 31/10/2024 1:47 pm, Andrew Cooper wrote: > The change works for divergent branches, but doe

Re: [PATCH v4 1/6] xen/arm: Skip initializing the BSS section when it is empty

2024-11-01 Thread Julien Grall
Hi Ayan, On 28/10/2024 12:45, Ayan Kumar Halder wrote: If the BSS section is empty, then the function should return. If one does not check whether the BSS section is empty or not, then there is a risk of writing 0s outside of BSS section (which may contain critical data). Fixes: dac84b66cc9a ("

Re: [PATCH] CI: Drop alpine-3.18-rootfs-export and use test-artefacts

2024-11-01 Thread Stefano Stabellini
On Thu, 31 Oct 2024, Andrew Cooper wrote: > On 31/10/2024 10:46 pm, Stefano Stabellini wrote: > > On Thu, 31 Oct 2024, Andrew Cooper wrote: > >> The Argo work already moved this artefact into the new form. Reuse that, > >> and > >> drop one test job. > >> > >> Signed-off-by: Andrew Cooper > > Th

Re: [PATCH] scripts: Refine git-checkout.sh change for different branches

2024-11-01 Thread Jason Andryuk
On 2024-10-31 18:52, Andrew Cooper wrote: On 31/10/2024 10:44 pm, Stefano Stabellini wrote: On Thu, 31 Oct 2024, Andrew Cooper wrote: On 31/10/2024 1:47 pm, Andrew Cooper wrote: The change works for divergent branches, but doesn't work for explicit SHAs. Instead of passing `-b $TAG` to clon

[PATCH v3] xen/common: Move gic_dt_preinit() to common code

2024-11-01 Thread Oleksii Kurochko
Introduce intc_dt_preinit() in the common codebase, as it is not architecture-specific and can be reused by both PPC and RISC-V. This function identifies the node with the interrupt-controller property in the device tree and calls device_init() to handle architecture-specific initialization of the

Re: [PATCH v4 4/6] xen/arm: mpu: Create boot-time MPU protection regions

2024-11-01 Thread Julien Grall
Hi Ayan, On 28/10/2024 12:45, Ayan Kumar Halder wrote: Define enable_boot_cpu_mm() for the AArch64-V8R system. Like boot-time page table in MMU system, we need a boot-time MPU protection region configuration in MPU system so Xen can fetch code and data from normal memory. To do this, Xen maps

Re: [QEMU PATCH v9] xen/passthrough: use gsi to map pirq when dom0 is PVH

2024-11-01 Thread Stewart Hildebrand
On 10/24/24 05:06, Jiqian Chen wrote: > diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c > index 3635d1b39f79..5b10d501d566 100644 > --- a/hw/xen/xen_pt.c > +++ b/hw/xen/xen_pt.c > @@ -766,6 +766,50 @@ static void xen_pt_destroy(PCIDevice *d) { > } > /* init */ > > +#if CONFIG_XEN_CTRL_INTERFACE_

[PATCH v3 2/3] xen/riscv: initialize the VMAP_DEFAULT virtual range

2024-11-01 Thread Oleksii Kurochko
Call vm_init() to initialize the VMAP_DEFAULT virtual range. To support this, introduce the populate_pt_range() and arch_vmap_virt_end() functions, which are used by vm_init()->vm_init_type(). Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich --- Change in V2-V3: - Acked-by: Jan Beulich -

[PATCH v3 1/3] xen/riscv: introduce setup_mm()

2024-11-01 Thread Oleksii Kurochko
Introduce the implementation of setup_mm(), which includes: 1. Adding all free regions to the boot allocator, as memory is needed to allocate page tables used for frame table mapping. 2. Calculating RAM size and the RAM end address. 3. Setting up direct map mappings from each RAM bank and initia

Re: [PATCH v4 5/6] xen/arm: mpu: Enable MPU

2024-11-01 Thread Julien Grall
Hi Ayan, On 28/10/2024 12:45, Ayan Kumar Halder wrote: After the regions have been created, now we enable the MPU. For this we disable the background region so that the new memory map created for the regions take effect. Also, we treat all RW regions as non executable and the data cache is enabl

Re: [PATCH v4 0/6] Enable early bootup of AArch64 MPU systems

2024-11-01 Thread Julien Grall
Hi Ayan, On 28/10/2024 12:45, Ayan Kumar Halder wrote: We have enabled early booting of R82. Changes from v2 :- 1. Added a new patch "xen/arm: Skip initializing the BSS section when it is empty". 2. Split "xen/arm: mpu: Create boot-time MPU protection regions" into 2 patches. Changes from v3

Re: [PATCH v4 3/6] xen/arm: mpu: Define Xen start address for MPU systems

2024-11-01 Thread Julien Grall
Hi Ayan, On 28/10/2024 12:45, Ayan Kumar Halder wrote: From: Wei Chen On Armv8-A, Xen has a fixed virtual start address (link address too) for all Armv8-A platforms. In an MMU based system, Xen can map its loaded address to this virtual start address. So, on Armv8-A platforms, the Xen start ad

Re: [PATCH v6 2/3] xen/pci: introduce PF<->VF links

2024-11-01 Thread Stewart Hildebrand
+Daniel (XSM mention) On 10/28/24 13:02, Jan Beulich wrote: > On 18.10.2024 22:39, Stewart Hildebrand wrote: >> Add links between a VF's struct pci_dev and its associated PF struct >> pci_dev. Move the calls to pci_get_pdev()/pci_add_device() down to avoid >> dropping and re-acquiring the pcidevs_

Re: [PATCH] x86/io-apic: fix directed EOI when using AMd-Vi interrupt remapping

2024-11-01 Thread marma...@invisiblethingslab.com
On Mon, Oct 21, 2024 at 11:43:04AM +, Woodhouse, David wrote: > On Sat, 2024-10-19 at 05:23 +0200, Marek Marczykowski-Górecki wrote: > > On Fri, Oct 18, 2024 at 10:08:13AM +0200, Roger Pau Monne wrote: > > > When using AMD-VI interrupt remapping the vector field in the IO-APIC RTE > > > is > >

Re: [PATCH v4] x86/io-apic: fix directed EOI when using AMD-Vi interrupt remapping

2024-11-01 Thread Marek Marczykowski-Górecki
On Thu, Oct 31, 2024 at 09:57:13AM +0100, Roger Pau Monne wrote: > When using AMD-Vi interrupt remapping the vector field in the IO-APIC RTE is > repurposed to contain part of the offset into the remapping table. Previous > to > 2ca9fbd739b8 Xen had logic so that the offset into the interrupt rem

Re: [PATCH 3/6] xen: add new domctl get_changed_domain

2024-11-01 Thread Jürgen Groß
On 31.10.24 12:16, Jan Beulich wrote: On 23.10.2024 15:10, Juergen Gross wrote: --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -154,6 +154,57 @@ void domain_reset_states(void) rcu_read_unlock(&domlist_read_lock); } +static void set_domain_state_info(struct xen_domctl_get_domai

Re: [PATCH 1/6] xen: add a domain unique id to each domain

2024-11-01 Thread Jürgen Groß
On 31.10.24 12:58, Alejandro Vallejo wrote: On Wed Oct 23, 2024 at 3:27 PM BST, Juergen Gross wrote: On 23.10.24 16:08, Alejandro Vallejo wrote: On Wed Oct 23, 2024 at 2:10 PM BST, Juergen Gross wrote: Xenstore is referencing domains by their domid, but reuse of a domid can lead to the situati

Re: [RFC PATCH 1/4] xen/arm: ffa: Introduce VM to VM support

2024-11-01 Thread Andrew Cooper
On 16/10/2024 10:21 am, Bertrand Marquis wrote: > diff --git a/xen/arch/arm/tee/ffa_partinfo.c b/xen/arch/arm/tee/ffa_partinfo.c > index fde187dba4e5..d699a267cc76 100644 > --- a/xen/arch/arm/tee/ffa_partinfo.c > +++ b/xen/arch/arm/tee/ffa_partinfo.c > @@ -77,7 +77,21 @@ void ffa_handle_partition_i

Re: [RFC PATCH 4/4] xen/arm: ffa: Enable VM to VM without firmware

2024-11-01 Thread Jens Wiklander
Hi Bertrand, On Wed, Oct 16, 2024 at 11:22 AM Bertrand Marquis wrote: > > When VM to VM support is activated and there is no suitable FF-A support > in the firmware, enable FF-A support for VMs to allow using it for VM to > VM communications. > If there is Optee running in the secure world and us