Re: [PATCH v6 6/6] xen/arm: ffa: Enable VM to VM without firmware

2025-05-22 Thread Jens Wiklander
Hi Bertrand, On Thu, May 22, 2025 at 5:08 PM 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 OP-TEE running in the secure world and us

[PATCH v6 1/6] docs/arm: Document Xen booting protocol on Armv8-R

2025-05-22 Thread Luca Fancellu
Document the requirement needed to boot Xen on Armv8-R platforms. Signed-off-by: Luca Fancellu Reviewed-by: Ayan Kumar Halder Reviewed-by: Michal Orzel Acked-by: Julien Grall --- v6 changes: - Add Julien's Ack-by, add " Cache state shall follow [1], [2] for MPU." v5 changes: - restructured a

[PATCH v6 5/6] arm/mpu: Introduce utility functions for the pr_t type

2025-05-22 Thread Luca Fancellu
Introduce a few utility functions to manipulate and handle the pr_t type. Signed-off-by: Luca Fancellu --- v6 changes: - constify pointer arguments when needed, code style fix, add clarification comment in pr_set_limit v5 changes: - Don't rely on bitfield and use the mask MPU_REGION_RES0 for

[PATCH v6 6/6] arm/mpu: Provide a constructor for pr_t type

2025-05-22 Thread Luca Fancellu
Provide a function that creates a pr_t object from a memory range and some attributes. Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel --- v6 changes: - explicitly initialise also xn_0 and ap_0. v5 changes: - removed AP_RW_EL2 used only by pr_of_xenaddr(), fixed comments and typos -

[PATCH v6 2/6] arm/mpu: Introduce MPU memory region map structure

2025-05-22 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. Signed-off-by: Penny Zheng Signed-off-by: Wei Chen Signed-off-by: Luca Fancellu Acked-by: Julien Grall Reviewed-by: Mi

[PATCH v6 3/6] arm/mpu: Provide and populate MPU C data structures

2025-05-22 Thread Luca Fancellu
Provide some data structure in the C world to track the MPU status, these structures will be filled at boot by the assembly early code with the boot MPU regions and afterwards they will be used at runtime. Provide methods to update a bitmap created with DECLARE_BITMAP from the assembly code for bo

Re: [PATCH v6 3/6] xen/arm: ffa: Introduce VM to VM support

2025-05-22 Thread Jens Wiklander
Hi Bertrand, On Thu, May 22, 2025 at 5:08 PM Bertrand Marquis wrote: > > Create a CONFIG_FFA_VM_TO_VM parameter to activate FFA communication > between VMs. > When activated list VMs in the system with FF-A support in part_info_get. > > When VM to VM is activated, Xen will be tainted as Insecure

[PATCH v3 12/13] KVM: selftests: Add utilities to create eventfds and do KVM_IRQFD

2025-05-22 Thread Sean Christopherson
Add helpers to create eventfds and to (de)assign eventfds via KVM_IRQFD. Signed-off-by: Sean Christopherson --- tools/testing/selftests/kvm/arm64/vgic_irq.c | 12 ++ .../testing/selftests/kvm/include/kvm_util.h | 40 +++ .../selftests/kvm/x86/xen_shinfo_test.c | 18 ++

[PATCH v3 13/13] KVM: selftests: Add a KVM_IRQFD test to verify uniqueness requirements

2025-05-22 Thread Sean Christopherson
Add a selftest to verify that eventfd+irqfd bindings are globally unique, i.e. that KVM doesn't allow multiple irqfds to bind to a single eventfd, even across VMs. Signed-off-by: Sean Christopherson --- tools/testing/selftests/kvm/Makefile.kvm | 1 + tools/testing/selftests/kvm/irqfd_test.c |

[PATCH v3 08/13] sched/wait: Add a waitqueue helper for fully exclusive priority waiters

2025-05-22 Thread Sean Christopherson
Add a waitqueue helper to add a priority waiter that requires exclusive wakeups, i.e. that requires that it be the _only_ priority waiter. The API will be used by KVM to ensure that at most one of KVM's irqfds is bound to a single eventfd (across the entire kernel). Open code the helper instead o

[PATCH v3 01/13] KVM: Use a local struct to do the initial vfs_poll() on an irqfd

2025-05-22 Thread Sean Christopherson
Use a function-local struct for the poll_table passed to vfs_poll(), as nothing in the vfs_poll() callchain grabs a long-term reference to the structure, i.e. its lifetime doesn't need to be tied to the irqfd. Using a local structure will also allow propagating failures out of the polling callback

[PATCH v3 07/13] xen: privcmd: Don't mark eventfd waiter as EXCLUSIVE

2025-05-22 Thread Sean Christopherson
Don't set WQ_FLAG_EXCLUSIVE when adding an irqfd to a wait queue, as irqfd_wakeup() unconditionally returns '0', i.e. doesn't actually operate in exclusive mode. Note, the use of WQ_FLAG_PRIORITY is also dubious, but that's a problem for another day. Signed-off-by: Sean Christopherson --- drive

[PATCH v3 09/13] KVM: Disallow binding multiple irqfds to an eventfd with a priority waiter

2025-05-22 Thread Sean Christopherson
Disallow binding an irqfd to an eventfd that already has a priority waiter, i.e. to an eventfd that already has an attached irqfd. KVM always operates in exclusive mode for EPOLL_IN (unconditionally returns '1'), i.e. only the first waiter will be notified. KVM already disallows binding multiple

[PATCH v3 03/13] KVM: Initialize irqfd waitqueue callback when adding to the queue

