Re: [RFC 1/5] meminfo: add a per node counter for balloon drivers

2025-03-11 Thread Shakeel Butt
On Tue, Mar 11, 2025 at 06:06:56PM -0600, Nico Pache wrote: > Add NR_BALLOON_PAGES counter to track memory used by balloon drivers and > expose it through /proc/meminfo and other memory reporting interfaces. > > Signed-off-by: Nico Pache > --- > fs/proc/meminfo.c | 2 ++ > include/linux/mmz

Re: [RFC 2/5] virtio_balloon: update the NR_BALLOON_PAGES state

2025-03-11 Thread Michael S. Tsirkin
On Tue, Mar 11, 2025 at 06:06:57PM -0600, Nico Pache wrote: > Update the NR_BALLOON_PAGES counter when pages are added to or > removed from the virtio balloon. > > Signed-off-by: Nico Pache > --- > drivers/virtio/virtio_balloon.c | 4 > 1 file changed, 4 insertions(+) > > diff --git a/driv

[PATCH v1 02/19] xen/xsm: wrap around xsm_sysctl with CONFIG_SYSCTL

2025-03-11 Thread Penny Zheng
Signed-off-by: Penny Zheng --- xen/include/xsm/dummy.h | 7 +++ xen/include/xsm/xsm.h | 9 + xen/xsm/dummy.c | 2 ++ xen/xsm/flask/hooks.c | 4 4 files changed, 22 insertions(+) diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h index a8d06de6b0..afc54a0b

[PATCH v1 04/19] xen/sysctl: make CONFIG_TRACEBUFFER depend on CONFIG_SYSCTL

2025-03-11 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 --- xen/common/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/common/Kconfig b/xen/common/Kconfig index 72e1d7ea97..c

[PATCH v1 16/19] xen/sysctl: wrap around XEN_SYSCTL_coverage_op

2025-03-11 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 --- xen/Kconfig.debug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug index c4a8d

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

2025-03-11 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 --- xen/common/sched/arinc653.c | 6 ++ xen/common/sched/core.c | 2 ++ xen/common/sched/credit.c | 4 xen/co

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

2025-03-11 Thread Penny, Zheng
[Public] Hi, > -Original Message- > From: Penny, Zheng > Sent: Wednesday, March 12, 2025 12:06 PM > To: xen-devel@lists.xenproject.org > Cc: Huang, Ray ; Stabellini, Stefano > ; Andrew Cooper ; > Anthony PERARD ; Orzel, Michal > ; Jan Beulich ; Julien Grall > ; Roger Pau Monné ; Stefano

[PATCH v1 17/19] xen/sysctl: wrap around XEN_SYSCTL_livepatch_op

2025-03-11 Thread Penny Zheng
LIVEPATCH mechanism relies on LIVEPATCH_SYSCTL hypercall, so CONFIG_LIVEPATCH shall depend on CONFIG_SYSCTL Signed-off-by: Penny Zheng --- xen/common/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/common/Kconfig b/xen/common/Kconfig index fbaca097ff..583972f7e3 1

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

2025-03-11 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 --- xen/common/page_alloc.c | 2 ++ xen/include/xen/mm.h| 13 - xen/include/xsm/dummy.h | 7 +++

[PATCH v1 08/19] xen/sysctl: introduce CONFIG_PM_STATISTIC

2025-03-11 Thread Penny Zheng
This commit introduces CONFIG_PM_STATISTIC for wrapping all operations regarding performance management statistic operations. 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(). Signed-off-by: Penny Zheng --- xen/arch/x86

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

2025-03-11 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 Signed-off-by: Stefano Stabellini Signed-off-by: Sergiy Kibrik Signed-o

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

2025-03-11 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 v1 19/19] xen/sysctl: wrap around sysctl hypercall

2025-03-11 Thread Penny Zheng
From: Stefano Stabellini Signed-off-by: Stefano Stabellini Signed-off-by: Sergiy Kibrik Signed-off-by: Penny Zheng --- xen/common/Makefile | 2 +- xen/include/hypercall-defs.c | 4 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/xen/common/Makefile b/xen/common/Mak

[PATCH v1 10/19] xen/page: fix return type of online_page()

