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 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

[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] 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

[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 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 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 +++-

[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 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 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

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 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 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

[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

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 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 @

[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 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 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

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

[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

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

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] 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

[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] 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

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 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: [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 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: [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] 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

[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 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 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 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 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 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 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 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 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 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 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

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] 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 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 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 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 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

[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 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 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 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 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

[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 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 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] 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

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 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 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 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 +++

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 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

[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 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 v2 5/5] xen/arm: ffa: Enable VM to VM without firmware

2025-03-11 Thread Bertrand Marquis
When VM to VM support is activated and there is no suitable FF-A support in the firmware, enable FF-A support for VMs to allow using it for VM to VM communications. If there is Optee running in the secure world and using the non FF-A communication system, having CONFIG_FFA_VM_TO_VM could be non fun

<    1   2   3