[PATCH v2 01/19] xen/x86: remove "depends on !PV_SHIM_EXCLUSIVE"

2025-03-25 Thread Penny Zheng
We intend to remove all "depends on !PV_SHIM_EXCLUSIVE" (also the functionally equivalent "if !...") in Kconfig file, since negative dependancy will badly affect allyesconfig. This commit is based on "x86: provide an inverted Kconfig control for shim-exclusive mode"[1] [1] https://lists.xen.org/ar

[PATCH v2 05/19] xen/sysctl: make CONFIG_TRACEBUFFER depend on CONFIG_SYSCTL

2025-03-25 Thread Penny Zheng
Users could only access trace buffers via hypercal XEN_SYSCTL_tbuf_op, so this commit makes CONFIG_TRACEBUFFER depend on CONFIG_SYSCTL Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini --- xen/common/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/common/Kconfig b/xen/c

[PATCH v2 18/19] xen/sysctl: wrap around arch-specific arch_do_sysctl

2025-03-25 Thread Penny Zheng
Function arch_do_sysctl is to perform arch-specific sysctl op. Some functions, like psr_get_info for x86, DTB overlay support for arm, are solely available through sysctl op, then they all shall be wrapped with CONFIG_SYSCTL Also, remove all #ifdef CONFIG_SYSCTL-s in arch-specific sysctl.c, as we p

[PATCH v2 11/19] xen/sysctl: wrap around XEN_SYSCTL_page_offline_op

2025-03-25 Thread Penny Zheng
The following functions are only to deal with XEN_SYSCTL_page_offline_op, then shall be wrapped: - xsm_page_offline - online_page - query_page_offline Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini --- v1 -> v2: - add transient #ifdef in sysctl.c for correct compilation - no need to

[PATCH v2 15/19] xen/sysctl: wrap around XEN_SYSCTL_physinfo

2025-03-25 Thread Penny Zheng
The following functions are only used to deal with XEN_SYSCTL_physinfo, then they shall be wrapped: - arch_do_physinfo - get_outstanding_claims Signed-off-by: Penny Zheng --- v1 -> v2: - no need to wrap declaration - add transient #ifdef in sysctl.c for correct compilation --- xen/arch/arm/sysct

[PATCH v2 09/19] xen/pmstat: clean up pmstat.c

2025-03-25 Thread Penny Zheng
We intend to move the following functions into drivers/acpi/pmstat.c, as they are all designed for performance statistic: - cpufreq_residency_update - cpufreq_statistic_reset - cpufreq_statistic_update - cpufreq_statistic_init - cpufreq_statistic_exit and moving out acpi_set_pdc_bits(), as it is th

[PATCH v2 17/19] xen/sysctl: make CONFIG_LIVEPATCH depend on CONFIG_SYSCTL

2025-03-25 Thread Penny Zheng
LIVEPATCH mechanism relies on LIVEPATCH_SYSCTL hypercall, so CONFIG_LIVEPATCH shall depend on CONFIG_SYSCTL Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini --- v1 -> v2: - commit message refactor --- xen/common/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v2 13/19] xen/sysctl: wrap around XEN_SYSCTL_scheduler_op

2025-03-25 Thread Penny Zheng
Function sched_adjust_global is designed for XEN_SYSCTL_scheduler_op, so itself and its calling flow, like .adjust_global, shall all be wrapped. Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini --- v1 -> v2: - no need to wrap declarations - add transient #ifdef in sysctl.c for correct

[PATCH v2 08/19] xen/sysctl: wrap around XEN_SYSCTL_lockprof_op

2025-03-25 Thread Penny Zheng
The following function is only to serve spinlock profiling via XEN_SYSCTL_lockprof_op, so it shall be wrapped: - spinlock_profile_control Signed-off-by: Penny Zheng --- v1 -> v2: - add transient #ifdef in sysctl.c for correct compilation --- xen/common/spinlock.c | 2 ++ xen/common/sysctl.c |

[PATCH v2 02/19] xen: introduce CONFIG_SYSCTL

2025-03-25 Thread Penny Zheng
From: Stefano Stabellini We intend to introduces a new Kconfig CONFIG_SYSCTL, which shall only be disabled on some dom0less systems, to reduce Xen footprint. Signed-off-by: Stefano Stabellini Signed-off-by: Sergiy Kibrik Signed-off-by: Penny Zheng --- v1 -> v2: - complement missing commit mes

[PATCH v2 16/19] xen/sysctl: make CONFIG_COVERAGE depend on CONFIG_SYSCTL

2025-03-25 Thread Penny Zheng
All coverage-related op shall be wrapped around with CONFIG_SYSCTL, so this commit makes CONFIG_COVERAGE depend on CONFIG_SYSCTL. Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini --- v1 -> v2: - commit message refactor --- --- xen/Kconfig.debug | 2 +- 1 file changed, 1 insertion(+),

[PATCH v2 19/19] xen/sysctl: wrap around sysctl hypercall

2025-03-25 Thread Penny Zheng
From: Stefano Stabellini We intend to wrap around sysctl hypercall, and also correct the order alphabetically We also need to removes all transient "#ifdef CONFIG_SYSCTL"-s in sysctl.c. Signed-off-by: Stefano Stabellini Signed-off-by: Sergiy Kibrik Signed-off-by: Penny Zheng --- v1 -> v2: - r

[PATCH v2 12/19] xen/sysctl: wrap around XEN_SYSCTL_cpupool_op

2025-03-25 Thread Penny Zheng
Function cpupool_do_sysctl is designed for doing cpupool related sysctl operations, and shall be wrapped. The following static functions are only called by cpupool_do_sysctl(), then shall be wrapped too: - cpupool_get_next_by_id - cpupool_destroy - cpupool_unassign_cpu_helper - cpupool_unassign_cp