2025-03-11 Thread Penny Zheng
This commit fixes return type of online_page(), which shall be int to include correct error value. Signed-off-by: Penny Zheng --- xen/common/page_alloc.c | 2 +- xen/include/xen/mm.h| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/common/page_alloc.c b/xen/common/pa

[PATCH v1 09/19] xen/sysctl: make CONFIG_PM_STATISTIC depend on CONFIG_SYSCTL

2025-03-11 Thread Penny Zheng
Signed-off-by: Penny Zheng --- xen/common/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/common/Kconfig b/xen/common/Kconfig index ffc6b9d4df..fbaca097ff 100644 --- a/xen/common/Kconfig +++ b/xen/common/Kconfig @@ -109,7 +109,7 @@ config NUMA config PM_STATISTI

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

2025-03-11 Thread Penny Zheng
Function avail_domheap_pages() is only invoked by get_outstanding_claims(), so it shall be static, no need to extern. Signed-off-by: Penny Zheng --- xen/common/page_alloc.c | 2 +- xen/include/xen/mm.h| 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/xen/common/page_alloc.

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

2025-03-11 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 --- xen/arch/arm/sysctl.c | 2 ++ xen/arch/riscv/stubs.c | 2 ++ xen/arch/x86/sysctl.c | 2 ++ xen/common/page_alloc.c |

[PATCH v1 07/19] xen/sysctl: wrap around XEN_SYSCTL_lockprof_op

2025-03-11 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 --- xen/common/spinlock.c | 2 ++ xen/include/xen/spinlock.h | 7 +++ 2 files changed, 9 insertions(+) diff --git a/xen/c

[PATCH v1 05/19] xen/sysctl: wrap around XEN_SYSCTL_sched_id

2025-03-11 Thread Penny Zheng
The following function shall be wrapped: - scheduler_id Signed-off-by: Penny Zheng --- xen/common/sched/core.c | 2 ++ xen/include/xen/sched.h | 7 +++ 2 files changed, 9 insertions(+) diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c index d6296d99fd..ea452d8b3e 100644 --- a/x

[PATCH v1 00/19] xen: introduce CONFIG_SYSCTL

2025-03-11 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 v1 03/19] xen/sysctl: wrap around XEN_SYSCTL_readconsole

2025-03-11 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 --- xen/drivers/char/console.c | 2 ++ xen/include/xen/console.h | 8 xen/include/xsm/dummy.h| 11 --- xen/include

[PATCH v1 06/19] xen/sysctl: wrap around XEN_SYSCTL_perfc_op

2025-03-11 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 --- xen/common/perfc.c | 2 ++ xen/include/xen/perfc.h | 8 2 files changed, 10 insertions(+) dif

[PATCH v1 01/19] xen: introduce CONFIG_SYSCTL

2025-03-11 Thread Penny Zheng
From: Stefano Stabellini Signed-off-by: Stefano Stabellini Signed-off-by: Sergiy Kibrik Signed-off-by: Penny Zheng --- xen/common/Kconfig | 9 + 1 file changed, 9 insertions(+) diff --git a/xen/common/Kconfig b/xen/common/Kconfig index 6166327f4d..72e1d7ea97 100644 --- a/xen/common/K

[PATCH v1] CHANGELOG.md: Mention PCI passthrough for HVM domUs

2025-03-11 Thread Jiqian Chen
PCI passthrough is already supported for HVM domUs when dom0 is PVH on x86. The last related patch on Qemu side was merged after Xen4.20 release. So mention this feature in Xen4.21 entry. Signed-off-by: Jiqian Chen --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md

Re: [PATCH 2/3] x86/P2M: correct old entry checking in p2m_remove_entry()

2025-03-11 Thread Roger Pau Monné
On Wed, Feb 26, 2025 at 12:52:45PM +0100, Jan Beulich wrote: > Using p2m_is_valid() isn't quite right here. It expanding to RAM+MMIO, > the subsequent p2m_mmio_direct check effectively reduces its use to > RAM+MMIO_DM. Yet MMIO_DM entries, which are never marked present in the > page tables, won't

Re: [PATCH 08/23] xen/arm: dom0less seed xenstore grant table entry

