Re: [PATCH v2] systemd: Add hooks to stop/start xen-watchdog on suspend/resume

2025-07-25 Thread Mykola Kvach
On Fri, Jul 25, 2025 at 5:04 PM Anthony PERARD wrote: > > On Thu, Jul 17, 2025 at 11:16:58PM +0300, Mykola Kvach wrote: > > diff --git a/m4/systemd.m4 b/m4/systemd.m4 > > index ab12ea313d..ee684d3391 100644 > > --- a/m4/systemd.m4 > > +++ b/m4/systemd.m4 > > @@ -28,6 +28,12 @@ AC_DEFUN([AX_SYSTEMD

[PATCH v5 11/11] tools/xenstored: Remove hardcoded implicit path

2025-07-25 Thread Jason Andryuk
Update get_implicit_path to return the correct value for a non-dom0 xenstored domain. Signed-off-by: Jason Andryuk Reviewed-by: Juergen Gross --- v5: R-b: Juergen --- tools/xenstored/domain.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/xenstored/domain.c b/to

[PATCH v5 09/11] tools/xenstored: Rename dom0_domid to store_domid

2025-07-25 Thread Jason Andryuk
The dom0_domid variable is misnamed and conflates purposes. If we have xenstored running in a Linux domain that is not dom0, this variable controls the lookup of /proc/xen/xsd_kva and the event channel. Rename to store_domid to better show its purpose. One implication of this change is that the

[PATCH v5 02/11] tools/manage: Expose domain capabilities

2025-07-25 Thread Jason Andryuk
Add an additional "caps" argument to the libxenmanage functions to obtain a domains capabilities - control, hardware, and xenstore. Update the xenstored callers at the same time. Signed-off-by: Jason Andryuk Reviewed-by: Juergen Gross --- v2: Add Juergen's R-b --- tools/include/xenmanage.h | 1

[PATCH v5 05/11] tools/xenstored: Read event channel from xenstored page

2025-07-25 Thread Jason Andryuk
Make introduce_domain() use an event channel from the the xenstore page. It is only used if non-zero. Otherwise the passed in event channel port is used. The is useful for a xenstored stubdom to configure domains autonomously. Signed-off-by: Jason Andryuk Reviewed-by: Juergen Gross --- v4: R-b

[PATCH v5 10/11] tools/xenstored: Remove stubdom special casing

2025-07-25 Thread Jason Andryuk
posix.c and minios.c implement the same named functions serving slightly different purposes. For xenbus_map() posix.c maps the local /dev/xen/xsd_kva minios.c maps dom0 via grant and there is open coding for stub_domid in map_interface. Change xenbus_map() to map the local domain's interface. Th

[PATCH v5 04/11] xen/dom0less: store xenstore event channel in page

2025-07-25 Thread Jason Andryuk
Write the associated event channel into the xenstore page so xenstored can read it. xenstored can map the grant by the reserved grant table entry, and then read out the event channel and bind it. This eliminates the need for an additional mechanism to discover the event channel. Signed-off-by: J

[PATCH v5 07/11] tools/xenstored: Auto-introduce domains

2025-07-25 Thread Jason Andryuk
Replace dom0_init() with init_domains() which uses libxenmanage to iterate through all existing domains, storing them in a list. The xenstore domain is introduced first, and then all the other domains are introduced. The xenstore domain needs to be introduced first to setup structures needed for

[PATCH v5 08/11] tools/xenstored: Use priv_domid for manual nodes and permission

2025-07-25 Thread Jason Andryuk
Usually, priv_domid == dom0_domid == 0, and that is what is expected. If we rename s/dom0_domid/store_domid/, it seems more likely we want to actually have the priv_domid as the owner. That leads to follow on changes to ensure that the priv_domid is created first. If priv_domid is unset, set to d

[PATCH v5 00/11] xenstored patches from split hardware control

2025-07-25 Thread Jason Andryuk
This is a subset of patches focusing on xenstored changes from my split hardware control domain series. It should address the stubdom breakage from the previous series. stubdom was tested in gitlab-ci - xl list shows Domain-0 and Xenstore. "tools/xenstored: Use priv_domid for manual nodes and per

[PATCH v5 06/11] tools/xenstored: Add get_domain_evtchn() to find evtchn

2025-07-25 Thread Jason Andryuk
Add helpers to lookup the event channel for a domid. This hides some of the differences between dom0 and stubdom xenstored. Each version defines its own. It highlights the different meanings between get_xenbus_evtchn() in a stubdom, where it looks up dom0's event channel, and dom0, where it look

[PATCH v5 03/11] public/io: xs_wire: Include event channel in interface page

2025-07-25 Thread Jason Andryuk
Include the event channel in struct xenstore_domain_interface. This way the toolstack or xen can communicate the event channel to xenstored in memory xenstored already needs to access. xenstored maps the grant with the well known GNTTAB_RESERVED_XENSTORE index, so no further information is needed

[PATCH v5 01/11] xen: Add capabilities to get_domain_state

2025-07-25 Thread Jason Andryuk
Expose a domain's capabilities - control, hardware or xenstore - through stable get domain state hypercall. The xenstore domain can use this information to assign appropriate permissions on connections. Repurpose the 16bit pad field for this purpose. Signed-off-by: Jason Andryuk Reviewed-by: Ju

Re: [PATCH v4 09/12] tools/xenstored: Use priv_domid for manual nodes and permission

2025-07-25 Thread Jason Andryuk
On 2025-07-25 03:24, Jürgen Groß wrote: On 25.07.25 04:28, Jason Andryuk wrote: Usually, priv_domid == dom0_domid == 0, and that is what is expected. If we rename s/dom0_domid/store_domid/, it seems more likely we want to actually have the priv_domid as the owner. Yes, I agree. That leads t

Re: [PATCH v4 07/12] tools/xenstored: Auto-introduce domains

2025-07-25 Thread Jason Andryuk
On 2025-07-25 03:04, Jürgen Groß wrote: On 25.07.25 04:28, Jason Andryuk wrote: Replace dom0_init() with init_domains() which uses libxenmanage to iterate through all existing domains, storing them in a list.  The xenstore domain is introduced first, and then all the other domains are introduc

Re: [PATCH 4/4] tools/libxl: Remove unconditional XEN_DOMCTL_set_llc_colors hypercall

2025-07-25 Thread Stefano Stabellini
On Thu, 24 Jul 2025, Andrew Cooper wrote: > Hypercalls are not free; cache colouring is an experimental feature, and > ignoring an -EOPNOTSUPP is bad form. > > Now that Xen has been fixed to initialise colouring information correctly for > domains, xc_domain_set_llc_colors() only needs calling for

Re: [PATCH 1/4] xen/cache-col: Remove bogus cast in domain_llc_coloring_free()

2025-07-25 Thread Stefano Stabellini
On Fri, 25 Jul 2025, Jan Beulich wrote: > On 24.07.2025 18:23, Andrew Cooper wrote: > > --- a/xen/common/llc-coloring.c > > +++ b/xen/common/llc-coloring.c > > @@ -309,11 +309,8 @@ int domain_set_llc_colors(struct domain *d, > > > > void domain_llc_coloring_free(struct domain *d) > > { > > -

Re: [XEN PATCH v4] xen/arinc653: fix delay in the start of major frame

2025-07-25 Thread Dario Faggioli
On Thu, 2025-07-24 at 21:28 -0400, Stewart Hildebrand wrote: > On 7/24/25 18:33, Anderson Choi wrote: > > > > Fixes: 22787f2e107c ("ARINC 653 scheduler") > > Suggested-by: Stewart Hildebrand > > Suggested-by: Nathan Studer > > Signed-off-by: Anderson Choi > > Reviewed-by: Stewart Hildebrand >

Re: [XEN PATCH] xen/arinc653: fix delay in the start of major frame

2025-07-25 Thread Dario Faggioli
On Wed, 2025-07-09 at 09:08 +0900, Anderson Choi wrote: > ARINC653 specificaion requires partition scheduling to be > deterministic > and periodic over time. > > However, the use of current timestamp (now) as the baseline to > calculate > next_major_frame and next_switch_time introduces a delay in

Re: [RFC PATCH v1 00/10] Xen flamegraph (hypervisor stacktrace profile) support

2025-07-25 Thread Demi Marie Obenour
On 7/25/25 11:06, Edwin Török wrote: > Caveats: > * x86-only for now > * only tested on AMD EPYC 8124P > * Xen PMU support was broken to begin with on Xeon Silver 4514Y, so I > wasn't able to test there ('perf top' fails to parse samples). I'll > try to figure out what is wrong there separatel

Re: [PATCH] misra: address MISRA C Rule 18.3 compliance

2025-07-25 Thread Dmytro Prokopchuk1
On 7/23/25 16:58, Jan Beulich wrote: > On 23.07.2025 12:12, Dmytro Prokopchuk1 wrote: >> --- a/automation/eclair_analysis/ECLAIR/deviations.ecl >> +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl >> @@ -568,6 +568,14 @@ C99 Undefined Behaviour 45: Pointers that do not point >> into, or jus

[PATCH v1] xen/console: remove __printk_ratelimit()

2025-07-25 Thread dmkhn
From: Denis Mukhin __printk_ratelimit() is never used outside of the console driver. Remove it from the lib.h and merge with the public printk_ratelimit(). Not a functional change. Signed-off-by: Denis Mukhin --- xen/drivers/char/console.c | 29 - xen/include/xen/

[PATCH v10] xen/console: introduce domain_console struct

2025-07-25 Thread dmkhn
From: Denis Mukhin Introduce domain_console for grouping data structures used for integrating domain's diagnostic console with Xen's console driver. Group all pbuf-related data structures under domain_console. Rename the moved fields to plain .buf, .idx and .lock names, since all uses of the fi

[RESEND PATCH v3 1/1] kern/xen: Add Xen command line parsing

2025-07-25 Thread Aaron Rainbolt
Xen traditionally allows customizing guest behavior by passing arguments to the VM kernel via the kernel command line. This is no longer possible when using GRUB with Xen, as the kernel command line is decided by the GRUB configuration file within the guest, not data passed to the guest by Xen. To

[RESEND PATCH v3 0/1] kern/xen: Add Xen command line parsing

2025-07-25 Thread Aaron Rainbolt
The purpose of this patch is to allow the Xen hypervisor to pass extra data to GRUB in the form of a kernel command line, allowing the host to customize the boot process of the guest. The command line from Xen is parsed, and any variables within that start with the string `xen_grub_env_` are expose

Re: [PATCH v2 1/3] vpci: allow queueing of mapping operations

2025-07-25 Thread dmkhn
On Thu, Jul 24, 2025 at 09:47:24AM +0200, Jan Beulich wrote: > On 24.07.2025 05:42, dm...@proton.me wrote: > > On Thu, Jul 24, 2025 at 03:00:46AM +, dm...@proton.me wrote: > >> On Wed, Jul 23, 2025 at 12:37:41PM -0400, Stewart Hildebrand wrote: > >>> Introduce vPCI BAR mapping task queue. Decou

Re: [PATCH v2 2/2] xen/arm: smmuv3: fix xl pci-assignable-remove

2025-07-25 Thread dmkhn
On Fri, Jul 25, 2025 at 01:45:51PM -0400, Stewart Hildebrand wrote: > When attempting to xl pci-assignable-remove a PCI device, we encounter: > > $ xl pci-assignable-remove 00:01.0 > (XEN) SMMUv3: : not attached to domain 32753 > (XEN) d[IO]: deassign (:00:01.0) failed (-3) > libxl: error: li

Re: [PATCH v2 1/2] xen/arm: smmuv3: fix UB during deassign

2025-07-25 Thread dmkhn
On Fri, Jul 25, 2025 at 01:45:50PM -0400, Stewart Hildebrand wrote: > In arm_smmu_deassign_dev(), the return value from to_smmu_domain() is > NULL-checked. However, the implementation of to_smmu_domain() is a > container_of lookup, so the return value is unlikely to ever be NULL. In > case of a NUL

Re: [PATCH] xen: add missing noreturn attribute

2025-07-25 Thread Marek Marczykowski-Górecki
On Thu, Jul 24, 2025 at 06:06:28PM -0700, Stefano Stabellini wrote: > On Thu, 24 Jul 2025, Dmytro Prokopchuk1 wrote: > > These functions never return to their caller, > > causing a violation of MISRA C Rule 2.1: > > "A project shall not contain unreachable code". > > Add the `noreturn' attribute to

Re: [PATCH] hw/xen/xen_pt: fix missing include

2025-07-25 Thread Daniel P . Berrangé
On Fri, Jul 25, 2025 at 10:49:58AM -0700, Pierrick Bouvier wrote: > On 7/25/25 10:22 AM, Daniel P. Berrangé wrote: > > On Fri, Jul 25, 2025 at 09:57:49AM -0700, Pierrick Bouvier wrote: > > > FAILED: libqemu-i386-softmmu.a.p/hw_xen_xen_pt.c.o > > > ... > > > /home/user/.work/qemu/hw/xen/xen_pt.c: In

Re: [PATCH] iommu: restrict stratch page quarantining to specific iommu drivers

2025-07-25 Thread Stefano Stabellini
On Fri, 25 Jul 2025, Stewart Hildebrand wrote: > Scratch page quarantining is tied to specific IOMMU implementations, not > architectures, so tie it to AMD_IOMMU and INTEL_IOMMU instead of X86. > > Fixes: dd7e55a8848c ("iommu: restrict scratch page quarantining to x86") > Signed-off-by: Stewart Hi

Re: [PATCH] hw/xen/xen_pt: fix missing include

2025-07-25 Thread Pierrick Bouvier
On 7/25/25 10:22 AM, Daniel P. Berrangé wrote: On Fri, Jul 25, 2025 at 09:57:49AM -0700, Pierrick Bouvier wrote: FAILED: libqemu-i386-softmmu.a.p/hw_xen_xen_pt.c.o ... /home/user/.work/qemu/hw/xen/xen_pt.c: In function ‘xen_pt_need_gsi’: /home/user/.work/qemu/hw/xen/xen_pt.c:783:9: error: implic

[PATCH v2 2/2] xen/arm: smmuv3: fix xl pci-assignable-remove

2025-07-25 Thread Stewart Hildebrand
When attempting to xl pci-assignable-remove a PCI device, we encounter: $ xl pci-assignable-remove 00:01.0 (XEN) SMMUv3: : not attached to domain 32753 (XEN) d[IO]: deassign (:00:01.0) failed (-3) libxl: error: libxl_pci.c:910:libxl__device_pci_assignable_remove: failed to de-quarantine

[PATCH v2 1/2] xen/arm: smmuv3: fix UB during deassign

2025-07-25 Thread Stewart Hildebrand
In arm_smmu_deassign_dev(), the return value from to_smmu_domain() is NULL-checked. However, the implementation of to_smmu_domain() is a container_of lookup, so the return value is unlikely to ever be NULL. In case of a NULL argument to to_smmu_domain(), we will attempt to dereference the non-NULL

Re: [PATCH v1 4/6] vpci: add SR-IOV support for PVH Dom0

2025-07-25 Thread Teddy Astie
Le 25/07/2025 à 16:26, Mykyta Poturai a écrit : > From: Stewart Hildebrand > > This code is expected to only be used by privileged domains, > unprivileged domains should not get access to the SR-IOV capability. > > Implement RW handlers for PCI_SRIOV_CTRL register to dynamically > map/unmap VF BAR

Re: [PATCH 7/8] x86/public: Split the struct cpu_user_regs type

2025-07-25 Thread Roger Pau Monné
On Mon, Mar 24, 2025 at 10:47:29AM +0100, Jan Beulich wrote: > On 21.03.2025 16:11, Andrew Cooper wrote: > > On 17/03/2025 12:15 pm, Jan Beulich wrote: > >> 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

Re: [PATCH] hw/xen/xen_pt: fix missing include

2025-07-25 Thread Daniel P . Berrangé
On Fri, Jul 25, 2025 at 09:57:49AM -0700, Pierrick Bouvier wrote: > FAILED: libqemu-i386-softmmu.a.p/hw_xen_xen_pt.c.o > ... > /home/user/.work/qemu/hw/xen/xen_pt.c: In function ‘xen_pt_need_gsi’: > /home/user/.work/qemu/hw/xen/xen_pt.c:783:9: error: implicit declaration of > function ‘error_repor

[PATCH] hw/xen/xen_pt: fix missing include

2025-07-25 Thread Pierrick Bouvier
FAILED: libqemu-i386-softmmu.a.p/hw_xen_xen_pt.c.o ... /home/user/.work/qemu/hw/xen/xen_pt.c: In function ‘xen_pt_need_gsi’: /home/user/.work/qemu/hw/xen/xen_pt.c:783:9: error: implicit declaration of function ‘error_report’; did you mean ‘error_report_err’? [-Wimplicit-function-declaration] 78

[PATCH v2] misra: add deviations of MISRA C Rule 5.5

2025-07-25 Thread Dmytro Prokopchuk1
MISRA C Rule 5.5 states that: "Identifiers shall be distinct from macro names". Update ECLAIR configuration to deviate clashes: specify the macros that should be ignored. Update deviations.rst and rules.rst accordingly. Signed-off-by: Dmytro Prokopchuk --- v1: https://patchew.org/Xen/7e1c381d6f

[PATCH] iommu: restrict stratch page quarantining to specific iommu drivers

2025-07-25 Thread Stewart Hildebrand
Scratch page quarantining is tied to specific IOMMU implementations, not architectures, so tie it to AMD_IOMMU and INTEL_IOMMU instead of X86. Fixes: dd7e55a8848c ("iommu: restrict scratch page quarantining to x86") Signed-off-by: Stewart Hildebrand --- xen/drivers/passthrough/Kconfig | 2 +- 1

Re: [PATCH] iommu: restrict scratch page quarantining to x86

2025-07-25 Thread Stewart Hildebrand
On 7/25/25 04:01, Roger Pau Monné wrote: > On Thu, Jul 24, 2025 at 01:43:48PM -0400, Stewart Hildebrand wrote: >> All IOMMU_QUARANTINE_* options are exposed on Arm since 163c6b589879 >> ("xen/arm: pci: introduce PCI_PASSTHROUGH Kconfig option"). However, >> only NONE and BASIC are implemented in an

Re: [RFC PATCH v1 00/10] Xen flamegraph (hypervisor stacktrace profile) support

2025-07-25 Thread Edwin Torok
On Fri, Jul 25, 2025 at 4:07 PM Edwin Török wrote: > [...] > > Edwin Török (10): > pmu.h: add a BUILD_BUG_ON to ensure it fits within one page > arch-x86/pmu.h: document current memory layout for VPMU > arch-x86/pmu.h: convert ascii art drawing to Unicode > vpmu.c: factor out register conv

Re: [PATCH v4 06/12] tools/xenstored: Add get_domain_evtchn() to find evtchn

2025-07-25 Thread Jason Andryuk
On 2025-07-25 02:41, Jürgen Groß wrote: On 25.07.25 04:28, Jason Andryuk wrote: Add a helper to lookup the event channel for a domid.  This hides some of the differences between dom0 and stubdom xenstored. It highlights the different meanings between get_xenbus_evtchn() in a stubdom, where it l

[RFC PATCH v1 09/10] vpmu.c hypervisor stacktrace support in vPMU

2025-07-25 Thread Edwin Török
Signed-off-by: Edwin Török --- xen/arch/x86/cpu/vpmu.c | 53 +++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/cpu/vpmu.c b/xen/arch/x86/cpu/vpmu.c index 770f63f95a..ad02ab9dd8 100644 --- a/xen/arch/x86/cpu/vpmu.c +++ b/xen/arch/

[RFC LINUX PATCH v1 3/3] perf kvm: implement Xen hypervisor stacktraces

2025-07-25 Thread Edwin Török
Using the new VPMU 0.2 interface. This is backwards compatible with VPMU 0.1: the new 'struct xen_pmu_hv_stacktrace` is stored at the end of the page, and stacktrace_nr would be 0 on old hypervisors. Signed-off-by: Edwin Török --- arch/x86/events/core.c | 4 ++- arch/x86/xen/pmu.c | 73

[RFC PATCH v1 08/10] pmu.h: expose a hypervisor stacktrace feature

2025-07-25 Thread Edwin Török
For now this'll only be expected to work when the hypervisor is compiled with frame pointers, and only when the domain is privileged enough to profile Xen (i.e. it is the hardware domain running in HV or ALL modes). The stacktrace feature is a flag, rather than a new mode, and would simply report

[RFC PATCH v1 03/10] arch-x86/pmu.h: convert ascii art drawing to Unicode

2025-07-25 Thread Edwin Török
Use `aa2u` (ascii-art-to-unicode from Hackage) to convert to Unicode box drawing characters. The full list of supported drawing characters can be seen in the examples at: https://github.com/fmthoma/ascii-art-to-unicode/blob/master/src/Text/AsciiArt.hs For future maintenance: conversion can be don

[RFC PATCH v1 02/10] arch-x86/pmu.h: document current memory layout for VPMU

2025-07-25 Thread Edwin Török
There are nested structs, unions, padding and flexible array members. The interpretation of the flexible array members is all done with pointer arithmetic, it is useful to visualize the actual memory layout. The ascii-art drawing is compatible with ascii-art-to-unicode (aa2u) fro m hackage. No fu

[RFC PATCH v1 00/10] Xen flamegraph (hypervisor stacktrace profile) support

2025-07-25 Thread Edwin Török
I've long wanted to get stacktraces when profiling Xen, otherwise all you'd see is e.g. the address of memcpy, but without knowing which function called it you can't optimize it. Once you have stacktraces, even a simple low (prime) frequency timer based profile can show hotspots that would be opti

[RFC PATCH v1 04/10] vpmu.c: factor out register conversion

2025-07-25 Thread Edwin Török
A followup commit will use this to store the guest's regs when domid == DOMID_XEN. To avoid code duplication move the code into a function. No functional change. Signed-off-by: Edwin Török --- xen/arch/x86/cpu/vpmu.c | 49 ++--- 1 file changed, 26 insertions(

[RFC LINUX PATCH v1 1/3] perf kvm: introduce a hypervisor_callchain callback

2025-07-25 Thread Edwin Török
`perf kvm` currently assumes that it can construct a stacktrace by looking up stack pointer addresses in the current kernel's address space. That only works if the hypervisor is the same as the kernel (i.e. KVM), but doesn't work if the hypervisor is separate from the kernel (Xen, with Linux as Dom

[RFC PATCH v1 10/10] xen/tools/pyperf.py: example script to parse perf output

2025-07-25 Thread Edwin Török
Looks up symbols by parsing the output of 'perf script -i perf.data.kvm'. Note that addr2line is very slow, and invoking it for each symbol would results in the script taking several minutes to process a trace that only lasts a few seconds. Processing only unique addresses, and processing multiple

[RFC PATCH v1 06/10] arch-x86/pmu.h: convert ascii art diagram to Unicode

2025-07-25 Thread Edwin Török
Using `aa2u` tool. Signed-off-by: Edwin Török --- xen/include/public/arch-x86/pmu.h | 47 --- xen/include/public/pmu.h | 2 +- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/xen/include/public/arch-x86/pmu.h b/xen/include/public/arch-x86/p

[RFC PATCH v1 07/10] arch-x86/vpmu.c: store guest registers when domain_id == DOMID_XEN

2025-07-25 Thread Edwin Török
When Xen profiling is enabled (for HW domain only), then domain_id is set to DOMID_XEN, and Xen's IP is reported as the sample location. With VPMU >= 0.2 we can now report more information to help a guest construct a stacktrace, and store the guest's registers and domain_id into the new 'struct xe

[RFC LINUX PATCH v1 2/3] xen/{interface,xenpmu}.h: update with VPMU 0.2 from Xen

2025-07-25 Thread Edwin Török
Signed-off-by: Edwin Török --- arch/x86/include/asm/xen/interface.h | 100 +++ include/xen/interface/xenpmu.h | 56 +-- 2 files changed, 152 insertions(+), 4 deletions(-) diff --git a/arch/x86/include/asm/xen/interface.h b/arch/x86/include/asm/xen/inte

[RFC PATCH v1 01/10] pmu.h: add a BUILD_BUG_ON to ensure it fits within one page

2025-07-25 Thread Edwin Török
Linux already has a similar BUILD_BUG_ON. Currently this struct is ~224 bytes on x86-64. No functional change. Signed-off-by: Edwin Török --- xen/arch/x86/cpu/vpmu.c | 1 + xen/include/public/pmu.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/xen/arch/x86/cpu/vpmu.c b/xen/arch/x86/c

[RFC PATCH v1 05/10] pmu.h: introduce a stacktrace area

2025-07-25 Thread Edwin Török
The guest always allocates a full page that is mapped for 'struct xen_pmu_data' (there is no smaller mapping granularity). The existing struct contains a flexible array member that is used to store architectural performance counters on Intel (their number is dynamically determined from CPUID). AF

Re: [PATCH v1 3/6] vpci: rename and export vpci_bar_add_rangeset

2025-07-25 Thread Teddy Astie
Le 25/07/2025 à 16:26, Mykyta Poturai a écrit : > Export functions required for SR-IOV support. > > Signed-off-by: Mykyta Poturai > --- > xen/drivers/vpci/header.c | 8 > xen/include/xen/vpci.h| 2 ++ > 2 files changed, 6 insertions(+), 4 deletions(-) > > diff --git a/xen/drivers/

Re: [PATCH v1 2/6] vpci: rename and export vpci_guest_mem_bar_{read,write}

2025-07-25 Thread Teddy Astie
Le 25/07/2025 à 16:26, Mykyta Poturai a écrit : > From: Stewart Hildebrand > > Export functions required for SR-IOV support. > > Signed-off-by: Stewart Hildebrand > Signed-off-by: Mykyta Poturai Reviewed-by: Teddy Astie Thanks Teddy Astie | Vates XCP-ng Developer XCP-ng & Xen Orchestra - Vate

Re: [PATCH v1 1/6] vpci: rename and export vpci_modify_bars

2025-07-25 Thread Teddy Astie
Le 25/07/2025 à 16:26, Mykyta Poturai a écrit : > From: Stewart Hildebrand > > Export functions required for SR-IOV support. > > Signed-off-by: Stewart Hildebrand > Signed-off-by: Mykyta Poturai Reviewed-by: Teddy Astie Thanks Teddy Astie | Vates XCP-ng Developer XCP-ng & Xen Orchestra - V

Re: [PATCH v2 7/7] tools: allow to limit xenstore features via guest config

2025-07-25 Thread Nick Rosbrook
On Fri, Jul 25, 2025 at 9:20 AM Juergen Gross wrote: > > Add a guest config parameter "xenstore_feature_mask" allowing to limit > the Xenstore features the guest can see and use. This can be needed in > order to allow migrating a guest to a host running a Xenstore version > providing less features

[PATCH v1 1/6] vpci: rename and export vpci_modify_bars

2025-07-25 Thread Mykyta Poturai
From: Stewart Hildebrand Export functions required for SR-IOV support. Signed-off-by: Stewart Hildebrand Signed-off-by: Mykyta Poturai --- xen/drivers/vpci/header.c | 16 +--- xen/include/xen/vpci.h| 3 +++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/xen/d

[PATCH v1 3/6] vpci: rename and export vpci_bar_add_rangeset

2025-07-25 Thread Mykyta Poturai
Export functions required for SR-IOV support. Signed-off-by: Mykyta Poturai --- xen/drivers/vpci/header.c | 8 xen/include/xen/vpci.h| 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c index f33fb27bde..f947f65

[PATCH v1 6/6] vpci: add SR-IOV support for DomUs

2025-07-25 Thread Mykyta Poturai
From: Stewart Hildebrand SR-IOV virtual functions have simplified configuration space such as Vendor ID is derived from the physical function and Device ID comes from SR-IOV extended capability. Emulate those, so we can provide VID/DID pair for guests which use PCI passthrough for SR-IOV virtual

[PATCH v1 5/6] vpci: export vpci_init_capability_list()

2025-07-25 Thread Mykyta Poturai
From: Stewart Hildebrand Export functions required for SR-IOV support. Signed-off-by: Stewart Hildebrand Signed-off-by: Mykyta Poturai --- xen/drivers/vpci/header.c | 2 +- xen/include/xen/vpci.h| 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/xen/drivers/vpci/header.

[PATCH v1 4/6] vpci: add SR-IOV support for PVH Dom0

2025-07-25 Thread Mykyta Poturai
From: Stewart Hildebrand This code is expected to only be used by privileged domains, unprivileged domains should not get access to the SR-IOV capability. Implement RW handlers for PCI_SRIOV_CTRL register to dynamically map/unmap VF BARS. Recalculate BAR sizes before mapping VFs to account for p

[PATCH v1 0/6] Implement SR-IOV support for PVH

2025-07-25 Thread Mykyta Poturai
This series enables support for PCI SR-IOV capabilty for PVH domains. It allows Dom0 to enable and use SR-IOV virtual functions and for this functions to be passed to guests. To achieve this, handlers for SRIOV_CONTROL register and simplified handlers for VFs header were implemented. Core functio

[PATCH v1 2/6] vpci: rename and export vpci_guest_mem_bar_{read,write}

2025-07-25 Thread Mykyta Poturai
From: Stewart Hildebrand Export functions required for SR-IOV support. Signed-off-by: Stewart Hildebrand Signed-off-by: Mykyta Poturai --- xen/drivers/vpci/header.c | 20 +++- xen/include/xen/vpci.h| 6 ++ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git

Re: [PATCH v2] systemd: Add hooks to stop/start xen-watchdog on suspend/resume

2025-07-25 Thread Anthony PERARD
On Thu, Jul 17, 2025 at 11:16:58PM +0300, Mykola Kvach wrote: > diff --git a/m4/systemd.m4 b/m4/systemd.m4 > index ab12ea313d..ee684d3391 100644 > --- a/m4/systemd.m4 > +++ b/m4/systemd.m4 > @@ -28,6 +28,12 @@ AC_DEFUN([AX_SYSTEMD_OPTIONS], [ > [set directory for systemd modules load

[PATCH v5 2/2] xen/arm: allow translated iommu mappings

2025-07-25 Thread Stewart Hildebrand
From: Stefano Stabellini In preparation of exposing vITS to domUs, generalize arm_iommu_map_page and arm_iommu_unmap_page to allow ITS doorbell mappings with dfn != mfn. The mfn does not need to be passed to guest_physmap_remove_page since there is no mfn checking on the p2m_iommu_map_{rw,ro} p2

[PATCH v5 1/2] xen/arm: fix arm_iommu_map_page after f9f6b22abf1d

2025-07-25 Thread Stewart Hildebrand
From: Stefano Stabellini Up until f9f6b22abf1d "xen/arm: Map ITS doorbell register to IOMMU page tables" the only caller of iommu_map on ARM was grant_table.c which has a specific usage model and restrictions as described by the in-code comment in arm_iommu_map_page. f9f6b22abf1d introduced a se

Re: [PATCH v2 4/7] tools/xenstored: add server feature support

2025-07-25 Thread Jason Andryuk
On 2025-07-25 09:19, Juergen Gross wrote: Add per domain server features, which are initialized by the supported features at domain introduction, or by live update from the migration stream. This requires to add the DOMAIN_DATA record to the migration stream, but for now it will only contain the

[PATCH v2 7/7] tools: allow to limit xenstore features via guest config

2025-07-25 Thread Juergen Gross
Add a guest config parameter "xenstore_feature_mask" allowing to limit the Xenstore features the guest can see and use. This can be needed in order to allow migrating a guest to a host running a Xenstore version providing less features than the source host. Signed-off-by: Juergen Gross Reviewed-b

[PATCH v2 5/7] tools/xenstored: support SET/GET_FEATURE commands

2025-07-25 Thread Juergen Gross
Add support for XS_SET_FEATURE and XS_GET_FEATURE to xenstored. Signed-off-by: Juergen Gross Reviewed-by: Jason Andryuk --- tools/xenstored/core.c | 4 +++ tools/xenstored/domain.c | 60 tools/xenstored/domain.h | 8 ++ 3 files changed, 72 insert

[PATCH v2 2/7] tools/xenstored: support specification of migration stream version

2025-07-25 Thread Juergen Gross
In order to prepare xenstored supporting migration stream versions other than 1, add a parameter to the live update command allowing to specify the version of the migration stream. This will allow going back from xenstored using version 2 per default to a xenstored only accepting version 1. For n

[PATCH v2 3/7] tools/xenstored: add missing migration record definitions

2025-07-25 Thread Juergen Gross
Add all the missing migration record structures and defines to the xenstore_state.h header file. Update the version of the migration stream to "2". In order to allow receiving version 1 streams, change the version check of the header to reject only streams with a version higher than the current kn

[PATCH v2 0/7] tools: add support for domain specific Xenstore features

2025-07-25 Thread Juergen Gross
Add support for limiting the optional Xenstore features via domain configuration. This will be needed when adding features like limiting the scope of Xenstore watch events. This patch series is handling only the xl/libxl side, libxenstore and C Xenstore (xenstored and xenstore-stubdom). Oxenstored

[PATCH v2 6/7] tools/xl: add available Xenstore features to xl info output

2025-07-25 Thread Juergen Gross
Add the Xenstore feature value to the output of "xl info" in order to prepare for a future capability to limit Xenstore features visible by a guest. Signed-off-by: Juergen Gross Reviewed-by: Jason Andryuk --- tools/xl/Makefile | 3 ++- tools/xl/xl_info.c | 22 ++ 2 files c

[PATCH v2 4/7] tools/xenstored: add server feature support

2025-07-25 Thread Juergen Gross
Add per domain server features, which are initialized by the supported features at domain introduction, or by live update from the migration stream. This requires to add the DOMAIN_DATA record to the migration stream, but for now it will only contain the feature word. Advertise the Xenstore featur

[PATCH v2 1/7] tools/libs/store: add get- and set-feature related functions

2025-07-25 Thread Juergen Gross
Add functions for getting and setting Xenstore features to libxenstore: xs_get_features_supported(): return the features supported by the running Xenstore implementation as defined in xs_wire.h via the XENSTORE_SERVER_FEATURE_* macros. xs_get_features_domain(): return the features offered for a s

Re: [PATCH 4/7] tools/xenstored: add server feature support

2025-07-25 Thread Jason Andryuk
On 2025-07-25 01:18, Jürgen Groß wrote: On 25.07.25 00:48, Jason Andryuk wrote: On 2025-07-22 10:06, Juergen Gross wrote: Add per domain server features, which are initialized by the supported features at domain introduction, or by live update from the migration stream. This requires to add t

Re: [PATCH] x86: Conditionalise init_dom0_cpu_policy()

2025-07-25 Thread Roger Pau Monné
On Fri, Jul 25, 2025 at 12:02:18PM +0200, Alejandro Vallejo wrote: > On Wed Jul 23, 2025 at 9:18 AM CEST, Roger Pau Monné wrote: > > On Thu, Jul 17, 2025 at 07:58:24PM +0200, Alejandro Vallejo wrote: > >> Later patches will keep refactoring create_dom0() > >> until it can create arbitrary domains.

[PATCH] xen: Rename xenmem_reservation_increase to xenmem_populate_physmap

2025-07-25 Thread Teddy Astie
xenmem_reservation_increase currently calls XENMEM_populate_physmap. Rename the function to avoid confusion with XENMEM_increase_reservation. Signed-off-by: Teddy Astie --- Cc: Juergen Gross Cc: Stefano Stabellini Cc: Oleksandr Tyshchenko --- drivers/xen/balloon.c | 2 +- drivers/xen/

Re: [PATCH] x86: Conditionalise init_dom0_cpu_policy()

2025-07-25 Thread Alejandro Vallejo
On Wed Jul 23, 2025 at 9:18 AM CEST, Roger Pau Monné wrote: > On Thu, Jul 17, 2025 at 07:58:24PM +0200, Alejandro Vallejo wrote: >> Later patches will keep refactoring create_dom0() >> until it can create arbitrary domains. This is one >> small step in that direction. >> >> Signed-off-by: Alejandr

Re: [PATCH 4/7] tools/xenstored: add server feature support

2025-07-25 Thread Juergen Gross
On 25.07.25 07:18, Jürgen Groß wrote: On 25.07.25 00:48, Jason Andryuk wrote: On 2025-07-22 10:06, Juergen Gross wrote: Add per domain server features, which are initialized by the supported features at domain introduction, or by live update from the migration stream. This requires to add the

Re: [PATCH v8 2/8] vpci: Refactor REGISTER_VPCI_INIT

2025-07-25 Thread Chen, Jiqian
On 2025/7/25 16:08, Roger Pau Monné wrote: > On Fri, Jul 25, 2025 at 03:15:13AM +, Chen, Jiqian wrote: >> On 2025/7/24 22:28, Roger Pau Monné wrote: >>> On Thu, Jul 24, 2025 at 01:50:00PM +0800, Jiqian Chen wrote: diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c index 74

Re: [PATCH] xen/credit2: factor in previous active unit's credit in csched2_runtime()

2025-07-25 Thread Jürgen Groß
On 21.06.25 16:14, Koichiro Den wrote: When a running unit is about to be scheduled out due to a competing unit with the highest remaining credit, the residual credit of the previous unit is currently ignored in csched2_runtime() because it hasn't yet been reinserted into the runqueue. As a resu

Re: [PATCH v2 2/3] vpci: allow BAR map/unmap without affecting memory decoding bit

2025-07-25 Thread Roger Pau Monné
On Wed, Jul 23, 2025 at 12:37:42PM -0400, Stewart Hildebrand wrote: > Introduce enum vpci_map_op and allow invoking modify_bars() without > changing the memory decoding bit. > > Signed-off-by: Stewart Hildebrand > --- > v1->v2: > * new patch > --- > xen/drivers/vpci/header.c | 22 +++

Re: [PATCH v8 2/8] vpci: Refactor REGISTER_VPCI_INIT

2025-07-25 Thread Roger Pau Monné
On Fri, Jul 25, 2025 at 03:15:13AM +, Chen, Jiqian wrote: > On 2025/7/24 22:28, Roger Pau Monné wrote: > > On Thu, Jul 24, 2025 at 01:50:00PM +0800, Jiqian Chen wrote: > >> diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c > >> index 74211301ba10..eb3e7dcd1068 100644 > >> --- a/xen

Re: [PATCH v2 3/9] mm/huge_memory: support huge zero folio in vmf_insert_folio_pmd()

2025-07-25 Thread Wei Yang
On Thu, Jul 17, 2025 at 01:52:06PM +0200, David Hildenbrand wrote: >Just like we do for vmf_insert_page_mkwrite() -> ... -> >insert_page_into_pte_locked() with the shared zeropage, support the >huge zero folio in vmf_insert_folio_pmd(). > >When (un)mapping the huge zero folio in page tables, we nei

Re: [PATCH v8 8/8] vpci/msix: Free MSIX resources when init_msix() fails

2025-07-25 Thread Roger Pau Monné
On Fri, Jul 25, 2025 at 02:50:36AM +, Chen, Jiqian wrote: > On 2025/7/24 23:59, Roger Pau Monné wrote: > > On Thu, Jul 24, 2025 at 01:50:06PM +0800, Jiqian Chen wrote: > >> When init_msix() fails, current logic return fail and free MSIX-related > >> resources in vpci_deassign_device(). But the

Re: [PATCH] iommu: restrict scratch page quarantining to x86

2025-07-25 Thread Roger Pau Monné
On Thu, Jul 24, 2025 at 01:43:48PM -0400, Stewart Hildebrand wrote: > All IOMMU_QUARANTINE_* options are exposed on Arm since 163c6b589879 > ("xen/arm: pci: introduce PCI_PASSTHROUGH Kconfig option"). However, > only NONE and BASIC are implemented in any Arm iommu driver since > 63919fc4d1ca ("xen/

Re: [PATCH v2 1/3] vpci: allow queueing of mapping operations

2025-07-25 Thread Roger Pau Monné
On Thu, Jul 24, 2025 at 06:44:32PM +0200, Roger Pau Monné wrote: > On Wed, Jul 23, 2025 at 12:37:41PM -0400, Stewart Hildebrand wrote: > > @@ -283,7 +297,48 @@ static int __init apply_map(struct domain *d, const > > struct pci_dev *pdev, > > return rc; > > } > > > > -static void defer_map(

Re: [PATCH v4 12/12] tools/xenstored: Remove hardcoded implicit path

2025-07-25 Thread Jürgen Groß
On 25.07.25 04:28, Jason Andryuk wrote: Update get_implicit_path to return the correct value for a non-dom0 xenstored domain. Signed-off-by: Jason Andryuk Reviewed-by: Juergen Gross Juergen OpenPGP_0xB0DE9DD628BF132F.asc Description: OpenPGP public key OpenPGP_signature.asc Description

Re: [PATCH v4 11/12] tools/xenstored: Rename xenbus_master_domid -> xenbus_store_domain

2025-07-25 Thread Jürgen Groß
On 25.07.25 04:28, Jason Andryuk wrote: Rename the helper that access store_domid accordingly. While doing this, rename the is_store_domain variable. No functional change. Signed-off-by: Jason Andryuk With my remark on the previous patch this one can just be dropped. Juergen OpenPGP_0xB

Re: [PATCH v4 10/12] tools/xenstored: Rename dom0_domid to store_domid

2025-07-25 Thread Jürgen Groß
On 25.07.25 04:28, Jason Andryuk wrote: The dom0_domid variable is misnamed and conflates purposes. If we have xenstored running in a Linux domain that is not dom0, this variable controls the lookup of /proc/xen/xsd_kva and the event channel. One implication of this change is that the xenstore

Re: [PATCH v4 09/12] tools/xenstored: Use priv_domid for manual nodes and permission

2025-07-25 Thread Jürgen Groß
On 25.07.25 04:28, Jason Andryuk wrote: Usually, priv_domid == dom0_domid == 0, and that is what is expected. If we rename s/dom0_domid/store_domid/, it seems more likely we want to actually have the priv_domid as the owner. Yes, I agree. That leads to follow on changes to ensure that the pr

Re: [PATCH v4 08/12] tools/xenstored: Remove stubdom special casing

2025-07-25 Thread Jürgen Groß
On 25.07.25 04:28, Jason Andryuk wrote: posix.c and minios.c implement the same named functions serving slightly different purposes. For xenbus_map() posix.c maps the local /dev/xen/xsd_kva minios.c maps dom0 via grant and there is open coding for stub_domid in map_interface. Change xenbus_map(

Re: [PATCH v4 07/12] tools/xenstored: Auto-introduce domains

2025-07-25 Thread Jürgen Groß
On 25.07.25 04:28, Jason Andryuk wrote: Replace dom0_init() with init_domains() which uses libxenmanage to iterate through all existing domains, storing them in a list. The xenstore domain is introduced first, and then all the other domains are introduced. The xenstore domain needs to be introd