[PATCH v6 02/18] xen/xsm: wrap around xsm_sysctl with CONFIG_SYSCTL

2025-07-04 Thread Penny Zheng
As function xsm_sysctl() is solely invoked in sysctl.c, we need to wrap around it with CONFIG_SYSCTL Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini --- xen/include/xsm/xsm.h | 4 xen/xsm/dummy.c | 2 ++ xen/xsm/flask/hooks.c | 4 3 files changed, 10 insertions(+) di

[PATCH v6 01/18] xen: introduce CONFIG_SYSCTL

2025-07-04 Thread Penny Zheng
From: Stefano Stabellini We introduce a new Kconfig CONFIG_SYSCTL, which shall only be disabled on some dom0less systems or PV shim on x86, to reduce Xen footprint. Making SYSCTL without prompt is transient and it will be adjusted in the final patch. And the consequence of introducing "CONFIG_SY

[PATCH v6 04/18] xen/sysctl: make CONFIG_TRACEBUFFER depend on CONFIG_SYSCTL

2025-07-04 Thread Penny Zheng
Users could only access trace buffers via hypercall XEN_SYSCTL_tbuf_op, so we shall make 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/comm

[PATCH v6 10/18] xen/sysctl: wrap around XEN_SYSCTL_page_offline_op

2025-07-04 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 ne

Re: [RFC PATCH] xen/flask: estimate max sidtable size

2025-07-04 Thread Jan Beulich
On 04.07.2025 12:10, Sergiy Kibrik wrote: > 01.07.25 13:42, Jan Beulich: >> On 30.06.2025 10:55, Sergiy Kibrik wrote: >>> @@ -54,4 +54,7 @@ $(obj)/policy.bin: FORCE >>> FLASK_BUILD_DIR=$(FLASK_BUILD_DIR) POLICY_FILENAME=$(POLICY_SRC) >>> cmp -s $(POLICY_SRC) $@ || cp $(POLICY_SRC) $

Re: [PATCH v5 14/18] xen/cpufreq: introduce GET_CPUFREQ_CPPC sub-cmd

2025-07-04 Thread Jan Beulich
On 04.07.2025 10:56, Penny, Zheng wrote: > [Public] > >> -Original Message- >> From: Jan Beulich >> Sent: Friday, July 4, 2025 4:33 PM >> To: Penny, Zheng ; Andryuk, Jason >> >> Cc: Huang, Ray ; Anthony PERARD >> ; Juergen Gross ; Andrew >> Cooper ; Orzel, Michal ; >> Julien Grall ; Roge

[PATCH v6 18/18] xen/sysctl: wrap around sysctl hypercall

2025-07-04 Thread Penny Zheng
From: Stefano Stabellini Wrap sysctl hypercall def and sysctl.o with CONFIG_SYSCTL, and since PV_SHIM_EXCLUSIVE needs sorting in the future, we move them out of PV_SHIM_EXCLUSIVE condition at the same time. We need to make SYSCTL with prompt back, add help info and set default value as y. We sha

[PATCH v6 17/18] xen/x86: remove "depends on !PV_SHIM_EXCLUSIVE"

2025-07-04 Thread Penny Zheng
Remove all "depends on !PV_SHIM_EXCLUSIVE" (also the functionally equivalent "if !...") in Kconfig file, since negative dependancy will badly affect allyesconfig. Although "if !PV_SHIM_EXCLUSIVE" for CONFIG_VGA is not truly a dependency, setting PV_SHIM_EXCLUSIVE y still makes it unconfigurable. So

Re: [PATCH v4 59/65] accel: Always register AccelOpsClass::get_virtual_clock() handler

2025-07-04 Thread Mads Ynddal
> On 2 Jul 2025, at 20.53, Philippe Mathieu-Daudé wrote: > > In order to dispatch over AccelOpsClass::get_virtual_clock(), > we need it always defined, not calling a hidden handler under > the hood. Make AccelOpsClass::get_virtual_clock() mandatory. > Register the default cpus_kick_thread() for

Re: [PATCH v4 58/65] accel: Always register AccelOpsClass::get_elapsed_ticks() handler

2025-07-04 Thread Mads Ynddal
> On 2 Jul 2025, at 20.53, Philippe Mathieu-Daudé wrote: > > In order to dispatch over AccelOpsClass::get_elapsed_ticks(), > we need it always defined, not calling a hidden handler under > the hood. Make AccelOpsClass::get_elapsed_ticks() mandatory. > Register the default cpus_kick_thread() for