2025-03-11 Thread Jan Beulich
On 06.03.2025 23:03, Jason Andryuk wrote: > --- a/xen/common/grant_table.c > +++ b/xen/common/grant_table.c > @@ -4346,6 +4346,16 @@ static void gnttab_usage_print(struct domain *rd) > printk("no active grant table entries\n"); > } > > +void gnttab_seed_entry(struct domain *d, int idx,

Re: [PATCH 02/16] exec/memory_ldst_phys: extract memory_ldst_phys declarations from cpu-all.h

2025-03-11 Thread Pierrick Bouvier
On 3/9/25 21:58, Pierrick Bouvier wrote: They are now accessible through exec/memory.h instead, and we make sure all variants are available for common or target dependent code. To allow this, we need to implement address_space_st{*}_cached, simply forwarding the calls to _cached_slow variants.

Re: [PATCH] XSM: correct xsm_get_domain_state()

2025-03-11 Thread Jürgen Groß
On 06.03.25 15:16, Jan Beulich wrote: Add the missing first parameter and move it next to a close relative. Fixes: 3ad3df1bd0aa ("xen: add new domctl get_domain_state") Signed-off-by: Jan Beulich Acked-by: Juergen Gross With this patch you can ignore my patch just sent out, I guess. :-) J

Re: [PATCH v3 20/25] drm/tegra: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-03-11 Thread Thierry Reding
On Tue, Feb 18, 2025 at 03:23:43PM +0100, Thomas Zimmermann wrote: > Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and > buffer size. Align the pitch according to hardware requirements. > > Signed-off-by: Thomas Zimmermann > Cc: Thierry Reding > Cc: Mikko Perttunen > --- > dr

Re: [PATCH v8 0/9] remove libxenctrl usage from xenstored

2025-03-11 Thread Jan Beulich
On 06.03.2025 14:27, Jürgen Groß wrote: > On 06.03.25 14:13, Jan Beulich wrote: >> On 06.03.2025 00:32, Stefano Stabellini wrote: >>> On Wed, 5 Mar 2025, Juergen Gross wrote: On 25.02.25 12:10, Juergen Gross wrote: > Ping? Especially ... > > On 04.02.25 12:33, Juergen Gross wrote:

[PATCH 03/16] include: move target_words_bigendian() from tswap to bswap

2025-03-11 Thread Pierrick Bouvier
This is needed for next commits (especially when implementing st/ld primitives which will use this function). As well, remove reference to TARGET_BIG_ENDIAN, as we are about to remove this dependency. Signed-off-by: Pierrick Bouvier --- include/exec/tswap.h | 11 --- include/qemu/bswap.h

[PATCH 01/16] exec/memory_ldst: extract memory_ldst declarations from cpu-all.h

2025-03-11 Thread Pierrick Bouvier
They are now accessible through exec/memory.h instead, and we make sure all variants are available for common or target dependent code. Signed-off-by: Pierrick Bouvier --- include/exec/cpu-all.h | 12 include/exec/memory_ldst.h.inc | 13 + 2 files changed, 5 inse

[RFC 4/5] vmx_balloon: update the NR_BALLOON_PAGES state

2025-03-11 Thread Nico Pache
Update the NR_BALLOON_PAGES counter when pages are added to or removed from the VMware balloon. Signed-off-by: Nico Pache --- drivers/misc/vmw_balloon.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw_balloon.c index c817d8c21

[RFC 2/5] virtio_balloon: update the NR_BALLOON_PAGES state

2025-03-11 Thread Nico Pache
Update the NR_BALLOON_PAGES counter when pages are added to or removed from the virtio balloon. Signed-off-by: Nico Pache --- drivers/virtio/virtio_balloon.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 89da052f4f

[RFC 0/5] track memory used by balloon drivers

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

[RFC 3/5] hv_balloon: update the NR_BALLOON_PAGES state

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

[RFC 5/5] xen: balloon: update the NR_BALLOON_PAGES state

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

[RFC 1/5] meminfo: add a per node counter for balloon drivers

2025-03-11 Thread Nico Pache
Add NR_BALLOON_PAGES counter to track memory used by balloon drivers and expose it through /proc/meminfo and other memory reporting interfaces. Signed-off-by: Nico Pache --- fs/proc/meminfo.c | 2 ++ include/linux/mmzone.h | 1 + mm/memcontrol.c| 1 + mm/show_mem.c | 4 +++-

Re: [PATCH] x86/IDT: Fix IDT generation for INT $0x80

