Re: [PATCH v4 01/13] x86/boot: add cmdline to struct boot_domain

2025-04-17 Thread Alejandro Vallejo
On Thu Apr 17, 2025 at 3:54 PM BST, Jan Beulich wrote: > On 17.04.2025 14:48, Alejandro Vallejo wrote: >> From: "Daniel P. Smith" >> >> 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 constructe

[PATCH v5] xen/riscv: Increase XEN_VIRT_SIZE

2025-04-17 Thread Oleksii Kurochko
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

[PATCH v1] xen/arm: AArch32-V8R: Add MPU register definitions

2025-04-17 Thread Ayan Kumar Halder
Add the definitions for HPRBAR<0..31>, HPRLAR<0..31> and HPRENR. The definitions are taken from ARM DDI 0568A.c ID110520, E2.2.3 HPRBAR, E2.2.4 HPRENR and E2.2.6 HPRLAR. Introduce pr_t typedef which is a structure having the prbar and prlar members, each being structured as the registers of the AA

Re: [PATCH v4 01/15] xen/cpufreq: move "init" flag into common structure

2025-04-17 Thread Jan Beulich
On 14.04.2025 09:40, Penny Zheng wrote: > AMD cpufreq cores will be intialized in two modes, legacy P-state mode, > and CPPC mode. So "init" flag shall be extracted from specific > "struct xen_processor_perf", and placed in the common > "struct processor_pminfo". The code change is certainly accep

Re: [PATCH v1 03/14] xen/riscv: introduce ioremap()