Re: [RFC PATCH] xen/flask: estimate max sidtable size

2025-07-04 Thread Sergiy Kibrik
01.07.25 13:42, Jan Beulich: On 30.06.2025 10:55, Sergiy Kibrik wrote: Currently Xen lacks a defined largest number of security IDs it can potentially use. The number of SIDs are naturally limited by number of security contexts provided by a given security policy, i.e. how many combination of us

Re: [PATCH 5/6] x86/idle: Drop incorrect smp_mb() in mwait_idle_with_hints()

2025-07-04 Thread Andrew Cooper
On 03/07/2025 2:30 pm, Jan Beulich wrote: > On 03.07.2025 14:37, Andrew Cooper wrote: >> On 03/07/2025 10:24 am, Jan Beulich wrote: >>> On 02.07.2025 16:41, Andrew Cooper wrote: With the recent simplifications, it becomes obvious that smp_mb() isn't the right barrier; all we need is a com

RE: [PATCH v5 14/18] xen/cpufreq: introduce GET_CPUFREQ_CPPC sub-cmd

2025-07-04 Thread Penny, Zheng
[Public] > -Original Message- > From: Jan Beulich > Sent: Friday, July 4, 2025 4:33 PM > To: Penny, Zheng ; Andryuk, Jason > > Cc: Huang, Ray ; Anthony PERARD > ; Juergen Gross ; Andrew > Cooper ; Orzel, Michal ; > Julien Grall ; Roger Pau Monné ; Stefano > Stabellini ; xen-devel@lists.x

[PATCH] xen/arm32: Tidy up setup_mm()

2025-07-04 Thread Michal Orzel
The current look and feel of setup_mm() leaves a lot to be desired. The scope of variables is not the best, many variables are not really needed while some others are set but not used. The first iteration of membanks is split from the loop for no reason. Tidy up this function for better readability

Re: [PATCH v6 00/18] xen: introduce CONFIG_SYSCTL

2025-07-04 Thread Jan Beulich
On 04.07.2025 11:29, Penny Zheng wrote: > It can be beneficial for some dom0less systems to further reduce Xen footprint > via disabling some hypercalls handling code, which may not to be used & > required in such systems. Each hypercall has a separate option to keep > configuration flexible. > >

[PATCH v6 16/18] xen/sysctl: wrap around arch-specific arch_do_sysctl

2025-07-04 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 w

[PATCH v6 12/18] xen/sysctl: wrap around XEN_SYSCTL_scheduler_op

2025-07-04 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 Acked-by: Stewart Hildebrand #a653 --- v1 -> v2: - no need to wrap declarations - add trans

[PATCH v6 15/18] xen/sysctl: make CONFIG_LIVEPATCH depend on CONFIG_SYSCTL

2025-07-04 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 v6 13/18] xen/sysctl: wrap around XEN_SYSCTL_physinfo

2025-07-04 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 Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- v1 -> v2: - no need to wrap declaration - add transient #ifdef

[PATCH v6 14/18] xen/sysctl: make CONFIG_COVERAGE depend on CONFIG_SYSCTL

2025-07-04 Thread Penny Zheng
Users rely on SYSCTL_coverage_op hypercall to interact with the coverage data, that is, according operations shall be wrapped around with CONFIG_SYSCTL. Right now, it is compiled under CONFIG_COVERAGE, so we shall make CONFIG_COVERAGE depend on CONFIG_SYSCTL. Signed-off-by: Penny Zheng Reviewed-b

[PATCH v6 09/18] xen/sysctl: introduce CONFIG_PM_STATS

2025-07-04 Thread Penny Zheng
We introduce a new Kconfig CONFIG_PM_STATS for wrapping all operations regarding performance management statistics. The major codes reside in xen/drivers/acpi/pmstat.c, including the pm-statistic-related sysctl op: do_get_pm_info(). CONFIG_PM_STATS also shall depend on CONFIG_SYSCTL We shall also

[PATCH v6 08/18] xen/pmstat: introduce CONFIG_PM_OP

2025-07-04 Thread Penny Zheng
We move the following functions into a new file drivers/acpi/pm-op.c, as they are all more fitting in performance controling and only called by do_pm_op(): - get_cpufreq_para() - set_cpufreq_para() - set_cpufreq_gov() - set_cpufreq_cppc() - cpufreq_driver_getavg() - cpufreq_update_turbo() -

[PATCH v6 07/18] xen/sysctl: wrap around XEN_SYSCTL_lockprof_op