2025-03-11 Thread Andrew Cooper
On 11/03/2025 11:36 pm, Andrew Cooper wrote: > On 11/03/2025 9:27 pm, Andrew Cooper wrote: >> On 11/03/2025 9:22 pm, Andrew Cooper wrote: >>> When PV is enabled, entry_int80 needs to be DPL3, not DPL0. >>> >>> This causes the XSA-259 PoC to fail with: >>> >>> --- Xen Test Framework --- >>> Envi

Re: [PATCH] x86/IDT: Fix IDT generation for INT $0x80

2025-03-11 Thread Andrew Cooper
On 11/03/2025 9:27 pm, Andrew Cooper wrote: > On 11/03/2025 9:22 pm, Andrew Cooper wrote: >> When PV is enabled, entry_int80 needs to be DPL3, not DPL0. >> >> This causes the XSA-259 PoC to fail with: >> >> --- Xen Test Framework --- >> Environment: PV 64bit (Long mode 4 levels) >> XSA-259 Po

Re: [PATCH] automation/cirrus-ci: store xen/.config as an artifact

2025-03-11 Thread Andrew Cooper
On 10/03/2025 6:38 pm, Roger Pau Monné wrote: > On Mon, Mar 10, 2025 at 06:30:15PM +, Andrew Cooper wrote: >> On 10/03/2025 6:16 pm, Roger Pau Monne wrote: >>> Always store xen/.config as an artifact, renamed to xen-config to match >>> the naming used in the Gitlab CI tests. >>> >>> Reported-by

Re: [PATCH 14/16] xen/arm: Resume memory management on Xen resume

2025-03-11 Thread Julien Grall
Hi, On 05/03/2025 09:11, Mykola Kvach wrote: From: Mirela Simonovic The MMU needs to be enabled in the resume flow before the context can be restored (we need to be able to access the context data by virtual address in order to restore it). The configuration of system registers prior to branch

Re: [PATCH 00/16] Suspend to RAM support for Xen on arm64

2025-03-11 Thread Julien Grall
Hi, On 05/03/2025 09:11, Mykola Kvach wrote: This is V1 series from Mirela Simonovic. Ported to 4.16 and with added changes suggested here https://lore.kernel.org/all/CAKPH-NjmaZENb8gT=+fobraycrf01_--6gura2ck9di5wiu...@mail.gmail.com This is V2 series form Mykyta Poturai: https://marc.info/?l=x

Re: [PATCH 06/16] xen/arm: Introduce system suspend config option

2025-03-11 Thread Julien Grall
Hi, On 05/03/2025 09:11, Mykola Kvach wrote: From: Mykola Kvach This option enables the system suspend support. This is the mechanism that allows the system to be suspended to RAM and later resumed. Signed-off-by: Mykyta Poturai Signed-off-by: Mykola Kvach --- xen/arch/arm/Kconfig | 11 ++

Re: [ImageBuilder][PATCH v2] uboot-script-gen: handle reserved memory regions

2025-03-11 Thread Stefano Stabellini
On Tue, 11 Mar 2025, Luca Miccio wrote: > Currently, the uboot-script-gen does not account for reserved memory > regions in the device tree. This oversight can lead to scenarios where > one or more boot modules overlap with a reserved region. As a result, > Xen will always crash upon detecting this

Re: [PATCH] x86/IDT: Fix IDT generation for INT $0x80

2025-03-11 Thread Luca Fancellu
Hi Andrew, > On 11 Mar 2025, at 21:22, Andrew Cooper wrote: > > When PV is enabled, entry_int80 needs to be DPL3, not DPL0. > > This causes the XSA-259 PoC to fail with: > > --- Xen Test Framework --- > Environment: PV 64bit (Long mode 4 levels) > XSA-259 PoC > Error: Unexpected fault 0x80

[REGRESSION] Re: [PATCH 0/3] x86/P2M: assorted corrections