[PATCH v2 10/19] xen/sysctl: introduce CONFIG_PM_STATS

2025-03-25 Thread Penny Zheng
We intend to introduce CONFIG_PM_STATS for wrapping all operations regarding performance management statistics. The major codes reside in xen/drivers/acpi/pmstat.c, including two main pm-related sysctl op: do_get_pm_info() and do_pm_op(). So This commit also makes CONFIG_PM_STATS depend on CONFIG_S

[PATCH v2 14/19] xen: make avail_domheap_pages() static

2025-03-25 Thread Penny Zheng
Function avail_domheap_pages() is only invoked by get_outstanding_claims(), so it could be inlined into its sole caller. Move up avail_heap_pages() to avoid declaration before get_outstanding_claims(). Signed-off-by: Penny Zheng --- v1 -> v2: - let avail_domheap_pages() being inlined into its sol

[PATCH v2 06/19] xen/sysctl: wrap around XEN_SYSCTL_sched_id

2025-03-25 Thread Penny Zheng
The following function shall be wrapped: - scheduler_id Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini --- xen/common/sched/core.c | 2 ++ xen/common/sysctl.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c index 904341429

[PATCH v2 04/19] xen/sysctl: wrap around XEN_SYSCTL_readconsole

2025-03-25 Thread Penny Zheng
The following functions is to deal with XEN_SYSCTL_readconsole sub-op, and shall be wrapped: - xsm_readconsole - read_console_ring Signed-off-by: Penny Zheng --- v1 -> v2: - remove redundant dummy handle - add transient #ifdef in sysctl.c for correct compilation --- xen/common/sysctl.c|

[PATCH v2 07/19] xen/sysctl: wrap around XEN_SYSCTL_perfc_op

2025-03-25 Thread Penny Zheng
perfc_control() and perfc_copy_info() are responsible for providing control of perf counters via XEN_SYSCTL_perfc_op in DOM0, so they both shall be wrapped. Signed-off-by: Penny Zheng --- - add transient #ifdef in sysctl.c for correct compilation --- xen/common/perfc.c | 2 ++ xen/common/sysctl

[PATCH v2 00/19] xen: introduce CONFIG_SYSCTL

2025-03-25 Thread Penny Zheng
It can be beneficial for some dom0less systems to further reduce Xen footprint and disable some hypercalls handling code, which may not to be used & required in such systems. Each hypercall has a separate option to keep configuration flexible. Options to disable hypercalls: - sysctl - domctl - hvm

[PATCH v2] xen/riscv: add H extenstion to -march

