[PATCH v8 7/8] vpci/msi: Free MSI resources when init_msi() fails

2025-07-23 Thread Jiqian Chen
When init_msi() fails, current logic return fail and free MSI-related resources in vpci_deassign_device(). But the previous new changes will hide MSI capability and return success, it can't reach vpci_deassign_device() to remove resources if hiding success, so those resources must be removed in cle

[PATCH v8 0/8] Support hiding capability when its initialization fails

2025-07-23 Thread Jiqian Chen
Hi, This series is to emulate extended capability list for dom0, including patch #1. hide legacy and extended capability when its initialization fails, including patch #2, #3, #4. remove all related registers and other resources when initializing capability fails, including patch #5, #6, #7, #8.

[PATCH v8 5/8] vpci: Refactor vpci_remove_register to remove matched registers

2025-07-23 Thread Jiqian Chen
vpci_remove_register() only supports removing a register in a time, but the follow-on changes need to remove all registers within a range. So, refactor it to support removing all registers in a given region. And it is no issue to remove a non exist register, so remove the __must_check prefix. Sig

[PATCH v8 2/8] vpci: Refactor REGISTER_VPCI_INIT

2025-07-23 Thread Jiqian Chen
Refactor REGISTER_VPCI_INIT to contain more capability specific information, this will benefit further follow-on changes to hide capability when initialization fails. What's more, change the definition of init_header() since it is not a capability and it is needed for all devices' PCI config space

[PATCH v8 6/8] vpci/rebar: Free Rebar resources when init_rebar() fails

2025-07-23 Thread Jiqian Chen
When init_rebar() fails, current logic return fail and free Rebar-related resources in vpci_deassign_device(). But the previous new changes will hide Rebar capability and return success, it can't reach vpci_deassign_device() to remove resources if hiding success, so those resources must be removed

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

2025-07-23 Thread Jiqian Chen
When init_msix() fails, current logic return fail and free MSIX-related resources in vpci_deassign_device(). But the previous new changes will hide MSIX capability and return success, it can't reach vpci_deassign_device() to remove resources if hiding success, so those resources must be removed in

[PATCH v8 4/8] vpci: Hide extended capability when it fails to initialize

2025-07-23 Thread Jiqian Chen
When vpci fails to initialize an extended capability of device, it just returns an error and vPCI gets disabled for the whole device. So, add function to hide extended capability when initialization fails. And remove the failed extended capability handler from vpci extended capability list. Signe

[PATCH v8 1/8] vpci/header: Emulate extended capability list for dom0

2025-07-23 Thread Jiqian Chen
Add a new function to emulate extended capability list for dom0, and call it in init_header(). So that it will be easy to hide an extended capability whose initialization fails. As for the extended capability list of domU, just move the logic into above function and keep hiding it for domU. Signe

[PATCH v8 3/8] vpci: Hide legacy capability when it fails to initialize

2025-07-23 Thread Jiqian Chen
When vpci fails to initialize a legacy capability of device, it just returns an error and vPCI gets disabled for the whole device. That most likely renders the device unusable, plus possibly causing issues to Xen itself if guest attempts to program the native MSI or MSI-X capabilities if present.

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

2025-07-23 Thread dmkhn
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. Decouple map operation state from > > general vPCI state: in particular, move the per-BAR rangeset out of > > struct vpci

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

2025-07-23 Thread dmkhn
On Wed, Jul 23, 2025 at 12:37:41PM -0400, Stewart Hildebrand wrote: > Introduce vPCI BAR mapping task queue. Decouple map operation state from > general vPCI state: in particular, move the per-BAR rangeset out of > struct vpci and into the map task struct. > > This is preparatory work for further

Re: [PATCH v9] xen/console: introduce domain_console struct

2025-07-23 Thread dmkhn
On Wed, Jul 23, 2025 at 06:24:07PM +, dm...@proton.me wrote: > On Wed, Jul 23, 2025 at 05:10:04PM +0200, Jan Beulich wrote: > > On 23.07.2025 02:11, dm...@proton.me wrote: > > > @@ -559,7 +559,8 @@ void hvm_do_resume(struct vcpu *v) > > > static int cf_check hvm_print_line( > > > int dir,

Re: [PATCH v3] EFI/runtime: switch to xv[mz]alloc_array()

2025-07-23 Thread dmkhn
On Wed, Jul 23, 2025 at 03:39:11PM +0200, Jan Beulich wrote: > Use the more "modern" form, thus doing away with effectively open-coding > xmalloc_array() at the same time. While there is a difference in > generated code, as xmalloc_bytes() forces SMP_CACHE_BYTES alignment, if > code really cared ab

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

2025-07-23 Thread dmkhn
On Wed, Jul 23, 2025 at 06:54:20PM -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 1/2] xen/arm: smmuv3: fix UB during deassign

2025-07-23 Thread dmkhn
On Wed, Jul 23, 2025 at 06:54:19PM -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

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

2025-07-23 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

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

2025-07-23 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

Re: [PATCH v8] xen/arm: pci: introduce PCI_PASSTHROUGH Kconfig option

2025-07-23 Thread Stewart Hildebrand
On 7/23/25 18:16, Stewart Hildebrand wrote: > On 7/23/25 10:59, Jan Beulich wrote: >> On 23.07.2025 16:26, Stewart Hildebrand wrote: >>> On 7/23/25 06:18, Jan Beulich wrote: On 13.06.2025 17:17, Stewart Hildebrand wrote: > --- a/xen/arch/arm/Kconfig > +++ b/xen/arch/arm/Kconfig > @