2025-03-11 Thread Andrew Cooper
On 26/02/2025 11:51 am, Jan Beulich wrote: > 1: synchronize fast and slow paths of p2m_get_page_from_gfn() > 2: correct old entry checking in p2m_remove_entry() > 3: don't include MMIO_DM in p2m_is_valid() Luca is triaging failures in ARM's CI. Commit be59cceb2dbb ("x86/P2M: don't include MMIO_DM

Re: [PATCH] docs: add explanation for 'Resolved:'

2025-03-11 Thread Stefano Stabellini
On Tue, 11 Mar 2025, Jason Andryuk wrote: > On 2025-03-11 03:28, dm...@proton.me wrote: > > From: Denis Mukhin > > > > 'Resolves:' tag may be used if the patch addresses one of the tickets > > logged via Gitlab to auto-close such ticket when the patch got merged. > > > > Add documentation for th

[PATCH] tools: Mark ACPI SDTs as NVS in the PVH build path

2025-03-11 Thread Alejandro Vallejo
Commit cefeffc7e583 marked ACPI tables as NVS in the hvmloader path because SeaBIOS may otherwise just mark it as RAM. There is, however, yet another reason to do it even in the PVH path. Xen's incarnation of AML relies on having access to some ACPI tables (e.g: _STA of Processor objects relies on

[PATCH v2 0/5] FF-A VM to VM support

2025-03-11 Thread Bertrand Marquis
This patch serie adds support to use FF-A between VM for communications using indirect messages. It adds a Kconfig parameter to enable this feature and marks it as experimental as for now there is no system to restrict communication rights between VM using this system. It also adds support to use

Re: [PATCH 11/16] xen/arm: Implement PSCI system suspend

2025-03-11 Thread Julien Grall
Hi, On 05/03/2025 09:11, Mykola Kvach wrote: From: Mirela Simonovic The implementation consists of: -Adding PSCI system suspend call as new PSCI function -Trapping PSCI system_suspend HVC -Implementing PSCI system suspend call (virtual interface that allows guests to suspend themselves), but

Re: [PATCH] x86/IDT: Fix IDT generation for INT $0x80

2025-03-11 Thread Andrew Cooper
On 11/03/2025 9:22 pm, Andrew Cooper wrote: > When PV is enabled, entry_int80 needs to be DPL3, not DPL0. > > This causes the XSA-259 PoC to fail with: > > --- Xen Test Framework --- > Environment: PV 64bit (Long mode 4 levels) > XSA-259 PoC > Error: Unexpected fault 0x800d0802, #GP[IDT[256

[PATCH] x86/IDT: Fix IDT generation for INT $0x80

2025-03-11 Thread Andrew Cooper
When PV is enabled, entry_int80 needs to be DPL3, not DPL0. This causes the XSA-259 PoC to fail with: --- Xen Test Framework --- Environment: PV 64bit (Long mode 4 levels) XSA-259 PoC Error: Unexpected fault 0x800d0802, #GP[IDT[256]] Test result: ERROR (Clearly I have a bug in XTF's re

[PATCH 4/8] Revert "x86/traps: 'Fix' safety of read_registers() in #DF path"

2025-03-11 Thread Andrew Cooper
This reverts commit 6065a05adf152a556fb9f11a5218c89e41b62893. The discussed "proper fix" has now been implemented, and the #DF path no longer writes out-of-bounds. Restore the proper #DF IST pointer. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné Only 5 years late... --

[PATCH 3/8] x86/traps: Avoid OoB accesses to print the data selectors

2025-03-11 Thread Andrew Cooper
_show_registers() prints the data selectors from struct cpu_user_regs, but these fields are sometimes out-of-bounds. See commit 6065a05adf15 ("x86/traps: 'Fix' safety of read_registers() in #DF path"). There are 3 callers of _show_registers(): 1. vcpu_show_registers(), which always operates on

[PATCH 0/8] x86: Drop the vm86 segments selectors from struct cpu_user_regs

2025-03-11 Thread Andrew Cooper
This is the next chunk of work in order to support FRED. https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1711534693 https://cirrus-ci.com/build/6031265616363520 Andrew Cooper (8): x86/regs: Fold x86_64/regs.h into it's single includer x86/traps: Rework register state printing to

[PATCH 6/8] x86/pv: Store the data segment selectors outside of cpu_user_regs

2025-03-11 Thread Andrew Cooper
In order to support FRED, we're going to have to remove the {ds..gs} fields from struct cpu_user_regs. This will impact v->arch.user_regs. These fields are unused for HVM guests, but for PV hold the selector values when the vCPU is scheduled out. Introduce new fields for the selectors in struct

[PATCH 8/8] x86: Drop the vm86 segments selectors from struct cpu_user_regs

2025-03-11 Thread Andrew Cooper
The data segment registers are part of the on-stack IRET frame when interrupting Virtual 8086 mode, but this ceased being relevant for Xen in commit 5d1181a5ea5e ("xen: Remove x86_32 build target.") in 2012. With all other cleanup in place, delete the fields so we can introduce FRED support which

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

2025-03-11 Thread Andrew Cooper
In order to support FRED, we're going to have to remove the {ds..gs} fields from struct cpu_user_regs, meaning that it is going to have to become a different type to the structure embedded in vcpu_guest_context_u. struct cpu_user_regs is a name used in common Xen code (i.e. needs to stay using thi

[PATCH 5/8] x86/domctl: Stop using XLAT_cpu_user_regs()

2025-03-11 Thread Andrew Cooper
In order to support FRED, we're going to have to remove the {ds..gs} fields from struct cpu_user_regs, meaning that it is going to have to become a different type to the structure embedded in vcpu_guest_context_u. In both arch_{get,set}_info_guest(), expand the memcpy()/XLAT_cpu_user_regs() to cop

[PATCH 2/8] x86/traps: Rework register state printing to use a struct

2025-03-11 Thread Andrew Cooper
... in preference to the crs[8] array. This avoids abusing crs[5..7] for the fs/gs bases, giving them proper named fields instead, and avoids storage for cr1 which is unused in the x86 architecture. In show_registers(), remove a redundant read_cr2(). read_registers() already did the same, and it

[PATCH 1/8] x86/regs: Fold x86_64/regs.h into it's single includer

2025-03-11 Thread Andrew Cooper
Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné --- xen/arch/x86/include/asm/regs.h| 21 ++- xen/arch/x86/include/asm/x86_64/regs.h | 28 -- 2 files changed, 20 insertions(+), 29 deletions(-) delete mode 100644 xen/arch/x86/i

Re: [PATCH 08/16] xen/arm: add watchdog domain suspend/resume helpers

2025-03-11 Thread Julien Grall
Hi Mykola, On 05/03/2025 09:11, Mykola Kvach wrote: From: Mykola Kvach This patch implements suspend/resume helpers for the watchdog. While a domain is suspended its watchdogs must be paused. Otherwise, if the domain stays in the suspend state for a longer period of time compared to the watchd

Re: [PATCH 05/16] xen/percpu: don't initialize percpu on resume

2025-03-11 Thread Julien Grall
(+ Juergen) Hi Mykola, On 05/03/2025 09:11, Mykola Kvach wrote: Invocation of the CPU_UP_PREPARE notification on ARM64 during resume causes a crash: (XEN) [ 315.807606] Error bringing CPU1 up: -16 (XEN) [ 315.811926] Xen BUG at common/cpu.c:258 [...] (XEN) [ 316.142765] Xen call trace: (XEN

Re: [PATCH] xen/domain: Initialise the domain handle before inserting into the domlist

2025-03-11 Thread Andrew Cooper
On 10/03/2025 8:23 am, Jan Beulich wrote: > On 07.03.2025 17:46, Andrew Cooper wrote: >> As soon as the the domain is in the domlist, it can be queried via various >> means, ahead of being fully constructed. Ensure it the UUID give by the >> toolstack is in place ahead of this. > Nit: The latter s

Re: [PATCH 04/16] xen/cpu: prevent disable_nonboot_cpus crash on ARM64

2025-03-11 Thread Julien Grall
Hi Mykola, On 05/03/2025 09:11, Mykola Kvach wrote: If we call disable_nonboot_cpus on ARM64 with system_state set to SYS_STATE_suspend, the following assertion will be triggered: ``` (XEN) [ 25.582712] Disabling non-boot CPUs ... (XEN) [ 25.587032] Assertion '!in_irq() && (local_irq_is_ena

Re: [PATCH] x86/boot: Fix zap_low_mappings() to map less of the trampoline

2025-03-11 Thread Andrew Cooper
On 06/01/2025 11:54 am, Jan Beulich wrote: > On 06.01.2025 12:26, Andrew Cooper wrote: >> Regular data access into the trampoline is via the directmap. >> >> As now discussed quite extensively in asm/trampoline.h, the trampoline is >> arranged so that only the AP and S3 paths need an identity mappi

Re: [PATCH 2/3] x86/P2M: correct old entry checking in p2m_remove_entry()

2025-03-11 Thread Roger Pau Monné
On Mon, Mar 10, 2025 at 04:16:36PM +0100, Roger Pau Monné wrote: > On Wed, Feb 26, 2025 at 12:52:45PM +0100, Jan Beulich wrote: > > Using p2m_is_valid() isn't quite right here. It expanding to RAM+MMIO, > > the subsequent p2m_mmio_direct check effectively reduces its use to > > RAM+MMIO_DM. Yet MMI

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

2025-03-11 Thread Pierrick Bouvier
Hi Zoltan, On 3/10/25 06:23, BALATON Zoltan wrote: On Sun, 9 Mar 2025, Pierrick Bouvier wrote: The main goal of this series is to be able to call any memory ld/st function from code that is *not* target dependent. Why is that needed? this series belongs to the "single binary" topic, where

Re: [PATCH 01/16] iommu: Add checks before calling iommu suspend/resume

2025-03-11 Thread Julien Grall
Hi, On 05/03/2025 09:11, Mykola Kvach wrote: From: Mykyta Poturai These functions may be unimplemented, so check that they exist before calling to prevent crashes. Looking at the cover letter, I see you wrote the following: "Add suspend/resume handlers to IOMMU drivers (there aren’t any pro

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

2025-03-11 Thread Pierrick Bouvier
Those functions are used by system/physmem.c, and are called only if xen is enabled (which happens only if CONFIG_XEN is not set). So we can crash in case those are called. Acked-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- hw/xen/xen_stubs.c | 56 +

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

2025-03-11 Thread Pierrick Bouvier
Only system/physmem.c and system/memory.c use those functions, so we can move then to internal header. Signed-off-by: Pierrick Bouvier --- include/exec/memory-internal.h | 19 +++ include/exec/memory.h | 18 -- 2 files changed, 19 insertions(+), 18 deleti

[PATCH v3 16/17] system/memory: make compilation unit common

2025-03-11 Thread Pierrick Bouvier
Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- system/memory.c| 17 + system/meson.build | 2 +- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/system/memory.c b/system/memory.c index 4c829793a0a..eddd21a6cdb 100644 --- a/system/memory.c

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

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

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

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

Re: [PATCH] MISRA: Rephrase the deviation for Directive 4.10

2025-03-11 Thread Andrew Cooper
On 11/03/2025 7:48 pm, Julien Grall wrote: > Hi, > > On 05/03/2025 00:17, Stefano Stabellini wrote: >> On Tue, 4 Mar 2025, Andrew Cooper wrote: >>> The use of "legitimately" mixes the concepts of "it was designed to >>> do this" >>> and "it was correct to do this". >>> >>> The latter in particular

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

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

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

2025-03-11 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 --- v16->v17: * new patch See https://lore.kernel.org/xen-devel/bc6660ef-59f1-4514-9792-067d

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

2025-03-11 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 v17: - add ("xen/arm: check read handler behavior") - drop ("xen/arm: account IO handlers for emulated PCI MSI-X") as it should wait for future work - drop committed p

[PATCH v3 09/17] exec/ram_addr: remove dependency on cpu.h

2025-03-11 Thread Pierrick Bouvier
Needed so compilation units including it can be common. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/exec/ram_addr.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h index 3d8df4edf15..7c011fadd

[PATCH v3 14/17] include/exec/memory: extract devend_big_endian from devend_memop

2025-03-11 Thread Pierrick Bouvier
we'll use it in system/memory.c. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/exec/memory.h | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 069021ac3ff..70177304a92 100644 -

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

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

[PATCH v3 05/17] exec/memory.h: make devend_memop "target defines" agnostic

2025-03-11 Thread Pierrick Bouvier
Will allow to make system/memory.c common later. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/exec/memory.h | 16 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index da21e9150b5..069021

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

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

[PATCH v3 08/17] exec/memory-internal: remove dependency on cpu.h

2025-03-11 Thread Pierrick Bouvier
Needed so compilation units including it can be common. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/exec/memory-internal.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h index 100c1237ac2..b729f

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

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

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

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

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

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

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

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

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

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

[PATCH v3 00/17] make system memory API available for common code

2025-03-11 Thread Pierrick Bouvier
The main goal of this series is to be able to call any memory ld/st function from code that is *not* target dependent. As a positive side effect, we can turn related system compilation units into common code. The first 5 patches remove dependency of memory API to cpu headers and remove dependency

[PATCH v3 02/17] exec/tswap: implement {ld,st}.*_p as functions instead of macros

2025-03-11 Thread Pierrick Bouvier
Defining functions allows to use them from common code, by not depending on TARGET_BIG_ENDIAN. Remove previous macros from exec/cpu-all.h. By moving them out of cpu-all.h, we'll be able to break dependency on cpu.h for memory related functions coming in next commits. Reviewed-by: Richard Henderson

Re: [PATCH] MISRA: Rephrase the deviation for Directive 4.10

2025-03-11 Thread Julien Grall
Hi, On 05/03/2025 00:17, Stefano Stabellini wrote: On Tue, 4 Mar 2025, Andrew Cooper wrote: The use of "legitimately" mixes the concepts of "it was designed to do this" and "it was correct to do this". The latter in particular can go stale. "intended" is a better way of phrasing this. No fun

Re: [PATCH v2] docs: specify numerical values of Xenstore commands

2025-03-11 Thread Julien Grall
Hi Juergen, On 11/03/2025 09:40, Jürgen Groß wrote: On 11.03.25 10:21, Julien Grall wrote: Hi Juergen, On 11/03/2025 07:31, Juergen Gross wrote: In docs/misc/xenstore.txt all Xenstore commands are specified, but the specifications lack the numerical values of the commands. Add a table with a

Re: [PATCH v2 1/2] xen/arm: fix iomem permissions cfg in map_range_to_domain()

2025-03-11 Thread Julien Grall
On 11/03/2025 11:31, Grygorii Strashko wrote: Hi On 19.02.25 13:25, Julien Grall wrote: Hi Grygorii, On 18/02/2025 11:22, Grygorii Strashko wrote: Now the following code in map_range_to_domain() res = iomem_permit_access(d, paddr_to_pfn(addr), paddr_to_pfn(PAGE_A

Re: [PATCH] tools/init-dom0less: Fix cpus > 1 and xenstore entries

2025-03-11 Thread Jason Andryuk
On 2025-03-06 05:29, Orzel, Michal wrote: On 05/03/2025 22:58, Jason Andryuk wrote: The trailing / in the path is incorrect and generates an error when writing to xenstore: Checking domid: 1 Init dom0less domain: 1 init-dom0less: writing to xenstore: No error information init-dom0less exits

[PATCH 09/16] exec/memory-internal: remove dependency on cpu.h

2025-03-11 Thread Pierrick Bouvier
Signed-off-by: Pierrick Bouvier --- include/exec/memory-internal.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h index 100c1237ac2..b729f3b25ad 100644 --- a/include/exec/memory-internal.h +++ b/include/exec/memory-internal.h @

[RFC PATCH v3 7/7] xen/arm: scmi: generate scmi dt node for DomUs

2025-03-11 Thread Grygorii Strashko
From: Oleksii Moisieiev This feature introduces SCMI support for DomU domains with partial SCMI DT node generation. During domain creation the following prerequisites are expected: - SCMI node template in partial device-tree, which should contain all subnodes used by DomU: / { firmware {

Re: [PATCH] tools/init-dom0less: Fix cpus > 1 and xenstore entries

2025-03-11 Thread Orzel, Michal
On 05/03/2025 22:58, Jason Andryuk wrote: > > > The trailing / in the path is incorrect and generates an error when > writing to xenstore: > Checking domid: 1 > Init dom0less domain: 1 > init-dom0less: writing to xenstore: No error information > > init-dom0less exits without finishing initial

Re: [PATCH v2 1/7] xen/arm: allow PCI host bridge to have private data

2025-03-11 Thread Julien Grall
Hi, On 11/03/2025 15:05, Grygorii Strashko wrote: On 11.03.25 12:24, Mykyta Poturai wrote: From: Oleksandr Andrushchenko Some of the PCI host bridges require private data. Create a generic approach for that, so such bridges may request the private data to be allocated during initialization.

  1   2   3   >