2025-03-25 Thread Oleksii Kurochko
H provides additional instructions and CSRs that control the new stage of address translation and support hosting a guest OS in virtual S-mode (VS-mode). According to the Unprivileged Architecture (version 20240411) specification: ``` Table 74 summarizes the standardized extension names. The table

Re: [PATCH v2] x86/irq: introduce APIC_VECTOR_VALID()

2025-03-25 Thread Andrew Cooper
On 24/03/2025 12:36 pm, Jan Beulich wrote: > On 21.03.2025 00:05, dm...@proton.me wrote: >> Add new macro APIC_VECTOR_VALID() to validate the interrupt vector >> range as per [1]. This macro replaces hardcoded checks against the >> open-coded value 16 in LAPIC and virtual LAPIC code and simplifies

[PATCH 1/2] x86/hvm: Rearrange the logic in hvmemul_{read,write}_cr()

2025-03-25 Thread Andrew Cooper
In hvmemul_read_cr(), make the TRACE()/X86EMUL_OKAY path common in preparation for adding a %cr8 case. Use a local 'val' variable instead of always operating on a deferenced pointer. In both, calculate curr once. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger

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

2025-03-25 Thread pr-tracker-bot
The pull request you sent on Sun, 23 Mar 2025 11:26:18 +0100: > git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git > for-linus-6.15-rc1-tag has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/dce3ab4c57e662ae019c22e7c2f2aa887617beae Thank you! -- Deet-doot-dot, I

linux-next: duplicate patches in the xen-tip tree

2025-03-25 Thread Stephen Rothwell
Hi all, The following commits are also in Linus Torvalds' tree as different commits (but the same patches): d9f2164238d8 ("PCI/MSI: Convert pci_msi_ignore_mask to per MSI domain flag") cae5129fccb1 ("PCI: vmd: Disable MSI remapping bypass under Xen") These are commits c3164d2e0d18 ("PCI/M

Re: [PATCH v3 1/5] xen/acpi: upload power and performance related data from a PVH dom0

2025-03-25 Thread Elliott Mitchell
On Thu, Mar 06, 2025 at 07:08:20PM +0800, Penny Zheng wrote: > From: Roger Pau Monne > > When running as a PVH dom0 the ACPI MADT is crafted by Xen in order to > report the correct numbers of vCPUs that dom0 has, so the host MADT is > not provided to dom0. This creates issues when parsing the po

[RFC PATCH] xen/device-tree: Switch back to dt_unreserved_regions() in boot allocator

2025-03-25 Thread Oleksandr Tyshchenko
On the device-tree-based Arm64 system, if Xen is built with CONFIG_ACPI=y, CONFIG_STATIC_MEMORY=y, and the static memory range is provided in the host device tree, the BUG is triggered in common/page_alloc.c during Xen's early boot. The BUG occurs when the first page from the static range is fed to

[PATCH] x86/bitops: Account for POPCNT errata on earlier Intel CPUs

2025-03-25 Thread Andrew Cooper
Manually break the false dependency for the benefit of cases such as bitmap_weight() which is a reasonable hotpath. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné Not sure if this warrants a fixes or not, but: Fixes: 6978602334d9 ("x86/bitops: Use the POPCNT instruction

Re: [PATCH v4 29/30] x86/mm, mm/vmalloc: Defer flush_tlb_kernel_range() targeting NOHZ_FULL CPUs

2025-03-25 Thread Jann Horn
On Tue, Mar 25, 2025 at 6:52 PM Valentin Schneider wrote: > On 20/02/25 09:38, Dave Hansen wrote: > > But, honestly, I'm still not sure this is worth all the trouble. If > > folks want to avoid IPIs for TLB flushes, there are hardware features > > that *DO* that. Just get new hardware instead of a

[PATCH] x86/elf: Remove ASM_CALL_CONSTRAINT from elf_core_save_regs()

2025-03-25 Thread Andrew Cooper
I was mistaken about when ASM_CALL_CONSTRAINT is applicable. It is not applicable for plain pushes/pops, so remove it from the flags logic. Clarify the description of ASM_CALL_CONSTRAINT to be explicit about unwinding using framepointers. Fixes: 0754534b8a38 ("x86/elf: Improve code generation in

[PATCH 0/2] x86/emul: Emulate %cr8 accesses

2025-03-25 Thread Andrew Cooper
This very quickly turned into a rats nest. I don't have time to fix %cr8 handling, so stay with a stopgap mitigation for introspection puporses, and leave some notes for later. Andrew Cooper (2): x86/hvm: Rearrange the logic in hvmemul_{read,write}_cr() x86/emul: Emulate %cr8 accesses xen/a

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

2025-03-25 Thread Oleksii Kurochko
preinit_xen_time() does two things: 1. Parse timebase-frequency properpy of /cpus node to initialize cpu_khz variable. 2. Initialize xen_start_clock_cycles with the current time counter value. Signed-off-by: Oleksii Kurochko --- Changes in v2: - Update SPDX tag for time.c - s/read_mostly/

[PATCH v2 3/4] xen/riscv: implement basic aplic_preinit()

2025-03-25 Thread Oleksii Kurochko
Introduce preinitialization stuff for the RISC-V Advanced Platform-Level Interrupt Controller (APLIC) in Xen: - Implementing the APLIC pre-initialization function (`aplic_preinit()`), ensuring that only one APLIC instance is supported in S mode. - Initialize APLIC's correspoinding DT node. -

[PATCH v2 2/4] automation: select APLIC and IMSIC to handle both wired interrupts and MSIs

2025-03-25 Thread Oleksii Kurochko
By default, the `aia` option is set to "none" which selects the SiFive PLIC for handling wired interrupts. However, since PLIC is now considered obsolete and will not be supported by Xen now, APLIC and IMSIC are selected instead to manage both wired interrupts and MSIs. Signed-off-by: Oleksii Kuro

[PATCH v18 0/2] PCI devices passthrough on Arm, part 3

2025-03-25 Thread Stewart Hildebrand
This is next version of vPCI rework. Aim of this series is to prepare ground for introducing PCI support on ARM platform. in v18: - address warning in vpci test suite in v17: - add ("xen/arm: check read handler behavior") - drop ("xen/arm: account IO handlers for emulated PCI MSI-X") as it

[PATCH v18 2/2] xen/arm: check read handler behavior

2025-03-25 Thread Stewart Hildebrand
We expect mmio read handlers to leave the bits above the access size zeroed. Add an ASSERT to check this aspect of read handler behavior. Suggested-by: Roger Pau Monné Signed-off-by: Stewart Hildebrand --- v17->v18: * no change v16->v17: * new patch See https://lore.kernel.org/xen-devel/bc666

[PATCH v18 1/2] xen/arm: translate virtual PCI bus topology for guests

2025-03-25 Thread Stewart Hildebrand
From: Oleksandr Andrushchenko There are three originators for the PCI configuration space access: 1. The domain that owns physical host bridge: MMIO handlers are there so we can update vPCI register handlers with the values written by the hardware domain, e.g. physical view of the registers vs gu

Re: [PATCH] RISCV/bitops: Use Zbb to provide arch-optimised bitops

2025-03-25 Thread Jan Beulich
On 25.03.2025 17:35, Oleksii Kurochko wrote: > > On 3/7/25 1:12 PM, Andrew Cooper wrote: >> On 07/03/2025 12:01 pm, Jan Beulich wrote: >>> On 07.03.2025 12:50, Oleksii Kurochko wrote: On 3/6/25 9:19 PM, Andrew Cooper wrote: > On 05/03/2025 7:34 am, Jan Beulich wrote: >> I was actually

Re: [PATCH v3 15/15] xen/cpufreq: Adapt SET/GET_CPUFREQ_CPPC xen_sysctl_pm_op for amd-cppc driver

2025-03-25 Thread Jan Beulich
On 06.03.2025 09:39, Penny Zheng wrote: > Introduce helper set_amd_cppc_para and get_amd_cppc_para to > SET/GET CPPC-related para for amd-cppc/amd-cppc-epp driver. > > Signed-off-by: Penny Zheng > --- > v1 -> v2: > - Give the variable des_perf an initializer of 0 > - Use the strncmp()s directly i

Re: [PATCH V2] xen/arm: Initialize acpi_disabled to true during declaration

2025-03-25 Thread Oleksandr Tyshchenko
On 25.03.25 18:09, Julien Grall wrote: > Hi Oleksandr, Hello Julien > > On 25/03/2025 16:05, Oleksandr Tyshchenko wrote: > Furthermore, what happen if we decide to use ACPI afterwards? Wouldn't > this mean that the static regions would be reserved even if ACPI > doesn't > us

Re: [PATCH v3 1/5] xen/acpi: upload power and performance related data from a PVH dom0

2025-03-25 Thread Jason Andryuk
On 2025-03-25 12:17, Jan Beulich wrote: On 06.03.2025 12:08, Penny Zheng wrote: From: Roger Pau Monne When running as a PVH dom0 the ACPI MADT is crafted by Xen in order to report the correct numbers of vCPUs that dom0 has, so the host MADT is not provided to dom0. This creates issues when pa

Re: [PATCH v2] xen/riscv: add H extenstion to -march

2025-03-25 Thread Oleksii Kurochko
On 3/25/25 5:26 PM, Jan Beulich wrote: On 25.03.2025 15:46, Oleksii Kurochko wrote: On 3/25/25 2:47 PM, Jan Beulich wrote: On 25.03.2025 14:02, Oleksii Kurochko wrote: On 3/25/25 12:52 PM, Jan Beulich wrote: On 25.03.2025 12:48, Oleksii Kurochko wrote: On 3/24/25 1:31 PM, Jan Beulich wrote:

Re: [PATCH v3 1/5] xen/acpi: upload power and performance related data from a PVH dom0

2025-03-25 Thread Jan Beulich
On 06.03.2025 12:08, Penny Zheng wrote: > From: Roger Pau Monne > > When running as a PVH dom0 the ACPI MADT is crafted by Xen in order to > report the correct numbers of vCPUs that dom0 has, so the host MADT is > not provided to dom0. This creates issues when parsing the power and > performance

Re: [PATCH v3 14/15] xen/xenpm: Adapt cpu frequency monitor in xenpm

2025-03-25 Thread Jason Andryuk
On 2025-03-25 07:26, Jan Beulich wrote: On 06.03.2025 09:39, Penny Zheng wrote: Make `xenpm get-cpureq-para/set-cpufreq-para` available in CPPC mode. --- a/tools/libs/ctrl/xc_pm.c +++ b/tools/libs/ctrl/xc_pm.c @@ -214,13 +214,12 @@ int xc_get_cpufreq_para(xc_interface *xch, int cpuid,

Re: [PATCH] RISCV/bitops: Use Zbb to provide arch-optimised bitops

2025-03-25 Thread Oleksii Kurochko
On 3/7/25 1:12 PM, Andrew Cooper wrote: On 07/03/2025 12:01 pm, Jan Beulich wrote: On 07.03.2025 12:50, Oleksii Kurochko wrote: On 3/6/25 9:19 PM, Andrew Cooper wrote: On 05/03/2025 7:34 am, Jan Beulich wrote: I was actually hoping to eliminate BITS_PER_LONG at some point, in favor of using

Re: [PATCH v2] xen/riscv: add H extenstion to -march

2025-03-25 Thread Jan Beulich
On 25.03.2025 15:46, Oleksii Kurochko wrote: > > On 3/25/25 2:47 PM, Jan Beulich wrote: >> On 25.03.2025 14:02, Oleksii Kurochko wrote: >>> On 3/25/25 12:52 PM, Jan Beulich wrote: On 25.03.2025 12:48, Oleksii Kurochko wrote: > On 3/24/25 1:31 PM, Jan Beulich wrote: >> On 21.03.2025 17

Re: [PATCH v2] xen/riscv: add H extenstion to -march

2025-03-25 Thread Jan Beulich
On 25.03.2025 14:02, Oleksii Kurochko wrote: > > On 3/25/25 12:52 PM, Jan Beulich wrote: >> On 25.03.2025 12:48, Oleksii Kurochko wrote: >>> On 3/24/25 1:31 PM, Jan Beulich wrote: On 21.03.2025 17:17, Oleksii Kurochko wrote: > H provides additional instructions and CSRs that control the n

Re: [PATCH V2] xen/arm: Initialize acpi_disabled to true during declaration

2025-03-25 Thread Julien Grall
Hi Oleksandr, On 25/03/2025 16:05, Oleksandr Tyshchenko wrote: Furthermore, what happen if we decide to use ACPI afterwards? Wouldn't this mean that the static regions would be reserved even if ACPI doesn't use static memory (all the memory is expected to be given to the allocator)? I don't thi

Re: [PATCH 1/3] CI: Update build tests based on new minimum toolchain requirements

2025-03-25 Thread Anthony PERARD
On Thu, Mar 20, 2025 at 04:01:36PM +, Andrew Cooper wrote: > On 20/03/2025 3:59 pm, Andrew Cooper wrote: > > Drop CentOS 7 entirely. It's way to old now. > > > > Ubuntu 22.04 is the oldest Ubuntu with a suitable version of Clang, so swap > > the 16.04 clang builds for 22.04. > > > > Signed-off

Re: [PATCH V2] xen/arm: Initialize acpi_disabled to true during declaration

2025-03-25 Thread Oleksandr Tyshchenko
On 25.03.25 17:47, Julien Grall wrote: Hello Julien, Michal. > Hi Michal, > > On 25/03/2025 15:35, Orzel, Michal wrote: >> >> >> On 25/03/2025 16:23, Julien Grall wrote: >>> >>> >>> Hi Oleksandr, Michal, >>> >>> On 25/03/2025 15:08, Oleksandr Tyshchenko wrote: On the device-tree-based Ar

Re: [PATCH V2] xen/arm: Initialize acpi_disabled to true during declaration

2025-03-25 Thread Orzel, Michal
On 25/03/2025 16:23, Julien Grall wrote: > > > Hi Oleksandr, Michal, > > On 25/03/2025 15:08, Oleksandr Tyshchenko wrote: >> On the device-tree-based Arm64 system, if Xen is built with >> CONFIG_ACPI=y, CONFIG_STATIC_MEMORY=y, and the static memory range >> is provided in the host device tree

Re: [PATCH V2] xen/arm: Initialize acpi_disabled to true during declaration

2025-03-25 Thread Julien Grall
Hi Michal, On 25/03/2025 15:35, Orzel, Michal wrote: On 25/03/2025 16:23, Julien Grall wrote: Hi Oleksandr, Michal, On 25/03/2025 15:08, Oleksandr Tyshchenko wrote: On the device-tree-based Arm64 system, if Xen is built with CONFIG_ACPI=y, CONFIG_STATIC_MEMORY=y, and the static memory ran

Re: [PATCH V2] xen/arm: Initialize acpi_disabled to true during declaration

2025-03-25 Thread Julien Grall
Hi Oleksandr, Michal, On 25/03/2025 15:08, Oleksandr Tyshchenko wrote: On the device-tree-based Arm64 system, if Xen is built with CONFIG_ACPI=y, CONFIG_STATIC_MEMORY=y, and the static memory range is provided in the host device tree, the BUG is triggered in common/page_alloc.c during Xen's earl

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

2025-03-25 Thread Juergen Gross
On 14.03.25 13:18, Juergen Gross wrote: 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 This patch is still missing an Ack. J

[PATCH V2] xen/arm: Initialize acpi_disabled to true during declaration

2025-03-25 Thread Oleksandr Tyshchenko
On the device-tree-based Arm64 system, if Xen is built with CONFIG_ACPI=y, CONFIG_STATIC_MEMORY=y, and the static memory range is provided in the host device tree, the BUG is triggered in common/page_alloc.c during Xen's early boot. The BUG occurs when the first page from the static range is fed to

Re: [PATCH v2] xen/riscv: add H extenstion to -march

2025-03-25 Thread Oleksii Kurochko
On 3/25/25 2:47 PM, Jan Beulich wrote: On 25.03.2025 14:02, Oleksii Kurochko wrote: On 3/25/25 12:52 PM, Jan Beulich wrote: On 25.03.2025 12:48, Oleksii Kurochko wrote: On 3/24/25 1:31 PM, Jan Beulich wrote: On 21.03.2025 17:17, Oleksii Kurochko wrote: H provides additional instructions and

Re: [PATCH] xenpm: sanitize allocations in show_cpufreq_para_by_cpuid()

2025-03-25 Thread Jan Beulich
On 25.03.2025 15:30, Jan Beulich wrote: > On 25.03.2025 15:20, Andrew Cooper wrote: >> On 25/03/2025 12:51 pm, Jan Beulich wrote: >>> malloc(), when passed zero size, may return NULL (the behavior is >>> implementation defined). >> >> More importantly, this is the Musl behaviour, so is how ~most of

Re: [PATCH] xenpm: sanitize allocations in show_cpufreq_para_by_cpuid()

2025-03-25 Thread Jan Beulich
On 25.03.2025 15:20, Andrew Cooper wrote: > On 25/03/2025 12:51 pm, Jan Beulich wrote: >> malloc(), when passed zero size, may return NULL (the behavior is >> implementation defined). > > More importantly, this is the Musl behaviour, so is how ~most of Gitlab > CI behaves. > >> Extend the ->gov_

Re: [PATCH] xenpm: sanitize allocations in show_cpufreq_para_by_cpuid()

2025-03-25 Thread Andrew Cooper
On 25/03/2025 12:51 pm, Jan Beulich wrote: > malloc(), when passed zero size, may return NULL (the behavior is > implementation defined). More importantly, this is the Musl behaviour, so is how ~most of Gitlab CI behaves. > Extend the ->gov_num check to the other two > allocations as well. I'm

Re: [PATCH] tools/arm: Fix nr_spis handling v2

2025-03-25 Thread Alejandro Vallejo
On Mon Mar 24, 2025 at 3:31 PM GMT, Michal Orzel wrote: > > > On 24/03/2025 16:22, Alejandro Vallejo wrote: > > > > > > On Mon Mar 24, 2025 at 1:08 PM GMT, Michal Orzel wrote: > >> > >> > >> On 19/03/2025 15:01, Alejandro Vallejo wrote: > >>> > >>> Doesn't this regenerate the golang bindings? > >

Re: [PATCH] x86/pmstat: fold two allocations in get_cpufreq_para()

2025-03-25 Thread Andrew Cooper
On 25/03/2025 2:00 pm, Jan Beulich wrote: > On 25.03.2025 14:52, Andrew Cooper wrote: >> On 25/03/2025 12:53 pm, Jan Beulich wrote: >>> --- a/xen/drivers/acpi/pmstat.c >>> +++ b/xen/drivers/acpi/pmstat.c >>> @@ -219,25 +218,22 @@ static int get_cpufreq_para(struct xen_s >>> return -EAGAIN;

Re: [PATCH] x86/pmstat: fold two allocations in get_cpufreq_para()

2025-03-25 Thread Jan Beulich
On 25.03.2025 14:52, Andrew Cooper wrote: > On 25/03/2025 12:53 pm, Jan Beulich wrote: >> There's little point in allocation two uint32_t[] arrays separately. >> We'll need the bigger of the two anyway, and hence we can use that >> bigger one also for transiently storing the smaller number of items

Re: [PATCH v3 09/15] xen/x86: introduce a new amd cppc driver for cpufreq scaling

2025-03-25 Thread Jason Andryuk
On 2025-03-25 05:57, Jan Beulich wrote: On 06.03.2025 09:39, Penny Zheng wrote: +static int cf_check amd_cppc_cpufreq_target(struct cpufreq_policy *policy, +unsigned int target_freq, +unsigned int relation)

Re: [PATCH] x86/pmstat: fold two allocations in get_cpufreq_para()

2025-03-25 Thread Andrew Cooper
On 25/03/2025 12:53 pm, Jan Beulich wrote: > There's little point in allocation two uint32_t[] arrays separately. > We'll need the bigger of the two anyway, and hence we can use that > bigger one also for transiently storing the smaller number of items. > > While there also drop j (we can use i twi

Re: [PATCH v2] xen/riscv: add H extenstion to -march

2025-03-25 Thread Oleksii Kurochko
On 3/25/25 12:52 PM, Jan Beulich wrote: On 25.03.2025 12:48, Oleksii Kurochko wrote: On 3/24/25 1:31 PM, Jan Beulich wrote: On 21.03.2025 17:17, Oleksii Kurochko wrote: H provides additional instructions and CSRs that control the new stage of address translation and support hosting a guest OS

[PATCH] x86/pmstat: fold two allocations in get_cpufreq_para()

2025-03-25 Thread Jan Beulich
There's little point in allocation two uint32_t[] arrays separately. We'll need the bigger of the two anyway, and hence we can use that bigger one also for transiently storing the smaller number of items. While there also drop j (we can use i twice) and adjust the type of the remaining two variabl

[PATCH] xenpm: sanitize allocations in show_cpufreq_para_by_cpuid()

2025-03-25 Thread Jan Beulich
malloc(), when passed zero size, may return NULL (the behavior is implementation defined). Extend the ->gov_num check to the other two allocations as well. Don't chance then actually using a NULL in print_cpufreq_para(). Fixes: 75e06d089d48 ("xenpm: add cpu frequency control interface, through whi

Re: [PATCH v4] x86/PVH: account for module command line length

2025-03-25 Thread Jason Andryuk
On 2025-03-25 04:47, Jan Beulich wrote: As per observation in practice, initrd->cmdline_pa is not normally zero. Hence so far we always appended at least one byte. That alone may already render insufficient the "allocation" made by find_memory(). Things would be worse when there's actually a (per

Re: [RFC PATCH] xen/device-tree: Switch back to dt_unreserved_regions() in boot allocator

2025-03-25 Thread Oleksandr Tyshchenko
On 25.03.25 10:46, Orzel, Michal wrote: Hello Michal > > > On 24/03/2025 22:27, Oleksandr Tyshchenko wrote: >> >> >> On the device-tree-based Arm64 system, if Xen is built with >> CONFIG_ACPI=y, CONFIG_STATIC_MEMORY=y, and the static memory range >> is provided in the host device tree, the BUG

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

2025-03-25 Thread Jan Beulich
On 25.03.2025 12:23, Oleksii Kurochko wrote: > > On 3/17/25 4:24 PM, Jan Beulich wrote: >> On 11.03.2025 17:19, Oleksii Kurochko wrote: >> +static __initdata struct dt_device_node *timer; >> + >> +/* Set up the timer on the boot CPU (early init function) */ >> +static void __init preinit_dt_xen_ti

Re: [PATCH v2] xen/riscv: add H extenstion to -march

2025-03-25 Thread Jan Beulich
On 25.03.2025 12:48, Oleksii Kurochko wrote: > > On 3/24/25 1:31 PM, Jan Beulich wrote: >> On 21.03.2025 17:17, Oleksii Kurochko wrote: >>> H provides additional instructions and CSRs that control the new stage of >>> address translation and support hosting a guest OS in virtual S-mode >>> (VS-mod

Re: [PATCH v2] xen/riscv: add H extenstion to -march

2025-03-25 Thread Oleksii Kurochko
On 3/24/25 1:31 PM, Jan Beulich wrote: On 21.03.2025 17:17, Oleksii Kurochko wrote: H provides additional instructions and CSRs that control the new stage of address translation and support hosting a guest OS in virtual S-mode (VS-mode). According to the Unprivileged Architecture (version 2024

Re: [PATCH] lib/inflate.c: remove dead code

2025-03-25 Thread Andrew Cooper
On 25/03/2025 8:13 am, Jan Beulich wrote: > From: Ariel Otilibili > > This is a follow up from a discussion in Xen: > > The if-statement tests that `res` is non-zero; meaning the case zero is > never reached. > > Link: > https://lore.kernel.org/all/7587b503-b2ca-4476-8dc9-e9683d4ca...@suse.com/ >

Re: VIF network definition does not work with backend=domnet

2025-03-25 Thread Shen Long
Am 23.03.25 um 15:56 schrieb Jason Andryuk: On Sat, Mar 22, 2025 at 8:51 AM Shen Long wrote: Hello, Hi Shen, Hi Jason, Try: vif = [ 'backend=netbackend,bridge=dmz,type=vif' ] This will give "test" just a PV nic (and not an emulated nic). yes, thank you thats it! Though to be fair, i

Re: [RFC PATCH] xen/device-tree: Switch back to dt_unreserved_regions() in boot allocator

2025-03-25 Thread Oleksandr Tyshchenko
Hello all. Please, ignore this second email, it was sent by mistake. -- Regards, Oleksandr Tyshchenko

Re: [PATCH v3 14/15] xen/xenpm: Adapt cpu frequency monitor in xenpm

2025-03-25 Thread Jan Beulich
On 06.03.2025 09:39, Penny Zheng wrote: > Make `xenpm get-cpureq-para/set-cpufreq-para` available in CPPC mode. > --- a/tools/libs/ctrl/xc_pm.c > +++ b/tools/libs/ctrl/xc_pm.c > @@ -214,13 +214,12 @@ int xc_get_cpufreq_para(xc_interface *xch, int cpuid, >user_para->gov_num *

Re: [PATCH v3 12/15] xen/x86: implement EPP support for the amd-cppc driver in active mode

2025-03-25 Thread Jan Beulich
On 06.03.2025 09:39, Penny Zheng wrote: > amd-cppc has 2 operation modes: autonomous (active) mode, > non-autonomous (passive) mode. > In active mode, platform ignores the requestd done in the Desired > Performance Target register and takes into account only the values > set to the minimum, maximum

[PATCH v2] tools/arm: Fix nr_spis handling v2

2025-03-25 Thread Michal Orzel
We are missing a way to detect whether a user provided a value for nr_spis equal to 0 or did not provide any value (default is also 0) which can cause issues when calculated nr_spis is > 0 and the value from domain config is 0. Fix it by setting default value for nr_spis to newly added LIBXL_NR_SPI

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

2025-03-25 Thread Nicola Vetrini
On 2025-03-24 16:47, Jan Beulich wrote: On 06.03.2025 09:39, Penny Zheng wrote: This commit fixes core frequency calculation for AMD Family 1Ah CPUs, due to a change in the PStateDef MSR layout in AMD Family 1Ah+. In AMD Family 1Ah+, Core current operating frequency in MHz is calculated as fo

Re: [PATCH v3 3/3] PCI/MSI: Convert pci_msi_ignore_mask to per MSI domain flag

2025-03-25 Thread Roger Pau Monné
On Tue, Mar 25, 2025 at 11:27:51AM +0100, Thomas Gleixner wrote: > On Tue, Mar 25 2025 at 11:22, Roger Pau Monné wrote: > > On Tue, Mar 25, 2025 at 10:20:43AM +0100, Thomas Gleixner wrote: > > I'm a bit confused by what msi_create_device_irq_domain() does, as it > > does allocate an irq_domain with

Re: [PATCH v3 3/3] PCI/MSI: Convert pci_msi_ignore_mask to per MSI domain flag

2025-03-25 Thread Roger Pau Monné
On Tue, Mar 25, 2025 at 10:20:43AM +0100, Thomas Gleixner wrote: > On Tue, Mar 25 2025 at 09:11, Thomas Gleixner wrote: > > > On Mon, Mar 24 2025 at 20:18, Roger Pau Monné wrote: > >> On Mon, Mar 24, 2025 at 07:58:14PM +0100, Daniel Gomez wrote: > >>> The issue is that info appears to be uninitial

Re: [PATCH v3 09/15] xen/x86: introduce a new amd cppc driver for cpufreq scaling

2025-03-25 Thread Jan Beulich
On 06.03.2025 09:39, Penny Zheng wrote: > v2 -> v3: > - Move all MSR-definations to msr-index.h and follow the required style > - Refactor opening figure braces for struct/union > - Sort overlong lines throughout the series > - Make offset/res int covering underflow scenario > - Error out when amd_

Re: [PATCH v3 3/3] PCI/MSI: Convert pci_msi_ignore_mask to per MSI domain flag

2025-03-25 Thread Thomas Gleixner
On Tue, Mar 25 2025 at 11:22, Roger Pau Monné wrote: > On Tue, Mar 25, 2025 at 10:20:43AM +0100, Thomas Gleixner wrote: > I'm a bit confused by what msi_create_device_irq_domain() does, as it > does allocate an irq_domain with an associated msi_domain_info > structure, however that irq_domain is se

Re: [PATCH v3 05/15] xen/x86: introduce "cpufreq=amd-cppc" xen cmdline

2025-03-25 Thread Jan Beulich
On 06.03.2025 09:39, Penny Zheng wrote: > +static const struct cpufreq_driver __initconst_cf_clobber > +amd_cppc_cpufreq_driver = > +{ > +.name = XEN_AMD_CPPC_DRIVER_NAME, > +}; Because of the hook pointers not being set right here, ... > +int __init amd_cppc_register_driver(void) > +{ > +

Re: [PATCH v3 3/3] PCI/MSI: Convert pci_msi_ignore_mask to per MSI domain flag

2025-03-25 Thread Daniel Gomez
On Tue, Mar 25, 2025 at 10:20:43AM +0100, Thomas Gleixner wrote: > On Tue, Mar 25 2025 at 09:11, Thomas Gleixner wrote: > > > On Mon, Mar 24 2025 at 20:18, Roger Pau Monné wrote: > >> On Mon, Mar 24, 2025 at 07:58:14PM +0100, Daniel Gomez wrote: > >>> The issue is that info appears to be uninitial

[MINI-OS PATCH v3 0/2] 9pfs: add some file operation hooks

2025-03-25 Thread Juergen Gross
For being able to store the Xenstore state in preparation of a live update operation, 9pfront is needing support for fstat and lseek. Changes in V2: - addressed comment for patch 1 Changes in V3: - addressed comment for patch 1 Juergen Gross (2): 9pfs: add fstat file operation hook 9pfs: add

[MINI-OS PATCH v3 1/2] 9pfs: add fstat file operation hook

2025-03-25 Thread Juergen Gross
Add a file operations fstat hook to the 9pfs frontend. Signed-off-by: Juergen Gross Reviewed-by: Jason Andryuk Reviewed-by: Samuel Thibault --- V2: - or file access mode into st_mode (Jason Andryuk) V3: - set st_ctime, too (Samuel Thibault) --- 9pfront.c | 30 ++ 1

Re: [PATCH v3 3/3] PCI/MSI: Convert pci_msi_ignore_mask to per MSI domain flag

2025-03-25 Thread Thomas Gleixner
On Tue, Mar 25 2025 at 09:11, Thomas Gleixner wrote: > On Mon, Mar 24 2025 at 20:18, Roger Pau Monné wrote: >> On Mon, Mar 24, 2025 at 07:58:14PM +0100, Daniel Gomez wrote: >>> The issue is that info appears to be uninitialized. So, this worked for me: >> >> Indeed, irq_domain->host_data is NULL,

[PATCH v4] x86/PVH: account for module command line length

2025-03-25 Thread Jan Beulich
As per observation in practice, initrd->cmdline_pa is not normally zero. Hence so far we always appended at least one byte. That alone may already render insufficient the "allocation" made by find_memory(). Things would be worse when there's actually a (perhaps long) command line. Skip setup when

Re: [PATCH v3 3/3] PCI/MSI: Convert pci_msi_ignore_mask to per MSI domain flag

2025-03-25 Thread Thomas Gleixner
On Mon, Mar 24 2025 at 20:18, Roger Pau Monné wrote: > On Mon, Mar 24, 2025 at 07:58:14PM +0100, Daniel Gomez wrote: >> The issue is that info appears to be uninitialized. So, this worked for me: > > Indeed, irq_domain->host_data is NULL, there's no msi_domain_info. As > this is x86, I was expecti

Re: [RFC PATCH] xen/device-tree: Switch back to dt_unreserved_regions() in boot allocator

2025-03-25 Thread Orzel, Michal
On 24/03/2025 22:27, Oleksandr Tyshchenko wrote: > > > On the device-tree-based Arm64 system, if Xen is built with > CONFIG_ACPI=y, CONFIG_STATIC_MEMORY=y, and the static memory range > is provided in the host device tree, the BUG is triggered in > common/page_alloc.c during Xen's early boot.

Re: [PATCH v3 02/15] xen/x86: introduce new sub-hypercall to propagate CPPC data

2025-03-25 Thread Jan Beulich
On 25.03.2025 05:12, Penny, Zheng wrote: >> -Original Message- >> From: Jan Beulich >> Sent: Monday, March 24, 2025 10:28 PM >> >> On 06.03.2025 09:39, Penny Zheng wrote: >>> +pm_info = processor_pminfo[cpuid]; >>> +/* Must already allocated in set_psd_pminfo */ >>> +if ( !pm_i

[PATCH] lib/inflate.c: remove dead code

2025-03-25 Thread Jan Beulich
From: Ariel Otilibili This is a follow up from a discussion in Xen: The if-statement tests that `res` is non-zero; meaning the case zero is never reached. Link: https://lore.kernel.org/all/7587b503-b2ca-4476-8dc9-e9683d4ca...@suse.com/ Link: https://lkml.kernel.org/r/20241219092615.644642-2-ar

Re: [PATCH v3] x86/PVH: account for module command line length

2025-03-25 Thread Jan Beulich
On 24.03.2025 19:24, Andrew Cooper wrote: > On 24/03/2025 12:03 pm, Jan Beulich wrote: >> As per observation in practice, initrd->cmdline_pa is not normally zero. >> Hence so far we always appended at least one byte. That alone may >> already render insufficient the "allocation" made by find_memory

Re: [PATCH v4 4/5] xen/arm: ffa: Add indirect message between VM

2025-03-25 Thread Jens Wiklander
Hi Bertrand, On Mon, Mar 24, 2025 at 2:53 PM Bertrand Marquis wrote: > > Add support for indirect messages between VMs. > This is only enabled if CONFIG_FFA_VM_TO_VM is selected. > > Signed-off-by: Bertrand Marquis > --- > Changes in v4: > - Use a local copy of the message header to prevent a TO

Re: [PATCH v4 1/5] xen/arm: Create tee command line parameter

2025-03-25 Thread Jens Wiklander
Hi Bertrand, On Mon, Mar 24, 2025 at 2:53 PM Bertrand Marquis wrote: > > Add a new command line parameter "tee=" to be used to explicitly select > what tee mediator is to be used by Xen and fail if it does not exist > or the probe function for it failed. > > Without specifying which tee is to be

Re: [PATCH v4 2/5] xen/arm: ffa: Introduce VM to VM support

2025-03-25 Thread Jens Wiklander
Hi Bertrand, On Mon, Mar 24, 2025 at 2:58 PM Bertrand Marquis wrote: > > Hi, > > > On 24 Mar 2025, at 14:53, Bertrand Marquis wrote: > > > > Create a CONFIG_FFA_VM_TO_VM parameter to activate FFA communication > > between VMs. > > When activated list VMs in the system with FF-A support in part_i

Re: [XEN PATCH v1 1/4] x86:svm: use nsvm_efer_svm_enabled() to check guest's EFER.SVME

2025-03-25 Thread Jan Beulich
On 20.03.2025 11:34, Sergiy Kibrik wrote: > There's a macro for this, might improve readability a bit & save a bit of > space. > > Signed-off-by: Sergiy Kibrik Acked-by: Jan Beulich

[PATCH] x86/CPU: don't hard-code MTRR availability

2025-03-25 Thread Jan Beulich
In particular if we're running virtualized, the underlying hypervisor (which may be another Xen) may not surface MTRRs, and offer PAT only. Fixes: 5a281883cdc3 ("Hardcode many cpu features for x86/64 -- we know 64-bit") Signed-off-by: Jan Beulich --- a/xen/arch/x86/include/asm/cpufeature.h +++ b

[PATCH v2] x86/P2M: synchronize fast and slow paths of p2m_get_page_from_gfn()

2025-03-25 Thread Jan Beulich
Handling of both grants and foreign pages was different between the two paths. While permitting access to grants would be desirable, doing so would require more involved handling; undo that for the time being. In particular the page reference obtained would prevent the owning domain from changing