2025-05-22 Thread Sean Christopherson
Initialize the irqfd waitqueue callback immediately prior to inserting the irqfd into the eventfd's waitqueue. Pre-initializing the state in a completely different context is all kinds of confusing, and incorrectly suggests that the waitqueue function needs to be initialize prior to vfs_poll(). S

[PATCH v3 05/13] KVM: Add irqfd to eventfd's waitqueue while holding irqfds.lock

2025-05-22 Thread Sean Christopherson
Add an irqfd to its target eventfd's waitqueue while holding irqfds.lock, which is mildly terrifying but functionally safe. irqfds.lock is taken inside the waitqueue's lock, but if and only if the eventfd is being released, i.e. that path is mutually exclusive with registration as KVM holds a refe

[PATCH v3 11/13] KVM: selftests: Assert that eventfd() succeeds in Xen shinfo test

2025-05-22 Thread Sean Christopherson
Assert that eventfd() succeeds in the Xen shinfo test instead of skipping the associated testcase. While eventfd() is outside the scope of KVM, KVM unconditionally selects EVENTFD, i.e. the syscall should always succeed. Signed-off-by: Sean Christopherson --- tools/testing/selftests/kvm/x86/xen

[PATCH v3 10/13] KVM: Drop sanity check that per-VM list of irqfds is unique

2025-05-22 Thread Sean Christopherson
Now that the eventfd's waitqueue ensures it has at most one priority waiter, i.e. prevents KVM from binding multiple irqfds to one eventfd, drop KVM's sanity check that eventfds are unique for a single VM. Signed-off-by: Sean Christopherson --- virt/kvm/eventfd.c | 11 --- 1 file changed

[PATCH v3 06/13] sched/wait: Drop WQ_FLAG_EXCLUSIVE from add_wait_queue_priority()

2025-05-22 Thread Sean Christopherson
Drop the setting of WQ_FLAG_EXCLUSIVE from add_wait_queue_priority() and instead have callers manually add the flag prior to adding their structure to the queue. Blindly setting WQ_FLAG_EXCLUSIVE is flawed, as the nature of exclusive, priority waiters means that only the first waiter added will ev

xen_acpi_processor driver is bound to dom0 vcpu count

2025-05-22 Thread me
I think I’ve just uncovered a rather nasty bug in the xen_acpi_processor driver in dom0. If the vcpu count in dom0 is set to anything other than the exact number of physical cores, the xen_acpi_processor kernel driver will fail to upload the C-state information for those cores to Xen, resulting

[PATCH v3 04/13] KVM: Add irqfd to KVM's list via the vfs_poll() callback

2025-05-22 Thread Sean Christopherson
Add the irqfd structure to KVM's list of irqfds in kvm_irqfd_register(), i.e. via the vfs_poll() callback. This will allow taking irqfds.lock across the entire registration sequence (add to waitqueue, add to list), and more importantly will allow inserting into KVM's list if and only if adding to

[PATCH v3 00/13] KVM: Make irqfd registration globally unique

2025-05-22 Thread Sean Christopherson
Non-KVM folks, I am hoping to route this through the KVM tree (6.17 or later), as the non-KVM changes should be glorified nops. Please holler if you object to that idea. Hyper-V folks in particular, let me know if you want a stable topic branch/tag, e.g. on the off chance you want to make simila

[PATCH v3 02/13] KVM: Acquire SCRU lock outside of irqfds.lock during assignment

2025-05-22 Thread Sean Christopherson
Acquire SRCU outside of irqfds.lock so that the locking is symmetrical, and add a comment explaining why on earth KVM holds SRCU for so long. Signed-off-by: Sean Christopherson --- virt/kvm/eventfd.c | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/virt/kv

Re: [XTF PATCH v2 2/2] tests/argo: use event channel to get own domain ID

2025-05-22 Thread dmkhn
On Wed, May 21, 2025 at 10:37:40PM +0100, Andrew Cooper wrote: > On 21/05/2025 10:18 pm, [email protected] wrote: > > From: Denis Mukhin > > > > The existing argo test depends on xenstore to retrieve the domain ID. > > > > Also, test does not perform peer-to-peer communication using Argo > > hyperc

Re: [PATCH v8 3/3] xen/domain: introduce CONFIG_MAX_DOMID

2025-05-22 Thread dmkhn
On Thu, May 22, 2025 at 09:01:51AM +0200, Jan Beulich wrote: > On 22.05.2025 02:09, [email protected] wrote: > > On Wed, May 21, 2025 at 09:31:34AM +0200, Jan Beulich wrote: > >> On 21.05.2025 02:00, [email protected] wrote: > >>> --- a/xen/arch/arm/tee/ffa.c > >>> +++ b/xen/arch/arm/tee/ffa.c > >>> @@

[PATCH 1/3] CI/qubes: Deduplicate the handling of ${dom0_check}