Re: [PATCH v2] xen/netfront: Fix TX response spurious interrupts

2025-07-23 Thread Elliott Mitchell
On Thu, Jul 17, 2025 at 07:29:51AM -0700, Jakub Kicinski wrote: > On Tue, 15 Jul 2025 16:11:29 + Anthoine Bourgeois wrote: > > Fixes: b27d47950e48 ("xen/netfront: harden netfront against event channel > > storms") > > Not entirely sure who you expect to apply this patch, but if networking > t

Re: [PATCH] automation/eclair: tag guidelines D4.7, R21.18, R21.20 as clean

2025-07-23 Thread Dmytro Prokopchuk1
On 7/23/25 23:24, Stefano Stabellini wrote: > On Wed, 23 Jul 2025, Dmytro Prokopchuk1 wrote: >> Update ECLAIR configuration to consider guidelines as clean >> so as to avoid regressions. >> >> Signed-off-by: Dmytro Prokopchuk > > Please provide a link to a clean pipeline. Assuming you have it:

[PATCH v3] automation/eclair: monitor rules 11.6, 17.2, 18.3, 21.11, 21.14-16

2025-07-23 Thread Dmytro Prokopchuk1
Add MISRA C rules to the monitored set. All these rules are 'accepted' for XEN, have zero or few violations, and should be enabled for the ECLAIR scan. Rule 17.2 is enabled to detect accidental direct recursion. Signed-off-by: Dmytro Prokopchuk --- Test CI pipeline: https://gitlab.com/xen-proje

Re: [PATCH v8] xen/arm: pci: introduce PCI_PASSTHROUGH Kconfig option

2025-07-23 Thread Stewart Hildebrand
On 7/23/25 10:59, Jan Beulich wrote: > On 23.07.2025 16:26, Stewart Hildebrand wrote: >> On 7/23/25 06:18, Jan Beulich wrote: >>> On 13.06.2025 17:17, Stewart Hildebrand wrote: --- a/xen/arch/arm/Kconfig +++ b/xen/arch/arm/Kconfig @@ -8,6 +8,8 @@ config ARM_64 depends on !ARM

Re: [PATCH v2 04/17] xen: Introduce XEN_DOMCTL_CDF_not_hypercall_target

2025-07-23 Thread Jason Andryuk
On 2025-07-23 05:29, Julien Grall wrote: Hi Jason, On 21/07/2025 23:00, Jason Andryuk wrote: diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index 88a294c5be..f1f6f96bc2 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -70,9 +70,11 @@ struct x

Re: [PATCH v1] xen: move getdomaininfo() to domain.c

2025-07-23 Thread Stefano Stabellini
On Wed, 23 Jul 2025, Jan Beulich wrote: > On 23.07.2025 02:46, Stefano Stabellini wrote: > > On Tue, 22 Jul 2025, Jan Beulich wrote: > >> On 22.07.2025 07:04, Penny Zheng wrote: > >>> Function getdomaininfo() is not only invoked by domctl-op, but also > >>> sysctl-op, > >>> so it shall better live

Re: [PATCH v2] automation/eclair: monitor rules 11.6, 17.2, 18.3, 21.11, 21.14-16

2025-07-23 Thread Stefano Stabellini
On Wed, 23 Jul 2025, Dmytro Prokopchuk1 wrote: > Add MISRA C rules to the monitored set. > All these rules are 'accepted' for XEN, have zero or few violations, > and should be enabled for the ECLAIR scan. > > Rule 17.2 is enabled to prevent accidental direct recursion. > > Signed-off-by: Dmytro P

Re: [PATCH] automation/eclair: tag guidelines D4.7, R21.18, R21.20 as clean

2025-07-23 Thread Stefano Stabellini
On Wed, 23 Jul 2025, Dmytro Prokopchuk1 wrote: > Update ECLAIR configuration to consider guidelines as clean > so as to avoid regressions. > > Signed-off-by: Dmytro Prokopchuk Please provide a link to a clean pipeline. Assuming you have it: Acked-by: Stefano Stabellini > --- > automation/ec

Re: [PATCH v2 15/17] xen/riscv: Implement superpage splitting for p2m mappings

2025-07-23 Thread Oleksii Kurochko
On 7/22/25 6:02 PM, Jan Beulich wrote: On 22.07.2025 16:57, Oleksii Kurochko wrote: On 7/21/25 3:34 PM, Jan Beulich wrote: On 17.07.2025 18:37, Oleksii Kurochko wrote: On 7/2/25 11:25 AM, Jan Beulich wrote: On 10.06.2025 15:05, Oleksii Kurochko wrote: Add support for down large memory mappi

Re: [PATCH v9] xen/console: introduce domain_console struct

2025-07-23 Thread dmkhn
On Wed, Jul 23, 2025 at 05:10:04PM +0200, Jan Beulich wrote: > On 23.07.2025 02:11, dm...@proton.me wrote: > > @@ -559,7 +559,8 @@ void hvm_do_resume(struct vcpu *v) > > static int cf_check hvm_print_line( > > int dir, unsigned int port, unsigned int bytes, uint32_t *val) > > { > > -stru

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

2025-07-23 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

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

2025-07-23 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 v2 1/3] vpci: allow queueing of mapping operations

2025-07-23 Thread Stewart Hildebrand
Introduce vPCI BAR mapping task queue. Decouple map operation state from general vPCI state: in particular, move the per-BAR rangeset out of struct vpci and into the map task struct. This is preparatory work for further changes that need to perform multiple unmap/map operations before returning to