2025-07-04 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 Reviewed-by: Stefano Stabellini --- v2 -> v3: - add the blank line --- v3 -> v4: - remove transient "#ifdef CONFIG_SYSCTL" --- x

[PATCH v6 03/18] xen/sysctl: wrap around XEN_SYSCTL_readconsole

2025-07-04 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 Reviewed-by: Stefano Stabellini --- v2 -> v3: - move #endif up ahead of the blank line --- v3 -> v4: - remove transient "#ifdef CONFIG

[PATCH v6 05/18] xen/sysctl: wrap around XEN_SYSCTL_sched_id

2025-07-04 Thread Penny Zheng
The following function shall be wrapped: - scheduler_id() Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini --- v3 -> v4: - remove transient "#ifdef CONFIG_SYSCTL" --- xen/common/sched/core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/common/sched/core.c b/xen/common/sch

[PATCH v6 00/18] xen: introduce CONFIG_SYSCTL

2025-07-04 Thread Penny Zheng
It can be beneficial for some dom0less systems to further reduce Xen footprint via disabling 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 - h

[PATCH v6 11/18] xen/sysctl: wrap around XEN_SYSCTL_cpupool_op

2025-07-04 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 v6 06/18] xen/sysctl: wrap around XEN_SYSCTL_perfc_op

2025-07-04 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 Reviewed-by: Stefano Stabellini --- v2 -> v3: - add the blank line --- v3 -> v4: - remove transient "#ifdef CONF

RE: [PATCH v6 00/18] xen: introduce CONFIG_SYSCTL

2025-07-04 Thread Penny, Zheng
[Public] > -Original Message- > From: Jan Beulich > Sent: Friday, July 4, 2025 5:49 PM > To: Penny, Zheng > Cc: Huang, Ray ; Andrew Cooper > ; Anthony PERARD ; > Orzel, Michal ; Julien Grall ; Roger Pau > Monné ; Stefano Stabellini ; > Daniel > P. Smith ; Dario Faggioli ; > Juergen Gros

Re: [PATCH v6 30/39] accel: Propagate AccelState to AccelClass::init_machine()

2025-07-04 Thread Zhao Liu
On Thu, Jul 03, 2025 at 07:32:36PM +0200, Philippe Mathieu-Daudé wrote: > Date: Thu, 3 Jul 2025 19:32:36 +0200 > From: Philippe Mathieu-Daudé > Subject: [PATCH v6 30/39] accel: Propagate AccelState to > AccelClass::init_machine() > X-Mailer: git-send-email 2.49.0 > > In order to avoid init_mach

Re: [PATCH v4 56/65] accel: Expose and register generic_handle_interrupt()

2025-07-04 Thread Mads Ynddal
> On 2 Jul 2025, at 20.53, Philippe Mathieu-Daudé wrote: > > In order to dispatch over AccelOpsClass::handle_interrupt(), > we need it always defined, not calling a hidden handler under > the hood. Make AccelOpsClass::handle_interrupt() mandatory. > Expose generic_handle_interrupt() prototype a

Re: [PATCH v6 38/39] accel: Extract AccelClass definition to 'accel/accel-ops.h'

2025-07-04 Thread Richard Henderson
On 7/3/25 11:32, Philippe Mathieu-Daudé wrote: Only accelerator implementations (and the common accelator code) need to know about AccelClass internals. Move the definition out but forward declare AccelState and AccelClass. Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS

Re: [PATCH v6 37/39] accel: Rename 'system/accel-ops.h' -> 'accel/accel-cpu-ops.h'

2025-07-04 Thread Richard Henderson
On 7/3/25 11:32, Philippe Mathieu-Daudé wrote: Unfortunately "system/accel-ops.h" handlers are not only system-specific. For example, the cpu_reset_hold() hook is part of the vCPU creation, after it is realized. Mechanical rename to drop 'system' using: $ sed -i -e s_system/accel-ops.h_accel

Re: [PATCH v5 3/9] xen/riscv: imsic_init() implementation

2025-07-04 Thread Oleksii Kurochko
On 6/30/25 4:27 PM, Jan Beulich wrote: --- a/xen/arch/riscv/include/asm/smp.h +++ b/xen/arch/riscv/include/asm/smp.h @@ -3,6 +3,7 @@ #define ASM__RISCV__SMP_H #include +#include #include #include @@ -18,6 +19,18 @@ static inline unsigned long cpuid_to_hartid(unsigned long cp

Re: [PATCH 3/6] xen/softirq: Rework arch_skip_send_event_check() into arch_pend_softirq()

