RE: [PATCH v2 3/4] hv_balloon: update the NR_BALLOON_PAGES state

2025-03-14 Thread Michael Kelley
From: Nico Pache Sent: Friday, March 14, 2025 2:38 PM > > Update the NR_BALLOON_PAGES counter when pages are added to or > removed from the Hyper-V balloon. > > Signed-off-by: Nico Pache > --- > drivers/hv/hv_balloon.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/hv/hv_b

Re: [PATCH] x86/irq: use NR_ISAIRQS instead of open-coded value

2025-03-14 Thread Denis Mukhin
On Friday, March 14th, 2025 at 1:51 AM, Jan Beulich wrote: > > > On 14.03.2025 02:20, dm...@proton.me wrote: > > > Replace the open-coded value 16 with the NR_ISAIRQS symbol to enhance > > readability. > > > > No functional changes. > > > > Signed-off-by: Denis Mukhin dmuk...@ford.com > > --

[PATCH v2 3/4] hv_balloon: update the NR_BALLOON_PAGES state

2025-03-14 Thread Nico Pache
Update the NR_BALLOON_PAGES counter when pages are added to or removed from the Hyper-V balloon. Signed-off-by: Nico Pache --- drivers/hv/hv_balloon.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c index fec2f18679e3..2b4080e51f97 100644 -

Re: S3 regression on AMD in 4.20 (was: Re: [PATCH] ci: add yet another HW runner)

2025-03-14 Thread Marek Marczykowski-Górecki
On Fri, Mar 14, 2025 at 11:23:28PM +0100, Marek Marczykowski-Górecki wrote: > On Fri, Mar 14, 2025 at 02:19:19PM -0700, Stefano Stabellini wrote: > > On Fri, 14 Mar 2025, Marek Marczykowski-Górecki wrote: > > > This is AMD Zen2 (Ryzen 5 4500U specifically), in a HP Probook 445 G7. > > > > > > This

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

2025-03-14 Thread dmkhn
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. Patch 2 adds new symbol APIC_VECTOR_VALID and makes use

[PATCH v9 4/8] xen/arm: smmuv2: Add PCI devices support for SMMUv2

2025-03-14 Thread Mykyta Poturai
From: Oleksandr Andrushchenko Implement support for PCI devices in the SMMU driver. Make arm_smmu_master structure to hold a pointer to the device to allow it to hold PCI devices. Trigger iommu-map parsing when new PCI device is added. Add checks to assign/deassign functions to ensure PCI devices

[PATCH v9 7/8] xen/arm: enable dom0 to use PCI devices with pci-passthrough=no

2025-03-14 Thread Mykyta Poturai
From: Stewart Hildebrand Enable the use of IOMMU + PCI in dom0 without having to specify "pci-passthrough=yes". We rely on dom0 to initialize the PCI controller and perform a PHYSDEVOP_pci_device_add call to add each device to SMMU. Enable pci_init() for initializing Xen's internal PCI subsystem

Re: [PATCH v4 12/17] hw/xen: add stubs for various functions

2025-03-14 Thread Anthony PERARD
On Thu, Mar 13, 2025 at 09:38:58AM -0700, Pierrick Bouvier wrote: > Those functions are used by system/physmem.c, and are called only if > xen is enabled (which happens only if CONFIG_XEN is not set). You mean, 's/is not set/is set/'? > > So we can crash in case those are called. > > Acked-by: R

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

2025-03-14 Thread Mykyta Poturai
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 the existing iommu_add_dt_device API, except it handles PCI

[PATCH v9 1/8] iommu/arm: Add iommu_dt_xlate()

2025-03-14 Thread Mykyta Poturai
From: Oleksandr Tyshchenko Move code for processing DT IOMMU specifier to a separate helper. This helper will be re-used for adding PCI devices by the subsequent patches as we will need exact the same actions for processing DT PCI-IOMMU specifier. Signed-off-by: Oleksandr Tyshchenko Signed-off-

Re: [PATCH] x86/irq: use NR_ISAIRQS instead of open-coded value

2025-03-14 Thread Jan Beulich
On 14.03.2025 10:14, Andrew Cooper wrote: > On 14/03/2025 1:20 am, dm...@proton.me wrote: >> Replace the open-coded value 16 with the NR_ISAIRQS symbol to enhance >> readability. >> >> No functional changes. >> >> Signed-off-by: Denis Mukhin > > There are currently very few uses of NR_ISAIRQS, an

Re: [PATCH v9 2/3] tools/xenstored: use unique_id to identify new domain with same domid

2025-03-14 Thread Andrew Cooper
On 14/03/2025 12:18 pm, Juergen Gross wrote: > Use the new unique_id of a domain in order to detect that a domain > has been replaced with another one reusing the doamin-id of the old domain. > domain. > > While changing the related code, switch from "dom_invalid" to > "dom_valid" in order to avo

Re: [PATCH v4 2/3] x86:monitor: control monitor.c build with CONFIG_VM_EVENT option

2025-03-14 Thread Sergiy Kibrik
14.03.25 13:11, Jan Beulich: On 14.03.2025 06:23, Sergiy Kibrik wrote: Replace more general CONFIG_HVM option with CONFIG_VM_EVENT which is more relevant and specific to monitoring. This is only to clarify at build level to which subsystem this file belongs. No functional change here, as VM_EVE