[PATCH v2 0/3] vpci: allow 32-bit BAR writes with memory decoding enabled

2025-07-23 Thread Stewart Hildebrand
Pipeline: https://gitlab.com/xen-project/people/stewarthildebrand/xen/-/pipelines/1944094764 v1->v2: * new approach with queued p2m operations RFC->v1: * rework BAR mapping machinery to support unmap-then-map operation Stewart Hildebrand (3): vpci: allow queueing of mapping operations vpci:

[PATCH v2 3/3] vpci: allow 32-bit BAR writes with memory decoding enabled

2025-07-23 Thread Stewart Hildebrand
Currently, Xen vPCI refuses BAR writes if the BAR is mapped in p2m. If firmware initializes a 32-bit BAR to a bad address, Linux may try to write a new address to the 32-bit BAR without disabling memory decoding. Since Xen refuses such writes, the BAR (and thus PCI device) will be non-functional.

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

2025-07-23 Thread Stewart Hildebrand
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 +++--- xen/include/xen/vpci.h| 4 2 files changed, 19 insertions(+), 7 del

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

2025-07-23 Thread Dmytro Prokopchuk1
On 7/21/25 13:34, Jan Beulich wrote: > On 21.07.2025 12:27, Dmytro Prokopchuk1 wrote: >> On 7/16/25 21:08, Dmytro Prokopchuk wrote: >>> MISRA C Rule 5.5 states that: "Identifiers shall >>> be distinct from macro names". >>> >>> Update ECLAIR configuration to deviate: >>> - clashes in 'xen/include

Re: [PATCH v6 15/19] tools/cpufreq: introduce helper to deal with CPPC-related parameters

2025-07-23 Thread Jan Beulich
On 11.07.2025 05:51, Penny Zheng wrote: > New helpers print_cppc_para() and get_cpufreq_cppc() are introduced to deal > with CPPC-related parameters, in order to be re-used when later exporting new > sub-op "get-cpufreq-cppc". > > Signed-off-by: Penny Zheng Acked-by: Jan Beulich I once again w

Re: [PATCH] xen/x86: fix xen.efi boot crash from some bootloaders

2025-07-23 Thread Jan Beulich
On 23.07.2025 17:39, Yann Sionneau wrote: > On 7/23/25 16:18, Jan Beulich wrote: >> On 23.07.2025 15:56, Yann Sionneau wrote: >>> xen.efi PE does not boot when loaded from shim or some patched >>> downstream grub2. >>> >>> What happens is the bootloader would honour the MEM_DISCARDABLE >>> flag of

Re: [PATCH] xen/arm, xen/common: Add Kconfig option to control Dom0 boot

2025-07-23 Thread Oleksii Moisieiev
On 23/07/2025 18:04, Jan Beulich wrote: > On 23.07.2025 16:33, Oleksii Moisieiev wrote: >> Hi Jan, >> >> On 23/07/2025 17:27, Jan Beulich wrote: >>> On 23.07.2025 16:05, Oleksii Moisieiev wrote: --- a/xen/arch/arm/Kconfig +++ b/xen/arch/arm/Kconfig @@ -19,6 +19,7 @@ config ARM

Re: [PATCH v6 14/19] xen/cpufreq: get performance policy from governor set via xenpm

2025-07-23 Thread Jan Beulich
On 11.07.2025 05:51, Penny Zheng wrote: > Even if Xen governor is not used in amd-cppc active mode, we could > somehow deduce which performance policy (CPUFREQ_POLICY_xxx) user wants to > apply through which governor they choose, such as: > If user chooses performance governor, they want maximum pe

Re: [PATCH] xen/x86: fix xen.efi boot crash from some bootloaders

2025-07-23 Thread Yann Sionneau
On 7/23/25 16:18, Jan Beulich wrote: > On 23.07.2025 15:56, Yann Sionneau wrote: >> xen.efi PE does not boot when loaded from shim or some patched >> downstream grub2. >> >> What happens is the bootloader would honour the MEM_DISCARDABLE >> flag of the .reloc section meaning it would not load its c

Re: [PATCH] x86/hvmloader: adjust strtoll() to parse hex numbers without 0x prefix

2025-07-23 Thread Jan Beulich
On 23.07.2025 17:19, Roger Pau Monne wrote: > The current strtoll() implementation in hvmloader requires hex number to be > prefixed with 0x, otherwise strtoll() won't parse them correctly even when > calling the function with base == 16. > > Fix this by not unconditionally setting the base to 10

Re: [PATCH v10 6/9] xen: Make the maximum number of altp2m views configurable for x86

2025-07-23 Thread Jan Beulich
On 16.07.2025 22:15, Petr Beneš wrote: > From: Petr Beneš > > This commit introduces the ability to configure the maximum number of altp2m > views for the domain during its creation. Previously, the limits were > hardcoded > to a maximum of 10. This change allows for greater flexibility in envir

Re: [PATCH v2] automation/eclair: monitor rules 11.6, 17.2, 18.3, 21.11, 21.14-16

2025-07-23 Thread Dmytro Prokopchuk1
On 7/23/25 18:14, Jan Beulich wrote: > On 23.07.2025 17:07, Dmytro Prokopchuk1 wrote: >> Add MISRA C rules to the monitored set. >> All these rules are 'accepted' for XEN, have zero or few violations, >> and should be enabled for the ECLAIR scan. >> >> Rule 17.2 is enabled to prevent accidental d

