[PATCH v1] x86: make Viridian support optional

2025-03-17 Thread Sergiy Kibrik
Add config option HVM_VIRIDIAN that covers viridian code within HVM. Calls to viridian functions guarded by is_viridian_domain() and related macros. Having this option may be beneficial by reducing code footprint for systems that are not using Hyper-V. Signed-off-by: Sergiy Kibrik --- xen/arch/x

Re: [PATCH 1/3] x86/irq: rename NR_ISAIRQS to NR_ISA_IRQS

2025-03-17 Thread Jan Beulich
On 15.03.2025 02:00, dm...@proton.me wrote: > Rename NR_ISAIRQS to NR_ISA_IRQS to enhance readability. > > No functional changes. Requested-by: Andrew Cooper > Signed-off-by: Denis Mukhin Acked-by: Jan Beulich

Re: [PATCH v2 6/7] xen: introduce Kconfig HAS_PAGING_MEMPOOL

2025-03-17 Thread Orzel, Michal
On 16/03/2025 20:24, Luca Fancellu wrote: > > > From: Penny Zheng > > ARM MPU system doesn't need to use paging memory pool, as MPU memory > mapping table at most takes only one 4KB page, which is enough to > manage the maximum 255 MPU memory regions, for all EL2 stage 1 > translation and EL

Re: [PATCH v1] x86: make Viridian support optional

2025-03-17 Thread Jan Beulich
On 17.03.2025 08:19, Sergiy Kibrik wrote: > --- a/xen/arch/x86/Kconfig > +++ b/xen/arch/x86/Kconfig > @@ -348,6 +348,11 @@ config HYPERV_GUEST > > endif > > +config HVM_VIRIDIAN > + bool "Viridian enlightenments support" if EXPERT > + depends on HVM > + default y Imo the prompt wa

[PATCH] xen/pciback: use sysfs_emit_at() instead of scnprintf()

2025-03-17 Thread tang.dongxing
From: TangDongxing Follow the advice in Documentation/filesystems/sysfs.rst: show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: TangDongxing --- drivers/xen/xen-pciback/pci_stub.c | 2 +- 1 file changed, 1 insertion(+),

Re: [PATCH v2 3/7] xen/arm: Introduce frame_table and virt_to_page

2025-03-17 Thread Luca Fancellu
> On 17 Mar 2025, at 09:51, Orzel, Michal wrote: > > > > On 17/03/2025 10:33, Luca Fancellu wrote: >> >> >> Hi Michal, >> >>> On 17 Mar 2025, at 09:29, Orzel, Michal wrote: >>> >>> >>> >>> On 16/03/2025 20:24, Luca Fancellu wrote: Introduce frame_table in order to prov

Re: [PATCH] x86/traps: Drop incorrect BUILD_BUG_ON() and comment in load_system_tables()

2025-03-17 Thread Jan Beulich
On 14.03.2025 19:33, Andrew Cooper wrote: > It is only the hardware task switching mechanism which cares about a TSS being > at least 0x67 bytes long. I/O bitmap accesses are where this particular limit comes into play. For 32-bit task switching a slightly shorter one would still do, I think? >

Re: [PATCH 14/23] xsm/dummy: Allow XS_PRIV to call get_hvm_param

2025-03-17 Thread Jan Beulich
On 06.03.2025 23:03, Jason Andryuk wrote: > This is useful for a combined hardware/xenstore domain that will run > init-dom0less and xenstored. init-dom0less calls xc_hvm_param_get() to > retrieve the xenstore event channel and pfn to configure xenstore for a > guest. With a hypervisor-allocated

Re: [PATCH v9 2/8] iommu/arm: Introduce iommu_add_dt_pci_sideband_ids API

2025-03-17 Thread Jan Beulich
On 14.03.2025 14:34, Mykyta Poturai wrote: > From: Oleksandr Tyshchenko > > The main purpose of this patch is to add a way to register PCI device > (which is behind the IOMMU) using the generic PCI-IOMMU DT bindings [1] > before assigning that device to a domain. > > This behaves similarly to th

Re: [PATCH 16/23] xsm/dummy: Allow hwdom xen_version

2025-03-17 Thread Jan Beulich
On 06.03.2025 23:03, Jason Andryuk wrote: > Running xl queries XENVER_commandline and XENVER_build_id. The hardware > domain should have access to the command line. And that's because of? > The hardware domain is > at least semi-trusted - just allow it access to all the xen_version > info. I'm

Re: [PATCH v2 3/3] drivers: Make ioapic_sbdf and hpet_sbdf contain pci_sbdf_t

2025-03-17 Thread Jan Beulich
On 16.03.2025 11:08, Andrii Sultanov wrote: > Following a similar change to amd_iommu struct, make two more structs > take pci_sbdf_t directly instead of seg and bdf separately. This lets us > drop several conversions from the latter to the former and simplifies > several comparisons and assignment

Re: [PATCH 17/23] xsm/dummy: Allow hwdom more - except targeting control

2025-03-17 Thread Jason Andryuk
On 2025-03-17 10:28, Jan Beulich wrote: On 06.03.2025 23:03, Jason Andryuk wrote: Allow hwdom all perms, except XSM_PRIV, and except commands where the target is the control domain. This protects the control domain from hwdom while allowing the hardware domain to serve as the backend and device

Re: [PATCH v5 05/17] exec/memory.h: make devend_memop "target defines" agnostic

2025-03-17 Thread Philippe Mathieu-Daudé
On 14/3/25 18:31, Pierrick Bouvier wrote: Will allow to make system/memory.c common later. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/exec/memory.h | 16 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/include/exec/memory.h b/i