2025-07-04 Thread Andrew Cooper
On 04/07/2025 9:25 am, Jan Beulich wrote: > On 04.07.2025 09:55, Roger Pau Monné wrote: >> On Fri, Jul 04, 2025 at 09:23:29AM +0200, Jan Beulich wrote: >>> On 03.07.2025 18:21, Roger Pau Monné wrote: On Wed, Jul 02, 2025 at 03:41:18PM +0100, Andrew Cooper wrote: > --- a/xen/include/xen/sof

Re: [PATCH 4/6] x86/idle: Implement a new MWAIT IPI-elision algorithm

2025-07-04 Thread Andrew Cooper
On 04/07/2025 8:24 am, Roger Pau Monné wrote: > On Thu, Jul 03, 2025 at 06:48:23PM +0100, Andrew Cooper wrote: >> On 03/07/2025 5:36 pm, Roger Pau Monné wrote: >>> On Wed, Jul 02, 2025 at 03:41:19PM +0100, Andrew Cooper wrote: In order elide IPIs, we must be able to identify whether a target C

Re: [PATCH 4/6] x86/idle: Implement a new MWAIT IPI-elision algorithm

2025-07-04 Thread Andrew Cooper
On 04/07/2025 8:52 am, Roger Pau Monné wrote: > On Wed, Jul 02, 2025 at 03:41:19PM +0100, Andrew Cooper wrote: >> diff --git a/xen/arch/x86/include/asm/softirq.h >> b/xen/arch/x86/include/asm/softirq.h >> index e4b194f069fb..069e5716a68d 100644 >> --- a/xen/arch/x86/include/asm/softirq.h >> +++ b/

[PATCH v2 1/6] x86/idle: Remove broken MWAIT implementation

2025-07-04 Thread Andrew Cooper
cpuidle_wakeup_mwait() is a TOCTOU race. The cpumask_and() sampling cpuidle_mwait_flags can take a arbitrary period of time, and there's no guarantee that the target CPUs are still in MWAIT when writing into mwait_wakeup(cpu). The consequence of the race is that we'll fail to IPI certain targets.

[PATCH v2 5/6] x86/idle: Implement a new MWAIT IPI-elision algorithm

2025-07-04 Thread Andrew Cooper
In order elide IPIs, we must be able to identify whether a target CPU is in MWAIT at the point it is woken up. i.e. the store to wake it up must also identify the state. Create a new in_mwait variable beside __softirq_pending, so we can use a CMPXCHG to set the softirq while also observing the st

[PATCH v2 6/6] x86/idle: Fix buggy "x86/mwait-idle: enable interrupts before C1 on Xeons"

2025-07-04 Thread Andrew Cooper
The check of this_softirq_pending must be performed with irqs disabled, but this property was broken by an attempt to optimise entry/exit latency. Commit c227233ad64c in Linux (which we copied into Xen) was fixed up by edc8fc01f608 in Linux, which we have so far missed. Going to sleep without wak

[PATCH v2 0/6] x86/idle: Multiple MWAIT fixes

2025-07-04 Thread Andrew Cooper
The two main bugs were identified in Linux first, and I've modelled Xen's fix similarly. Patches 1-4 want committing together. They do bisect and operate correctly, but the range takes out an optimisation in order to reimplement it correctly. https://gitlab.com/xen-project/hardware/xen-staging/-

[PATCH v2 2/6] x86/idle: Drop incorrect smp_mb() in mwait_idle_with_hints()

2025-07-04 Thread Andrew Cooper
With the recent simplifications, it becomes obvious that smp_mb() isn't the right barrier. Strictly speaking, MONITOR is ordered as a load, but smp_rmb() isn't correct either, as this only pertains to local ordering. All we need is a compiler barrier(). Merge the barier() into the monitor() itse

[PATCH v2 4/6] xen/softirq: Rework arch_skip_send_event_check() into arch_set_softirq()

2025-07-04 Thread Andrew Cooper
x86 is the only architecture wanting an optimisation here, but the test_and_set_bit() is a store into the monitored line (i.e. will wake up the target) and, prior to the removal of the broken IPI-elision algorithm, was racy, causing unnecessary IPIs to be sent. To do this in a race-free way, the s

[PATCH v2 3/6] x86/idle: Convert force_mwait_ipi_wakeup to X86_BUG_MONITOR

2025-07-04 Thread Andrew Cooper
We're going to want alternative-patch based on it. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Anthony PERARD CC: Michal Orzel CC: Julien Grall CC: Stefano Stabellini --- xen/arch/x86/acpi/cpu_idle.c | 6 -- xen/arch/x86/cpu