Re: [PATCH v4 12/17] hw/xen: add stubs for various functions

2025-03-14 Thread Pierrick Bouvier
On 3/14/25 06:35, Anthony PERARD wrote: On Thu, Mar 13, 2025 at 09:38:58AM -0700, Pierrick Bouvier wrote: Those functions are used by system/physmem.c, and are called only if xen is enabled (which happens only if CONFIG_XEN is not set). You mean, 's/is not set/is set/'? Right, I'll update th

Re: [PATCH] ci: add yet another HW runner

2025-03-14 Thread Stefano Stabellini
On Fri, 14 Mar 2025, Marek Marczykowski-Górecki wrote: > This is AMD Zen2 (Ryzen 5 4500U specifically), in a HP Probook 445 G7. > > This one has working S3, so add a test for it here. > > Signed-off-by: Marek Marczykowski-Górecki > --- > Cc: Jan Beulich > Cc: Andrew Cooper > > The suspend tes

Re: [PATCH v4] xen/console: make console buffer size configurable

2025-03-14 Thread Andrew Cooper
On 11/03/2025 7:09 am, dm...@proton.me wrote: > diff --git a/docs/misc/xen-command-line.pandoc > b/docs/misc/xen-command-line.pandoc > index 89db6e83be..a471a9f7ce 100644 > --- a/docs/misc/xen-command-line.pandoc > +++ b/docs/misc/xen-command-line.pandoc > @@ -425,10 +425,11 @@ The following are e

Re: [PATCH v9 2/3] tools/xenstored: use unique_id to identify new domain with same domid

2025-03-14 Thread Jürgen Groß
On 14.03.25 13:58, Jason Andryuk wrote: On 2025-03-14 08:18, Juergen Gross wrote: Use the new unique_id of a domain in order to detect that a domain has been replaced with another one reusing the doamin-id of the old domain. While changing the related code, switch from "dom_invalid" to "dom_val

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

2025-03-14 Thread Andrew Cooper
On 13/03/2025 2:39 am, dm...@proton.me wrote: > diff --git a/xen/arch/x86/hvm/Kconfig b/xen/arch/x86/hvm/Kconfig > new file mode 100644 > index 00..2ca664f36f > --- /dev/null > +++ b/xen/arch/x86/hvm/Kconfig > @@ -0,0 +1,76 @@ > +menuconfig HVM > + bool "HVM support" > + depends on

Re: [PATCH 1/2] hw/xen: Fix xen_bus_realize() error handling

2025-03-14 Thread Stefano Stabellini
On Fri, 14 Mar 2025, Markus Armbruster wrote: > The Error ** argument must be NULL, &error_abort, &error_fatal, or a > pointer to a variable containing NULL. Passing an argument of the > latter kind twice without clearing it in between is wrong: if the > first call sets an error, it no longer poin

Re: [PATCH 2/2] hw/xen: Downgrade a xen_bus_realize() non-error to warning

2025-03-14 Thread Stefano Stabellini
On Fri, 14 Mar 2025, Markus Armbruster wrote: > xen_bus_realize() reports a failure to set up a watch as error, but it > doesn't treat it as one: it simply continues. Report a warning > instead. > > Signed-off-by: Markus Armbruster Acked-by: Stefano Stabellini > --- > hw/xen/xen-bus.c | 7 +

[PATCH v2 0/4] track memory used by balloon drivers

2025-03-14 Thread Nico Pache
This series introduces a way to track memory used by balloon drivers. Add a NR_BALLOON_PAGES counter to track how many pages are reclaimed by the balloon drivers. First add the accounting, then updates the balloon drivers (virtio, Hyper-V, VMware, Pseries-cmm, and Xen) to maintain this counter. Th

[PATCH v2 4/4] xen: balloon: update the NR_BALLOON_PAGES state

2025-03-14 Thread Nico Pache
Update the NR_BALLOON_PAGES counter when pages are added to or removed from the Xen balloon. Signed-off-by: Nico Pache --- drivers/xen/balloon.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index 163f7f1d70f1..65d4e7fa1eb8 100644 --- a/dri

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