Re: [PATCH v1] x86: make Viridian support optional

2025-03-17 Thread Jan Beulich
On 17.03.2025 14:55, Alejandro Vallejo wrote: > On Mon, 17 Mar 2025, 09:29 Jan Beulich, wrote: >> On 17.03.2025 10:19, Alejandro Vallejo wrote: >>> On Mon, 17 Mar 2025, 07:19 Sergiy Kibrik, wrote: --- a/xen/arch/x86/Kconfig +++ b/xen/arch/x86/Kconfig @@ -348,6 +348,11 @@ config HYP

Re: Xen panic when shutting down ARINC653 cpupool

2025-03-17 Thread Andrew Cooper
On 17/03/2025 1:21 pm, Choi, Anderson wrote: > Jürgen, > >> On 17.03.25 06:07, Choi, Anderson wrote: >>> I'd like to report xen panic when shutting down an ARINC653 domain >>> with the following setup. Note that this is only observed when >>> CONFIG_DEBUG is enabled. >>> >>> [Test environment] >>

Re: [PATCH v1 1/4] xen/riscv: introduce preinit_xen_time()

2025-03-17 Thread Jan Beulich
On 11.03.2025 17:19, Oleksii Kurochko wrote: > --- /dev/null > +++ b/xen/arch/riscv/time.c > @@ -0,0 +1,38 @@ > +#include > +#include > +#include > +#include > + > +unsigned long __ro_after_init cpu_khz; /* CPU clock frequency in kHz. */ > +unsigned long __read_mostly boot_count; Why not also

Re: [PATCH v1] x86: make Viridian support optional

2025-03-17 Thread Alejandro Vallejo
+xen-devel (sent it on private by mistake) On Mon, 17 Mar 2025, 09:29 Jan Beulich, wrote: > On 17.03.2025 10:19, Alejandro Vallejo wrote: > > Hi, > > > > I'm surprised this isn't already possible. Neat! > > > > On Mon, 17 Mar 2025, 07:19 Sergiy Kibrik, > wrote: > > > >> Add config option HVM_VI

Re: [PATCH v5 00/17] make system memory API available for common code

2025-03-17 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > Hi, > > On 14/3/25 19:39, Pierrick Bouvier wrote: >> On 3/14/25 11:34, Anthony PERARD wrote: >>> On Fri, Mar 14, 2025 at 10:33:08AM -0700, Pierrick Bouvier wrote: Hi, one patch is missing review: [PATCH v5 12/17] hw/xen: add stubs for various f

Re: [PATCH v1 4/4] xen/riscv: introduce intc_preinit()