[PATCH] x86/hvmloader: adjust strtoll() to parse hex numbers without 0x prefix

2025-07-23 Thread Roger Pau Monne
The current strtoll() implementation in hvmloader requires hex number to be prefixed with 0x, otherwise strtoll() won't parse them correctly even when calling the function with base == 16. Fix this by not unconditionally setting the base to 10 when the string is not 0 prefixed, this also allows pa

Re: [PATCH v2] automation/eclair: monitor rules 11.6, 17.2, 18.3, 21.11, 21.14-16

2025-07-23 Thread Jan Beulich
On 23.07.2025 17:07, Dmytro Prokopchuk1 wrote: > Add MISRA C rules to the monitored set. > All these rules are 'accepted' for XEN, have zero or few violations, > and should be enabled for the ECLAIR scan. > > Rule 17.2 is enabled to prevent accidental direct recursion. How does this "prevent" wor

Re: [PATCH v9] xen/console: introduce domain_console struct

2025-07-23 Thread Jan Beulich
On 23.07.2025 02:11, dm...@proton.me wrote: > @@ -559,7 +559,8 @@ void hvm_do_resume(struct vcpu *v) > static int cf_check hvm_print_line( > int dir, unsigned int port, unsigned int bytes, uint32_t *val) > { > -struct domain *cd = current->domain; > +struct domain *d = current->domai

[PATCH v2] automation/eclair: monitor rules 11.6, 17.2, 18.3, 21.11, 21.14-16

2025-07-23 Thread Dmytro Prokopchuk1
Add MISRA C rules to the monitored set. All these rules are 'accepted' for XEN, have zero or few violations, and should be enabled for the ECLAIR scan. Rule 17.2 is enabled to prevent accidental direct recursion. Signed-off-by: Dmytro Prokopchuk --- Changes in v2: - updated commit message --- a

Re: [PATCH] xen/arm, xen/common: Add Kconfig option to control Dom0 boot

2025-07-23 Thread Jan Beulich
On 23.07.2025 16:33, Oleksii Moisieiev wrote: > Hi Jan, > > On 23/07/2025 17:27, Jan Beulich wrote: >> On 23.07.2025 16:05, Oleksii Moisieiev wrote: >>> --- a/xen/arch/arm/Kconfig >>> +++ b/xen/arch/arm/Kconfig >>> @@ -19,6 +19,7 @@ config ARM >>> select HAS_ALTERNATIVE if HAS_VMAP >>> sel

Re: [PATCH v8] xen/arm: pci: introduce PCI_PASSTHROUGH Kconfig option

2025-07-23 Thread Jan Beulich
On 23.07.2025 16:26, Stewart Hildebrand wrote: > On 7/23/25 06:18, Jan Beulich wrote: >> On 13.06.2025 17:17, Stewart Hildebrand wrote: >>> --- a/xen/arch/arm/Kconfig >>> +++ b/xen/arch/arm/Kconfig >>> @@ -8,6 +8,8 @@ config ARM_64 >>> depends on !ARM_32 >>> select 64BIT >>> select HAS_

[PATCH] automation/eclair: tag guidelines D4.7, R21.18, R21.20 as clean

2025-07-23 Thread Dmytro Prokopchuk1
Update ECLAIR configuration to consider guidelines as clean so as to avoid regressions. Signed-off-by: Dmytro Prokopchuk --- automation/eclair_analysis/ECLAIR/tagging.ecl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/automation/eclair_analysis/ECLAIR/tagging.ecl b/automation/eclair_ana

Re: [PATCH] x86: correct scrub_page_{hot,cold}() prototypes

2025-07-23 Thread Jan Beulich
On 23.07.2025 16:47, Nicola Vetrini wrote: > On 2025-07-23 16:37, Jan Beulich wrote: >> ... to be in line with Misra rule 8.2 requirements. >> >> Fixes: 6ff0cfbfd4f7 ("mm: allow page scrubbing routine(s) to be arch >> controlled") >> Signed-off-by: Jan Beulich > > Reviewed-by: Nicola Vetrini T

Re: [XEN PATCH] x86/page: fix regressions of MISRA C Rule 8.2

2025-07-23 Thread Jan Beulich
On 23.07.2025 16:45, Nicola Vetrini wrote: > The rule states: "Function types shall be in prototype form > with named parameters". Add missing parameter names. > > Fixes: 6ff0cfbfd4f7 ("mm: allow page scrubbing routine(s) to be arch > controlled") > Signed-off-by: Nicola Vetrini Can as well tak

Re: [PATCH] xen/x86: fix xen.efi boot crash from some bootloaders

2025-07-23 Thread Jan Beulich
On 23.07.2025 16:45, Jan Beulich wrote: > On 23.07.2025 16:38, Andrew Cooper wrote: >> On 23/07/2025 3:21 pm, Jan Beulich wrote: >>> On 23.07.2025 16:13, Andrew Cooper wrote: On 23/07/2025 2:56 pm, Yann Sionneau wrote: > xen.efi PE does not boot when loaded from shim or some patched >

Re: [PATCH] x86: correct scrub_page_{hot,cold}() prototypes

2025-07-23 Thread Nicola Vetrini
On 2025-07-23 16:37, Jan Beulich wrote: ... to be in line with Misra rule 8.2 requirements. Fixes: 6ff0cfbfd4f7 ("mm: allow page scrubbing routine(s) to be arch controlled") Signed-off-by: Jan Beulich Reviewed-by: Nicola Vetrini --- The offending patch had been pending for far longer tha

[XEN PATCH] x86/page: fix regressions of MISRA C Rule 8.2

2025-07-23 Thread Nicola Vetrini
The rule states: "Function types shall be in prototype form with named parameters". Add missing parameter names. Fixes: 6ff0cfbfd4f7 ("mm: allow page scrubbing routine(s) to be arch controlled") Signed-off-by: Nicola Vetrini --- xen/arch/x86/include/asm/page.h | 4 ++-- 1 file changed, 2 insert

Re: [PATCH] xen/x86: fix xen.efi boot crash from some bootloaders

2025-07-23 Thread Jan Beulich
On 23.07.2025 16:38, Andrew Cooper wrote: > On 23/07/2025 3:21 pm, Jan Beulich wrote: >> On 23.07.2025 16:13, Andrew Cooper wrote: >>> On 23/07/2025 2:56 pm, Yann Sionneau wrote: xen.efi PE does not boot when loaded from shim or some patched downstream grub2. What happens is the

Re: [PATCH] xen/x86: fix xen.efi boot crash from some bootloaders

2025-07-23 Thread Andrew Cooper
On 23/07/2025 3:21 pm, Jan Beulich wrote: > On 23.07.2025 16:13, Andrew Cooper wrote: >> On 23/07/2025 2:56 pm, Yann Sionneau wrote: >>> xen.efi PE does not boot when loaded from shim or some patched >>> downstream grub2. >>> >>> What happens is the bootloader would honour the MEM_DISCARDABLE >>> f

[PATCH] x86: correct scrub_page_{hot,cold}() prototypes

2025-07-23 Thread Jan Beulich
... to be in line with Misra rule 8.2 requirements. Fixes: 6ff0cfbfd4f7 ("mm: allow page scrubbing routine(s) to be arch controlled") Signed-off-by: Jan Beulich --- The offending patch had been pending for far longer than we care about Misra, and hence at the time of writing I didn't pay attenti

Re: [PATCH] xen/arm, xen/common: Add Kconfig option to control Dom0 boot

2025-07-23 Thread Oleksii Moisieiev
Hi Jan, On 23/07/2025 17:27, Jan Beulich wrote: > On 23.07.2025 16:05, Oleksii Moisieiev wrote: >> --- a/xen/arch/arm/Kconfig >> +++ b/xen/arch/arm/Kconfig >> @@ -19,6 +19,7 @@ config ARM >> select HAS_ALTERNATIVE if HAS_VMAP >> select HAS_DEVICE_TREE >> select HAS_DOM0LESS >> +

Re: [PATCH] xen/arm, xen/common: Add Kconfig option to control Dom0 boot

2025-07-23 Thread Oleksii Moisieiev
Sorry, missed that on my send script On 23/07/2025 17:29, Jan Beulich wrote: > On 23.07.2025 16:05, Oleksii Moisieiev wrote: >> This commit introduces a new Kconfig option, `CONFIG_DOM0_BOOT`, to >> allow for building Xen without support for booting a regular domain (Dom0). >> This functionality i

Re: [PATCH] xen/arm, xen/common: Add Kconfig option to control Dom0 boot

2025-07-23 Thread Jan Beulich
On 23.07.2025 16:05, Oleksii Moisieiev wrote: > This commit introduces a new Kconfig option, `CONFIG_DOM0_BOOT`, to > allow for building Xen without support for booting a regular domain (Dom0). > This functionality is primarily intended for the ARM architecture. > > A new Kconfig symbol, `HAS_DOM0

Re: [PATCH] xen/arm, xen/common: Add Kconfig option to control Dom0 boot

2025-07-23 Thread Jan Beulich
On 23.07.2025 16:05, Oleksii Moisieiev wrote: > --- a/xen/arch/arm/Kconfig > +++ b/xen/arch/arm/Kconfig > @@ -19,6 +19,7 @@ config ARM > select HAS_ALTERNATIVE if HAS_VMAP > select HAS_DEVICE_TREE > select HAS_DOM0LESS > + select HAS_DOM0 This wants to move one line up, for t

Re: [PATCH v8] xen/arm: pci: introduce PCI_PASSTHROUGH Kconfig option

2025-07-23 Thread Stewart Hildebrand
On 7/23/25 06:18, Jan Beulich wrote: > On 13.06.2025 17:17, Stewart Hildebrand wrote: >> --- a/xen/arch/arm/Kconfig >> +++ b/xen/arch/arm/Kconfig >> @@ -8,6 +8,8 @@ config ARM_64 >> depends on !ARM_32 >> select 64BIT >> select HAS_FAST_MULTIPLY >> +select HAS_VPCI_GUEST_SUPPORT i

Re: [PATCH] xen/x86: fix xen.efi boot crash from some bootloaders

2025-07-23 Thread Jan Beulich
On 23.07.2025 16:13, Andrew Cooper wrote: > On 23/07/2025 2:56 pm, Yann Sionneau wrote: >> xen.efi PE does not boot when loaded from shim or some patched >> downstream grub2. >> >> What happens is the bootloader would honour the MEM_DISCARDABLE >> flag of the .reloc section meaning it would not loa

Re: [PATCH] xen/x86: fix xen.efi boot crash from some bootloaders

2025-07-23 Thread Jan Beulich
On 23.07.2025 15:56, Yann Sionneau wrote: > xen.efi PE does not boot when loaded from shim or some patched > downstream grub2. > > What happens is the bootloader would honour the MEM_DISCARDABLE > flag of the .reloc section meaning it would not load its content > into memory. > > But Xen is parsi

Re: [PATCH] xen/x86: fix xen.efi boot crash from some bootloaders

2025-07-23 Thread Andrew Cooper
On 23/07/2025 2:56 pm, Yann Sionneau wrote: > xen.efi PE does not boot when loaded from shim or some patched > downstream grub2. > > What happens is the bootloader would honour the MEM_DISCARDABLE > flag of the .reloc section meaning it would not load its content > into memory. > > But Xen is parsi

[PATCH] xen/arm, xen/common: Add Kconfig option to control Dom0 boot

2025-07-23 Thread Oleksii Moisieiev
This commit introduces a new Kconfig option, `CONFIG_DOM0_BOOT`, to allow for building Xen without support for booting a regular domain (Dom0). This functionality is primarily intended for the ARM architecture. A new Kconfig symbol, `HAS_DOM0`, has been added and is selected by default for ARM arc

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

2025-07-23 Thread Jan Beulich
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 just beyond, the > -config=MC3A2.R18.2,reports+

[PATCH] xen/x86: fix xen.efi boot crash from some bootloaders

2025-07-23 Thread Yann Sionneau
xen.efi PE does not boot when loaded from shim or some patched downstream grub2. What happens is the bootloader would honour the MEM_DISCARDABLE flag of the .reloc section meaning it would not load its content into memory. But Xen is parsing the .reloc section content twice at boot: * https://eli

[PATCH v3] EFI/runtime: switch to xv[mz]alloc_array()

2025-07-23 Thread Jan Beulich
Use the more "modern" form, thus doing away with effectively open-coding xmalloc_array() at the same time. While there is a difference in generated code, as xmalloc_bytes() forces SMP_CACHE_BYTES alignment, if code really cared about such higher than default alignment, it should request so explicit

Re: [PATCH] automation/eclair: monitor rules 11.6, 17.2, 18.3, 21.11, 21.14-16

2025-07-23 Thread Dmytro Prokopchuk1
On 7/23/25 16:34, Nicola Vetrini wrote: > On 2025-07-23 15:30, Dmytro Prokopchuk1 wrote: >> Add MISRA C rules to the monitored set. >> All these rules are 'accepted' for XEN, have zero or few violations, >> and should be enabled for the ECLAIR scan. >> >> Signed-off-by: Dmytro Prokopchuk >> ---

Re: [PATCH] automation/eclair: monitor rules 11.6, 17.2, 18.3, 21.11, 21.14-16

2025-07-23 Thread Nicola Vetrini
On 2025-07-23 15:30, Dmytro Prokopchuk1 wrote: Add MISRA C rules to the monitored set. All these rules are 'accepted' for XEN, have zero or few violations, and should be enabled for the ECLAIR scan. Signed-off-by: Dmytro Prokopchuk --- Test CI: https://gitlab.com/xen-project/people/dimaprkp4k/

[PATCH] automation/eclair: monitor rules 11.6, 17.2, 18.3, 21.11, 21.14-16

2025-07-23 Thread Dmytro Prokopchuk1
Add MISRA C rules to the monitored set. All these rules are 'accepted' for XEN, have zero or few violations, and should be enabled for the ECLAIR scan. Signed-off-by: Dmytro Prokopchuk --- Test CI: https://gitlab.com/xen-project/people/dimaprkp4k/xen/-/pipelines/1943607023 --- automation/eclair

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

2025-07-23 Thread Stewart Hildebrand
On 7/22/25 20:16, Choi, Anderson wrote: > Stewart, > >> EXT email: be mindful of links/attachments. >> >> Hi, >> >> It largely looks OK to me, just a few small comments below. >> >> On 7/18/25 05:16, Anderson Choi wrote: >>> ARINC653 specificaion requires partition scheduling to be >>> determinist

Re: PCI passthrough of XHCI on Framework AMD crashes the host

2025-07-23 Thread Andrew Cooper
On 23/07/2025 1:35 pm, Marek Marczykowski-Górecki wrote: > Hi, > > There is yet another issue affecting Framework AMD... When I start a > domU with XHCI controller attached (PCI passthrough), the whole host > resets if there was an USB device plugged into it. I don't get any panic > message (neithe

Re: PCI passthrough of XHCI on Framework AMD crashes the host

2025-07-23 Thread Tu Dinh
On 23/07/2025 15:10, Marek Marczykowski-Górecki wrote: > On Wed, Jul 23, 2025 at 12:55:53PM +, Tu Dinh wrote [...] >> I had a similar problem with a Beelink mini PC with the Ryzen 5800U >> after a recent Qubes upgrade. >> >> If the USB controller is passed through to sys-usb then the system >

Re: PCI passthrough of XHCI on Framework AMD crashes the host

2025-07-23 Thread Marek Marczykowski-Górecki
On Wed, Jul 23, 2025 at 12:55:53PM +, Tu Dinh wrote: > On 23/07/2025 14:35, Marek Marczykowski-Górecki wrote: > > Hi, > > > > There is yet another issue affecting Framework AMD... When I start a > > domU with XHCI controller attached (PCI passthrough), the whole host > > resets if there was an

Re: PCI passthrough of XHCI on Framework AMD crashes the host

2025-07-23 Thread Tu Dinh
On 23/07/2025 14:35, Marek Marczykowski-Górecki wrote: > Hi, > > There is yet another issue affecting Framework AMD... When I start a > domU with XHCI controller attached (PCI passthrough), the whole host > resets if there was an USB device plugged into it. I don't get any panic > message (neither

PCI passthrough of XHCI on Framework AMD crashes the host

2025-07-23 Thread Marek Marczykowski-Górecki
Hi, There is yet another issue affecting Framework AMD... When I start a domU with XHCI controller attached (PCI passthrough), the whole host resets if there was an USB device plugged into it. I don't get any panic message (neither on XHCI console - which is connected to a different XHCI controlle

[PATCH] x86/MCE: adjust S3 resume handling

2025-07-23 Thread Jan Beulich
The BSP resume path calls mcheck_init() with the address of boot_cpu_data, thus rendering comparisons against that pointer ineffective. The additional "bsp" boolean needs to be used (and propagated as necessary) instead. While touching intel_init_thermal(), constify its 1st parameter, which in tur

Re: [XEN][PATCH 0/8] xen/arm64: make aarch32 support optional

2025-07-23 Thread Grygorii Strashko
On 23.07.25 15:02, Julien Grall wrote: Hi, On 23/07/2025 12:48, Grygorii Strashko wrote: On 23.07.25 13:54, Orzel, Michal wrote: On 23/07/2025 10:06, Julien Grall wrote: On 23/07/2025 08:58, Grygorii Strashko wrote: From: Grygorii Strashko Hi, Hi Grygorii, Now Arm64 AArch32 gu

Re: [PATCH] x86/pmstat: drop struct px_stat's usable field

2025-07-23 Thread Andrew Cooper
On 23/07/2025 12:59 pm, Jan Beulich wrote: > Its initial calculation in cpufreq_statistic_init() is entirely unused, > as do_get_pm_info() recalculates it before use. That re-calculation can > then be done right where the output field is set, eliminating the need > for the internal field. In turn t

Re: [XEN][PATCH 0/8] xen/arm64: make aarch32 support optional

2025-07-23 Thread Julien Grall
Hi, On 23/07/2025 12:48, Grygorii Strashko wrote: On 23.07.25 13:54, Orzel, Michal wrote: On 23/07/2025 10:06, Julien Grall wrote: On 23/07/2025 08:58, Grygorii Strashko wrote: From: Grygorii Strashko Hi, Hi Grygorii, Now Arm64 AArch32 guest support is always enabled and built-in w

[PATCH] x86/CPU: correct reset_cpuinfo() comment

2025-07-23 Thread Jan Beulich
Part of it stated the opposite of what actual behavior is. Fixes: 7126b7f806d5 ("x86/CPU: re-work populating of cpu_data[]") Reported-by: Juergen Gross Signed-off-by: Jan Beulich --- a/xen/arch/x86/include/asm/cpufeature.h +++ b/xen/arch/x86/include/asm/cpufeature.h @@ -91,8 +91,8 @@ struct cpu

[PATCH] x86/pmstat: drop struct px_stat's usable field

2025-07-23 Thread Jan Beulich
Its initial calculation in cpufreq_statistic_init() is entirely unused, as do_get_pm_info() recalculates it before use. That re-calculation can then be done right where the output field is set, eliminating the need for the internal field. In turn the struct pointer there can then be constified. Si

Re: [PATCH v2] x86/hvm: Replace do_sched_op calls with their underlying logic

2025-07-23 Thread Andrew Cooper
On 23/07/2025 12:57 pm, Teddy Astie wrote: > Le 23/07/2025 à 13:16, Andrew Cooper a écrit : >> On 23/07/2025 10:05 am, Teddy Astie wrote: >>> do_sched_op(SCHEDOP_yield) just calls vcpu_yield(). Remove the indirection >>> through the hypercall handler and use the function directly. >>> >>> Perform t

Re: [PATCH v2] x86/hvm: Replace do_sched_op calls with their underlying logic

2025-07-23 Thread Teddy Astie
Le 23/07/2025 à 13:16, Andrew Cooper a écrit : > On 23/07/2025 10:05 am, Teddy Astie wrote: >> do_sched_op(SCHEDOP_yield) just calls vcpu_yield(). Remove the indirection >> through the hypercall handler and use the function directly. >> >> Perform the same for SCHEDOP_block. >> >> Not a functional

Re: [PATCH] x86/svm: Always flush TLB using TLB_CTRL_FLUSH_ALL

2025-07-23 Thread Andrew Cooper
On 22/07/2025 3:20 pm, Teddy Astie wrote: > Xen currently uses an ASID scheme where: > - ASIDs are cycled where a "TLB flush" is performed > - When ASIDs wrap around, perform a full TLB flush > - In exceptional cases, stop using ASIDs > > However, the TLB control mode used only flushes the current

Re: [XEN][PATCH 0/8] xen/arm64: make aarch32 support optional

2025-07-23 Thread Grygorii Strashko
On 23.07.25 13:54, Orzel, Michal wrote: On 23/07/2025 10:06, Julien Grall wrote: On 23/07/2025 08:58, Grygorii Strashko wrote: From: Grygorii Strashko Hi, Hi Grygorii, Now Arm64 AArch32 guest support is always enabled and built-in while not all Arm64 platforms supports AArch32 or t

Re: [PATCH v3 1/2] xen: Add capabilities to get_domain_state

2025-07-23 Thread Andrew Cooper
On 23/07/2025 8:29 am, Jürgen Groß wrote: > On 23.07.25 09:04, Jan Beulich wrote: >> On 23.07.2025 08:55, Jürgen Groß wrote: >>> On 23.07.25 08:43, Jan Beulich wrote: On 23.07.2025 08:34, Jürgen Groß wrote: > On 23.07.25 08:28, Jan Beulich wrote: >> On 22.07.2025 02:19, Jason Andryuk w

Re: [PATCH v2] x86/hvm: Replace do_sched_op calls with their underlying logic

2025-07-23 Thread Andrew Cooper
On 23/07/2025 10:05 am, Teddy Astie wrote: > do_sched_op(SCHEDOP_yield) just calls vcpu_yield(). Remove the indirection > through the hypercall handler and use the function directly. > > Perform the same for SCHEDOP_block. > > Not a functional change. > > Signed-off-by: Teddy Astie > --- > v2: >

Re: [XEN][PATCH 2/8] xen/arm: move vcpu_switch_to_aarch64_mode() in arch_vcpu_create()

2025-07-23 Thread Andrew Cooper
On 23/07/2025 11:19 am, Grygorii Strashko wrote: > > > On 23.07.25 12:16, Julien Grall wrote: >> Hi, >> >> On 23/07/2025 08:58, Grygorii Strashko wrote: >>> From: Grygorii Strashko >>> >>> Move vcpu_switch_to_aarch64_mode() in arch_vcpu_create() callback >>> instead >>> of calling it manually from

Re: [XEN][PATCH 2/8] xen/arm: move vcpu_switch_to_aarch64_mode() in arch_vcpu_create()

2025-07-23 Thread Julien Grall
Hi, On 23/07/2025 11:19, Grygorii Strashko wrote: On 23.07.25 12:16, Julien Grall wrote: On 23/07/2025 08:58, Grygorii Strashko wrote: From: Grygorii Strashko Move vcpu_switch_to_aarch64_mode() in arch_vcpu_create() callback instead of calling it manually from few different places after vc

Re: [XEN][PATCH 0/8] xen/arm64: make aarch32 support optional

2025-07-23 Thread Orzel, Michal
On 23/07/2025 10:06, Julien Grall wrote: > > > On 23/07/2025 08:58, Grygorii Strashko wrote: >> From: Grygorii Strashko >> >> Hi, > > Hi Grygorii, > >> Now Arm64 AArch32 guest support is always enabled and built-in while not >> all Arm64 platforms supports AArch32 or this support might not

Re: [XEN][PATCH 3/8] xen/arm: move vcpu_switch_to_aarch64_mode() in arm64

2025-07-23 Thread Grygorii Strashko
On 23.07.25 12:22, Julien Grall wrote: Hi, On 23/07/2025 08:58, Grygorii Strashko wrote: From: Grygorii Strashko The vcpu_switch_to_aarch64_mode() is Arm64 specific, so move it in Arm64. As part of this change: - introduce arm32/arm64 domain.h headers and include them in asm/domain.h basin

Re: [XEN][PATCH 2/2] xen/arm: irq: drop unreachable pirq callbacks

2025-07-23 Thread Jan Beulich
On 23.07.2025 12:37, Grygorii Strashko wrote: > On 18.07.25 17:18, Jan Beulich wrote: >> On 18.07.2025 13:47, Grygorii Strashko wrote: >>> On 18.07.25 13:22, Jan Beulich wrote: On 18.07.2025 12:11, Grygorii Strashko wrote: > From: Grygorii Strashko > > Hence all common PIRQ code i

Re: [XEN][PATCH 2/2] xen/arm: irq: drop unreachable pirq callbacks

2025-07-23 Thread Grygorii Strashko
On 18.07.25 17:18, Jan Beulich wrote: On 18.07.2025 13:47, Grygorii Strashko wrote: On 18.07.25 13:22, Jan Beulich wrote: On 18.07.2025 12:11, Grygorii Strashko wrote: From: Grygorii Strashko Hence all common PIRQ code is under CONFIG_HAS_PIRQ idefs corresponding Arm arch callbacks beco

Re: [XEN][PATCH 2/8] xen/arm: move vcpu_switch_to_aarch64_mode() in arch_vcpu_create()

2025-07-23 Thread Grygorii Strashko
On 23.07.25 12:16, Julien Grall wrote: Hi, On 23/07/2025 08:58, Grygorii Strashko wrote: From: Grygorii Strashko Move vcpu_switch_to_aarch64_mode() in arch_vcpu_create() callback instead of calling it manually from few different places after vcpu_create(). Before doing above ensure vcpu0

Re: [PATCH v8] xen/arm: pci: introduce PCI_PASSTHROUGH Kconfig option

2025-07-23 Thread Jan Beulich
On 13.06.2025 17:17, Stewart Hildebrand wrote: > --- a/xen/arch/arm/Kconfig > +++ b/xen/arch/arm/Kconfig > @@ -8,6 +8,8 @@ config ARM_64 > depends on !ARM_32 > select 64BIT > select HAS_FAST_MULTIPLY > + select HAS_VPCI_GUEST_SUPPORT if PCI_PASSTHROUGH > + select HAS_PASST

[PATCH] misra: address MISRA C Rule 18.3 compliance

2025-07-23 Thread Dmytro Prokopchuk1
Rule 18.3: "The relational operators >, >=, < and <= shall not be applied to objects of pointer type except where they point into the same object". Update relational comparison to cast `text_start` (void pointer) to `unsigned long`. This ensures the comparison occurs between two values of the same

  1   2   >