2025-05-22 Thread Andrew Cooper
Make it clear that ${dom0_check} is unconditional. No functional change. Signed-off-by: Andrew Cooper --- CC: Anthony PERARD CC: Stefano Stabellini CC: Michal Orzel CC: Marek Marczykowski-Górecki --- automation/scripts/qubes-x86-64.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(

[PATCH 2/3] CI: Use bash arrays to simplfy dom0 rootfs construction

2025-05-22 Thread Andrew Cooper
For Qubes, this requires switching from sh to bash. This reduces the number of times the target filename needs to be written to 1. Expand the comment to explain the concatination constraints. No functional change. Signed-off-by: Andrew Cooper --- CC: Anthony PERARD CC: Stefano Stabellini CC:

[PATCH 0/3] CI: Improve domU handling

2025-05-22 Thread Andrew Cooper
A follow-up to an RFC patch on the initrd handling improvements, this time non-RFC. https://gitlab.com/xen-project/hardware/xen-staging/-/pipelines/1831808006 Andrew Cooper (3): CI/qubes: Deduplicate the handling of ${dom0_check} CI: Use bash arrays to simplfy dom0 rootfs construction CI: A

[PATCH 3/3] CI: Adjust how domU is packaged in dom0

2025-05-22 Thread Andrew Cooper
Package domU in /root for dom0 and insert into the uncompressed part of dom0's rootfs, rather than recompressing it as part of the overlay. For Qubes, this avoids putting the domU kernel in dom0's rootfs for tests which aren't going to boot a guest. Signed-off-by: Andrew Cooper --- CC: Anthony P

Re: [PATCH v2 1/4] x86/boot: print CPU and APIC ID in bring up failure

2025-05-22 Thread Andrew Cooper
On 22/05/2025 5:50 pm, Roger Pau Monné wrote: > On Thu, May 22, 2025 at 03:39:57PM +0100, Andrew Cooper wrote: >> On 22/05/2025 10:10 am, Jan Beulich wrote: >>> On 22.05.2025 09:54, Roger Pau Monne wrote: Print the CPU and APIC ID that fails to respond to the init sequence, or that didn't

Re: [PATCH v2 1/4] x86/boot: print CPU and APIC ID in bring up failure

2025-05-22 Thread Roger Pau Monné
On Thu, May 22, 2025 at 03:39:57PM +0100, Andrew Cooper wrote: > On 22/05/2025 10:10 am, Jan Beulich wrote: > > On 22.05.2025 09:54, Roger Pau Monne wrote: > >> Print the CPU and APIC ID that fails to respond to the init sequence, or > >> that didn't manage to reach the "callin" state. Expand a bi

Re: [PATCH 2/2] x86/vpci: refuse to map BARs at position 0

2025-05-22 Thread Roger Pau Monné
On Thu, May 22, 2025 at 11:44:24AM -0400, Stewart Hildebrand wrote: > On 5/22/25 10:59, Jan Beulich wrote: > > On 22.05.2025 16:03, Roger Pau Monne wrote: > >> diff --git a/xen/arch/x86/pci.c b/xen/arch/x86/pci.c > >> index 26bb7f6a3c3a..39fd5a16a4aa 100644 > >> --- a/xen/arch/x86/pci.c > >> +++ b/

Re: [PATCH v1 2/6] xen/riscv: introduce things necessary for p2m initialization

2025-05-22 Thread Jan Beulich
On 22.05.2025 17:53, Oleksii Kurochko wrote: > On 5/20/25 3:37 PM, Jan Beulich wrote: >> On 09.05.2025 17:57, Oleksii Kurochko wrote: >>> +static struct page_info *p2m_get_clean_page(struct domain *d) >>> +{ >>> +struct page_info *page; >>> + >>> +/* >>> + * As mentioned in the Privilig

Re: [PATCH v3 11/14] xen/riscv: implementation of aplic and imsic operations

2025-05-22 Thread Jan Beulich
On 21.05.2025 18:03, Oleksii Kurochko wrote: > +static void aplic_set_irq_affinity(struct irq_desc *desc, const cpumask_t > *mask) > +{ > +unsigned int cpu; > +uint64_t group_index, base_ppn; > +uint32_t hhxw, lhxw ,hhxs, value; Nit: Comma vs blank placement. > +const struct imsi

Re: [PATCH v1 2/6] xen/riscv: introduce things necessary for p2m initialization

2025-05-22 Thread Oleksii Kurochko
On 5/20/25 3:37 PM, Jan Beulich wrote: On 09.05.2025 17:57, Oleksii Kurochko wrote: --- /dev/null +++ b/xen/arch/riscv/p2m.c +static void clear_and_clean_page(struct page_info *page) +{ +void *p = __map_domain_page(page); + +clear_page(p); +unmap_domain_page(p); +} What's the "clea

Re: [PATCH 2/2] x86/vpci: refuse to map BARs at position 0

2025-05-22 Thread Stewart Hildebrand
On 5/22/25 10:59, Jan Beulich wrote: > On 22.05.2025 16:03, Roger Pau Monne wrote: >> diff --git a/xen/arch/x86/pci.c b/xen/arch/x86/pci.c >> index 26bb7f6a3c3a..39fd5a16a4aa 100644 >> --- a/xen/arch/x86/pci.c >> +++ b/xen/arch/x86/pci.c >> @@ -101,6 +101,15 @@ int pci_conf_write_intercept(unsigned

[PATCH] iommu/amd: Remove dead non-atomic update checking

2025-05-22 Thread Teddy Astie
When updating a DTE, amd_iommu_setup_domain_device checks if the update had been non-atomic (i.e rc > 0) and eventually throws a warning but since [1], rc can no longer be positive, making this check never taken. [1] x86/iommu: remove non-CX16 logic from DMA remapping https://gitlab.com/xen-p

Re: [PATCH 2/2] x86/vpci: refuse to map BARs at position 0

2025-05-22 Thread Stewart Hildebrand
On 5/22/25 10:03, Roger Pau Monne wrote: > A BAR at position 0 is not initialized (not positioned). While Xen could > attempt to map it into the p2m, marking it as mapped will prevent dom0 to > change the position of the BAR, as the vPCI code has a shortcomming of not > allowing to write to BAR re

Re: [PATCH v3 10/14] xen/riscv: introduce intc_init() and helpers

2025-05-22 Thread Jan Beulich
On 21.05.2025 18:03, Oleksii Kurochko wrote: > Introduce intc_init() to initialize the interrupt controller using the > registered hardware ops. > Also add intc_route_irq_to_xen() to route IRQs to Xen, with support for > setting IRQ type and priority via new internal helpers intc_set_irq_type() > a

Re: [PATCH v3 09/14] xen/riscv: aplic_init() implementation

2025-05-22 Thread Jan Beulich
On 21.05.2025 18:03, Oleksii Kurochko wrote: > --- /dev/null > +++ b/xen/arch/riscv/aplic-priv.h > @@ -0,0 +1,34 @@ > +/* SPDX-License-Identifier: MIT */ > + > +/* > + * xen/arch/riscv/aplic-priv.h > + * > + * Private part of aplic.h header. > + * > + * RISC-V Advanced Platform-Level Interrupt Cont

[PATCH v6 0/6] FF-A VM to VM support

2025-05-22 Thread Bertrand Marquis
This patch serie adds support to use FF-A between VM for communications using indirect messages. It adds a Kconfig parameter to enable this feature and marks it as experimental as for now there is no system to restrict communication rights between VM using this system. It also adds support to use

[PATCH v6 6/6] xen/arm: ffa: Enable VM to VM without firmware

2025-05-22 Thread Bertrand Marquis
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 OP-TEE running in the secure world and using the non FF-A communication system, having CONFIG_FFA_VM_TO_VM could be non fu

[PATCH v6 5/6] xen/arm: ffa: Add indirect message between VM

2025-05-22 Thread Bertrand Marquis
Add support for indirect messages between VMs. This is only enabled if CONFIG_FFA_VM_TO_VM is selected. Signed-off-by: Bertrand Marquis Reviewed-by: Jens Wiklander --- Changes in v6: - fix code alignment (Jens) - add Jens R-b Changes in v5: - Prevent potential overflow in send2 handling (Julien)

[PATCH v6 2/6] xen/arm: ffa: Rework partinfo_get implementation

2025-05-22 Thread Bertrand Marquis
This patch is in preparation for VM to VM support in order to do the changes on the SP handling part of partinfo_get before adding support for the VM part. This patches is doing the following changes: - split partinfo_get into 3 functions to have the locking handling and proper exit on error han

[PATCH v6 3/6] xen/arm: ffa: Introduce VM to VM support

2025-05-22 Thread Bertrand Marquis
Create a CONFIG_FFA_VM_TO_VM parameter to activate FFA communication between VMs. When activated list VMs in the system with FF-A support in part_info_get. When VM to VM is activated, Xen will be tainted as Insecure and a message is displayed to the user during the boot as there is no filtering of

[PATCH v6 4/6] xen/arm: ffa: Add buffer full notification support

2025-05-22 Thread Bertrand Marquis
Add support to raise a Rx buffer full notification to a VM. This function will be used for indirect message support between VM and is only activated if CONFIG_FFA_VM_TO_VM is selected. Even if there are 32 framework notifications possible, right now only one is defined so the implementation is sim

[PATCH v6 1/6] xen/arm: Create tee command line parameter

2025-05-22 Thread Bertrand Marquis
Add a new command line parameter "tee=" to be used to explicitly select what tee mediator is to be used by Xen and fail if it does not exist or the probe function for it failed. Without specifying which tee is to be used, Xen will use the first one for which the probe function succeeds which depen

[PATCH 1/3] x86/alternatives: Factor out access to ideal_nops[]

2025-05-22 Thread Andrew Cooper
... in order to rework the calculation. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné --- xen/arch/x86/alternative.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternati

[PATCH 3/3] x86/alternatives: Introduce init_or_livepatch_ro_after_init

2025-05-22 Thread Andrew Cooper
... and use it for ideal_nops and toolchain_nops_are_ideal; both of which are invariant after arch_init_ideal_nops() has run. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné --- xen/arch/x86/alternative.c | 4 ++-- xen/include/xen/livepatch.h | 2 ++

[PATCH 2/3] x86/alternatives: Rework get_ideal_nops()

2025-05-22 Thread Andrew Cooper
The {k8,p6}_nops[] arrays are both 80-byte structures indexing 45-byte structures. Furthermore, perhaps unusually for C, the source layout is an obvious hint about the trangular nature of the structure. Therefore, we can replace the pointer chase with some simple arithmatic. No functional change

[PATCH 0/3] x86/alt: Simplify nops handling

2025-05-22 Thread Andrew Cooper
Mostly patch 2, with tidyup either side Andrew Cooper (3): x86/alternatives: Factor out access to ideal_nops[] x86/alternatives: Rework get_ideal_nops() x86/alternatives: Introduce init_or_livepatch_ro_after_init xen/arch/x86/alternative.c | 51 +++-- xen/i

Re: [PATCH 2/2] x86/vpci: refuse to map BARs at position 0

2025-05-22 Thread Jan Beulich
On 22.05.2025 16:03, Roger Pau Monne wrote: > A BAR at position 0 is not initialized (not positioned). While Xen could > attempt to map it into the p2m, marking it as mapped will prevent dom0 to > change the position of the BAR, With memory decoding enabled, that is? > as the vPCI code has a sho

Re: [PATCH 2/2] x86/boot: attempt to print trace and panic on AP bring up stall

2025-05-22 Thread Jan Beulich
On 22.05.2025 16:11, Roger Pau Monné wrote: > On Thu, May 22, 2025 at 09:18:57AM +0200, Jan Beulich wrote: >> On 21.05.2025 18:55, Roger Pau Monne wrote: >>> --- a/xen/arch/x86/traps.c >>> +++ b/xen/arch/x86/traps.c >>> @@ -714,13 +714,15 @@ static cpumask_t show_state_mask; >>> static bool opt_sh

Re: [PATCH v3 08/14] xen/riscv: imsic_init() implementation

2025-05-22 Thread Jan Beulich
On 21.05.2025 18:03, Oleksii Kurochko wrote: > --- /dev/null > +++ b/xen/arch/riscv/imsic.c > @@ -0,0 +1,354 @@ > +/* SPDX-License-Identifier: MIT */ > + > +/* > + * xen/arch/riscv/imsic.c > + * > + * RISC-V Incoming MSI Controller support > + * > + * (c) Microchip Technology Inc. > + * (c) Vates >

Re: [PATCH v2 4/4] x86/boot: attempt to print trace and panic on AP bring up stall

2025-05-22 Thread Andrew Cooper
On 22/05/2025 8:54 am, Roger Pau Monne wrote: > With the current AP bring up code, Xen can get stuck indefinitely if an AP > freezes during boot after the 'callin' step. Introduce a 5s timeout while > waiting for APs to finish startup. > > On failure of an AP to complete startup, send an NMI to tr

Re: [PATCH v2 1/4] x86/boot: print CPU and APIC ID in bring up failure

2025-05-22 Thread Andrew Cooper
On 22/05/2025 10:10 am, Jan Beulich wrote: > On 22.05.2025 09:54, Roger Pau Monne wrote: >> Print the CPU and APIC ID that fails to respond to the init sequence, or >> that didn't manage to reach the "callin" state. Expand a bit the printed >> error messages. Otherwise the "Not responding." messa

Re: [PATCH 2/2] x86/vpci: refuse to map BARs at position 0

2025-05-22 Thread Roger Pau Monné
On Thu, May 22, 2025 at 03:22:53PM +0100, Andrew Cooper wrote: > On 22/05/2025 3:03 pm, Roger Pau Monne wrote: > > A BAR at position 0 is not initialized (not positioned). While Xen could > > attempt to map it into the p2m, marking it as mapped will prevent dom0 to > > change the position of the B

Re: [PATCH 2/2] x86/vpci: refuse to map BARs at position 0

2025-05-22 Thread Andrew Cooper
On 22/05/2025 3:03 pm, Roger Pau Monne wrote: > A BAR at position 0 is not initialized (not positioned). While Xen could > attempt to map it into the p2m, marking it as mapped will prevent dom0 to > change the position of the BAR, as the vPCI code has a shortcomming of not Minor grammar point.  "

Re: [PATCH 1/2] x86/vpci: fix off-by-one

2025-05-22 Thread Andrew Cooper
On 22/05/2025 3:03 pm, Roger Pau Monne wrote: > rangeset_remove_range() uses inclusive ranges, and hence the end of the > range should be calculated using PFN_DOWN(), not PFN_UP(). > > Fixes: 4acab25a9300 ('x86/vpci: fix handling of BAR overlaps with non-hole > regions') > Signed-off-by: Roger Pau

Re: [PATCH 2/2] x86/boot: attempt to print trace and panic on AP bring up stall

2025-05-22 Thread Roger Pau Monné
On Thu, May 22, 2025 at 09:18:57AM +0200, Jan Beulich wrote: > On 21.05.2025 18:55, Roger Pau Monne wrote: > > --- a/xen/arch/x86/traps.c > > +++ b/xen/arch/x86/traps.c > > @@ -714,13 +714,15 @@ static cpumask_t show_state_mask; > > static bool opt_show_all; > > boolean_param("async-show-all", op

Re: [PATCH v6 02/12] common/hyperlaunch: introduce the domain builder

2025-05-22 Thread Alejandro Vallejo
On Wed May 14, 2025 at 12:23 AM CEST, Daniel P. Smith wrote: > On 5/13/25 04:05, Jan Beulich wrote: >> On 06.05.2025 21:29, Daniel P. Smith wrote: >>> On 5/2/25 03:21, Jan Beulich wrote: On 30.04.2025 20:56, Daniel P. Smith wrote: > On 4/29/25 08:36, Alejandro Vallejo wrote: >> --- a/x

[PATCH 1/2] x86/vpci: fix off-by-one

2025-05-22 Thread Roger Pau Monne
rangeset_remove_range() uses inclusive ranges, and hence the end of the range should be calculated using PFN_DOWN(), not PFN_UP(). Fixes: 4acab25a9300 ('x86/vpci: fix handling of BAR overlaps with non-hole regions') Signed-off-by: Roger Pau Monné --- xen/arch/x86/pci.c | 2 +- 1 file changed, 1

[PATCH 2/2] x86/vpci: refuse to map BARs at position 0

2025-05-22 Thread Roger Pau Monne
A BAR at position 0 is not initialized (not positioned). While Xen could attempt to map it into the p2m, marking it as mapped will prevent dom0 to change the position of the BAR, as the vPCI code has a shortcomming of not allowing to write to BAR registers while the BAR is mapped on the p2m. Work

[PATCH 0/2] x86/vpci: two fixes

2025-05-22 Thread Roger Pau Monne
Hello, Patch 1 fixes a regression reported by the Qubes ADL runner, so it's required to unblock the testing. Patch 2 is possibly more controversial, it's not strictly required to unblock the testing, but might be good to consider. Thanks, Roger. Roger Pau Monne (2): x86/vpci: fix off-by-one

Re: [PATCH v5 6/6] xen/arm: ffa: Enable VM to VM without firmware

2025-05-22 Thread Bertrand Marquis
Hi Jens, > On 22 May 2025, at 14:00, Jens Wiklander wrote: > > Hi Bertrand, > > On Thu, May 22, 2025 at 11:11 AM Bertrand Marquis > wrote: >> >> Hi Jens, >> >>> On 22 May 2025, at 10:30, Jens Wiklander wrote: >>> >>> Hi, >>> >>> On Thu, May 22, 2025 at 10:18 AM Bertrand Marquis >>> wrote

Re: [PATCH v3 07/14] xen/riscv: introduce register_intc_ops() and intc_hw_ops.

2025-05-22 Thread Jan Beulich
On 21.05.2025 18:03, Oleksii Kurochko wrote: > Introduce the intc_hw_operations structure to encapsulate interrupt > controller-specific data and operations. This structure includes: > - A pointer to interrupt controller information (`intc_info`) > - Callbacks to initialize the controller and set I

Re: xen/arm: Virtio-PCI for dom0less on ARM

2025-05-22 Thread Edgar E. Iglesias
On Wed, May 21, 2025 at 01:22:11PM +0100, Julien Grall wrote: > Hi Edgar, > > Thanks for the write-up. > Thanks for commenting! > On 20/05/2025 09:04, Edgar E. Iglesias wrote: > > Hi all, > > > > Following up on the ARM virtio-pci series I posted a while back ago. > > > > There have been som

Re: [Eclair false positive] Re: [PATCH] x86/msr: Rework wrmsr_safe() using asm goto()

2025-05-22 Thread Andrew Cooper
On 22/05/2025 1:45 pm, Nicola Vetrini wrote: > On 2025-05-21 20:00, Andrew Cooper wrote: >> On 21/05/2025 3:36 pm, Andrew Cooper wrote: >>> diff --git a/xen/arch/x86/include/asm/msr.h >>> b/xen/arch/x86/include/asm/msr.h >>> index 0d3b1d637488..4c4f18b3a54d 100644 >>> --- a/xen/arch/x86/include/asm

Re: [PATCH v2 3/4] x86/traps: split code to dump execution state to a separate helper

2025-05-22 Thread Jan Beulich
On 22.05.2025 09:54, Roger Pau Monne wrote: > --- a/xen/arch/x86/traps.c > +++ b/xen/arch/x86/traps.c > @@ -714,13 +714,15 @@ static cpumask_t show_state_mask; > static bool opt_show_all; > boolean_param("async-show-all", opt_show_all); > > +static bool force_show_all; > + > static int cf_chec

Re: [PATCH v5 6/6] arm/mpu: Provide a constructor for pr_t type

2025-05-22 Thread Orzel, Michal
On 22/05/2025 14:49, Luca Fancellu wrote: > Hi Michal, > >>> + >>> +pr_t pr_of_addr(paddr_t base, paddr_t limit, unsigned int flags) >>> +{ >>> +unsigned int attr_idx = PAGE_AI_MASK(flags); >>> +prbar_t prbar; >>> +prlar_t prlar; >>> +pr_t region; >>> + >>> +/* Build up valu

Re: [PATCH v5 6/6] arm/mpu: Provide a constructor for pr_t type

2025-05-22 Thread Luca Fancellu
Hi Michal, >> + >> +pr_t pr_of_addr(paddr_t base, paddr_t limit, unsigned int flags) >> +{ >> +unsigned int attr_idx = PAGE_AI_MASK(flags); >> +prbar_t prbar; >> +prlar_t prlar; >> +pr_t region; >> + >> +/* Build up value for PRBAR_EL2. */ >> +prbar = (prbar_t) { >> +

Re: [Eclair false positive] Re: [PATCH] x86/msr: Rework wrmsr_safe() using asm goto()

2025-05-22 Thread Nicola Vetrini
On 2025-05-21 20:00, Andrew Cooper wrote: On 21/05/2025 3:36 pm, Andrew Cooper wrote: diff --git a/xen/arch/x86/include/asm/msr.h b/xen/arch/x86/include/asm/msr.h index 0d3b1d637488..4c4f18b3a54d 100644 --- a/xen/arch/x86/include/asm/msr.h +++ b/xen/arch/x86/include/asm/msr.h @@ -69,20 +69,20 @

Re: [PATCH v6 02/12] common/hyperlaunch: introduce the domain builder

2025-05-22 Thread Alejandro Vallejo
On Wed May 21, 2025 at 10:54 AM CEST, Jan Beulich wrote: > On 29.04.2025 14:36, Alejandro Vallejo wrote: >> @@ -1284,9 +1285,14 @@ void asmlinkage __init noreturn __start_xen(void) >> bi->nr_modules); >> } >> >> -/* Dom0 kernel is always first */ >> -bi->mods[0].type

Re: Hyperlaunch/dom0less code sharing

2025-05-22 Thread Alejandro Vallejo
Hi, On Wed May 21, 2025 at 5:31 PM CEST, Daniel P. Smith wrote: > On 5/21/25 10:35, Alejandro Vallejo wrote: >> Hi, >> >> (There's a TL;DR at the end) >> >> While working on preparing and reworking the hyperlaunch series for >> upstreaming it's slowly becoming apparent the degree of duplication

Re: [PATCH v5 6/6] xen/arm: ffa: Enable VM to VM without firmware

2025-05-22 Thread Jens Wiklander
Hi Bertrand, On Thu, May 22, 2025 at 11:11 AM Bertrand Marquis wrote: > > Hi Jens, > > > On 22 May 2025, at 10:30, Jens Wiklander wrote: > > > > Hi, > > > > On Thu, May 22, 2025 at 10:18 AM Bertrand Marquis > > wrote: > >> > >> Hi Jens, > >> > >>> On 22 May 2025, at 10:00, Jens Wiklander > >>

Re: Hyperlaunch Device Tree Discussion

2025-05-22 Thread Alejandro Vallejo
On Wed May 21, 2025 at 5:39 PM CEST, Daniel P. Smith wrote: > Greetings, > > Per my response to Allejandro's message, here is the response sent the > the DTB working group formed last year to discuss DTB parsing for x86. > > > Original Message: > > I have copied everyone that attended the hyperlau

Re: [PATCH v5 5/6] arm/mpu: Introduce utility functions for the pr_t type

2025-05-22 Thread Orzel, Michal
On 22/05/2025 11:56, Luca Fancellu wrote: > Hi Michal, > >>> + >>> +/* >>> + * Set limit address of MPU protection region. >>> + * >>> + * @pr: pointer to the protection region structure. >>> + * @limit: exclusive address as limit of the protection region. >>> + */ >>> +static inline void pr_se

Re: [PATCH v5 5/6] arm/mpu: Introduce utility functions for the pr_t type

2025-05-22 Thread Luca Fancellu
Hi Michal, >> + >> +/* >> + * Set limit address of MPU protection region. >> + * >> + * @pr: pointer to the protection region structure. >> + * @limit: exclusive address as limit of the protection region. >> + */ >> +static inline void pr_set_limit(pr_t *pr, paddr_t limit) >> +{ >> +pr->prlar.

Re: [PATCH v5 2/6] arm/mpu: Introduce MPU memory region map structure

2025-05-22 Thread Luca Fancellu
Hi Michal, >> >> diff --git a/xen/arch/arm/include/asm/arm64/mpu.h >> b/xen/arch/arm/include/asm/arm64/mpu.h >> new file mode 100644 >> index ..d3c055a2e53b >> --- /dev/null >> +++ b/xen/arch/arm/include/asm/arm64/mpu.h >> @@ -0,0 +1,52 @@ >> +/* SPDX-License-Identifier: GPL-2.0-only

Re: [PATCH v5 6/6] arm/mpu: Provide a constructor for pr_t type

2025-05-22 Thread Orzel, Michal
On 13/05/2025 10:45, Luca Fancellu wrote: > Provide a function that creates a pr_t object from a memory > range and some attributes. > > Signed-off-by: Luca Fancellu > --- > v5 changes: > - removed AP_RW_EL2 used only by pr_of_xenaddr(), fixed >comments and typos > - Given some comments

Re: [PATCH v2 2/4] x86/traps: remove smp_mb() ahead of IPI dispatch

2025-05-22 Thread Jan Beulich
On 22.05.2025 09:54, Roger Pau Monne wrote: > The IPI dispatch functions should already have the required barriers to > ensure correct memory ordering. To be quite honest, "should" isn't sufficient here for my taste. Either they are there or they aren't. According to my check they are, so ... > N

Re: [PATCH v1 net-next 5/6] socket: Replace most sock_create() calls with sock_create_kern().

2025-05-22 Thread Paolo Abeni
On 5/17/25 5:50 AM, Kuniyuki Iwashima wrote: > Except for only one user, sctp_do_peeloff(), all sockets created > by drivers and fs are not tied to userspace processes nor exposed > via file descriptors. > > Let's use sock_create_kern() for such in-kernel use cases as CIFS > client and NFS. > > S

Re: [PATCH v5 6/6] xen/arm: ffa: Enable VM to VM without firmware

2025-05-22 Thread Bertrand Marquis
Hi Jens, > On 22 May 2025, at 10:30, Jens Wiklander wrote: > > Hi, > > On Thu, May 22, 2025 at 10:18 AM Bertrand Marquis > wrote: >> >> Hi Jens, >> >>> On 22 May 2025, at 10:00, Jens Wiklander wrote: >>> >>> Hi Bertrand, >>> >>> On Wed, Apr 16, 2025 at 9:40 AM Bertrand Marquis >>> wrote:

Re: [PATCH v2 1/4] x86/boot: print CPU and APIC ID in bring up failure

2025-05-22 Thread Jan Beulich
On 22.05.2025 09:54, Roger Pau Monne wrote: > Print the CPU and APIC ID that fails to respond to the init sequence, or > that didn't manage to reach the "callin" state. Expand a bit the printed > error messages. Otherwise the "Not responding." message is not easy to > understand by users. > > Re

[PATCH 2/2] x86/numa: introduce per-NUMA node flush locks

2025-05-22 Thread Roger Pau Monne
Contention around the global flush_lock increases as the amount of physical CPUs on the host also increases. Sadly this doesn't scale on big boxes. However most of the time Xen doesn't require broadcasting flushes to all CPUs on the system, and hence more fine grained (ie: covering less CPUs) lock

[PATCH 0/2] x86/numa: introduce per-node flush_lock

2025-05-22 Thread Roger Pau Monne
Hello, I've had this patches pending for quite some time, but never sent them. Kind of RFC because I'm unsure whether the approach is the best, there's however a need to split the flush_lock, as on hosts with a high number of CUPs there's there's a non-trivial amount of contention around it. Firs

[PATCH 1/2] x86/numa: add per-node lock profile objects

2025-05-22 Thread Roger Pau Monne
Add some basic infrastructure to be able to use lockprofile with per NUMA node locks. This patch just introduces the required types, plus the printing of the data for the newly introduced type. There's no user of per NUMA node locks introduced here. Signed-off-by: Roger Pau Monné --- tools/mis

Re: [PATCH v5 5/6] arm/mpu: Introduce utility functions for the pr_t type

2025-05-22 Thread Orzel, Michal
On 13/05/2025 10:45, Luca Fancellu wrote: > Introduce a few utility functions to manipulate and handle the > pr_t type. > > Signed-off-by: Luca Fancellu > --- > v5 changes: > - Don't rely on bitfield and use the mask MPU_REGION_RES0 for >pr_set_base and pr_set_limit to make it explicit. F

RE: [PATCH v4 15/15] xen/xenpm: Adapt SET/GET_CPUFREQ_CPPC xen_sysctl_pm_op for amd-cppc driver

2025-05-22 Thread Penny, Zheng
[Public] > -Original Message- > From: Jan Beulich > Sent: Thursday, May 22, 2025 2:51 PM > To: Penny, Zheng > Cc: Huang, Ray ; Andrew Cooper > ; Roger Pau Monné ; xen- > [email protected] > Subject: Re: [PATCH v4 15/15] xen/xenpm: Adapt SET/GET_CPUFREQ_CPPC > xen_sysctl_pm_op fo

Re: [PATCH v5 6/6] xen/arm: ffa: Enable VM to VM without firmware

2025-05-22 Thread Jens Wiklander
Hi, On Thu, May 22, 2025 at 10:18 AM Bertrand Marquis wrote: > > Hi Jens, > > > On 22 May 2025, at 10:00, Jens Wiklander wrote: > > > > Hi Bertrand, > > > > On Wed, Apr 16, 2025 at 9:40 AM Bertrand Marquis > > wrote: > >> > >> When VM to VM support is activated and there is no suitable FF-A sup

Re: [PATCH v5 4/6] arm/mpu: Provide access to the MPU region from the C code

2025-05-22 Thread Orzel, Michal
On 13/05/2025 10:45, Luca Fancellu wrote: > Implement some utility function in order to access the MPU regions NIT: s/function/functions > from the C world. > > Signed-off-by: Luca Fancellu > --- > v5 changes: > - move MPU_REGION_RES0 to arm64, fixed typos and code style. > v4 changes: > -

Re: [PATCH v5 6/6] xen/arm: ffa: Enable VM to VM without firmware

2025-05-22 Thread Bertrand Marquis
Hi Jens, > On 22 May 2025, at 10:00, Jens Wiklander wrote: > > Hi Bertrand, > > On Wed, Apr 16, 2025 at 9:40 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

Re: [PATCH v5 2/6] arm/mpu: Introduce MPU memory region map structure

2025-05-22 Thread Orzel, Michal
On 13/05/2025 10:45, Luca Fancellu wrote: > 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. > > Signed-off-by: Penny Zheng > Signed-off-by: Wei Chen > Signed

xen-users mailing list? (Apologies for sending this here)

2025-05-22 Thread Joost Roeleveld
Hi all, I am not sure where to send this, but as this list seems to still work, I'll try here. I am not receiving any emails from the xen-users mailing list since the 13th and my email I sent yesterday doesn't even show up in the archive. I tried re-subscribing, but according to the mail I

Re: [PATCH v5 6/6] xen/arm: ffa: Enable VM to VM without firmware

2025-05-22 Thread Jens Wiklander
Hi Bertrand, On Wed, Apr 16, 2025 at 9:40 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 OP-TEE running in the secure world and us

[PATCH v2 0/4] x86/boot: provide better diagnostics in AP boot failure

2025-05-22 Thread Roger Pau Monne
Hello, This series attempts to improve AP boot failure diagnosis by improving the printed failure messages (patch 1) and detecting AP getting stuck during bringup (patch 4). Patches 2 and 3 are preparatory changes for the work done in patch 4. They should be non-functional changes for systems wo

[PATCH v2 4/4] x86/boot: attempt to print trace and panic on AP bring up stall

2025-05-22 Thread Roger Pau Monne
With the current AP bring up code, Xen can get stuck indefinitely if an AP freezes during boot after the 'callin' step. Introduce a 5s timeout while waiting for APs to finish startup. On failure of an AP to complete startup, send an NMI to trigger the printing of a stack backtrace on the stuck AP

[PATCH v2 1/4] x86/boot: print CPU and APIC ID in bring up failure

2025-05-22 Thread Roger Pau Monne
Print the CPU and APIC ID that fails to respond to the init sequence, or that didn't manage to reach the "callin" state. Expand a bit the printed error messages. Otherwise the "Not responding." message is not easy to understand by users. Reported-by: Andrew Cooper Signed-off-by: Roger Pau Monné

[PATCH v2 3/4] x86/traps: split code to dump execution state to a separate helper

2025-05-22 Thread Roger Pau Monne
Split the code that triggers remote CPUs to dump stacks into a separate function. Also introduce a parameter that can be set by the caller of the newly introduced function to force CPUs to dump the full stack, rather than just dumping the current function name. No functional change intended. Sig

[PATCH v2 2/4] x86/traps: remove smp_mb() ahead of IPI dispatch

2025-05-22 Thread Roger Pau Monne
The IPI dispatch functions should already have the required barriers to ensure correct memory ordering. Note other callers of send_IPI_mask() don't use any barriers. Reported-by: Andrew Cooper Signed-off-by: Roger Pau Monné --- Changes since v1: - New in this version. --- xen/arch/x86/traps.c

Re: [PATCH v3 06/14] xen/riscv: dt_processor_hartid() implementation

2025-05-22 Thread Jan Beulich
On 21.05.2025 18:03, Oleksii Kurochko wrote: > --- a/xen/arch/riscv/smpboot.c > +++ b/xen/arch/riscv/smpboot.c > @@ -1,5 +1,8 @@ > #include > +#include > +#include > #include > +#include > #include Nit: The latter insertion wants to move one line down. Yet then - isn't xen/stdint.h suffic

  1   2   >