2025-03-17 Thread Jan Beulich
On 11.03.2025 17:19, Oleksii Kurochko wrote: > --- a/xen/arch/riscv/setup.c > +++ b/xen/arch/riscv/setup.c > @@ -16,6 +16,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -128,6 +129,8 @@ void __init noreturn start_xen(unsigned long bootcpu_id, >

Re: [PATCH v5 11/17] exec/ram_addr: call xen_hvm_modified_memory only if xen is enabled

2025-03-17 Thread Pierrick Bouvier
On 3/17/25 09:23, Philippe Mathieu-Daudé wrote: On 17/3/25 17:22, Philippe Mathieu-Daudé wrote: On 17/3/25 17:07, Pierrick Bouvier wrote: On 3/17/25 08:50, Philippe Mathieu-Daudé wrote: On 14/3/25 18:31, Pierrick Bouvier wrote: Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier

Re: [PATCH 14/23] xsm/dummy: Allow XS_PRIV to call get_hvm_param

2025-03-17 Thread Jason Andryuk
On 2025-03-17 10:18, Jan Beulich wrote: On 06.03.2025 23:03, Jason Andryuk wrote: This is useful for a combined hardware/xenstore domain that will run init-dom0less and xenstored. init-dom0less calls xc_hvm_param_get() to retrieve the xenstore event channel and pfn to configure xenstore for a g

Re: [RFC] analysis of runtime xenheap memory allocations

2025-03-17 Thread Andrew Cooper
On 17/03/2025 6:48 pm, Andrea Bastoni wrote: > Hi, > > In the last months we have been working with Stefano's team in AMD at tools to > facilitate the analysis of "anonymous" memory allocations performed at > "runtime" > from the shared Xen heap. > > - Anonymous here means: allocations that insist

[PATCH v7 3/3] CHANGELOG.md: Mention stack-protector feature

2025-03-17 Thread Volodymyr Babchuk
Stack protector is meant to be enabled on all architectures, but currently it is tested (and enabled) only on ARM, so mention it in ARM section. Signed-off-by: Volodymyr Babchuk Acked-by: Oleksii Kurochko --- Changes in v7: - Moved the change to v4.21 - Added Oleksii's acked-by tag Changes

[PATCH v7 1/3] xen: common: add ability to enable stack protector

2025-03-17 Thread Volodymyr Babchuk
Both GCC and Clang support -fstack-protector feature, which add stack canaries to functions where stack corruption is possible. This patch makes general preparations to enable this feature on different supported architectures: - Added CONFIG_HAS_STACK_PROTECTOR option so each architecture can

Re: [ImageBuilder][PATCH] uboot-script-gen: add ability to cfg vcpu hard affinity

2025-03-17 Thread Stefano Stabellini
On Mon, 17 Mar 2025, gragst.li...@gmail.com wrote: > From: Grygorii Strashko > > Add DOMU_VCPU_HARD_AFFINITY[number,vcpu] configuration file string option > specifying the hard affinity configuration for the VM vCPU(vcpu) in DT. > > The format is a comma-separated list of pCPUs or ranges of pCPU

[PATCH v7 0/3] Add/enable stack protector

2025-03-17 Thread Volodymyr Babchuk
Both GCC and Clang support -fstack-protector feature, which add stack canaries to functions where stack corruption is possible. This series makes possible to use this feature in Xen. I tested this on ARM64 and it is working as intended. Tested both with GCC and Clang. Also tested with "-fstack-prot

Re: [PATCH v2 1/4] meminfo: add a per node counter for balloon drivers

2025-03-17 Thread Nico Pache
On 3/14/25 7:06 PM, Andrew Morton wrote: > On Fri, 14 Mar 2025 15:37:54 -0600 Nico Pache wrote: > >> Add NR_BALLOON_PAGES counter to track memory used by balloon drivers and >> expose it through /proc/meminfo and other memory reporting interfaces. >> >> ... >> >> --- a/fs/proc/meminfo.c >> +++

[PATCH v6 16/18] include/exec/memory: move devend functions to memory-internal.h

2025-03-17 Thread Pierrick Bouvier
Only system/physmem.c and system/memory.c use those functions, so we can move then to internal header. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/exec/memory-internal.h | 19 +++ include/exec/memory.h | 18 -- 2 files chan

Re: [PATCH 1/8] automation/cirrus-ci: add timestamps

2025-03-17 Thread Stefano Stabellini
On Mon, 17 Mar 2025, Roger Pau Monne wrote: > Such timestamps can still be disabled from the Web UI using a tick box. > > Signed-off-by: Roger Pau Monné Acked-by: Stefano Stabellini > --- > .cirrus.yml | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/.cirrus.yml b/.cirrus.yml > index

Re: [PATCH 2/8] automation/cirrus-ci: update FreeBSD to 13.5

2025-03-17 Thread Stefano Stabellini
On Mon, 17 Mar 2025, Roger Pau Monne wrote: > Signed-off-by: Roger Pau Monné Acked-by: Stefano Stabellini > --- > .cirrus.yml | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/.cirrus.yml b/.cirrus.yml > index aa195ba370ac..ce7588b7b6b1 100644 > --- a/.cirrus.yml > +++

Re: S3 regression on AMD in 4.20

2025-03-17 Thread Jan Beulich
On 17.03.2025 18:38, Roger Pau Monné wrote: > On Mon, Mar 17, 2025 at 05:11:56PM +0100, Jan Beulich wrote: >> On 17.03.2025 16:56, Roger Pau Monné wrote: >>> On Sat, Mar 15, 2025 at 12:02:50AM +, Andrew Cooper wrote: On 14/03/2025 11:53 pm, Marek Marczykowski-Górecki wrote: > On Fri, M

[PATCH v7 2/3] xen: arm: enable stack protector feature

2025-03-17 Thread Volodymyr Babchuk
Enable previously added CONFIG_STACK_PROTECTOR feature for ARM platform. Initialize stack protector magic value very early, at the very beginning of start_xen() function. We want to do this early because prior to that boot_stack_chk_guard_setup() call, default stack protector guard value is used.

[PATCH] xen/sched: call xfree() after local IRQ is enabled

2025-03-17 Thread Anderson Choi
xen panic is observed with the following configuration. 1. Debug xen build (CONFIG_DEBUG=y) 2. dom1 of an ARINC653 domain 3. shutdown dom1 with xl command $ xl shutdown (XEN) (XEN) Panic on CPU 2: (XEN) Assertion '!in_irq() && (local_irq_is_enabled() ||

[PATCH] xen: vm_event: do not do vm_event_op for an invalid domain

2025-03-17 Thread Volodymyr Babchuk
A privileged domain can issue XEN_DOMCTL_vm_event_op with op->domain == DOMID_INVALID. In this case vm_event_domctl() function will get NULL as the first parameter and this will cause hypervisor panic, as it tries to derefer this pointer. Fix the issue by checking if valid domain is passed in. Si

Re: [PATCH] xen: vm_event: do not do vm_event_op for an invalid domain

2025-03-17 Thread Volodymyr Babchuk
Hi Tamas, Tamas K Lengyel writes: > On Mon, Mar 17, 2025 at 7:08 PM Volodymyr Babchuk > wrote: >> >> A privileged domain can issue XEN_DOMCTL_vm_event_op with >> op->domain == DOMID_INVALID. In this case vm_event_domctl() >> function will get NULL as the first parameter and this will >> cause

Re: [PATCH 15/23] xen/xsm: Add XSM_HW_PRIV

2025-03-17 Thread Stefano Stabellini
On Mon, 17 Mar 2025, Jason Andryuk wrote: > On 2025-03-17 10:22, Jan Beulich wrote: > > On 06.03.2025 23:03, Jason Andryuk wrote: > > > --- a/xen/include/xsm/dummy.h > > > +++ b/xen/include/xsm/dummy.h > > > @@ -95,7 +95,11 @@ static always_inline int xsm_default_action( > > > return

Re: [PATCH 7/8] automation/console.exp: do not assume expect is always at /usr/bin/

2025-03-17 Thread Stefano Stabellini
On Mon, 17 Mar 2025, Roger Pau Monne wrote: > Instead use env to find the location of expect. > > Additionally do not use the -f flag, as it's only meaningful when passing > arguments on the command line, which we never do for console.exp. From the > expect 5.45.4 man page: > > > The -f flag pre

Re: [PATCH 5/8] automation/cirrus-ci: build XTF

2025-03-17 Thread Stefano Stabellini
On Mon, 17 Mar 2025, Roger Pau Monne wrote: > In preparation for using the XTF selftests to smoke test the FreeBSD based > Xen builds. > > Signed-off-by: Roger Pau Monné > --- > I've used the current version of FreeBSD to build XTF, but it might be > safer to use the latest production (release) v

Re: [PATCH] xen: vm_event: do not do vm_event_op for an invalid domain

2025-03-17 Thread Andrew Cooper
On 17/03/2025 11:08 pm, Volodymyr Babchuk wrote: > A privileged domain can issue XEN_DOMCTL_vm_event_op with > op->domain == DOMID_INVALID. In this case vm_event_domctl() > function will get NULL as the first parameter and this will > cause hypervisor panic, as it tries to derefer this pointer. > >

[PATCH v3 1/7] arm/mpu: Add HYPERVISOR_VIRT_START and avoid a check in xen.lds.S

2025-03-17 Thread Luca Fancellu
The define HYPERVISOR_VIRT_START is required by the common code, even if MPU system doesn't use virtual memory, define it in mpu/layout.h in order to reuse existing code. Disable a check in the linker script for arm for !MMU systems. Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel --- v3

[PATCH v2] xen: vm_event: do not do vm_event_op for an invalid domain

2025-03-17 Thread Volodymyr Babchuk
A privileged domain can issue XEN_DOMCTL_vm_event_op with op->domain == DOMID_INVALID. In this case vm_event_domctl() function will get NULL as the first parameter and this will cause hypervisor panic, as it tries to derefer this pointer. Fix the issue by checking if valid domain is passed in. Fi

Re: [PATCH 4/8] automation/cirrus-ci: use matrix keyword to generate per-version build tasks

2025-03-17 Thread Stefano Stabellini
On Mon, 17 Mar 2025, Roger Pau Monne wrote: > Move the current logic to use the matrix keyword to generate a task for > each version of FreeBSD we want to build Xen on. The matrix keyword > however cannot be used in YAML aliases, so it needs to be explicitly used > inside of each task, which creat

Re: [PATCH 6/8] automation/cirrus-ci: store XTF and Xen build artifacts

2025-03-17 Thread Stefano Stabellini
On Mon, 17 Mar 2025, Roger Pau Monne wrote: > In preparation for adding some smoke tests that will consume those outputs. > > Signed-off-by: Roger Pau Monné Acked-by: Stefano Stabellini

Re: [PATCH 8/8] automation/cirrus-ci: add smoke tests for the FreeBSD builds

2025-03-17 Thread Stefano Stabellini
On Mon, 17 Mar 2025, Roger Pau Monne wrote: > Introduce a basic set of smoke tests using the XTF selftest image, and run > them on QEMU. Use the matrix keyword to create a different task for each > XTF flavor on each FreeBSD build. > > Signed-off-by: Roger Pau Monné > --- > I've used the current

Re: [ImageBuilder][PATCH] uboot-script-gen: add debug option to print final dt "chosen" node

2025-03-17 Thread Stefano Stabellini
On Mon, 17 Mar 2025, Grygorii Strashko wrote: > Add debug DBG_FDT_PRINT_CHOSEN config file option which adds > print of DT "chosen" node at the end of generated U-boot script. > > This is useful for debug and development purposes. > > Example: > ... > setenv fdt_high 0x > fd

Re: [PATCH 3/8] automation/cirrus-ci: store Xen Kconfig before doing a build

2025-03-17 Thread Stefano Stabellini
On Mon, 17 Mar 2025, Roger Pau Monne wrote: > In case the build fails or gets stuck, store the Kconfig file ahead of > starting the build. > > Signed-off-by: Roger Pau Monné Acked-by: Stefano Stabellini

Re: [PATCH] xen: vm_event: do not do vm_event_op for an invalid domain

2025-03-17 Thread Tamas K Lengyel
On Mon, Mar 17, 2025 at 7:08 PM Volodymyr Babchuk wrote: > > A privileged domain can issue XEN_DOMCTL_vm_event_op with > op->domain == DOMID_INVALID. In this case vm_event_domctl() > function will get NULL as the first parameter and this will > cause hypervisor panic, as it tries to derefer this p

Re: [PATCH v2 2/7] xen/arm: Implement virt/maddr conversion in MPU system

2025-03-17 Thread Orzel, Michal
On 16/03/2025 20:24, Luca Fancellu wrote: > > > From: Penny Zheng > > virt_to_maddr and maddr_to_virt are used widely in Xen code. So > even there is no VMSA in MPU system, we keep the interface in MPU to > to avoid changing the existing common code. > > In order to do that, move the virt_t

Re: [PATCH v2] x86/hvm: Use for_each_set_bit() in hvm_emulate_writeback()

2025-03-17 Thread Jan Beulich
On 14.03.2025 21:49, Andrew Cooper wrote: > ... which is more consise than the opencoded form, and more efficient when > compiled. > > For production VMs, ~100% of emulations are simple MOVs, so it is likely that > there are no segments to write back. > > Furthermore, now that find_{first,next}_b

Re: [PATCH] x86/traps: Drop incorrect BUILD_BUG_ON() and comment in load_system_tables()

2025-03-17 Thread Andrew Cooper
On 17/03/2025 9:03 am, Jan Beulich wrote: > On 14.03.2025 19:33, Andrew Cooper wrote: >> It is only the hardware task switching mechanism which cares about a TSS >> being >> at least 0x67 bytes long. > I/O bitmap accesses are where this particular limit comes into play. For > 32-bit task switching

[PATCH 4/8] automation/cirrus-ci: use matrix keyword to generate per-version build tasks

2025-03-17 Thread Roger Pau Monne
Move the current logic to use the matrix keyword to generate a task for each version of FreeBSD we want to build Xen on. The matrix keyword however cannot be used in YAML aliases, so it needs to be explicitly used inside of each task, which creates a bit of duplication. At least abstract the Free

Re: [PATCH] [RFC] vpci: allow BAR write while mapped

2025-03-17 Thread Roger Pau Monné
On Fri, Mar 14, 2025 at 10:39:04AM +, Alejandro Vallejo wrote: > On Thu Mar 13, 2025 at 5:43 PM GMT, Stewart Hildebrand wrote: > > I think this just reinforces the need to rework the BAR mapping > > machinery. > > Right. The most delicate part is dealing with races with another vCPU when the >

Re: [PATCH 8/8] x86: Drop the vm86 segments selectors from struct cpu_user_regs

2025-03-17 Thread Jan Beulich
On 11.03.2025 22:10, Andrew Cooper wrote: > The data segment registers are part of the on-stack IRET frame when > interrupting Virtual 8086 mode, but this ceased being relevant for Xen in > commit 5d1181a5ea5e ("xen: Remove x86_32 build target.") in 2012. > > With all other cleanup in place, delet

Re: [PATCH v3] x86/hvm: add HVM-specific Kconfig

2025-03-17 Thread Andrew Cooper
On 15/03/2025 1:19 am, dm...@proton.me wrote: > Add a separate menu for configuring HVM build-time settings to better > organize HVM-specific options. > > HVM options will now appear in a dedicated sub-menu in the menuconfig > tool. > > Also, make AMD_SVM config dependent on AMD config and INTEL_VM

Re: [PATCH 2/8] x86/traps: Rework register state printing to use a struct

2025-03-17 Thread Jan Beulich
On 11.03.2025 22:10, Andrew Cooper wrote: > ... in preference to the crs[8] array. This avoids abusing crs[5..7] for the > fs/gs bases, giving them proper named fields instead, and avoids storage for > cr1 which is unused in the x86 architecture. > > In show_registers(), remove a redundant read_c

Re: [PATCH 1/8] x86/regs: Fold x86_64/regs.h into it's single includer

2025-03-17 Thread Jan Beulich
On 11.03.2025 22:10, Andrew Cooper wrote: > Signed-off-by: Andrew Cooper Acked-by: Jan Beulich

Re: [PATCH 4/8] Revert "x86/traps: 'Fix' safety of read_registers() in #DF path"

2025-03-17 Thread Jan Beulich
On 11.03.2025 22:10, Andrew Cooper wrote: > This reverts commit 6065a05adf152a556fb9f11a5218c89e41b62893. > > The discussed "proper fix" has now been implemented, and the #DF path no > longer writes out-of-bounds. Restore the proper #DF IST pointer. > > Signed-off-by: Andrew Cooper Acked-by: J

Re: [PATCH 3/8] x86/traps: Avoid OoB accesses to print the data selectors

2025-03-17 Thread Andrew Cooper
On 17/03/2025 11:00 am, Jan Beulich wrote: > On 11.03.2025 22:10, Andrew Cooper wrote: >> _show_registers() prints the data selectors from struct cpu_user_regs, but >> these fields are sometimes out-of-bounds. See commit 6065a05adf15 >> ("x86/traps: 'Fix' safety of read_registers() in #DF path").

Re: [PATCH 3/8] x86/traps: Avoid OoB accesses to print the data selectors

2025-03-17 Thread Jan Beulich
On 11.03.2025 22:10, Andrew Cooper wrote: > _show_registers() prints the data selectors from struct cpu_user_regs, but > these fields are sometimes out-of-bounds. See commit 6065a05adf15 > ("x86/traps: 'Fix' safety of read_registers() in #DF path"). > > There are 3 callers of _show_registers(): >

[ImageBuilder][PATCH] uboot-script-gen: add debug option to print final dt "chosen" node

2025-03-17 Thread Grygorii Strashko
Add debug DBG_FDT_PRINT_CHOSEN config file option which adds print of DT "chosen" node at the end of generated U-boot script. This is useful for debug and development purposes. Example: ... setenv fdt_high 0x fdt print /chosen booti 0x4300 - 0x4320 Signed-off-by:

Re: [PATCH v2 1/4] xen/arm32: Initialize MM specific registers in enable_mmu

2025-03-17 Thread Orzel, Michal
On 13/03/2025 19:28, Ayan Kumar Halder wrote: > All the memory management specific registers are initialized in enable_mmu. The title is a bit misleading (description does not help too). It's a pure code movement, yet it's not mentioned at all. This can be fixed by changing title: "Move MM speci

[PATCH] arinc653: move next_switch_time access under lock

2025-03-17 Thread Jan Beulich
Even before its recent movement to the scheduler's private data structure it looks to have been wrong to update the field under lock, but then read it with the lock no longer held. Coverity-ID: 1644500 Fixes: 9f0c658baedc ("arinc: add cpu-pool support to scheduler") Signed-off-by: Jan Beulich ---

Re: [PATCH v2 3/7] xen/arm: Introduce frame_table and virt_to_page

2025-03-17 Thread Orzel, Michal
On 17/03/2025 10:33, Luca Fancellu wrote: > > > Hi Michal, > >> On 17 Mar 2025, at 09:29, Orzel, Michal wrote: >> >> >> >> On 16/03/2025 20:24, Luca Fancellu wrote: >>> >>> >>> Introduce frame_table in order to provide the implementation of >>> virt_to_page for MPU system, move the MMU varia

Re: [PATCH] xen/pciback: use sysfs_emit_at() instead of scnprintf()

2025-03-17 Thread Jiri Slaby
On 17. 03. 25, 8:16, tang.dongx...@zte.com.cn wrote: From: TangDongxing Follow the advice in Documentation/filesystems/sysfs.rst: show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: TangDongxing --- drivers/xen/xen-pc

Re: [PATCH 2/3] x86/irq: use NR_ISA_IRQS instead of open-coded value

2025-03-17 Thread Jan Beulich
On 15.03.2025 02:00, dm...@proton.me wrote: > Replace the open-coded value 16 with the NR_ISA_IRQS symbol to enhance > readability. > > No functional changes. > > Signed-off-by: Denis Mukhin Reviewed-by: Jan Beulich

Re: [PATCH] x86/boot: Fix zap_low_mappings() to map less of the trampoline

2025-03-17 Thread Jan Beulich
On 14.03.2025 20:00, Andrew Cooper wrote: > On 12/03/2025 9:57 am, Roger Pau Monné wrote: >> On Wed, Mar 12, 2025 at 09:31:37AM +0100, Jan Beulich wrote: >>> On 11.03.2025 21:47, Andrew Cooper wrote: On 06/01/2025 11:54 am, Jan Beulich wrote: > On 06.01.2025 12:26, Andrew Cooper wrote: >>>

[PATCH 3/8] automation/cirrus-ci: store Xen Kconfig before doing a build

2025-03-17 Thread Roger Pau Monne
In case the build fails or gets stuck, store the Kconfig file ahead of starting the build. Signed-off-by: Roger Pau Monné --- .cirrus.yml | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index ce7588b7b6b1..490f214f0460 100644 ---

[PATCH 8/8] automation/cirrus-ci: add smoke tests for the FreeBSD builds

2025-03-17 Thread Roger Pau Monne
Introduce a basic set of smoke tests using the XTF selftest image, and run them on QEMU. Use the matrix keyword to create a different task for each XTF flavor on each FreeBSD build. Signed-off-by: Roger Pau Monné --- I've used the current version of FreeBSD to run the tests, but it might be safe

[PATCH 6/8] automation/cirrus-ci: store XTF and Xen build artifacts

2025-03-17 Thread Roger Pau Monne
In preparation for adding some smoke tests that will consume those outputs. Signed-off-by: Roger Pau Monné --- .cirrus.yml | 12 1 file changed, 12 insertions(+) diff --git a/.cirrus.yml b/.cirrus.yml index d8a322acd54c..c74d5cf6eb9a 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -6

[PATCH 5/8] automation/cirrus-ci: build XTF

2025-03-17 Thread Roger Pau Monne
In preparation for using the XTF selftests to smoke test the FreeBSD based Xen builds. Signed-off-by: Roger Pau Monné --- I've used the current version of FreeBSD to build XTF, but it might be safer to use the latest production (release) version instead. --- .cirrus.yml | 24

[PATCH 2/8] automation/cirrus-ci: update FreeBSD to 13.5

2025-03-17 Thread Roger Pau Monne
Signed-off-by: Roger Pau Monné --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index aa195ba370ac..ce7588b7b6b1 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,7 +1,7 @@ # https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configu

[PATCH 1/8] automation/cirrus-ci: add timestamps

2025-03-17 Thread Roger Pau Monne
Such timestamps can still be disabled from the Web UI using a tick box. Signed-off-by: Roger Pau Monné --- .cirrus.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.cirrus.yml b/.cirrus.yml index 1a39f5026f9a..aa195ba370ac 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -14,6 +14,7 @@ freeb

[PATCH 0/8] automation/cirrus-ci: add smoke tests of the FreeBSD builds

2025-03-17 Thread Roger Pau Monne
Hello, The aim of the series is to introduce a basic set of smoke tests using QEMU and XTF, to ensure some minimal run-time testing of the LLVM toolchain generated Xen binary. Roger Pau Monne (8): automation/cirrus-ci: add timestamps automation/cirrus-ci: update FreeBSD to 13.5 automation/c

[PATCH 7/8] automation/console.exp: do not assume expect is always at /usr/bin/

2025-03-17 Thread Roger Pau Monne
Instead use env to find the location of expect. Additionally do not use the -f flag, as it's only meaningful when passing arguments on the command line, which we never do for console.exp. From the expect 5.45.4 man page: > The -f flag prefaces a file from which to read commands from. The flag >

Re: [PATCH 3/3] x86/irq: introduce APIC_VECTOR_VALID

2025-03-17 Thread Jan Beulich
On 15.03.2025 02:00, dm...@proton.me wrote: > Add new symbol APIC_VECTOR_VALID to replace open-coded value 16 in > LAPIC and virtual LAPIC code. First a good name is needed to make such a change. APIC_VECTOR_VALID could imo be the name of a predicate macro, but it can't be a mere number. Then ...

Re: [PATCH v2 6/7] xen: introduce Kconfig HAS_PAGING_MEMPOOL

2025-03-17 Thread Jan Beulich
On 16.03.2025 20:24, Luca Fancellu wrote: > --- a/xen/common/Kconfig > +++ b/xen/common/Kconfig > @@ -74,6 +74,9 @@ config HAS_KEXEC > config HAS_LLC_COLORING > bool > > +config HAS_PAGING_MEMPOOL > + bool Imo this is too little of a change outside of Arm-specific code here. Just go g

Re: [PATCH] xen: Drop __text_section()

2025-03-17 Thread Jan Beulich
On 14.03.2025 18:59, Andrew Cooper wrote: > This is an unnecessary indirection. > > Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich

Re: [PATCH] x86/debug: Move activate_debugregs() into debug.c

2025-03-17 Thread Jan Beulich
On 14.03.2025 19:07, Andrew Cooper wrote: > We have since gained a better location for it to live. > > Fix up the includes while doing so. I don't recall why we had kernel.h but > it's definitely stale now. > > No functional change. > > Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich

Re: [PATCH v2 2/4] xen/arm32: mpu: Create boot-time MPU protection regions

2025-03-17 Thread Orzel, Michal
On 13/03/2025 19:28, Ayan Kumar Halder wrote: > Define enable_boot_cpu_mm() for the Armv8-R AArch32. > > 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 map

Re: [PATCH 5/8] x86/domctl: Stop using XLAT_cpu_user_regs()

2025-03-17 Thread Jan Beulich
On 11.03.2025 22:10, Andrew Cooper wrote: > --- a/xen/include/xlat.lst > +++ b/xen/include/xlat.lst > @@ -34,8 +34,6 @@ > ?pmu_intel_ctxt arch-x86/pmu.h > ?pmu_regsarch-x86/pmu.h > > -!cpu_user_regs arch-x86/xen-@arch@.h Ma

Re: [PATCH 5/8] x86/domctl: Stop using XLAT_cpu_user_regs()

2025-03-17 Thread Jan Beulich
On 11.03.2025 22:10, Andrew Cooper wrote: > In order to support FRED, we're going to have to remove the {ds..gs} fields > from struct cpu_user_regs, meaning that it is going to have to become a > different type to the structure embedded in vcpu_guest_context_u. > > In both arch_{get,set}_info_gues

Re: [PATCH 6/8] x86/pv: Store the data segment selectors outside of cpu_user_regs

2025-03-17 Thread Jan Beulich
On 11.03.2025 22:10, Andrew Cooper wrote: > --- a/xen/arch/x86/domain.c > +++ b/xen/arch/x86/domain.c > @@ -1211,10 +1211,10 @@ int arch_set_info_guest( > v->arch.user_regs.rflags= c.nat->user_regs.rflags; > v->arch.user_regs.rsp = c.nat->user_regs.rsp; >

Re: Xen panic when shutting down ARINC653 cpupool

2025-03-17 Thread Jürgen Groß
On 17.03.25 06:07, Choi, Anderson wrote: I'd like to report xen panic when shutting down an ARINC653 domain with the following setup. Note that this is only observed when CONFIG_DEBUG is enabled. [Test environment] Yocto release : 5.05 Xen release : 4.19 (hash = 026c9fa29716b0ff0f8b7c687908e71b

[PATCH v2] CHANGELOG.md: Mention PCI passthrough for HVM domUs

2025-03-17 Thread Jiqian Chen
PCI passthrough is already supported for HVM domUs when dom0 is PVH on x86. The last related patch on Qemu side was merged after Xen4.20 release. So mention this feature in Xen4.21 entry. But SR-IOV is not yet supported on PVH dom0, add a note for it. Signed-off-by: Jiqian Chen Acked-by: Oleksii

Re: [PATCH] xen/pciback: use sysfs_emit_at() instead of scnprintf()

2025-03-17 Thread tang.dongxing
>> From: TangDongxing >> >> Follow the advice in Documentation/filesystems/sysfs.rst: >> show() should only use sysfs_emit() or sysfs_emit_at() when formatting >> the value to be returned to user space. >> >> Signed-off-by: TangDongxing >> --- >> drivers/xen/xen-pciback/pci_stub.c | 2 +- >>

Re: [PATCH v5 00/17] make system memory API available for common code

2025-03-17 Thread Philippe Mathieu-Daudé
Hi, On 14/3/25 19:39, Pierrick Bouvier wrote: On 3/14/25 11:34, Anthony PERARD wrote: On Fri, Mar 14, 2025 at 10:33:08AM -0700, Pierrick Bouvier wrote: Hi, one patch is missing review: [PATCH v5 12/17] hw/xen: add stubs for various functions. My "Acked-by" wasn't enough? Feel free try chang

Re: [PATCH v1] x86: make Viridian support optional

2025-03-17 Thread Alejandro Vallejo
Hi, I'm surprised this isn't already possible. Neat! On Mon, 17 Mar 2025, 07:19 Sergiy Kibrik, wrote: > Add config option HVM_VIRIDIAN that covers viridian code within HVM. > Calls to viridian functions guarded by is_viridian_domain() and related > macros. > Having this option may be beneficial

Re: [PATCH v2 6/7] xen: introduce Kconfig HAS_PAGING_MEMPOOL

2025-03-17 Thread Luca Fancellu
Hi Jan, > On 17 Mar 2025, at 08:41, Jan Beulich wrote: > > On 16.03.2025 20:24, Luca Fancellu wrote: >> --- a/xen/common/Kconfig >> +++ b/xen/common/Kconfig >> @@ -74,6 +74,9 @@ config HAS_KEXEC >> config HAS_LLC_COLORING >> bool >> >> +config HAS_PAGING_MEMPOOL >> + bool > > Imo this is too l

Re: [PATCH v1] x86: make Viridian support optional

2025-03-17 Thread Jan Beulich
On 17.03.2025 10:19, Alejandro Vallejo wrote: > Hi, > > I'm surprised this isn't already possible. Neat! > > On Mon, 17 Mar 2025, 07:19 Sergiy Kibrik, wrote: > >> Add config option HVM_VIRIDIAN that covers viridian code within HVM. >> Calls to viridian functions guarded by is_viridian_domain()

Re: [PATCH v2 3/7] xen/arm: Introduce frame_table and virt_to_page

2025-03-17 Thread Orzel, Michal
On 16/03/2025 20:24, Luca Fancellu wrote: > > > Introduce frame_table in order to provide the implementation of > virt_to_page for MPU system, move the MMU variant in mmu/mm.h. > > Introduce FRAMETABLE_NR that is required for 'pdx_group_valid' in > pdx.c, but leave the initialisation of the f

Re: [PATCH v2 3/7] xen/arm: Introduce frame_table and virt_to_page

2025-03-17 Thread Luca Fancellu
Hi Michal, > On 17 Mar 2025, at 09:29, Orzel, Michal wrote: > > > > On 16/03/2025 20:24, Luca Fancellu wrote: >> >> >> Introduce frame_table in order to provide the implementation of >> virt_to_page for MPU system, move the MMU variant in mmu/mm.h. >> >> Introduce FRAMETABLE_NR that is requ

Re: [PATCH v2 6/7] xen: introduce Kconfig HAS_PAGING_MEMPOOL

2025-03-17 Thread Jan Beulich
On 17.03.2025 10:29, Luca Fancellu wrote: >> On 17 Mar 2025, at 08:41, Jan Beulich wrote: >> On 16.03.2025 20:24, Luca Fancellu wrote: >>> --- a/xen/common/Kconfig >>> +++ b/xen/common/Kconfig >>> @@ -74,6 +74,9 @@ config HAS_KEXEC >>> config HAS_LLC_COLORING >>> bool >>> >>> +config HAS_PAGING_ME

Re: [PATCH] x86/boot: Fix zap_low_mappings() to map less of the trampoline

2025-03-17 Thread Andrew Cooper
On 17/03/2025 7:56 am, Jan Beulich wrote: > On 14.03.2025 20:00, Andrew Cooper wrote: >> On 12/03/2025 9:57 am, Roger Pau Monné wrote: >>> On Wed, Mar 12, 2025 at 09:31:37AM +0100, Jan Beulich wrote: On 11.03.2025 21:47, Andrew Cooper wrote: > On 06/01/2025 11:54 am, Jan Beulich wrote: >>>

Re: [PATCH 6/8] x86/pv: Store the data segment selectors outside of cpu_user_regs

2025-03-17 Thread Andrew Cooper
On 17/03/2025 11:58 am, Jan Beulich wrote: > On 11.03.2025 22:10, Andrew Cooper wrote: >> --- a/xen/arch/x86/domain.c >> +++ b/xen/arch/x86/domain.c >> @@ -1211,10 +1211,10 @@ int arch_set_info_guest( >> v->arch.user_regs.rflags= c.nat->user_regs.rflags; >> v->arch.use

Re: [PATCH 0/3] x86/irq: cleanup use of open-coded values

2025-03-17 Thread Andrew Cooper
On 15/03/2025 1:00 am, dm...@proton.me wrote: > Remove uses of open-coded value 16 in x86's interrupt management code > to enhance readability. > > Patch 0 makes a cosmetic rename NR_ISAIRQS -> NR_ISA_IRQS as per > code review [1]. > > Patch 1 makes use of NR_ISA_IRQS in the code where necessary

RE: Xen panic when shutting down ARINC653 cpupool

2025-03-17 Thread Choi, Anderson
Jürgen, > On 17.03.25 06:07, Choi, Anderson wrote: >> I'd like to report xen panic when shutting down an ARINC653 domain >> with the following setup. Note that this is only observed when >> CONFIG_DEBUG is enabled. >> >> [Test environment] >> Yocto release : 5.05 >> Xen release : 4.19 (hash = 0

[PATCH 15/15] drm/xen: Test for imported buffers with drm_gem_is_imported()

2025-03-17 Thread Thomas Zimmermann
Instead of testing import_attach for imported GEM buffers, invoke drm_gem_is_imported() to do the test. The helper tests the dma_buf itself while import_attach is just an artifact of the import. Prepares to make import_attach optional. Signed-off-by: Thomas Zimmermann Cc: Oleksandr Andrushchenko

Re: Xen panic when shutting down ARINC653 cpupool

2025-03-17 Thread Jürgen Groß
On 17.03.25 14:29, Andrew Cooper wrote: On 17/03/2025 1:21 pm, Choi, Anderson wrote: Jürgen, On 17.03.25 06:07, Choi, Anderson wrote: I'd like to report xen panic when shutting down an ARINC653 domain with the following setup. Note that this is only observed when CONFIG_DEBUG is enabled. [Te

Re: [PATCH] [RFC] vpci: allow BAR write while mapped

2025-03-17 Thread Alejandro Vallejo
On Mon Mar 17, 2025 at 12:32 PM GMT, Roger Pau Monné wrote: > On Fri, Mar 14, 2025 at 10:39:04AM +, Alejandro Vallejo wrote: > > On Thu Mar 13, 2025 at 5:43 PM GMT, Stewart Hildebrand wrote: > > > I think this just reinforces the need to rework the BAR mapping > > > machinery. > > > > Right. T

[ImageBuilder][PATCH] uboot-script-gen: add ability to cfg vcpu hard affinity

2025-03-17 Thread gragst . linux
From: Grygorii Strashko Add DOMU_VCPU_HARD_AFFINITY[number,vcpu] configuration file string option specifying the hard affinity configuration for the VM vCPU(vcpu) in DT. The format is a comma-separated list of pCPUs or ranges of pCPUs. Ranges are hyphen-separated intervals (such as 0-4) and are

  1   2   >