2025-03-14 Thread Roger Pau Monné
On Fri, Mar 14, 2025 at 09:04:55AM +0100, Jan Beulich wrote: > On 13.03.2025 18:48, Roger Pau Monné wrote: > > On Wed, Mar 12, 2025 at 03:50:17PM -0400, Stewart Hildebrand wrote: > >> @@ -585,10 +601,31 @@ static void cf_check bar_write( > >> { > >> /* If the value written is the curr

Re: [PATCH 3/7] x86/dom0: placate GCC 12 compile-time errors with UBSAN and PVH_GUEST

2025-03-14 Thread Jan Beulich
On 13.03.2025 16:30, Roger Pau Monne wrote: > When building Xen with GCC 12 with UBSAN and PVH_GUEST both enabled the > compiler emits the following errors: > > arch/x86/setup.c: In function '__start_xen': > arch/x86/setup.c:1504:19: error: 'consider_modules' reading 40 bytes from a > region of s

Re: [PATCH 2/7] x86/wait: prevent duplicated assembly labels

2025-03-14 Thread Jan Beulich
On 13.03.2025 16:30, Roger Pau Monne wrote: > When enabling UBSAN with clang, the following error is triggered during the > build: > > common/wait.c:154:9: error: symbol '.L_wq_resume' is already defined > 154 | "push %%rbx; push %%rbp; push %%r12;" > | ^ > :1:121: note: in

Re: [PATCH 10/10] arm/mpu: Create the skeleton for MPU compilation

2025-03-14 Thread Orzel, Michal
On 12/03/2025 14:52, Luca Fancellu wrote: > > > This commit introduces the skeleton for the MPU memory management > subsystem that allows the compilation. You forgot to mention that you're talking about Arm64 only. For Arm32, Ayan has a series containing a few patches to enable compilation. P

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

2025-03-14 Thread Jan Beulich
On 14.03.2025 09:21, Roger Pau Monné wrote: > On Fri, Mar 14, 2025 at 09:04:55AM +0100, Jan Beulich wrote: >> On 13.03.2025 18:48, Roger Pau Monné wrote: >>> On Wed, Mar 12, 2025 at 03:50:17PM -0400, Stewart Hildebrand wrote: @@ -585,10 +601,31 @@ static void cf_check bar_write( { >>

Re: [PATCH 09/10] xen/arm: introduce Kconfig HAS_PAGING_MEMPOOL

2025-03-14 Thread Luca Fancellu
Hi Michal, > On 14 Mar 2025, at 07:58, Orzel, Michal wrote: > > > > On 12/03/2025 14:52, 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 > NIT: I

Re: [PATCH 3/7] x86/dom0: placate GCC 12 compile-time errors with UBSAN and PVH_GUEST

2025-03-14 Thread Jan Beulich
On 14.03.2025 09:27, Roger Pau Monné wrote: > On Fri, Mar 14, 2025 at 09:10:59AM +0100, Jan Beulich wrote: >> On 13.03.2025 16:30, Roger Pau Monne wrote: >>> When building Xen with GCC 12 with UBSAN and PVH_GUEST both enabled the >>> compiler emits the following errors: >>> >>> arch/x86/setup.c: In

[PATCH 07/11] xen/page_alloc: Set node affinity when claiming pages from an exact node

2025-03-14 Thread Alejandro Vallejo
Set the domain's node affinity to the claimed node if the claim specified an exact node. Do it immediately before making any changes in case setting the affinity fails (even though it shouldn't). This allows preferentially allocating from the closest NUMA node when "exact" is not specified (e.g: p

Re: [PATCH] x86/irq: use NR_ISAIRQS instead of open-coded value

2025-03-14 Thread Denis Mukhin
On Friday, March 14th, 2025 at 2:14 AM, Andrew Cooper wrote: > > > On 14/03/2025 1:20 am, dm...@proton.me wrote: > > > Replace the open-coded value 16 with the NR_ISAIRQS symbol to enhance > > readability. > > > > No functional changes. > > > > Signed-off-by: Denis Mukhin dmuk...@ford.com >

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

2025-03-14 Thread dmkhn
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_VMX on INTEL respectively. Signed-off-by: Denis Mukhin ---

Re: [RFC PATCH v3 4/7] xen/arm: scmi: introduce SCI SCMI SMC multi-agent driver

2025-03-14 Thread Anthony PERARD
On Tue, Mar 11, 2025 at 01:16:15PM +0200, Grygorii Strashko wrote: > diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in > index 7edf272386e3..fc6041724a13 100644 > --- a/docs/man/xl.cfg.5.pod.in > +++ b/docs/man/xl.cfg.5.pod.in > @@ -3126,6 +3126,21 @@ single SCMI OSPM agent support.

[PATCH 10/11] tools/xl: Expose a "claim_on_node" setting in xl.cfg

2025-03-14 Thread Alejandro Vallejo
Expose a setting to explicitly select a NUMA node for created domains If the hypervisor can't reserve enough memory in the relevant NUMA node it fails the claim early. Also, disable automatic NUMA placement when this new option is enabled. Signed-off-by: Alejandro Vallejo --- tools/golang/xenli

[PATCH v5 01/17] exec/tswap: target code can use TARGET_BIG_ENDIAN instead of target_words_bigendian()

2025-03-14 Thread Pierrick Bouvier
Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/exec/tswap.h | 11 ++- cpu-target.c | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/exec/tswap.h b/include/exec/tswap.h index ecd4faef015..2683da0adb7 100644 --- a/include/ex

[PATCH v5 03/17] exec/memory_ldst: extract memory_ldst declarations from cpu-all.h

2025-03-14 Thread Pierrick Bouvier
They are now accessible through exec/memory.h instead, and we make sure all variants are available for common or target dependent code. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/exec/cpu-all.h | 12 include/exec/memory_ldst.h.inc | 4

[PATCH v5 04/17] exec/memory_ldst_phys: extract memory_ldst_phys declarations from cpu-all.h

2025-03-14 Thread Pierrick Bouvier
They are now accessible through exec/memory.h instead, and we make sure all variants are available for common or target dependent code. Move stl_phys_notdirty function as well. Cached endianness agnostic version rely on st/ld*_p, which is available through tswap.h. Reviewed-by: Richard Henderson

[PATCH 09/11] tools/xc: Add `node` argument to xc_domain_claim_pages()

2025-03-14 Thread Alejandro Vallejo
Add a node argument to make an exact-node claim. NUMA_NO_NODE means to make a regular any-node claim. No functional change. Signed-off-by: Alejandro Vallejo --- tools/include/xenctrl.h | 1 + tools/libs/ctrl/xc_domain.c | 13 - tools/libs/guest/xg_dom_x86.c | 8 +--- 3

[PATCH v5 06/17] codebase: prepare to remove cpu.h from exec/exec-all.h

2025-03-14 Thread Pierrick Bouvier
Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/tcg/tcg-op.h | 1 + target/ppc/helper_regs.h | 2 ++ hw/ppc/spapr_nested.c | 1 + hw/sh4/sh7750.c| 1 + page-vary-target.c | 2 +- target/ppc/tcg-excp_helper.c | 1 +

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

2025-03-14 Thread Pierrick Bouvier
Hi, one patch is missing review: [PATCH v5 12/17] hw/xen: add stubs for various functions. Regards, Pierrick On 3/14/25 10:31, Pierrick Bouvier wrote: The main goal of this series is to be able to call any memory ld/st function from code that is *not* target dependent. As a positive side effec

[PATCH v5 15/17] include/exec/memory: move devend functions to memory-internal.h

2025-03-14 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

[PATCH v5 10/17] system/kvm: make kvm_flush_coalesced_mmio_buffer() accessible for common code

2025-03-14 Thread Pierrick Bouvier
This function is used by system/physmem.c will be turn into common code in next commit. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/system/kvm.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/system/kvm.h b/include/system/kvm.h i

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

2025-03-14 Thread Pierrick Bouvier
Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/exec/ram_addr.h | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h index f5d574261a3..92e8708af76 100644 --- a/include/exec/ram_addr.h +++ b/inclu

[PATCH v5 13/17] system/physmem: compilation unit is now common to all targets

2025-03-14 Thread Pierrick Bouvier
Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- system/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/meson.build b/system/meson.build index eec07a94513..bd82ef132e7 100644 --- a/system/meson.build +++ b/system/meson.build @@ -3,7 +3,6 @

[PATCH v5 07/17] exec/exec-all: remove dependency on cpu.h

2025-03-14 Thread Pierrick Bouvier
Previous commit changed files relying transitively on it. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/exec/exec-all.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index dd5c40f2233..19b0eda44a7 100644 --- a/i

[PATCH v5 17/17] system/ioport: make compilation unit common

2025-03-14 Thread Pierrick Bouvier
Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- system/ioport.c| 1 - system/meson.build | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/system/ioport.c b/system/ioport.c index 55c2a752396..89daae9d602 100644 --- a/system/ioport.c +++ b/system/ioport.

[PATCH 05/11] xen: Create per-node outstanding claims

2025-03-14 Thread Alejandro Vallejo
Extends domain_set_outstanding_claims() to allow staking claims on an exact node. Also creates global per-node claim counts analogous to `outstanding_claims`. Note that the per-node counts can't replace the global one if we want exact-node claims to coexist with non-exact claims. Signed-off-by: Al

[PATCH 06/11] xen/page_alloc: Hook per-node claims to alloc_heap_pages()

2025-03-14 Thread Alejandro Vallejo
Extend the claim checks in alloc_heap_pages() to exact-node claims. The logic is slightly more complicated, so the patch moves it all to an auxiliary function. exact-node claims also follow global claims in order to ensure both can coexist in the same system. Signed-off-by: Alejandro Vallejo ---

[PATCH 04/11] xen: Add node argument to domain_{adjust_tot_pages,set_outstanding_pages}()

2025-03-14 Thread Alejandro Vallejo
domain_adjust_tot_pages() decreases the outstanding claims of a domain as pages are allocated, so that'll need to take into account the node in which an allocation is done. Deallocations just pass NUMA_NO_NODE. domain_set_outstanding_pages() takes the node on which to to stake an exact-node claim,

[PATCH 03/11] xen/page_alloc: Add static per-node counts of free pages

2025-03-14 Thread Alejandro Vallejo
These are effectively the sum of free memory in all zones of each node. It's an optimization to avoid doing that operation frequently in following patches that introduce exact-node claims. Signed-off-by: Alejandro Vallejo --- xen/common/page_alloc.c | 7 +++ 1 file changed, 7 insertions(+)

[PATCH 00/11] Add support for exact-node memory claims

2025-03-14 Thread Alejandro Vallejo
The Xen toolstack supports claiming memory ahead of allocating it with the intent of assisting bootstorms of massive VMs. This works ok for general VMs, but falls appart miserably whenever the toolstack attempts to force placement of specific NUMA nodes. This series extends the in-hypervisor claim

[PATCH 02/11] xen/page_alloc: Remove `claim` from domain_set_outstanding_pages()

2025-03-14 Thread Alejandro Vallejo
With a single global count for the claims it's easy to substract domain_tot_pages() from the claim so the number given in the hypercall is the real reservation of the domain. This is the current behaviour. However, a later patch introduces exact-node claims and those interact very poorly with such

[PATCH 08/11] xen/memory: Enable parsing NUMA node argument in XENMEM_claim_pages

2025-03-14 Thread Alejandro Vallejo
Extract a NUMA node from mem_flags. This _must_ be an exact node, and has the semantics of making a claim on a specific node. Signed-off-by: Alejandro Vallejo --- xen/common/memory.c | 23 --- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/xen/common/memory.c

Re: [PATCH v4 0/3] make build of vm_event/mem_access/monitor optional

2025-03-14 Thread Andrew Cooper
On 14/03/2025 5:19 am, Sergiy Kibrik wrote: > This series aims to provide a possibility to build Xen without mem_access and > related features. It is already largely covered by corresponding > CONFIG_MEM_ACCESS option, yet there're still some parts remaining. > Hopefully this would help to reduce d

[PATCH v5 12/17] hw/xen: add stubs for various functions

2025-03-14 Thread Pierrick Bouvier
Those symbols are used by system/physmem.c, and are called only if xen_enabled() (which happens only if CONFIG_XEN is set and xen is available). So we can crash the stubs in case those are called, as they are linked only when CONFIG_XEN is not set. Acked-by: Richard Henderson Acked-by: Anthony P

[PATCH] xen: Drop __text_section()

2025-03-14 Thread Andrew Cooper
This is an unnecessary indirection. Signed-off-by: Andrew Cooper --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné CC: Stefano Stabellini --- xen/include/xen/compiler.h | 1 - xen/include/xen/init.h | 6 +++--- 2 files changed, 3 insertions(+)

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

2025-03-14 Thread Andrew Cooper
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 --- CC: Jan Beulich CC: Roger Pau Monné --- xen/arch/x86/debug.c | 35 +

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

2025-03-14 Thread Andrew Cooper
... 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}_bit() are no longer in use, the seg_reg_{accessed,dirty}

[RFC PATCH v2] xen: add libafl-qemu fuzzer support

2025-03-14 Thread Volodymyr Babchuk
LibAFL, which is a part of AFL++ project is a instrument that allows us to perform fuzzing on beremetal code (Xen hypervisor in this case) using QEMU as an emulator. It employs QEMU's ability to create snapshots to run many tests relatively quickly: system state is saved right before executing a ne

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

2025-03-14 Thread dmkhn
Rename NR_ISAIRQS to NR_ISA_IRQS to enhance readability. No functional changes. Signed-off-by: Denis Mukhin --- xen/arch/x86/hvm/hvm.c | 4 ++-- xen/arch/x86/hvm/vpt.c | 2 +- xen/arch/x86/include/asm/hvm/irq.h | 4 ++-- xen/arch/x86/physdev.c | 2 +- xen/dri

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

2025-03-14 Thread dmkhn
Replace the open-coded value 16 with the NR_ISA_IRQS symbol to enhance readability. No functional changes. Signed-off-by: Denis Mukhin --- xen/arch/x86/hvm/dm.c | 2 +- xen/arch/x86/hvm/irq.c | 17 + xen/arch/x86/hvm/vpic.c| 4 ++-- xen/arch/x86/includ

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

2025-03-14 Thread Denis Mukhin
On Friday, March 14th, 2025 at 1:20 PM, Andrew Cooper wrote: > > > On 13/03/2025 2:39 am, dm...@proton.me wrote: > > > diff --git a/xen/arch/x86/hvm/Kconfig b/xen/arch/x86/hvm/Kconfig > > new file mode 100644 > > index 00..2ca664f36f > > --- /dev/null > > +++ b/xen/arch/x86/hvm/Kconfi

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

2025-03-14 Thread Jan Beulich
On 13.03.2025 18:48, Roger Pau Monné wrote: > On Wed, Mar 12, 2025 at 03:50:17PM -0400, Stewart Hildebrand wrote: >> @@ -585,10 +601,31 @@ static void cf_check bar_write( >> { >> /* If the value written is the current one avoid printing a >> warning. */ >> if ( val != (uint3

Re: [PATCH 6/6] symbols: centralize and re-arrange $(all_symbols) calculation

2025-03-14 Thread Jan Beulich
On 13.03.2025 18:02, Andrew Cooper wrote: > On 13/03/2025 1:55 pm, Jan Beulich wrote: >> For one there's no need for each architecture to have the same logic. >> Move to the root Makefile, also to calculate just once. >> >> And then re-arrange to permit FAST_SYMBOL_LOOKUP to be independent of >> LI

Re: [PATCH 10/10] arm/mpu: Create the skeleton for MPU compilation

2025-03-14 Thread Orzel, Michal
On 14/03/2025 09:38, Luca Fancellu wrote: > > > Hi Michal, > >> On 14 Mar 2025, at 08:27, Orzel, Michal wrote: >> >> >> >> On 12/03/2025 14:52, Luca Fancellu wrote: >>> >>> >>> This commit introduces the skeleton for the MPU memory management >>> subsystem that allows the compilation. >> You

Re: [PATCH 3/7] x86/dom0: placate GCC 12 compile-time errors with UBSAN and PVH_GUEST

2025-03-14 Thread Roger Pau Monné
On Fri, Mar 14, 2025 at 09:10:59AM +0100, Jan Beulich wrote: > On 13.03.2025 16:30, Roger Pau Monne wrote: > > When building Xen with GCC 12 with UBSAN and PVH_GUEST both enabled the > > compiler emits the following errors: > > > > arch/x86/setup.c: In function '__start_xen': > > arch/x86/setup.c:

Re: [PATCH 09/10] xen/arm: introduce Kconfig HAS_PAGING_MEMPOOL

2025-03-14 Thread Orzel, Michal
On 12/03/2025 14:52, 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 NIT: I always wonder what "mapping" means in MPU world. Is this common to use this wo

Re: [PATCH 5/7] x86/ioremap: prevent additions against the NULL pointer

2025-03-14 Thread Roger Pau Monné
On Thu, Mar 13, 2025 at 05:21:13PM +, Andrew Cooper wrote: > On 13/03/2025 3:30 pm, Roger Pau Monne wrote: > > This was reported by clang UBSAN as: > > > > UBSAN: Undefined behaviour in arch/x86/mm.c:6297:40 > > applying zero offset to null pointer > > [...] > > Xen call trace: > > [] R com

Re: [PATCH 10/10] arm/mpu: Create the skeleton for MPU compilation

2025-03-14 Thread Luca Fancellu
Hi Michal, > On 14 Mar 2025, at 08:27, Orzel, Michal wrote: > > > > On 12/03/2025 14:52, Luca Fancellu wrote: >> >> >> This commit introduces the skeleton for the MPU memory management >> subsystem that allows the compilation. > You forgot to mention that you're talking about Arm64 only. For

Re: [PATCH 6/7] x86/vga: fix mapping of the VGA text buffer

2025-03-14 Thread Roger Pau Monné
(resending because I seem to have inadvertently corrupted the Cc field) On Thu, Mar 13, 2025 at 07:39:58PM +, Andrew Cooper wrote: > On 13/03/2025 3:30 pm, Roger Pau Monne wrote: > > The call to ioremap_wc() in video_init() will always fail, because > > video_init() is called ahead of vm_init_

Re: [PATCH v1] drivers: Change amd_iommu struct to contain pci_sbdf_t, simplify code

2025-03-14 Thread Jan Beulich
On 14.03.2025 10:30, Andrew Cooper wrote: > On 14/03/2025 8:56 am, Jan Beulich wrote: >> On 14.03.2025 09:07, Andriy Sultanov wrote: >>> On Thu, 13 Mar 2025 at 19:59, Jason Andryuk wrote: On 2025-03-13 14:57, Andrii Sultanov wrote: > --- a/xen/drivers/passthrough/amd/iommu.h > +++ b/x

Re: [PATCH 2/7] x86/wait: prevent duplicated assembly labels

2025-03-14 Thread Jan Beulich
On 14.03.2025 11:12, Roger Pau Monné wrote: > On Fri, Mar 14, 2025 at 10:13:07AM +0100, Jan Beulich wrote: >> On 14.03.2025 10:05, Andrew Cooper wrote: >>> On 14/03/2025 8:44 am, Jan Beulich wrote: On 14.03.2025 09:30, Roger Pau Monné wrote: > On Fri, Mar 14, 2025 at 09:24:09AM +0100, Jan

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

2025-03-14 Thread Alejandro Vallejo
On Thu Mar 13, 2025 at 5:43 PM GMT, Stewart Hildebrand wrote: > The idea was that the unmap-then-map operation would appear atomic from > the guest's point of view. I've only queued up the unmap operation at > this point in the new logic. Due to the mentioned limitation in the BAR > mapping deferra

Re: [PATCH v4 3/3] xen: mem_access: conditionally compile vm_event.c & monitor.c

2025-03-14 Thread Jan Beulich
On 14.03.2025 06:25, Sergiy Kibrik wrote: > From: Stefano Stabellini > > Extend coverage of CONFIG_VM_EVENT option and make the build of VM events > and monitoring support optional. Also make MEM_PAGING option depend on > VM_EVENT > to document that mem_paging is relying on vm_event. > This is t

Re: [PATCH 2/7] x86/wait: prevent duplicated assembly labels

2025-03-14 Thread Andrew Cooper
On 14/03/2025 10:12 am, Roger Pau Monné wrote: > On Fri, Mar 14, 2025 at 10:13:07AM +0100, Jan Beulich wrote: >> But isn't it then going to be enough to latch &wqv->esp into a local >> variable, >> and use that in the asm() and in the subsequent if()? > I have the following diff which seems to pre

Re: [PATCH v4 2/3] x86:monitor: control monitor.c build with CONFIG_VM_EVENT option

2025-03-14 Thread Jan Beulich
On 14.03.2025 06:23, Sergiy Kibrik wrote: > Replace more general CONFIG_HVM option with CONFIG_VM_EVENT which is more > relevant and specific to monitoring. This is only to clarify at build level > to which subsystem this file belongs. > > No functional change here, as VM_EVENT depends on HVM. >

Re: [PATCH 6/7] x86/vga: fix mapping of the VGA text buffer

2025-03-14 Thread Jan Beulich
On 14.03.2025 11:39, Roger Pau Monné wrote: > (resending because I seem to have inadvertently corrupted the Cc field) > > On Thu, Mar 13, 2025 at 07:39:58PM +, Andrew Cooper wrote: >> On 13/03/2025 3:30 pm, Roger Pau Monne wrote: >>> The call to ioremap_wc() in video_init() will always fail, b

Re: [PATCH 2/7] x86/wait: prevent duplicated assembly labels

2025-03-14 Thread Jan Beulich
On 14.03.2025 10:06, Roger Pau Monné wrote: > On Fri, Mar 14, 2025 at 09:44:10AM +0100, Jan Beulich wrote: >> On 14.03.2025 09:30, Roger Pau Monné wrote: >>> On Fri, Mar 14, 2025 at 09:24:09AM +0100, Jan Beulich wrote: On 13.03.2025 16:30, Roger Pau Monne wrote: > When enabling UBSAN with

Re: [PATCH] xen/pciback: Remove unused pcistub_get_pci_dev

2025-03-14 Thread Juergen Gross
On 07.03.25 01:47, li...@treblig.org wrote: From: "Dr. David Alan Gilbert" pcistub_get_pci_dev() was added in 2009 as part of: commit 30edc14bf39a ("xen/pciback: xen pci backend driver.") Remove it. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Juergen Gross Juergen OpenPGP_0xB0D

Re: [PATCH v1 01/19] xen: introduce CONFIG_SYSCTL

2025-03-14 Thread Alejandro Vallejo
On Thu Mar 13, 2025 at 4:24 PM GMT, Jan Beulich wrote: > On 13.03.2025 11:58, Alejandro Vallejo wrote: > > Hi, > > > > On Wed Mar 12, 2025 at 4:06 AM GMT, Penny Zheng wrote: > >> From: Stefano Stabellini > >> > > > > Commit message? > > > >> Signed-off-by: Stefano Stabellini > >> Signed-off-by

Re: [PATCH 2/7] x86/wait: prevent duplicated assembly labels

2025-03-14 Thread Andrew Cooper
On 14/03/2025 8:44 am, Jan Beulich wrote: > On 14.03.2025 09:30, Roger Pau Monné wrote: >> On Fri, Mar 14, 2025 at 09:24:09AM +0100, Jan Beulich wrote: >>> On 13.03.2025 16:30, Roger Pau Monne wrote: When enabling UBSAN with clang, the following error is triggered during the build: >

Re: [PATCH v1] drivers: Change amd_iommu struct to contain pci_sbdf_t, simplify code

2025-03-14 Thread Andrew Cooper
On 14/03/2025 8:56 am, Jan Beulich wrote: > On 14.03.2025 09:07, Andriy Sultanov wrote: >> On Thu, 13 Mar 2025 at 19:59, Jason Andryuk wrote: >>> On 2025-03-13 14:57, Andrii Sultanov wrote: --- a/xen/drivers/passthrough/amd/iommu.h +++ b/xen/drivers/passthrough/amd/iommu.h @@ -77,8

Re: [PATCH 3/7] x86/dom0: placate GCC 12 compile-time errors with UBSAN and PVH_GUEST

2025-03-14 Thread Roger Pau Monné
On Fri, Mar 14, 2025 at 09:33:01AM +0100, Jan Beulich wrote: > On 14.03.2025 09:27, Roger Pau Monné wrote: > > On Fri, Mar 14, 2025 at 09:10:59AM +0100, Jan Beulich wrote: > >> On 13.03.2025 16:30, Roger Pau Monne wrote: > >>> When building Xen with GCC 12 with UBSAN and PVH_GUEST both enabled the

Re: [PATCH 2/7] x86/wait: prevent duplicated assembly labels

2025-03-14 Thread Roger Pau Monné
On Fri, Mar 14, 2025 at 09:44:10AM +0100, Jan Beulich wrote: > On 14.03.2025 09:30, Roger Pau Monné wrote: > > On Fri, Mar 14, 2025 at 09:24:09AM +0100, Jan Beulich wrote: > >> On 13.03.2025 16:30, Roger Pau Monne wrote: > >>> When enabling UBSAN with clang, the following error is triggered during

Re: [PATCH 2/7] x86/wait: prevent duplicated assembly labels

2025-03-14 Thread Jan Beulich
On 14.03.2025 10:05, Andrew Cooper wrote: > On 14/03/2025 8:44 am, Jan Beulich wrote: >> On 14.03.2025 09:30, Roger Pau Monné wrote: >>> On Fri, Mar 14, 2025 at 09:24:09AM +0100, Jan Beulich wrote: On 13.03.2025 16:30, Roger Pau Monne wrote: > When enabling UBSAN with clang, the following

Re: [PATCH] x86/irq: use NR_ISAIRQS instead of open-coded value

2025-03-14 Thread Andrew Cooper
On 14/03/2025 1:20 am, dm...@proton.me wrote: > Replace the open-coded value 16 with the NR_ISAIRQS symbol to enhance > readability. > > No functional changes. > > Signed-off-by: Denis Mukhin There are currently very few uses of NR_ISAIRQS, and you're about tripling that. Please could you do a p

Re: [PATCH] x86/irq: use NR_ISAIRQS instead of open-coded value

2025-03-14 Thread Andrew Cooper
On 14/03/2025 8:51 am, Jan Beulich wrote: > On 14.03.2025 02:20, dm...@proton.me wrote: >> Replace the open-coded value 16 with the NR_ISAIRQS symbol to enhance >> readability. >> >> No functional changes. >> >> Signed-off-by: Denis Mukhin >> --- >> xen/arch/x86/hvm/dm.c | 2 +- >> xen/

Re: [PATCH] x86/irq: use NR_ISAIRQS instead of open-coded value

2025-03-14 Thread Andrew Cooper
On 14/03/2025 9:16 am, Jan Beulich wrote: > On 14.03.2025 10:14, Andrew Cooper wrote: >> On 14/03/2025 1:20 am, dm...@proton.me wrote: >>> Replace the open-coded value 16 with the NR_ISAIRQS symbol to enhance >>> readability. >>> >>> No functional changes. >>> >>> Signed-off-by: Denis Mukhin >> Th

Re: [PATCH] xenfs/xensyms: respect hypervisor's "next" indication

2025-03-14 Thread Juergen Gross
On 12.03.25 16:32, Jan Beulich wrote: The interface specifies the symnum field as an input and output; the hypervisor sets it to the next sequential symbol's index. xensyms_next() incrementing the position explicitly (and xensyms_next_sym() decrementing it to "rewind") is only correct as long as

Re: [PATCH v2] xen: Add support for XenServer 6.1 platform device

2025-03-14 Thread Juergen Gross
On 07.03.25 12:14, Frediano Ziglio wrote: Hi, after all discussions on this thread and Xen-devel, can we agree that this patch is good as it is and can be merged upstream? Just to make it clear, it was already acked. Will add it for 6.15. Juergen OpenPGP_0xB0DE9DD628BF132F.asc Descripti

Re: [PATCH 5/6] symbols: arrange to know where functions end

2025-03-14 Thread Jan Beulich
On 13.03.2025 18:13, Andrew Cooper wrote: > On 13/03/2025 4:48 pm, Jan Beulich wrote: >> On 13.03.2025 17:39, Andrew Cooper wrote: >>> On 13/03/2025 1:54 pm, Jan Beulich wrote: When determining the symbol for a given address (e.g. for the %pS logging format specifier), so far the size of

Re: [PATCH v3 2/2] x86/iommu: avoid MSI address and data writes if IRT index hasn't changed

2025-03-14 Thread Roger Pau Monné
On Mon, Mar 10, 2025 at 11:51:09AM +0100, Jan Beulich wrote: > On 10.03.2025 10:55, Roger Pau Monne wrote: > > Attempt to reduce the MSI entry writes, and the associated checking whether > > memory decoding and MSI-X is enabled for the PCI device, when the MSI data > > hasn't changed. > > > > When

Re: [PATCH v1] drivers: Change amd_iommu struct to contain pci_sbdf_t, simplify code

2025-03-14 Thread Andriy Sultanov
On Thu, 13 Mar 2025 at 19:59, Jason Andryuk wrote: > > On 2025-03-13 14:57, Andrii Sultanov wrote: > > Following on from 250d87dc, struct amd_iommu has its seg and bdf fields > > backwards with relation to pci_sbdf_t. Swap them around, and simplify the > > expressions regenerating an sbdf_t from s

Re: [PATCH v1] drivers: Change amd_iommu struct to contain pci_sbdf_t, simplify code

2025-03-14 Thread Andriy Sultanov
On Thu, 13 Mar 2025 at 20:16, Andrew Cooper wrote: > > On 13/03/2025 6:57 pm, Andrii Sultanov wrote: > > Following on from 250d87dc, struct amd_iommu has its seg and bdf fields > > backwards with relation to pci_sbdf_t. Swap them around, and simplify the > > expressions regenerating an sbdf_t from

Re: [PATCH 5/7] x86/ioremap: prevent additions against the NULL pointer

2025-03-14 Thread Andrew Cooper
On 14/03/2025 8:43 am, Roger Pau Monné wrote: > On Thu, Mar 13, 2025 at 05:21:13PM +, Andrew Cooper wrote: >> On 13/03/2025 3:30 pm, Roger Pau Monne wrote: >>> This was reported by clang UBSAN as: >>> >>> UBSAN: Undefined behaviour in arch/x86/mm.c:6297:40 >>> applying zero offset to null point

[PATCH v9 2/3] tools/xenstored: use unique_id to identify new domain with same domid

2025-03-14 Thread Juergen Gross
Use the new unique_id of a domain in order to detect that a domain has been replaced with another one reusing the doamin-id of the old domain. While changing the related code, switch from "dom_invalid" to "dom_valid" in order to avoid double negation and use "bool" as type for it. Signed-off-by:

[PATCH v9 3/3] tools/xenstored: use xenmanage_poll_changed_domain()

2025-03-14 Thread Juergen Gross
Instead of checking each known domain after having received a VIRQ_DOM_EXC event, use the new xenmanage_poll_changed_domain() function for directly getting the domid of a domain having changed its state. A test doing "xl shutdown" of 1000 guests has shown to reduce the consumed cpu time of xenstor

[PATCH v9 1/3] docs: update xenstore migration stream definition

2025-03-14 Thread Juergen Gross
In order to close a race window for Xenstore live update when using the new unique_id of domains, the migration stream needs to contain this unique_id for each domain known by Xenstore. Signed-off-by: Juergen Gross --- V8: - new patch V9: - instead of using an offset, use a flag for unique_id pre

[PATCH 2/2] hw/xen: Downgrade a xen_bus_realize() non-error to warning

2025-03-14 Thread Markus Armbruster
xen_bus_realize() reports a failure to set up a watch as error, but it doesn't treat it as one: it simply continues. Report a warning instead. Signed-off-by: Markus Armbruster --- hw/xen/xen-bus.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/xen/xen-bus.c b/hw/x

[PATCH 1/2] hw/xen: Fix xen_bus_realize() error handling

2025-03-14 Thread Markus Armbruster
The Error ** argument must be NULL, &error_abort, &error_fatal, or a pointer to a variable containing NULL. Passing an argument of the latter kind twice without clearing it in between is wrong: if the first call sets an error, it no longer points to NULL for the second call. xen_bus_realize() is

  1   2   >