[PATCH 5.15.y v3] xen: replace xen_remap() with memremap()

2025-07-04 Thread Teddy Astie
From: Juergen Gross [ upstream commit 41925b105e345ebc84cedb64f59d20cb14a62613 ] xen_remap() is used to establish mappings for frames not under direct control of the kernel: for Xenstore and console ring pages, and for grant pages of non-PV guests. Today xen_remap() is defined to use ioremap()

Re: [PATCH v7 4/7] xen: Make the maximum number of altp2m views configurable for x86

2025-07-04 Thread Petr Beneš
On Wed, Jul 2, 2025 at 4:11 PM Jan Beulich wrote: > > --- a/xen/include/xen/sched.h > > +++ b/xen/include/xen/sched.h > > @@ -619,6 +619,8 @@ struct domain > > unsigned int guest_request_sync : 1; > > } monitor; > > > > +unsigned int nr_altp2m;/* Number of altp2m tab

Re: [XEN PATCH 0/5] address violation of MISRA C Rule 5.5

2025-07-04 Thread Dmytro Prokopchuk1
Pipeline: https://gitlab.com/xen-project/people/dimaprkp4k/xen/-/pipelines/1907188989 On 7/4/25 23:39, Dmytro Prokopchuk1 wrote: > This patch series fully eliminates MISRA C Rule 5.5 > violations for ARM64. > > The previous thread is here: > https://lore.kernel.org/xen-devel/48c7830931a98b2bf70ef1

Re: [PATCH 0/3] hvmloader: add new SMBIOS tables (7,8,9,26,27,28)

2025-07-04 Thread Petr Beneš
On Wed, Jul 2, 2025 at 8:47 AM Jan Beulich wrote: > > On 02.07.2025 01:45, Petr Beneš wrote: > > From: Petr Beneš > > > > Resubmitting patch from Anton Belousov and addressing review comments > > from Jan: > > https://old-list-archives.xen.org/archives/html/xen-devel/2022-01/msg00725.html > > In

Re: [PATCH v2 3/6] x86/idle: Convert force_mwait_ipi_wakeup to X86_BUG_MONITOR

2025-07-04 Thread Roger Pau Monné
On Fri, Jul 04, 2025 at 05:34:07PM +0100, Andrew Cooper wrote: > We're going to want alternative-patch based on it. > > No functional change. > > Signed-off-by: Andrew Cooper Acked-by: Roger Pau Monné Thanks, Roger.

Re: [PATCH v2 2/6] x86/idle: Drop incorrect smp_mb() in mwait_idle_with_hints()

2025-07-04 Thread Roger Pau Monné
On Fri, Jul 04, 2025 at 05:34:06PM +0100, Andrew Cooper wrote: > With the recent simplifications, it becomes obvious that smp_mb() isn't the > right barrier. Strictly speaking, MONITOR is ordered as a load, but smp_rmb() > isn't correct either, as this only pertains to local ordering. All we need

Re: [PATCH 3/3] hvmloader: add new SMBIOS tables (7,8,9,26,27,28)

2025-07-04 Thread Petr Beneš
On Wed, Jul 2, 2025 at 9:15 AM Jan Beulich wrote: > > On 02.07.2025 01:45, Petr Beneš wrote: > > From: Petr Beneš > > This isn't in line with the first S-o-b, nor with the fact that in the cover > letter you say this was previously submitted (and hence authored?) by Anton. Can you please point m

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

2025-07-04 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 a 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. Signed

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

2025-07-04 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.

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

2025-07-04 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 v7 4/8] vpci: Hide extended capability when it fails to initialize

2025-07-04 Thread Jiqian Chen
When vpci fails to initialize a 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. Signed

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

2025-07-04 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 v7 0/8] Support hiding capability when its initialization fails

2025-07-04 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 v7 2/8] vpci: Refactor REGISTER_VPCI_INIT

2025-07-04 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 v7 8/8] vpci/msix: Free MSIX resources when init_msix() fails

2025-07-04 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 v7 5/8] vpci: Refactor vpci_remove_register to remove matched registers

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

RE: [PATCH v5 14/18] xen/cpufreq: introduce GET_CPUFREQ_CPPC sub-cmd

2025-07-04 Thread Penny, Zheng
[Public] > -Original Message- > From: Jan Beulich > Sent: Tuesday, June 17, 2025 6:08 PM > To: Penny, Zheng > Cc: Huang, Ray ; Anthony PERARD > ; Juergen Gross ; Andrew > Cooper ; Orzel, Michal ; > Julien Grall ; Roger Pau Monné ; Stefano > Stabellini ; xen-devel@lists.xenproject.org > S

Re: [PATCH v5 10/18] xen/cpufreq: introduce a new amd cppc driver for cpufreq scaling

2025-07-04 Thread Jan Beulich
On 04.07.2025 09:23, Penny, Zheng wrote: > [Public] > >> -Original Message- >> From: Jan Beulich >> Sent: Friday, July 4, 2025 2:21 PM >> To: Penny, Zheng >> Cc: Huang, Ray ; Andrew Cooper >> ; Roger Pau Monné ; xen- >> de...@lists.xenproject.org >> Subject: Re: [PATCH v5 10/18] xen/cpuf

RE: [PATCH v5 12/18] xen/cpufreq: get performance policy from governor set via xenpm

2025-07-04 Thread Penny, Zheng
[Public] > -Original Message- > From: Jan Beulich > Sent: Tuesday, June 17, 2025 12:22 AM > To: Penny, Zheng > Cc: Huang, Ray ; xen-devel@lists.xenproject.org > Subject: Re: [PATCH v5 12/18] xen/cpufreq: get performance policy from > governor > set via xenpm > > On 27.05.2025 10:48, Pen

Re: [PATCH 4/6] x86/idle: Implement a new MWAIT IPI-elision algorithm

2025-07-04 Thread Roger Pau Monné
On Wed, Jul 02, 2025 at 03:41:19PM +0100, Andrew Cooper wrote: > diff --git a/xen/arch/x86/include/asm/softirq.h > b/xen/arch/x86/include/asm/softirq.h > index e4b194f069fb..069e5716a68d 100644 > --- a/xen/arch/x86/include/asm/softirq.h > +++ b/xen/arch/x86/include/asm/softirq.h > @@ -1,6 +1,8 @@

[PATCH 0/2] xen/arm: Creating base for future PDX changes

2025-07-04 Thread Michal Orzel
Two small patches laying a base for future PDX changes. See discussion here: https://lore.kernel.org/xen-devel/alpine.DEB.2.22.394.2507031103360.605088@ubuntu-linux-20-04-desktop/T/#m157f07f957bdad3d807ff53d05e75688a8ae6837 Michal Orzel (2): xen/arm64: Panic if direct map is too small xen/arm:

[PATCH 1/2] xen/arm64: Panic if direct map is too small

2025-07-04 Thread Michal Orzel
Harden the code by panicing if direct map is too small for current memory layout taking into account possible PDX compression. Otherwise the assert is observed: Assertion '(mfn_to_pdx(maddr_to_mfn(ma)) - directmap_base_pdx) < (DIRECTMAP_SIZE >> PAGE_SHIFT)' failed at ./arch/arm/include/asm/mmu/mm.

[PATCH 2/2] xen/arm: Skip loops in init_pdx() when no PDX compression is used

2025-07-04 Thread Michal Orzel
When CONFIG_PDX_COMPRESSION=n, pdx_init_mask(), pdx_region_mask() and pfn_pdx_hole_setup() are just stubs doing nothing. It does not make sense to keep the two loops iterating over all the memory banks. Signed-off-by: Michal Orzel --- xen/arch/arm/setup.c | 4 +++- 1 file changed, 3 insertions(+

Re: [PATCH 3/6] xen/softirq: Rework arch_skip_send_event_check() into arch_pend_softirq()

2025-07-04 Thread Roger Pau Monné
On Fri, Jul 04, 2025 at 09:23:29AM +0200, Jan Beulich wrote: > On 03.07.2025 18:21, Roger Pau Monné wrote: > > On Wed, Jul 02, 2025 at 03:41:18PM +0100, Andrew Cooper wrote: > >> --- a/xen/include/xen/softirq.h > >> +++ b/xen/include/xen/softirq.h > >> @@ -23,6 +23,22 @@ enum { > >> > >> #define

Re: [PATCH 3/6] xen/softirq: Rework arch_skip_send_event_check() into arch_pend_softirq()

2025-07-04 Thread Jan Beulich
On 03.07.2025 18:21, Roger Pau Monné wrote: > On Wed, Jul 02, 2025 at 03:41:18PM +0100, Andrew Cooper wrote: >> --- a/xen/include/xen/softirq.h >> +++ b/xen/include/xen/softirq.h >> @@ -23,6 +23,22 @@ enum { >> >> #define NR_SOFTIRQS (NR_COMMON_SOFTIRQS + NR_ARCH_SOFTIRQS) >> >> +/* >> + * Ens

Re: [PATCH 4/6] x86/idle: Implement a new MWAIT IPI-elision algorithm

2025-07-04 Thread Roger Pau Monné
On Thu, Jul 03, 2025 at 06:48:23PM +0100, Andrew Cooper wrote: > On 03/07/2025 5:36 pm, Roger Pau Monné wrote: > > On Wed, Jul 02, 2025 at 03:41:19PM +0100, Andrew Cooper wrote: > >> In order elide IPIs, we must be able to identify whether a target CPU is in > >> MWAIT at the point it is woken up.

RE: [PATCH v5 10/18] xen/cpufreq: introduce a new amd cppc driver for cpufreq scaling

2025-07-04 Thread Penny, Zheng
[Public] > -Original Message- > From: Jan Beulich > Sent: Friday, July 4, 2025 2:21 PM > To: Penny, Zheng > Cc: Huang, Ray ; Andrew Cooper > ; Roger Pau Monné ; xen- > de...@lists.xenproject.org > Subject: Re: [PATCH v5 10/18] xen/cpufreq: introduce a new amd cppc driver for > cpufreq sc

Re: [PATCH v6 37/39] accel: Rename 'system/accel-ops.h' -> 'accel/accel-cpu-ops.h'

2025-07-04 Thread Zhao Liu
On Thu, Jul 03, 2025 at 07:32:43PM +0200, Philippe Mathieu-Daudé wrote: > Date: Thu, 3 Jul 2025 19:32:43 +0200 > From: Philippe Mathieu-Daudé > Subject: [PATCH v6 37/39] accel: Rename 'system/accel-ops.h' -> > 'accel/accel-cpu-ops.h' > X-Mailer: git-send-email 2.49.0 > > Unfortunately "system/a

Re: [PATCH 3/6] xen/softirq: Rework arch_skip_send_event_check() into arch_pend_softirq()

2025-07-04 Thread Jan Beulich
On 04.07.2025 09:55, Roger Pau Monné wrote: > On Fri, Jul 04, 2025 at 09:23:29AM +0200, Jan Beulich wrote: >> On 03.07.2025 18:21, Roger Pau Monné wrote: >>> On Wed, Jul 02, 2025 at 03:41:18PM +0100, Andrew Cooper wrote: --- a/xen/include/xen/softirq.h +++ b/xen/include/xen/softirq.h

Re: [PATCH v5 12/18] xen/cpufreq: get performance policy from governor set via xenpm

2025-07-04 Thread Jan Beulich
On 04.07.2025 09:51, Penny, Zheng wrote: > [Public] > >> -Original Message- >> From: Jan Beulich >> Sent: Tuesday, June 17, 2025 12:22 AM >> To: Penny, Zheng >> Cc: Huang, Ray ; xen-devel@lists.xenproject.org >> Subject: Re: [PATCH v5 12/18] xen/cpufreq: get performance policy from >> g

Re: [PATCH v6 28/39] accel: Expose and register generic_handle_interrupt()

2025-07-04 Thread Philippe Mathieu-Daudé
On 4/7/25 08:38, Xiaoyao Li wrote: On 7/4/2025 1:32 AM, Philippe Mathieu-Daudé wrote: In order to dispatch over AccelOpsClass::handle_interrupt(), we need it always defined, It seems I can only understand it until I see the code to really require it to be mandatory. See https://lore.kerne

Re: [PATCH v5 14/18] xen/cpufreq: introduce GET_CPUFREQ_CPPC sub-cmd

2025-07-04 Thread Jan Beulich
On 04.07.2025 10:13, Penny, Zheng wrote: > [Public] > >> -Original Message- >> From: Jan Beulich >> Sent: Tuesday, June 17, 2025 6:08 PM >> To: Penny, Zheng >> Cc: Huang, Ray ; Anthony PERARD >> ; Juergen Gross ; Andrew >> Cooper ; Orzel, Michal ; >> Julien Grall ; Roger Pau Monné ; >>

Re: [PATCH v5 14/18] xen/cpufreq: introduce GET_CPUFREQ_CPPC sub-cmd

2025-07-04 Thread Jan Beulich
On 04.07.2025 10:32, Jan Beulich wrote: > On 04.07.2025 10:13, Penny, Zheng wrote: >>> -Original Message- >>> From: Jan Beulich >>> Sent: Tuesday, June 17, 2025 6:08 PM >>> >>> On 27.05.2025 10:48, Penny Zheng wrote: --- a/tools/misc/xenpm.c +++ b/tools/misc/xenpm.c @@ -69,6

Re: [PATCH v6 38/39] accel: Extract AccelClass definition to 'accel/accel-ops.h'

2025-07-04 Thread Zhao Liu
On Thu, Jul 03, 2025 at 07:32:44PM +0200, Philippe Mathieu-Daudé wrote: > Date: Thu, 3 Jul 2025 19:32:44 +0200 > From: Philippe Mathieu-Daudé > Subject: [PATCH v6 38/39] accel: Extract AccelClass definition to > 'accel/accel-ops.h' > X-Mailer: git-send-email 2.49.0 > > Only accelerator implemen

Re: [PATCH v2 5/6] x86/idle: Implement a new MWAIT IPI-elision algorithm

2025-07-04 Thread Roger Pau Monné
On Fri, Jul 04, 2025 at 05:34:09PM +0100, Andrew Cooper wrote: > In order elide IPIs, we must be able to identify whether a target CPU is in > MWAIT at the point it is woken up. i.e. the store to wake it up must also > identify the state. > > Create a new in_mwait variable beside __softirq_pendin

[XEN PATCH 5/5] xen/bitops: address violation of MISRA C Rule 5.5

2025-07-04 Thread Dmytro Prokopchuk1
Address a violation of MISRA C:2012 Rule 5.5: "Identifiers shall be distinct from macro names". Reports for service MC3A2.R5.5: xen/include/xen/bitops.h: non-compliant function '__test_and_set_bit(int, volatile void*)' xen/include/xen/bitops.h: non-compliant macro '__test_and_set_bit' xen/include

[XEN PATCH 4/5] device-tree: address violation of MISRA C Rule 5.5

2025-07-04 Thread Dmytro Prokopchuk1
Address a violation of MISRA C:2012 Rule 5.5: "Identifiers shall be distinct from macro names". Reports for service MC3A2.R5.5: xen/include/xen/fdt-domain-build.h: non-compliant parameter 'copy_to_guest' xen/include/xen/guest_access.h: non-compliant macro 'copy_to_guest' Rename 'copy_to_guest' fu

[XEN PATCH 2/5] iommu: address violation of MISRA C Rule 5.5

2025-07-04 Thread Dmytro Prokopchuk1
Address a violation of MISRA C:2012 Rule 5.5: "Identifiers shall be distinct from macro names". Reports for service MC3A2.R5.5: xen/include/xen/iommu.h: non-compliant struct 'page_list_head' xen/include/xen/mm.h: non-compliant macro 'page_list_head' xen/drivers/passthrough/iommu.c: non-compliant m

[XEN PATCH 3/5] x86/irq: address violation of MISRA C Rule 5.5

2025-07-04 Thread Dmytro Prokopchuk1
Address a violation of MISRA C:2012 Rule 5.5: "Identifiers shall be distinct from macro names". Reports for service MC3A2.R5.5: xen/include/xen/irq.h: non-compliant function `pirq_cleanup_check(struct pirq*, struct domain*)' xen/include/xen/irq.h: non-compliant macro `pirq_cleanup_check' The pri

[XEN PATCH 1/5] gnttab: address violation of MISRA C Rule 5.5

2025-07-04 Thread Dmytro Prokopchuk1
Address a violation of MISRA C:2012 Rule 5.5: "Identifiers shall be distinct from macro names". Reports for service MC3A2.R5.5: xen/common/grant_table.c: non-compliant macro 'update_gnttab_par' xen/common/grant_table.c: non-compliant macro 'parse_gnttab_limit' The macros above are intended to dis

[XEN PATCH 0/5] address violation of MISRA C Rule 5.5

2025-07-04 Thread Dmytro Prokopchuk1
This patch series fully eliminates MISRA C Rule 5.5 violations for ARM64. The previous thread is here: https://lore.kernel.org/xen-devel/48c7830931a98b2bf70ef1509f309b262b9e5792.1745427770.git.victorm.l...@amd.com/ where that violation was proposed to be deviated. Dmytro Prokopchuk (5): gnttab:

Re: [PATCH v2 11/17] xen/riscv: implement p2m_set_entry() and __p2m_set_entry()

2025-07-04 Thread Oleksii Kurochko
On 7/1/25 3:49 PM, Jan Beulich wrote: On 10.06.2025 15:05, Oleksii Kurochko wrote: This patch introduces p2m_set_entry() and its core helper __p2m_set_entry() for RISC-V, based loosely on the Arm implementation, with several RISC-V-specific modifications. Key differences include: - TLB Flushin