2025-04-17 Thread Oleksii Kurochko
On 4/17/25 4:24 PM, Jan Beulich wrote: On 17.04.2025 16:20, Oleksii Kurochko wrote: On 4/15/25 1:02 PM, Jan Beulich wrote: On 15.04.2025 12:29, Oleksii Kurochko wrote: On 4/10/25 5:13 PM, Jan Beulich wrote: On 08.04.2025 17:57, Oleksii Kurochko wrote: Based on RISC-V unpriviliged spec ( Ver

Re: [PATCH v2 1/4] xen/io: provide helpers for multi size MMIO accesses

2025-04-17 Thread Roger Pau Monné
On Thu, Apr 17, 2025 at 09:43:09AM +0200, Jan Beulich wrote: > On 15.04.2025 17:32, Roger Pau Monne wrote: > > @@ -5115,7 +5115,6 @@ static void subpage_mmio_write_emulate( > > > > if ( test_bit(offset / MMIO_RO_SUBPAGE_GRAN, entry->ro_elems) ) > > { > > - write_ignored: > > gp

Re: [PATCH] Update to latest Argo

2025-04-17 Thread Jason Andryuk
On 2025-04-17 10:55, Andrew Cooper wrote: The bugfixes I submitted during commit 36500bcb5e24 ("Overhaul how Argo is built and packged") have now been merged. Update the version used, and drop the -Wno-error workaround. Link: https://github.com/OpenXT/linux-xen-argo/pull/21 Signed-off-by: Andre

Re: [PATCH v4 02/13] kconfig: introduce domain builder config options

2025-04-17 Thread Alejandro Vallejo
On Thu Apr 17, 2025 at 4:00 PM BST, Jan Beulich wrote: > On 17.04.2025 14:48, Alejandro Vallejo wrote: >> --- /dev/null >> +++ b/xen/common/domain-builder/Kconfig >> @@ -0,0 +1,18 @@ >> + >> +menu "Domain Builder Features" >> +depends on HAS_BOOT_INFO > > That is, what's going to further be added h

Re: [PATCH v2 1/4] xen/io: provide helpers for multi size MMIO accesses

2025-04-17 Thread Jan Beulich
On 17.04.2025 16:16, Roger Pau Monné wrote: > On Thu, Apr 17, 2025 at 09:43:09AM +0200, Jan Beulich wrote: >> On 15.04.2025 17:32, Roger Pau Monne wrote: >>> @@ -5115,7 +5115,6 @@ static void subpage_mmio_write_emulate( >>> >>> if ( test_bit(offset / MMIO_RO_SUBPAGE_GRAN, entry->ro_elems) )

Re: [PATCH] vmx: Don't open-code vmresume/vmlaunch instructions

2025-04-17 Thread Andrew Cooper
On 17/04/2025 3:24 pm, Teddy Astie wrote: > 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 Reviewed-by: Andrew Cooper

Re: [PATCH v19 2/3] vpci: acquire d->pci_lock in I/O handlers

2025-04-17 Thread Stewart Hildebrand
On 4/16/25 11:27, Jan Beulich wrote: > On 15.04.2025 18:54, Stewart Hildebrand wrote: >> In preparation for translating virtual PCI bus topology (where a pdev >> lookup will be needed in the vPCI I/O handlers), acquire d->pci_lock in >> the vPCI I/O handlers. > > I find it concerning that the lock

Re: [PATCH v4 02/13] kconfig: introduce domain builder config options

2025-04-17 Thread Jan Beulich
On 17.04.2025 14:48, Alejandro Vallejo wrote: > --- /dev/null > +++ b/xen/common/domain-builder/Kconfig > @@ -0,0 +1,18 @@ > + > +menu "Domain Builder Features" > +depends on HAS_BOOT_INFO That is, what's going to further be added here will not ... > +config DOMAIN_BUILDER ...depend on this, but

[GIT PULL] xen: branch for v6.15-rc3

2025-04-17 Thread Juergen Gross
Linus, Please git pull the following tag: git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git for-linus-6.15a-rc3-tag xen: branch for v6.15-rc3 It contains just a single fix for the Xen multicall driver avoiding a percpu variable referencing initdata by its initializer. Thanks. Juerg

Re: [PATCH v4 01/13] x86/boot: add cmdline to struct boot_domain

2025-04-17 Thread Jan Beulich
On 17.04.2025 14:48, Alejandro Vallejo wrote: > From: "Daniel P. Smith" > > 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 > constructio

Re: [PATCH] vpci/msix: use host msix table address

2025-04-17 Thread Roger Pau Monné
On Tue, Apr 15, 2025 at 02:01:56PM -0400, Stewart Hildebrand wrote: > 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 Reviewed-by: Roger

Re: [PATCH] vmx: Don't open-code vmresume/vmlaunch instructions

2025-04-17 Thread Teddy Astie
Le 17/04/2025 à 16:24, Teddy Astie a écrit : > 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 > --- > xen/arch/x86/hvm/vmx/entry.S | 7 ++- > 1 file chang

Re: [PATCH] vmx: Don't open-code vmresume/vmlaunch instructions

2025-04-17 Thread Jan Beulich
On 17.04.2025 16:24, Teddy Astie wrote: > 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 Acked-by: Jan Beulich

Re: [PATCH v3 1/4] xen/io: provide helpers for multi size MMIO accesses

2025-04-17 Thread Jan Beulich
On 17.04.2025 17:25, Roger Pau Monne wrote: > 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 access

[PATCH] x86/intel: workaround several MONITOR/MWAIT errata

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

Re: [PATCH v3 2/4] x86/hvm: fix handling of accesses to partial r/o MMIO pages

2025-04-17 Thread Roger Pau Monné
On Thu, Apr 17, 2025 at 05:38:54PM +0200, Jan Beulich wrote: > On 17.04.2025 17:25, Roger Pau Monne wrote: > > --- 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 acc

Re: [PATCH v2 7/8] xen/common: dom0less: introduce common domain-build.c

2025-04-17 Thread Jan Beulich
On 14.04.2025 17:56, Oleksii Kurochko wrote: > --- a/xen/include/xen/fdt-domain-build.h > +++ b/xen/include/xen/fdt-domain-build.h > @@ -5,6 +5,7 @@ > #include > #include > #include > +#include > #include > > #if __has_include() > @@ -32,7 +33,37 @@ int make_memory_node(const struct ker

Re: [PATCH v1] xen/arm: AArch32-V8R: Add MPU register definitions

2025-04-17 Thread Julien Grall
Hi Ayan, On 18/04/2025 00:55, Ayan Kumar Halder wrote: Add the definitions for HPRBAR<0..31>, HPRLAR<0..31> and HPRENR. The definitions are taken from ARM DDI 0568A.c ID110520, E2.2.3 HPRBAR, E2.2.4 HPRENR and E2.2.6 HPRLAR. Introduce pr_t typedef which is a structure having the prbar and prlar

Re: [PATCH v1 3/4] CI: switch arm64 XTF test runner to qemu-xtf.sh

2025-04-17 Thread dmkhn
On Wed, Apr 16, 2025 at 05:12:55PM -0700, Stefano Stabellini wrote: > On Wed, 16 Apr 2025, dm...@proton.me wrote: > > From: Denis Mukhin > > > > Hook arm64 QEMU configuration to qemu-xtf.sh and use new script in arm64 CI > > jobs. > > > > Signed-off-by: Denis Mukhin > > Reviewed-by: Stefano Stab

Re: [PATCH] compat/memory: avoid UB shifts in XENMEM_exchange handling

2025-04-17 Thread Andrew Cooper
On 17/04/2025 3:08 pm, Jan Beulich wrote: > Add an early basic check, yielding the same error code as the more > thorough on the the main handler would produce. > > Fixes: b8a7efe8528a ("Enable compatibility mode operation for > HYPERVISOR_memory_op") > Reported-by: Manuel Andreas > Signed-off-by

Re: [PATCH v1 4/4] CI: add argo x86 XTF test

2025-04-17 Thread dmkhn
On Wed, Apr 16, 2025 at 05:11:51PM -0700, Stefano Stabellini wrote: > On Wed, 16 Apr 2025, dm...@proton.me wrote: > > From: Denis Mukhin > > > > Introduce new CI job to run x86 XTF argo test under QEMU to smoke test argo > > feature functionality in upstream CI. > > > > The new job lead time is ~3

Re: [GIT PULL] xen: branch for v6.15-rc3

2025-04-17 Thread pr-tracker-bot
The pull request you sent on Thu, 17 Apr 2025 16:58:31 +0200: > git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git > for-linus-6.15a-rc3-tag has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/85a9793e769e2af692d341a2b3935703eac65328 Thank you! -- Deet-doot-dot,

[PATCH 6.14 065/449] xen/mcelog: Add __nonstring annotations for unterminated strings

2025-04-17 Thread Greg Kroah-Hartman
6.14-stable review patch. If anyone has any objections, please let me know. -- From: Kees Cook [ Upstream commit 1c3dfc7c6b0f551fdca3f7c1f1e4c73be8adb17d ] When a character array without a terminating NUL character has a static initializer, GCC 15's -Wunterminated-string-initi

Re: x86 emulation bug

2025-04-17 Thread Jan Beulich
On 17.04.2025 00:52, Fabian Specht wrote: > Dear all, > > we discovered a bug in hvm64 x86 Xen. Using the attached xtf test we are > able to trigger an assert in arch/x86/hvm/emulate.c: > > > if ( (hvmemul_ctxt->ctxt.regs->eflags & X86_EFLAGS_DF) && (reps > 1) ) > { > /* >* x86_emu

Re: [PATCH v2 2/4] x86/hvm: fix handling of accesses to partial r/o MMIO pages

2025-04-17 Thread Jan Beulich
On 15.04.2025 17:32, Roger Pau Monne wrote: > --- a/xen/arch/x86/hvm/emulate.c > +++ b/xen/arch/x86/hvm/emulate.c > @@ -370,7 +370,12 @@ static int hvmemul_do_io( > /* If there is no suitable backing DM, just ignore accesses */ > if ( !s ) > { > -if ( is_mmio

Re: x86 emulation bug

2025-04-17 Thread Andrew Cooper
On 17/04/2025 8:14 am, Jan Beulich wrote: > On 17.04.2025 00:52, Fabian Specht wrote: >> Dear all, >> >> we discovered a bug in hvm64 x86 Xen. Using the attached xtf test we are >> able to trigger an assert in arch/x86/hvm/emulate.c: >> >> >> if ( (hvmemul_ctxt->ctxt.regs->eflags & X86_EFLAGS_DF) &

Re: [PATCH v7] Avoid crash calling PrintErrMesg from efi_multiboot2

2025-04-17 Thread Jan Beulich
On 17.04.2025 05:12, Marek Marczykowski-Górecki wrote: > On Fri, Mar 21, 2025 at 10:32:58AM +, Frediano Ziglio wrote: >> 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

Re: x86 emulation bug

2025-04-17 Thread Jan Beulich
On 17.04.2025 10:01, Andrew Cooper wrote: > On 17/04/2025 8:14 am, Jan Beulich wrote: >> On 17.04.2025 00:52, Fabian Specht wrote: >>> Dear all, >>> >>> we discovered a bug in hvm64 x86 Xen. Using the attached xtf test we are >>> able to trigger an assert in arch/x86/hvm/emulate.c: >>> >>> >>> if (

Re: [PATCH v7] Avoid crash calling PrintErrMesg from efi_multiboot2

2025-04-17 Thread Marek Marczykowski-Górecki
On Fri, Mar 21, 2025 at 10:32:58AM +, Frediano Ziglio wrote: > 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 e

[PATCH v4 06/13] x86/hyperlaunch: locate dom0 kernel with hyperlaunch

2025-04-17 Thread Alejandro Vallejo
From: "Daniel P. Smith" Look for a subnode of type `multiboot,kernel` within a domain node. If found, locate it using the multiboot module helper to generically ensure it lives in the module list. If the bootargs property is present and there was not an MB1 string, then use the command line from

Re: [PATCH v6 02/15] drivers/smmu-v3: Fix impending MISRA R20.6 violation

2025-04-17 Thread Bertrand Marquis
Hi Andrew, > On 16 Apr 2025, at 13:58, Andrew Cooper wrote: > > cpu_to_le64() is about to become a macro, at which point the #ifdef in the > middle of it becomes undefined behaviour. > > Use a logcal variable to prepare strtab, where the #ifdef is fine to use. > > No functional change. > > Si

[PATCH v4 02/13] kconfig: introduce domain builder config options

2025-04-17 Thread Alejandro Vallejo
From: "Daniel P. Smith" Hyperlaunch domain builder will be the consolidated boot time domain building logic framework. Introduces the config option to enable this domain builder to eventually turn on the ability to load the domain configuration via a flattened device tree. This is common code, b

[PATCH 5.15.y v2 1/1] xen/swiotlb: relax alignment requirements

2025-04-17 Thread Harshvardhan Jha
[ Upstream commit 85fcb57c983f423180ba6ec5d0034242da05cc54 ] When mapping a buffer for DMA via .map_page or .map_sg DMA operations, there is no need to check the machine frames to be aligned according to the mapped areas size. All what is needed in these cases is that the buffer is contiguous at m

[PATCH 5.15.y v2 0/1] Manual Backport of 099606a7b2d5 to 5.15

2025-04-17 Thread Harshvardhan Jha
The patch 099606a7b2d5 didn't cleanly apply to 5.15 due to the significant difference in codebases. I've tried to manually bring it back to 5.15 via some minor conflict resolution but also invoking the newly introduced API using inverted logic as the conditional statements present in 5.15 are the

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

2025-04-17 Thread Jan Beulich
On 17.04.2025 17:21, Oleksii Kurochko wrote: > > On 4/16/25 12:30 PM, Jan Beulich wrote: >> On 16.04.2025 12:15, Oleksii Kurochko wrote: >>> On 4/14/25 12:04 PM, Jan Beulich wrote: On 08.04.2025 17:57, Oleksii Kurochko wrote: > +rc = dt_property_read_u32(node, "msi-parent", &imsic_pha

Re: [PATCH v1] x86/vmx: Rework __vmread()/vmread_safe()/vmr()

2025-04-17 Thread Andrew Cooper
On 08/04/2025 2:15 am, dm...@proton.me wrote: > From: Denis Mukhin > > Use `asm goto()` in vmread_safe() to simplify the error handling logic. > > Update __vmread() to return `unsigned long` as per suggestion in [1]. > Rename __vmread() to vmread_unsafe() to match the behavior. > Update all call s

[PATCH 6.13 056/414] xen/mcelog: Add __nonstring annotations for unterminated strings

2025-04-17 Thread Greg Kroah-Hartman
6.13-stable review patch. If anyone has any objections, please let me know. -- From: Kees Cook [ Upstream commit 1c3dfc7c6b0f551fdca3f7c1f1e4c73be8adb17d ] When a character array without a terminating NUL character has a static initializer, GCC 15's -Wunterminated-string-initi

Re: [PATCH v1 2/4] CI: switch x86 EFI smoke test runner to qemu-xtf.sh

2025-04-17 Thread dmkhn
On Wed, Apr 16, 2025 at 05:14:41PM -0700, Stefano Stabellini wrote: > On Wed, 16 Apr 2025, dm...@proton.me wrote: > > From: Denis Mukhin > > > > 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. >

Re: x86 emulation bug

2025-04-17 Thread Fabian Specht
> Thanks for the report. However, already on Andreas' report on the day before > yesterday I was heavily inclined to ask about details you certainly have > figured out already. I find it odd that you leave to us all re-figuring out. > In this case, for example: Is the specific value you set %eax to

Re: [PATCH v1 1/4] CI: unify x86 XTF test runner

2025-04-17 Thread dmkhn
On Wed, Apr 16, 2025 at 05:16:49PM -0700, Stefano Stabellini wrote: > On Wed, 16 Apr 2025, dm...@proton.me wrote: > > From: Denis Mukhin > > > > 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

[PATCH 6.12 057/393] xen/mcelog: Add __nonstring annotations for unterminated strings

2025-04-17 Thread Greg Kroah-Hartman
6.12-stable review patch. If anyone has any objections, please let me know. -- From: Kees Cook [ Upstream commit 1c3dfc7c6b0f551fdca3f7c1f1e4c73be8adb17d ] When a character array without a terminating NUL character has a static initializer, GCC 15's -Wunterminated-string-initi

Re: [PATCH v1 03/14] xen/riscv: introduce ioremap()

2025-04-17 Thread Jan Beulich
On 17.04.2025 16:20, Oleksii Kurochko wrote: > On 4/15/25 1:02 PM, Jan Beulich wrote: >> On 15.04.2025 12:29, Oleksii Kurochko wrote: >>> On 4/10/25 5:13 PM, Jan Beulich wrote: On 08.04.2025 17:57, Oleksii Kurochko wrote: > Based on RISC-V unpriviliged spec ( Version 20240411 ): > ```

[PATCH] vmx: Don't open-code vmresume/vmlaunch instructions

2025-04-17 Thread Teddy Astie
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 --- xen/arch/x86/hvm/vmx/entry.S | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86

Re: [PATCH v2 5/8] asm-generic: move some parts of Arm's domain_build.h to common

2025-04-17 Thread Jan Beulich
On 14.04.2025 17:56, Oleksii Kurochko wrote: > --- /dev/null > +++ b/xen/include/xen/fdt-domain-build.h > @@ -0,0 +1,46 @@ > +/* SPDX-License-Identifier: GPL-2.0-only */ > +#ifndef __XEN_FDT_DOMAIN_BUILD_H__ > +#define __XEN_FDT_DOMAIN_BUILD_H__ > + > +#include > +#include > +#include > +#includ

Re: [PATCH v1 03/14] xen/riscv: introduce ioremap()

2025-04-17 Thread Oleksii Kurochko
On 4/15/25 1:02 PM, Jan Beulich wrote: On 15.04.2025 12:29, Oleksii Kurochko wrote: On 4/10/25 5:13 PM, Jan Beulich wrote: On 08.04.2025 17:57, Oleksii Kurochko wrote: Based on RISC-V unpriviliged spec ( Version 20240411 ): ``` For implementations that conform to the RISC-V Unix Platform Spec

[PATCH] Update to latest Argo

2025-04-17 Thread Andrew Cooper
The bugfixes I submitted during commit 36500bcb5e24 ("Overhaul how Argo is built and packged") have now been merged. Update the version used, and drop the -Wno-error workaround. Link: https://github.com/OpenXT/linux-xen-argo/pull/21 Signed-off-by: Andrew Cooper --- CC: Anthony PERARD CC: Stefan

Re: [PATCH v4 07/15] xen/cpufreq: fix core frequency calculation for AMD Family 1Ah CPUs

2025-04-17 Thread Jan Beulich
On 14.04.2025 09:40, Penny Zheng wrote: > AMD Family 1Ah CPU needs a different COF(Core Operating Frequency) formula, > due to a change in the PStateDef MSR layout in AMD Family 1Ah. > In AMD Family 1Ah, Core current operating frequency in MHz is calculated as > follows: > CoreCOF = Core::X86::

[PATCH v3 2/4] x86/hvm: fix handling of accesses to partial r/o MMIO pages

2025-04-17 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 v3 3/4] x86/hvm: only register the r/o subpage ops when needed

2025-04-17 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 v3 1/4] xen/io: provide helpers for multi size MMIO accesses

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

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

2025-04-17 Thread Oleksii Kurochko
On 4/16/25 12:30 PM, Jan Beulich wrote: On 16.04.2025 12:15, Oleksii Kurochko wrote: On 4/14/25 12:04 PM, Jan Beulich wrote: On 08.04.2025 17:57, Oleksii Kurochko wrote: +rc = dt_property_read_u32(node, "msi-parent", &imsic_phandle); +if ( !rc ) +panic("%s: IDC mode not suppor

[PATCH v4 05/13] x86/hyperlaunch: Add helpers to locate multiboot modules

2025-04-17 Thread Alejandro Vallejo
Hyperlaunch mandates either a reg or module-index DT prop on nodes that contain `multiboot,module" under their "compatible" prop. This patch introduces a helper to generically find such index, appending the module to the list of modules if it wasn't already (i.e: because it's given via the "reg" pr

Re: [PATCH] compat/memory: avoid UB shifts in XENMEM_exchange handling

2025-04-17 Thread Jason Andryuk
On 2025-04-17 10:08, Jan Beulich wrote: Add an early basic check, yielding the same error code as the more thorough on the the main handler would produce. "as the more thorough check in the main handler"... Fixes: b8a7efe8528a ("Enable compatibility mode operation for HYPERVISOR_memory_op")

Re: [PATCH] x86/AMD: Convert rdmsr_amd_safe() to use asm goto()

2025-04-17 Thread Andrew Cooper
On 07/04/2025 4:48 pm, Jan Beulich wrote: > On 07.04.2025 17:35, Andrew Cooper wrote: >> Unlike the WRMSR side, we can't use asm goto() unconditionally, because our >> toolchain baseline doesn't support asm goto with outputs. > Is there actually a benefit we gain from now needing to maintain two di

Re: [PATCH v2 8/8] vpci/msix: Add function to clean MSIX resources

2025-04-17 Thread Jan Beulich
On 09.04.2025 08:45, Jiqian Chen wrote: > --- a/xen/arch/x86/hvm/intercept.c > +++ b/xen/arch/x86/hvm/intercept.c > @@ -276,6 +276,50 @@ void register_mmio_handler(struct domain *d, > handler->mmio.ops = ops; > } > > +void unregister_mmio_handler(struct domain *d, > +

Re: [PATCH v2 8/8] vpci/msix: Add function to clean MSIX resources

2025-04-17 Thread Chen, Jiqian
On 2025/4/17 15:34, Jan Beulich wrote: > On 09.04.2025 08:45, Jiqian Chen wrote: >> --- a/xen/arch/x86/hvm/intercept.c >> +++ b/xen/arch/x86/hvm/intercept.c >> @@ -276,6 +276,50 @@ void register_mmio_handler(struct domain *d, >> handler->mmio.ops = ops; >> } >> >> +void unregister_mmio_hand

Re: [PATCH v2 1/4] xen/io: provide helpers for multi size MMIO accesses

2025-04-17 Thread Jan Beulich
On 15.04.2025 17:32, Roger Pau Monne wrote: > @@ -5115,7 +5115,6 @@ static void subpage_mmio_write_emulate( > > if ( test_bit(offset / MMIO_RO_SUBPAGE_GRAN, entry->ro_elems) ) > { > - write_ignored: > gprintk(XENLOG_WARNING, > "ignoring write to R/O MMIO 0x%"PR

Re: [PATCH v2 2/8] xen/common: dom0less: make some parts of Arm's CONFIG_DOM0LESS common

2025-04-17 Thread Jan Beulich
On 17.04.2025 10:08, Orzel, Michal wrote: >> --- /dev/null >> +++ b/xen/include/asm-generic/dom0less-build.h >> @@ -0,0 +1,40 @@ >> +/* SPDX-License-Identifier: GPL-2.0-only */ > empty line here please > >> +#ifndef __ASM_GENERIC_DOM0LESS_BUILD_H__ >> +#define __ASM_GENERIC_DOM0LESS_BUILD_H__ >> +

Re: [PATCH v2 2/8] xen/common: dom0less: make some parts of Arm's CONFIG_DOM0LESS common

2025-04-17 Thread Orzel, Michal
I'm ok with making dom0less common in principle but I don't know if we should keep using the word dom0less which we all know is confusing. In one of the maintainers call we agreed on using "predefined domUs" to denote the concept of starting domUs at boot in a static way. This was so that we could

[PATCH] Arm: rename smp_clear_cpu_maps()

2025-04-17 Thread Jan Beulich
The function has lost all clearing operations. Use the commonly available name (declared in xen/smp.h), that x86 also uses. Signed-off-by: Jan Beulich --- I would have expected this to also address a Misra violation (declaration without definition), but I can't spot any rule (having looked throug

Re: [ImageBuilder v2] uboot-script-gen: add xen xsm policy loading support

2025-04-17 Thread Grygorii Strashko
On 17.04.25 01:03, Stefano Stabellini wrote: On Tue, 15 Apr 2025, Grygorii Strashko wrote: From: Grygorii Strashko This patch adds Xen XSM policy loading support. The configuration file XEN_POLICY specifies Xen hypervisor XSM policy binary to load. Signed-off-by: Grygorii Strashko --- ch

Re: [PATCH v1 11/14] xen/riscv: add external interrupt handling for hypervisor mode

2025-04-17 Thread Oleksii Kurochko
On 4/15/25 4:42 PM, Jan Beulich wrote: +/* clear the pending bit */ +csr_clear(CSR_SIP, 1UL << IRQ_S_EXT); + +/* dispatch the interrupt */ +do_IRQ(regs, csr_swap(CSR_STOPEI, 0) >> TOPI_IID_SHIFT); + +/* enable external interrupts */ +csr_set(CSR_SIE, 1UL << IRQ_S_EXT);

[PATCH] xen/percpu: NUMA-position the per-CPU area

2025-04-17 Thread Andrew Cooper
This seems to have been quite an oversite in Xen's NUMA support, albeit it probably because NUMA was arch-specific at first. Take the opportunity to sort the includes. Signed-off-by: Andrew Cooper --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné C

Re: [PATCH] Arm: rename smp_clear_cpu_maps()

2025-04-17 Thread Nicola Vetrini
On 2025-04-17 10:36, Jan Beulich wrote: The function has lost all clearing operations. Use the commonly available name (declared in xen/smp.h), that x86 also uses. Signed-off-by: Jan Beulich --- I would have expected this to also address a Misra violation (declaration without definition), but I

Re: [PATCH] Arm: rename smp_clear_cpu_maps()

2025-04-17 Thread Orzel, Michal
On 17/04/2025 10:36, Jan Beulich wrote: > The function has lost all clearing operations. Use the commonly > available name (declared in xen/smp.h), that x86 also uses. > > Signed-off-by: Jan Beulich Reviewed-by: Michal Orzel ~Michal

Re: [PATCH] x86emul: also clip repetition count for STOS

2025-04-17 Thread Andrew Cooper
On 17/04/2025 10:05 am, Jan Beulich wrote: > 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 emulati

[PATCH] x86emul: also clip repetition count for STOS

2025-04-17 Thread Jan Beulich
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: Fa

Re: [PATCH] Arm: rename smp_clear_cpu_maps()

2025-04-17 Thread Jan Beulich
On 17.04.2025 10:48, Nicola Vetrini wrote: > On 2025-04-17 10:36, Jan Beulich wrote: >> The function has lost all clearing operations. Use the commonly >> available name (declared in xen/smp.h), that x86 also uses. >> >> Signed-off-by: Jan Beulich >> --- >> I would have expected this to also addre

Re: [PATCH v1 11/14] xen/riscv: add external interrupt handling for hypervisor mode

2025-04-17 Thread Oleksii Kurochko
On 4/17/25 10:44 AM, Oleksii Kurochko wrote: +action = desc->action; + +spin_unlock_irq(&desc->lock); + +#ifndef CONFIG_IRQ_HAS_MULTIPLE_ACTION Stolen from Arm? What's this about? Yes, it is stolen from Arm. I thought that it is a generic one, but the config is defined inside Arm's co

Re: [PATCH] xen/percpu: NUMA-position the per-CPU area

2025-04-17 Thread Jan Beulich
On 17.04.2025 10:53, Andrew Cooper wrote: > This seems to have been quite an oversite in Xen's NUMA support, albeit it Nit: oversight? > probably because NUMA was arch-specific at first. > > Take the opportunity to sort the includes. > > Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich

Re: [ImageBuilder v2] uboot-script-gen: add xen xsm policy loading support

2025-04-17 Thread Alejandro Vallejo
On Tue Apr 15, 2025 at 8:01 AM BST, Grygorii Strashko wrote: > From: Grygorii Strashko > > This patch adds Xen XSM policy loading support. > > The configuration file XEN_POLICY specifies Xen hypervisor > XSM policy binary to load. > > Signed-off-by: Grygorii Strashko Reviewed-by: Alejandro Valle

Re: [PATCH v1 12/14] xen/riscv: implement setup_irq()

2025-04-17 Thread Jan Beulich
On 17.04.2025 12:10, Oleksii Kurochko wrote: > On 4/15/25 5:55 PM, Jan Beulich wrote >>> +/* >>> + * we don't care for now which CPU will receive the >>> + * interrupt >>> + * >>> + * TODO: Handle case where IRQ is setup on different CPU than >>> + *

Re: [PATCH v1 14/14] xen/riscv: add basic UART support

2025-04-17 Thread Jan Beulich
On 17.04.2025 12:31, Oleksii Kurochko wrote: > On 4/15/25 6:03 PM, Jan Beulich wrote: >> On 08.04.2025 17:57, Oleksii Kurochko wrote: >>> --- a/xen/drivers/char/Kconfig >>> +++ b/xen/drivers/char/Kconfig >>> @@ -3,7 +3,6 @@ config GENERIC_UART_INIT >>> >>> config HAS_NS16550 >>> bool "NS16

Re: [PATCH v1 13/14] xen/riscv: initialize interrupt controller

2025-04-17 Thread Oleksii Kurochko
On 4/15/25 5:59 PM, Jan Beulich wrote: On 08.04.2025 17:57, Oleksii Kurochko wrote: Call intc_init() to do basic initialization steps for APLIC and IMISC. Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich yet ... --- a/xen/arch/riscv/setup.c +++ b/xen/arch/riscv/setup.c @@ -136,6 +136,8

Re: [PATCH v1 12/14] xen/riscv: implement setup_irq()

2025-04-17 Thread Oleksii Kurochko
On 4/15/25 5:55 PM, Jan Beulich wrote +#ifdef CONFIG_IRQ_HAS_MULTIPLE_ACTION +new->next = desc->action; +smp_mb(); +#endif + +desc->action = new; +smp_mb(); Aren't smp_wmb() sufficient on both places? If not, I think comments want adding. smp_wmb() will be sufficient but I thi

Re: [PATCH v3] xen/domain: unify domain ID allocation

2025-04-17 Thread Jan Beulich
On 16.04.2025 08:15, dm...@proton.me wrote: > From: Denis Mukhin > > Unify the logic of domain ID allocation, so that both the initial domain > creation and the usage by domctl use the same helper function across > architectures (Arm and x86). > > Wrap the domain ID allocation as an arch-indepen

Re: [ImageBuilder] uboot-script-gen: fix arm64 xen u-boot image generation

2025-04-17 Thread Alejandro Vallejo
On Wed Apr 16, 2025 at 5:10 PM BST, Grygorii Strashko wrote: > > > On 16.04.25 17:26, Alejandro Vallejo wrote: >> On Wed Apr 16, 2025 at 11:44 AM BST, Grygorii Strashko wrote: >>> >>> >>> On 16.04.25 04:03, Stefano Stabellini wrote: On Mon, 14 Apr 2025, Grygorii Strashko wrote: > From: Gry

Re: [PATCH v1 14/14] xen/riscv: add basic UART support

2025-04-17 Thread Oleksii Kurochko
On 4/15/25 6:03 PM, Jan Beulich wrote: On 08.04.2025 17:57, Oleksii Kurochko wrote: --- a/xen/arch/riscv/setup.c +++ b/xen/arch/riscv/setup.c @@ -4,11 +4,16 @@ #include #include #include +#include #include #include #include +#include Why's this one needed? It isn't needed

Re: [RFC PATCH v1 13/15] x86/msr: Use the alternatives mechanism to read MSR

2025-04-17 Thread Xin Li
On 4/14/2025 10:13 AM, Francesco Lavra wrote: This works only if this function has been called directly (e.g. via `call asm_xen_write_msr`), but doesn't work with alternative call types (like indirect calls). Not sure why one might want to use an indirect call to invoke asm_xen_write_msr, but thi

Re: [PATCH v3 08/16] x86/hyperlaunch: Add helpers to locate multiboot modules

2025-04-17 Thread Alejandro Vallejo
On Wed Apr 16, 2025 at 5:55 PM BST, Nicola Vetrini wrote: > On 2025-04-15 08:05, Jan Beulich wrote: >> On 14.04.2025 20:01, Alejandro Vallejo wrote: >>> On Mon Apr 14, 2025 at 4:05 PM BST, Jan Beulich wrote: On 14.04.2025 15:37, Alejandro Vallejo wrote: > On Thu Apr 10, 2025 at 11:42 AM BS

[PATCH v4 04/13] x86/hyperlaunch: initial support for hyperlaunch device tree

2025-04-17 Thread Alejandro Vallejo
From: "Daniel P. Smith" Add the ability to detect both a formal hyperlaunch device tree or a dom0less device tree. If the hyperlaunch device tree is found, then count the number of domain entries, reporting an error if more than one is found. Signed-off-by: Daniel P. Smith Signed-off-by: Jason

[PATCH v4 01/13] x86/boot: add cmdline to struct boot_domain

2025-04-17 Thread Alejandro Vallejo
From: "Daniel P. Smith" 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 ensurin

[PATCH v4 00/13] Hyperlaunch device tree for dom0

2025-04-17 Thread Alejandro Vallejo
Hi, Here's a new version. Took a while to integrate all the feedback, but here it is. v4 pipeline: https://gitlab.com/xen-project/people/agvallejo/xen/-/pipelines/1772300721 v3: https://lore.kernel.org/xen-devel/20250408160802.49870-1-agarc...@amd.com/ v2: https://lore.kernel.org/xen-devel/202

[PATCH v4 12/13] x86/hyperlaunch: add max vcpu parsing of hyperlaunch device tree

2025-04-17 Thread Alejandro Vallejo
From: "Daniel P. Smith" Introduce the `cpus` property, named as such for dom0less compatibility, that represents the maximum number of vcpus to allocate for a domain. In the device tree, it will be encoded as a u32 value. Signed-off-by: Daniel P. Smith Reviewed-by: Jason Andryuk Signed-off-by:

[PATCH v4 07/13] x86/hyperlaunch: obtain cmdline from device tree

2025-04-17 Thread Alejandro Vallejo
From: "Daniel P. Smith" Add support to read the command line from the hyperlauunch device tree. The device tree command line is located in the "bootargs" property of the "multiboot,kernel" node. A boot loader command line, e.g. a grub module string field, takes precendence ove the device tree on

[PATCH v4 03/13] common/hyperlaunch: introduce the domain builder

2025-04-17 Thread Alejandro Vallejo
From: "Daniel P. Smith" Introduce the domain builder which is capable of consuming a device tree as the first boot module. If it finds a device tree as the first boot module, it will set its type to BOOTMOD_FDT. This change only detects the boot module and continues to boot with slight change to

[PATCH v4 09/13] x86/hyperlaunch: add domain id parsing to domain config

2025-04-17 Thread Alejandro Vallejo
From: "Daniel P. Smith" Introduce the ability to specify the desired domain id for the domain definition. The domain id will be populated in the domid property of the domain node in the device tree configuration. Signed-off-by: Daniel P. Smith Signed-off-by: Alejandro Vallejo --- v4: * Add m

[PATCH v4 10/13] x86/hyperlaunch: specify dom0 mode with device tree

2025-04-17 Thread Alejandro Vallejo
From: "Daniel P. Smith" Enable selecting the mode in which the domain will be built and ran. This includes: - whether it will be either a 32/64 bit domain - if it will be run as a PV or HVM domain - and if it will require a device model (not applicable for dom0) In the device tree, this w

[PATCH v4 13/13] x86/hyperlaunch: add capabilities to boot domain

2025-04-17 Thread Alejandro Vallejo
From: "Daniel P. Smith" Introduce the ability to assign capabilities to a domain via its definition in device tree. The first capability enabled to select is the control domain capability. The capability property is a bitfield in both the device tree and `struct boot_domain`. Signed-off-by: Dani

Re: [PATCH v4 00/13] Hyperlaunch device tree for dom0

2025-04-17 Thread Alejandro Vallejo
On Thu Apr 17, 2025 at 1:48 PM BST, Alejandro Vallejo wrote: > Hi, > > Here's a new version. Took a while to integrate all the feedback, but > here it is. > > v4 pipeline: > https://gitlab.com/xen-project/people/agvallejo/xen/-/pipelines/1772300721 > > v3: https://lore.kernel.org/xen-devel/2025040

Re: [PATCH v2 1/8] xen/arm: drop declaration of handle_device_interrupts()

2025-04-17 Thread Orzel, Michal
On 14/04/2025 17:56, Oleksii Kurochko wrote: > There is no any users of handle_device_interrupts() thereby it > could be dropped. It reads as if you were dropping a definition. There is no definition, therefore no users. Prototype was added by accident in: 8d2c3ab18cc1fce46945bd3aa1819a7aea0c564

[PATCH] x86/pmstat: Check size of PMSTAT_get_pxstat buffers

2025-04-17 Thread Ross Lagerwall
Check that the total number of states passed in and hence the size of buffers is sufficient to avoid writing more than the caller has allocated. The interface is not explicit about whether getpx.total is expected to be set by the caller in this case but since it is always set in libxenctrl it seem

Re: [PATCH v2 2/4] x86/hvm: fix handling of accesses to partial r/o MMIO pages

2025-04-17 Thread Marek Marczykowski-Górecki
On Thu, Apr 17, 2025 at 09:57:29AM +0200, Jan Beulich wrote: > On 15.04.2025 17:32, Roger Pau Monne wrote: > > +void register_subpage_ro_handler(struct domain *d) > > +{ > > +static const struct hvm_mmio_ops subpage_mmio_ops = { > > +.check = subpage_mmio_accept, > > +.read = su

[PATCH v4 11/13] x86/hyperlaunch: add memory parsing to domain config

2025-04-17 Thread Alejandro Vallejo
From: "Daniel P. Smith" Add three properties, memory, mem-min, and mem-max, to the domain node device tree parsing to define the memory allocation for a domain. All three fields are expressed in kb and written as a u64 in the device tree entries. Signed-off-by: Daniel P. Smith Reviewed-by: Jaso

[PATCH v4 08/13] x86/hyperlaunch: locate dom0 initrd with hyperlaunch

2025-04-17 Thread Alejandro Vallejo
From: "Daniel P. Smith" Look for a subnode of type `multiboot,ramdisk` within a domain node and parse via the fdt_read_multiboot_module() helper. After a successful helper call, the module index is returned and the module is guaranteed to be in the module list. Fix unused typo in adjacent commen

Re: [PATCH v2 2/4] x86/hvm: fix handling of accesses to partial r/o MMIO pages

2025-04-17 Thread Roger Pau Monné
On Thu, Apr 17, 2025 at 09:57:29AM +0200, Jan Beulich wrote: > On 15.04.2025 17:32, Roger Pau Monne wrote: > > --- a/xen/arch/x86/hvm/emulate.c > > +++ b/xen/arch/x86/hvm/emulate.c > > @@ -370,7 +370,12 @@ static int hvmemul_do_io( > > /* If there is no suitable backing DM, just ignore acc

  1   2   >