Re: [PATCH] x86/boot: re-order .init.data contributions

2025-04-04 Thread Jason Andryuk
On 2025-04-01 01:56, Jan Beulich wrote: Putting a few bytes ahead of page tables isn't very efficient; there's a gap almost worth a full page. To avoid re-ordering of items in the source file, simply put the few small items in sub-section 1, for them to end up after the page tables, followed (in

[PATCH v1 02/11] ci: increase timeout for hw tests

2025-04-04 Thread Marek Marczykowski-Górecki
It appears as sometimes it takes more time for Xen even start booting, mostly due to firmware and fetching large boot files by grub. In some jobs the current timeout is pretty close to the actual time needed, and sometimes (rarely for now) test fails due to timeout expiring in the middle of dom0 bo

Re: [PATCH v1 2/2] Strip build path directories in tools, xen and xen/arch/x86

2025-04-04 Thread Marek Marczykowski-Górecki
On Thu, Mar 20, 2025 at 05:09:12PM +0100, Jan Beulich wrote: > On 20.03.2025 16:58, Marek Marczykowski-Górecki wrote: > > On Thu, Mar 20, 2025 at 04:48:02PM +0100, Jan Beulich wrote: > >> On 20.03.2025 16:32, Marek Marczykowski-Górecki wrote: > >>> On Thu, Mar 20, 2025 at 04:21:18PM +0100, Jan Beul

Re: [PATCH] automation: Add Arm64 MPU build job

2025-04-04 Thread Jan Beulich
On 03.04.2025 10:44, Orzel, Michal wrote: > On 03/04/2025 10:43, Jan Beulich wrote: >> On 03.04.2025 10:19, Michal Orzel wrote: >>> Just like for RISCV and PPC, the earlier we enable the CI build the >>> better. >> >> What about Arm32? > The series to enable compilation of Arm32 with MPU is still u

RE: [PATCH v3 01/15] xen/cpufreq: introduces XEN_PM_PSD for solely delivery of _PSD

2025-04-04 Thread Penny, Zheng
[Public] Hi, > -Original Message- > From: Jan Beulich > Sent: Monday, March 24, 2025 10:09 PM > To: Penny, Zheng > Cc: Huang, Ray ; Andrew Cooper > ; Roger Pau Monné ; > Anthony PERARD ; Orzel, Michal > ; Julien Grall ; Stefano Stabellini > ; xen-devel@lists.xenproject.org > Subject: Re

[PATCH v2 3/4] automation/cirrus-ci: store XTF and Xen build artifacts

2025-04-04 Thread Roger Pau Monne
In preparation for adding some smoke tests that will consume those outputs. Signed-off-by: Roger Pau Monné Acked-by: Stefano Stabellini --- .cirrus.yml | 12 1 file changed, 12 insertions(+) diff --git a/.cirrus.yml b/.cirrus.yml index a6e4a5d0308b..38b654f75cf2 100644 --- a/.cirr

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

2025-04-04 Thread Jan Beulich
On 29.03.2025 00:56, Stefano Stabellini wrote: > On Wed, 26 Mar 2025, Penny Zheng wrote: >> We intend to remove all "depends on !PV_SHIM_EXCLUSIVE" (also the >> functionally >> equivalent "if !...") in Kconfig file, since negative dependancy will badly >> affect allyesconfig. >> This commit is bas

Re: [RFC PATCH v1 01/15] x86/msr: Replace __wrmsr() with native_wrmsrl()

2025-04-04 Thread H. Peter Anvin
On March 31, 2025 3:17:30 AM PDT, Ingo Molnar wrote: > >* Xin Li (Intel) wrote: > >> -__wrmsr (MSR_AMD_DBG_EXTN_CFG, val | 3ULL << 3, val >> 32); >> +native_wrmsrl(MSR_AMD_DBG_EXTN_CFG, val | 3ULL << 3); > >This is an improvement. > >> -__wrmsr (MSR_IA32_PQR_ASSOC, rmid_p, p

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

2025-04-04 Thread Alejandro Vallejo
On Tue Mar 18, 2025 at 9:00 AM GMT, Michal Orzel wrote: > We are missing a way to detect whether a user provided a value for > nr_spis equal to 0 or did not provide any value (default is also 0) which > can cause issues when calculated nr_spis is > 0 and the value from domain > config is 0. Fix it

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

2025-04-04 Thread Jan Beulich
On 01.04.2025 10:41, Penny, Zheng wrote: >> -Original Message- >> From: Jan Beulich >> Sent: Monday, March 31, 2025 2:30 PM >> >> On 29.03.2025 00:56, Stefano Stabellini wrote: >>> On Wed, 26 Mar 2025, Penny Zheng wrote: We intend to remove all "depends on !PV_SHIM_EXCLUSIVE" (also th

[PATCH] xen/arm: mpu: Use new-style annotations

2025-04-04 Thread Michal Orzel
When purging old-style annotations, MPU code was left unmodified. Fix it. Fixes: 221c66f4f2a4 ("Arm: purge ENTRY(), ENDPROC(), and ALIGN") Signed-off-by: Michal Orzel --- I found the issue when applying Luca series to be commited enabling MPU on Arm64 build. This patch is a prerequisite for it. -

[RFC PATCH v1 11/15] x86/extable: Implement EX_TYPE_FUNC_REWIND

2025-04-04 Thread Xin Li (Intel)
From: "H. Peter Anvin (Intel)" Add a new exception type, which allows emulating an exception as if it had happened at or near the call site of a function. This allows a function call inside an alternative for instruction emulation to "kick back" the exception into the alternatives pattern, possi

Re: [PATCH v2 01/15] x86/boot: introduce boot domain

2025-04-04 Thread Daniel P. Smith
On 1/30/25 08:45, Jan Beulich wrote: On 26.12.2024 17:57, Daniel P. Smith wrote: @@ -596,9 +597,10 @@ int __init dom0_setup_permissions(struct domain *d) return rc; } -int __init construct_dom0(struct boot_info *bi, struct domain *d) +int __init construct_dom0(struct boot_domain *bd)

[PATCH v3] x86/emulate: Remove HAVE_AS_RDRAND and HAVE_AS_RDSEED

2025-04-04 Thread dmkhn
From: Denis Mukhin The new toolchain baseline knows the rdrand/rdseed instructions, no need to carry the workaround in the code. Resolves: https://gitlab.com/xen-project/xen/-/work_items/208 Signed-off-by: Denis Mukhin --- Changes since v2: - updated arch_get_random() - Link to v2: https://lor

[PATCH v3] x86/vmx: Rework VMX wrappers using `asm goto()`

2025-04-04 Thread dmkhn
From: Denis Mukhin Improve error handling in VMX wrappers by switching to `asm goto()` where possible. Resolves: https://gitlab.com/xen-project/xen/-/work_items/210 Signed-off-by: Denis Mukhin --- Changes since v2: - dropped vmread changes - checked \n\t formatting - Link to v2: https://lore.k

Re: [PATCH v1 01/11] ci: prevent grub unpacking initramfs

2025-04-04 Thread Marek Marczykowski-Górecki
On Thu, Apr 03, 2025 at 12:39:11PM +0100, Andrew Cooper wrote: > On 03/04/2025 12:29 pm, Jan Beulich wrote: > > On 03.04.2025 13:04, Marek Marczykowski-Górecki wrote: > >> It fails on larger initramfs (~250MB one) and sometimes even smaller > >> depending on memory size/memory map, let Linux do it.

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

2025-04-04 Thread Andrew Cooper
On 17/03/2025 12:15 pm, Jan Beulich wrote: > On 11.03.2025 22:10, Andrew Cooper wrote: >> 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_

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

2025-04-04 Thread Mykola Kvach
Hi, On Thu, Mar 20, 2025 at 1:25 PM Grygorii Strashko wrote: > > > > On 05.03.25 11: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 sta

Re: [PATCH v5 01/16] xen/lzo: Remove more remanants of TMEM

2025-04-04 Thread Jan Beulich
On 28.03.2025 14:44, Andrew Cooper wrote: > This logic was inserted by commit 447f613c5404 ("lzo: update LZO compression > to current upstream version") but was only relevant for the TMEM logic, so > should have been deleted in commit c492e19fdd05 ("xen: remove tmem from > hypervisor") > > Fixes:

[PATCH v2 5/5] symbols: prefer symbols which have a type

2025-04-04 Thread Jan Beulich
... and thus typically also a size. Using global vs local is undesirable in certain situations, e.g. when a "real" symbol is local and at the same address as a section start/end one (which are all global). Note that for xen.efi the checking for "Function" is only forward- looking at this point: Th

[PATCH v4] x86/domain: revisit logging in arch_domain_create()

2025-04-04 Thread dmkhn
From: Denis Mukhin Use %pd in all logs issued from arch_domain_create() and reword some of the messages. Also, expand error message in arch_domain_create() under !emulation_flags_ok() case to help debugging. Signed-off-by: Denis Mukhin --- Changes since v3: - re-formatted log messages - shorte

Re: [RFC PATCH v1 01/15] x86/msr: Replace __wrmsr() with native_wrmsrl()

2025-04-04 Thread Dave Hansen
On 3/31/25 22:53, Xin Li wrote: > Per "struct msr" defined in arch/x86/include/asm/shared/msr.h: > > struct msr { >     union { >     struct { >     u32 l; >     u32 h; >     }; >     u64 q; >     }; > }; > > Prob

[RFC PATCH v1 04/15] x86/msr: Let pv_cpu_ops.write_msr{_safe}() take an u64 instead of two u32

2025-04-04 Thread Xin Li (Intel)
Refactor pv_cpu_ops.write_msr{_safe}() to take the input MSR value in a single u64 argument, replacing the current dual u32 arguments. No functional change intended. Signed-off-by: Xin Li (Intel) --- arch/x86/include/asm/msr.h| 33 --- arch/x86/include/asm/pa

Re: [PATCH v1] x86/domain: revisit logging in arch_domain_create()

2025-04-04 Thread Roger Pau Monné
On Tue, Apr 01, 2025 at 09:51:53AM +0200, Jan Beulich wrote: > On 01.04.2025 08:59, Roger Pau Monné wrote: > > On Mon, Mar 31, 2025 at 09:34:24PM +, dm...@proton.me wrote: > >> --- a/xen/arch/x86/domain.c > >> +++ b/xen/arch/x86/domain.c > >> @@ -798,13 +798,12 @@ int arch_domain_create(struct

Re: [PATCH v3 3/3] xen: debug: gcov: add condition coverage support

2025-04-04 Thread Volodymyr Babchuk
Hi Jan, Jan Beulich writes: > On 01.04.2025 03:17, Volodymyr Babchuk wrote: >> --- a/xen/Kconfig >> +++ b/xen/Kconfig >> @@ -41,6 +41,11 @@ config CC_SPLIT_SECTIONS >> config CC_HAS_UBSAN >> def_bool $(cc-option,-fsanitize=undefined) >> >> +# Compiler supports -fcondition-coverage aka

Re: [RFC] xen/x86: allow overlaps with non-RAM regions

2025-04-04 Thread Jan Beulich
On 04.04.2025 03:01, Stefano Stabellini wrote: > On one Sapphire AMD x86 board, I see this: > > > (XEN) [003943ca6ff2] [f000, f7ff] (reserved) > (XEN) [0039460886d9] [fd00, ] (reserved) > [...] > (XEN) [4.612235] :02:00.0: not

Re: [PATCH v2 5/6] x86/emulate: remove HAVE_AS_RDRAND and HAVE_AS_RDSEED

2025-04-04 Thread Jan Beulich
On 03.04.2025 21:21, Andrew Cooper wrote: > On 03/04/2025 7:23 pm, dm...@proton.me wrote: >> From: Denis Mukhin >> >> The new toolchain baseline knows the rdrand/rdseed instructions, >> no need to carry the workaround in the code. >> >> Resolves: https://gitlab.com/xen-project/xen/-/work_items/208

Re: [PATCH v2 6/6] x86/vmx: rework VMX wrappers to use `asm goto()`

2025-04-04 Thread Jan Beulich
On 03.04.2025 22:10, Andrew Cooper wrote: > On 03/04/2025 7:23 pm, dm...@proton.me wrote: >> --- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h >> +++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h >> @@ -294,54 +294,57 @@ extern uint8_t posted_intr_vector; >> >> static always_inline void __vmptrld(u64 addr

Re: [PATCH v2] xen: Consistently use 'static' first

2025-04-04 Thread Jan Beulich
On 03.04.2025 23:41, Andrew Cooper wrote: > MISRA C:2012 Amendment 3 (which is under consideration, but not used by Xen > yet) is more particular about having the storage class specifier first. > > No functional change. > > Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich

Re: [PATCH] x86/amd: Convert wrmsr_amd_safe() to use asm goto()

2025-04-04 Thread Jan Beulich
On 03.04.2025 19:57, Andrew Cooper wrote: > Bloat-o-meter reports: > > add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-29 (-29) > Function old new delta > _probe_mask_msr 99 94 -5 > init_amd

Re: [PATCH v1] xen/riscv: Increase XEN_VIRT_SIZE

2025-04-04 Thread Jan Beulich
On 04.04.2025 09:31, Oleksii Kurochko wrote: > > On 4/4/25 8:56 AM, Jan Beulich wrote: >> On 03.04.2025 18:20, Oleksii Kurochko wrote: >>> On 4/1/25 6:04 PM, Jan Beulich wrote: On 01.04.2025 17:58, Oleksii Kurochko wrote: > On 3/31/25 6:14 PM, Jan Beulich wrote: >> On 31.03.2025 17:20

Re: [PATCH v1 08/11] ci: switch test kernel from 6.1.19 to 6.12.21

2025-04-04 Thread Marek Marczykowski-Górecki
On Thu, Apr 03, 2025 at 05:40:07PM -0700, Stefano Stabellini wrote: > On Thu, 3 Apr 2025, Marek Marczykowski-Górecki wrote: > > The jump is pretty big, but should be enough for a longer time. The > > change right now is motivated adding new runner with AMD Zen4. > > > > Signed-off-by: Marek Marczy

Re: [PATCH v1] xen/riscv: Increase XEN_VIRT_SIZE

2025-04-04 Thread Oleksii Kurochko
On 4/4/25 8:56 AM, Jan Beulich wrote: On 03.04.2025 18:20, Oleksii Kurochko wrote: On 4/1/25 6:04 PM, Jan Beulich wrote: On 01.04.2025 17:58, Oleksii Kurochko wrote: On 3/31/25 6:14 PM, Jan Beulich wrote: On 31.03.2025 17:20, Oleksii Kurochko wrote: +_AC(XEN_VIRT_START, UL) >> vpn1_

Re: [PATCH v3 4/7] xen/arm: dom0less seed xenstore grant table entry

2025-04-04 Thread Jan Beulich
On 03.04.2025 23:46, Jason Andryuk wrote: > xenstored maps other domains' xenstore pages. Currently this relies on > init-dom0less or xl to seed the grants from Dom0. With split > hardware/control/xenstore domains, this is problematic since we don't > want the hardware domain to be able to map ot

Re: [PATCH v4 1/3] xen/arm: Move some of the functions to common file

2025-04-04 Thread Luca Fancellu
Hi Ayan, > On 3 Apr 2025, at 18:12, Ayan Kumar Halder wrote: > > Added a new file prepare_xen_region.inc to hold the common earlyboot MPU > regions > configurations across arm64 and arm32. > > prepare_xen_region, fail_insufficient_regions() will be used by both arm32 and > arm64. Thus, they ha

Re: [PATCH v4 3/3] xen/arm32: mpu: Stubs to build MPU for arm32

2025-04-04 Thread Luca Fancellu
Hi Ayan, > On 3 Apr 2025, at 18:12, Ayan Kumar Halder wrote: > > Add stubs to enable compilation > > Signed-off-by: Ayan Kumar Halder > --- > > Changes from :- > > v1, v2 - > 1. New patch introduced in v3. > 2. Should be applied on top of > https://patchwork.kernel.org/project/xen-devel/cove

Re: [PATCH] x86: drop XSAVEOPT and CLWB build flags

2025-04-04 Thread Andrew Cooper
On 04/04/2025 8:21 am, Jan Beulich wrote: > On 04.04.2025 01:22, Alexander M. Merritt wrote: >> The new toolchain baseline knows both the XSAVEOPT and CLWB instructions. >> >> Resolves: https://gitlab.com/xen-project/xen/-/work_items/205 >> Signed-off-by: Alexander M. Merritt >> --- >> xen/arch/x

Re: [RFC] xen/x86: allow overlaps with non-RAM regions

2025-04-04 Thread Roger Pau Monné
On Thu, Apr 03, 2025 at 06:01:42PM -0700, Stefano Stabellini wrote: > On one Sapphire AMD x86 board, I see this: > > > (XEN) [003943ca6ff2] [f000, f7ff] (reserved) > (XEN) [0039460886d9] [fd00, ] (reserved) > [...] > (XEN) [4.61223

Re: [PATCH v2 1/2] x86/amd: Add guest support for AMD TCE

2025-04-04 Thread Andrew Cooper
On 04/04/2025 10:49 am, Teddy Astie wrote: > AMD Translation Cache Extension is a flag that can be enabled in the EFER MSR > to optimize > some TLB flushes. Expose this flag to guest if supported by hardware. > > AMD Architecture Developer Manual describe this feature as follow >> Setting this bit

Re: [PATCH] x86: drop XSAVEOPT and CLWB build flags

2025-04-04 Thread Jan Beulich
On 04.04.2025 01:22, Alexander M. Merritt wrote: > The new toolchain baseline knows both the XSAVEOPT and CLWB instructions. > > Resolves: https://gitlab.com/xen-project/xen/-/work_items/205 > Signed-off-by: Alexander M. Merritt > --- > xen/arch/x86/arch.mk | 2 -- > xen/arch/x86/f

Re: [PATCH] sched/null: avoid another crash after failed domU creation

2025-04-04 Thread Jan Beulich
On 03.04.2025 23:48, Stewart Hildebrand wrote: > The following sequence of events may lead a debug build of Xen to crash > when using the null scheduler: > > 1. domain creation (e.g. d1) failed due to bad configuration > 2. complete_domain_destroy() was deferred > 3. domain creation (e.g. d2) succ

Re: [PATCH v1] xen/riscv: Increase XEN_VIRT_SIZE

2025-04-04 Thread Oleksii Kurochko
On 4/4/25 9:52 AM, Jan Beulich wrote: On 04.04.2025 09:31, Oleksii Kurochko wrote: On 4/4/25 8:56 AM, Jan Beulich wrote: On 03.04.2025 18:20, Oleksii Kurochko wrote: On 4/1/25 6:04 PM, Jan Beulich wrote: On 01.04.2025 17:58, Oleksii Kurochko wrote: On 3/31/25 6:14 PM, Jan Beulich wrote: On

Re: [PATCH v4 0/3] Enable early bootup of Armv8-R AArch32 systems

2025-04-04 Thread Luca Fancellu
Hi Ayan, > On 3 Apr 2025, at 18:12, Ayan Kumar Halder wrote: > > Enable early booting of Armv8-R AArch32 based systems. > > Ayan Kumar Halder (3): > xen/arm: Move some of the functions to common file > xen/arm32: Create the same boot-time MPU regions as arm64 > xen/arm32: mpu: Stubs to build

[PATCH v2 1/2] x86/amd: Add guest support for AMD TCE

2025-04-04 Thread Teddy Astie
AMD Translation Cache Extension is a flag that can be enabled in the EFER MSR to optimize some TLB flushes. Expose this flag to guest if supported by hardware. AMD Architecture Developer Manual describe this feature as follow > Setting this bit to 1 changes how the INVLPG, INVLPGB, and INVPCID >

[PATCH v2 2/2] x86/amd: Enable TCE in Xen

2025-04-04 Thread Teddy Astie
Aside exposing this flag to guests, Xen can also make use of it to reduce the cost of some TLB flushes. Enable this flag if supported by hardware. Signed-off-by: Teddy Astie --- v2: - Add changelog entry - use trampoline_efer - use cpu_has_tce instead of opencoded boot_cpu_has(X86_FEATURE_TCE)

Re: [PATCH v1] xen/riscv: Increase XEN_VIRT_SIZE

2025-04-04 Thread Jan Beulich
On 04.04.2025 10:43, Oleksii Kurochko wrote: > > On 4/4/25 9:52 AM, Jan Beulich wrote: >> On 04.04.2025 09:31, Oleksii Kurochko wrote: >>> On 4/4/25 8:56 AM, Jan Beulich wrote: On 03.04.2025 18:20, Oleksii Kurochko wrote: > On 4/1/25 6:04 PM, Jan Beulich wrote: >> On 01.04.2025 17:58,

Re: [PATCH v2 6/6] x86/vmx: rework VMX wrappers to use `asm goto()`

2025-04-04 Thread Andrew Cooper
On 04/04/2025 8:14 am, Jan Beulich wrote: > On 03.04.2025 22:10, Andrew Cooper wrote: >> On 03/04/2025 7:23 pm, dm...@proton.me wrote: >>> --- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h >>> +++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h >>> @@ -294,54 +294,57 @@ extern uint8_t posted_intr_vector; >>>

[MINI-OS PATCH 01/12] kexec: add kexec framework

2025-04-04 Thread Juergen Gross
Add a new config option CONFIG_KEXEC for support of kexec-ing into a new mini-os kernel. Add a related kexec.c source and a kexec.h header. For now allow CONFIG_KEXEC to be set only for PVH variant of mini-os. Signed-off-by: Juergen Gross --- Config.mk | 1 + Makefile

Re: [PATCH v4 5/5] xen/arm: ffa: Enable VM to VM without firmware

2025-04-04 Thread Bertrand Marquis
Hi Julien, > On 27 Mar 2025, at 00:41, Julien Grall wrote: > > Hi Bertrand, > > On 24/03/2025 13:53, Bertrand Marquis wrote: >> 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 communicatio

Re: [PATCH v2] x86/xen: fix balloon target initialization for PVH dom0

2025-04-04 Thread Jürgen Groß
On 04.04.25 20:20, Dave Hansen wrote: On 4/4/25 06:34, Roger Pau Monne wrote: Much like a6aa4eb994ee, the code in this changeset should have been part of 38620fc4e893. Fixes: a6aa4eb994ee ('xen/x86: add extra pages to unpopulated-alloc if available') Signed-off-by: Roger Pau Monné I don't s

[PATCH v2] x86/xen: fix balloon target initialization for PVH dom0

2025-04-04 Thread Roger Pau Monne
PVH dom0 re-uses logic from PV dom0, in which RAM ranges not assigned to dom0 are re-used as scratch memory to map foreign and grant pages. Such logic relies on reporting those unpopulated ranges as RAM to Linux, and mark them as reserved. This way Linux creates the underlying page structures req

Re: [XEN PATCH] automation: Avoid changing source files for randconfig tests

2025-04-04 Thread Anthony PERARD
On Thu, Mar 27, 2025 at 03:59:16PM -0700, Stefano Stabellini wrote: > I was suggesting to create a file under /tmp instead to keep the source > directory cleaner, There's an easy way to keep the source directory *extra clean* when doing hypervisor build, like we are doing here for randoconfig, tha

[PATCH v2] xen/riscv: Increase XEN_VIRT_SIZE

2025-04-04 Thread Oleksii Kurochko
A randconfig job failed with the following issue: riscv64-linux-gnu-ld: Xen too large for early-boot assumptions The reason is that enabling the UBSAN config increased the size of the Xen binary. Increase XEN_VIRT_SIZE to reserve enough space, allowing both UBSAN and GCOV to be enabled together

Re: [PATCH v2 2/2] x86/amd: Enable TCE in Xen

2025-04-04 Thread Andrew Cooper
On 04/04/2025 10:49 am, Teddy Astie wrote: > diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c > index d70abb7e0c..0e2e7d012f 100644 > --- a/xen/arch/x86/setup.c > +++ b/xen/arch/x86/setup.c > @@ -2008,6 +2008,14 @@ void asmlinkage __init noreturn __start_xen(void) > if ( cpu_has_pku )

Re: [PATCH v3 1/7] xen: introduce hardware domain create flag

2025-04-04 Thread Jan Beulich
On 03.04.2025 23:46, Jason Andryuk wrote: > From: "Daniel P. Smith" > > Add and use a new internal create domain flag to specify the hardware > domain. This removes the hardcoding of domid 0 as the hardware domain. > > This allows more flexibility with domain creation. > > Signed-off-by: Danie

Re: Using Restricted DMA for virtio-pci

2025-04-04 Thread Michael S. Tsirkin
On Fri, Mar 21, 2025 at 03:38:10PM +, David Woodhouse wrote: > On Tue, 2021-02-09 at 14:21 +0800, Claire Chang wrote: > > This series implements mitigations for lack of DMA access control on > > systems without an IOMMU, which could result in the DMA accessing the > > system memory at unexpecte

Re: [PATCH v2 06/15] x86/hyperlaunch: introduce the domain builder

2025-04-04 Thread Jan Beulich
On 01.04.2025 20:01, Jason Andryuk wrote: > On 2025-01-30 09:52, Jan Beulich wrote: >> On 26.12.2024 17:57, Daniel P. Smith wrote: >>> --- a/xen/arch/x86/Makefile >>> +++ b/xen/arch/x86/Makefile >>> @@ -81,6 +81,8 @@ obj-$(CONFIG_COMPAT) += x86_64/platform_hypercall.o >>> obj-y += sysctl.o >>>

[PATCH v3 1/2] x86/amd: Add guest support for AMD TCE

2025-04-04 Thread Teddy Astie
AMD Translation Cache Extension is a flag that can be enabled in the EFER MSR to optimize some TLB flushes. Expose this flag to guest if supported by hardware. Only expose this feature to HAP-enabled guests. Guests with shadow paging guests have their TLB flush operations intercepted and handled

Re: [PATCH] x86: drop XSAVEOPT and CLWB build flags

2025-04-04 Thread Alexander Merritt
On 2025-04-03 19:34, Andrew Cooper wrote: On 04/04/2025 12:28 am, Andrew Cooper wrote: Also, I forgot to write in the ticket, clflushopt wants similar treatment, even if there isn't an outward define for it.  I think the following two hunks should do: ~Andrew diff --git a/xen/arch/x86/flushtlb.

Re: [PATCH v3 1/2] x86/amd: Add guest support for AMD TCE

2025-04-04 Thread Teddy Astie
Sorry I forgot to run add_maintainers on this patch series, so this serie got only sent to xen-devel@lists.xenproject.org without the proper CC. Teddy Teddy Astie | Vates XCP-ng Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech

Re: [PATCH v2] x86/xen: fix balloon target initialization for PVH dom0

2025-04-04 Thread Jürgen Groß
On 04.04.25 15:34, Roger Pau Monne wrote: PVH dom0 re-uses logic from PV dom0, in which RAM ranges not assigned to dom0 are re-used as scratch memory to map foreign and grant pages. Such logic relies on reporting those unpopulated ranges as RAM to Linux, and mark them as reserved. This way Linu

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

2025-04-04 Thread Penny, Zheng
[Public] Hi, > -Original Message- > From: Jan Beulich > Sent: Monday, March 31, 2025 2:30 PM > To: Stefano Stabellini ; Penny, Zheng > > Cc: xen-devel@lists.xenproject.org; Huang, Ray ; > Andrew Cooper ; Roger Pau Monné > ; Anthony PERARD ; Orzel, > Michal ; Julien Grall > Subject: Re:

[PATCH] xen/arm: Drop process_shm_chosen()

2025-04-04 Thread Michal Orzel
There's no benefit in having process_shm_chosen() next to process_shm(). The former is just a helper to pass "/chosen" node to the latter for hwdom case. Drop process_shm_chosen() and instead use process_shm() passing NULL as node parameter, which will result in searching for and using /chosen to f

[PATCH v3 3/7] xen/arm: dom0less delay xenstore initialization

2025-04-04 Thread Jason Andryuk
To allocate the xenstore event channel and initialize the grant table entry, the xenstore domid is neeed. A dom0 is created before the domUs, so it is normally available through hardware_domain. With capabilities and dom0less, the xenstore domain may not be created first. Keep the population of

Re: [XEN PATCH v2 1/1] tools/libxl: search PATH for QEMU if `QEMU_XEN_PATH` is not absolute

2025-04-04 Thread Anthony PERARD
On Mon, Mar 31, 2025 at 12:03:04AM +0800, Hongbo wrote: > `QEMU_XEN_PATH` will be configured as `qemu-system-i386` with no clue where, > if > `--with-system-qemu` is set without giving a path (as matched in the case > `yes` > but not `*`). However, the existence of the executable is checked by >

[PATCH v3 2/2] x86/amd: Enable TCE in Xen

2025-04-04 Thread Teddy Astie
Aside exposing this flag to guests, Xen can also make use of it to reduce the cost of some TLB flushes. Enable this flag if supported by hardware. Signed-off-by: Teddy Astie --- v2: - Add changelog entry - use trampoline_efer - use cpu_has_tce instead of opencoded boot_cpu_has(X86_FEATURE_TCE)

Re: [PATCH v1 1/3] vpci: Hide capability when it fails to initialize

2025-04-04 Thread Chen, Jiqian
On 2025/3/31 19:04, Roger Pau Monné wrote: > On Mon, Mar 31, 2025 at 09:32:02AM +, Chen, Jiqian wrote: >> So, I need to refactor the emulating PCI capability list codes of >> init_header() to serve >> for all domain(dom0+domUs) firstly, since current codes only emulate PCI >> capability list

[PATCH v2] x86/domain: revisit logging in arch_domain_create()

2025-04-04 Thread dmkhn
From: Denis Mukhin Use %pd in all logs issued from arch_domain_create(). Also, expand error message in arch_domain_create() under !emulation_flags_ok() case to help debugging. Signed-off-by: Denis Mukhin --- Changes since v1: - dropped parentheses around "hardware" in the log message --- xen/

Re: [PATCH] PCI/MSI: Handle the NOMASK flag correctly for all PCI/MSI backends

2025-04-04 Thread Bert Karwatzki
This also fixes a timeout error in the nvme driver introduced by commit c3164d2e0d1. In linux-next-2025032{5,6} booting hangs in about 50% of boot attempts with the message: nvme nvme1: I/O tag 4 (1004) QID 0 timeout, completion polled nvme nvme0: I/O tag 20 (1014) QID 0 timeout, completion polled

Re: [PATCH v2] x86/xen: fix balloon target initialization for PVH dom0

2025-04-04 Thread Dave Hansen
On 4/4/25 06:34, Roger Pau Monne wrote: > Much like a6aa4eb994ee, the code in this changeset should have been part of > 38620fc4e893. > > Fixes: a6aa4eb994ee ('xen/x86: add extra pages to unpopulated-alloc if > available') > Signed-off-by: Roger Pau Monné I don't see a cc:stable@ on there. Was

[PATCH] tools: Remove support for qemu-trad's battery reporting

2025-04-04 Thread Alejandro Vallejo
The way this undocumented feature works is via qemu-trad (who nobody uses anymore), by intercepting 3 magic PIOs. 0x88 is one of them, and it's probed by hvmloader as a means of detecting support for this (so, on qemu-upstream this check always fails). If hvmloader detects the feature, it appends a

[MINI-OS PATCH 03/12] add elf.h

2025-04-04 Thread Juergen Gross
Add some definitions for accessing an ELF file. Only the file header and the program header are needed. The main source for those are elfstructs.h and libelf.h from the Xen tree. The license boiler plate of those files is being kept in the resulting header file. Signed-off-by: Juergen Gross ---

Re: [PATCH] x86emul: replace _BYTES_PER_LONG

2025-04-04 Thread Anthony PERARD
On Mon, Mar 31, 2025 at 05:52:27PM +0200, Jan Beulich wrote: > We can now easily use __SIZEOF_LONG__ instead. For this to also work in > the test harness, move hvmloader's STR() to common-macros.h. > > Signed-off-by: Jan Beulich Acked-by: Anthony PERARD > Quite likely libxl{,u}_internal.h's ST

[PATCH 0/1] drop wrappers of SVM instructions

2025-04-04 Thread Alexander M. Merritt
Part of cleanup following toolchain baseline upgrade. As the new toolchain baseline knows the SVM instructions, this series drops macros with SVM instructions, and updates SVM wrappers to use real instructions rather than bytecode. Resolves: xen-project/xen#204 Alexander M. Merritt (1): xen/x8

Re: [RFC PATCH v1 10/15] KVM: VMX: Use WRMSRNS or its immediate form when available

2025-04-04 Thread Andrew Cooper
On 31/03/2025 9:27 pm, Konrad Rzeszutek Wilk wrote: > On Mon, Mar 31, 2025 at 01:22:46AM -0700, Xin Li (Intel) wrote: >> Signed-off-by: Xin Li (Intel) >> --- >> arch/x86/include/asm/msr-index.h | 6 ++ >> arch/x86/kvm/vmx/vmenter.S | 28 >> 2 files changed,

Re: [PATCH] automation: Add Arm64 MPU build job

2025-04-04 Thread Jan Beulich
On 03.04.2025 11:17, Orzel, Michal wrote: > On 03/04/2025 10:58, Jan Beulich wrote: >> On 03.04.2025 10:44, Orzel, Michal wrote: >>> On 03/04/2025 10:43, Jan Beulich wrote: On 03.04.2025 10:19, Michal Orzel wrote: > Just like for RISCV and PPC, the earlier we enable the CI build the >

Re: [PATCH] x86/amd: Convert wrmsr_amd_safe() to use asm goto()

2025-04-04 Thread Andrew Cooper
On 04/04/2025 8:48 am, Jan Beulich wrote: > On 03.04.2025 19:57, Andrew Cooper wrote: >> Bloat-o-meter reports: >> >> add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-29 (-29) >> Function old new delta >> _probe_mask_msr 99

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

2025-04-04 Thread Oleksandr Tyshchenko
On 27.03.25 00:39, Julien Grall wrote: > Hi Oleksandr, Hello Julien > > On 26/03/2025 11:45, Oleksandr Tyshchenko wrote: >> Also it is not entirely clear what we should do with acpi_disabled=true >> during declaration (what current patch does), even if we decided to go >> with splitting should

Re: [PATCH v1 1/3] vpci: Hide capability when it fails to initialize

2025-04-04 Thread Chen, Jiqian
On 2025/3/31 16:43, Roger Pau Monné wrote: > On Mon, Mar 31, 2025 at 07:26:20AM +, Chen, Jiqian wrote: >> On 2025/3/27 17:25, Roger Pau Monné wrote: >>> On Thu, Mar 27, 2025 at 03:32:12PM +0800, Jiqian Chen wrote: #endif /* CONFIG_HAS_VPCI_GUEST_SUPPORT */ +static int vpci_in

[RFC PATCH v1 05/15] x86/msr: Replace wrmsr(msr, low, 0) with wrmsrl(msr, value)

2025-04-04 Thread Xin Li (Intel)
Signed-off-by: Xin Li (Intel) --- arch/x86/hyperv/hv_apic.c | 6 +++--- arch/x86/include/asm/apic.h | 2 +- arch/x86/include/asm/switch_to.h | 2 +- arch/x86/kernel/cpu/amd.c | 2 +- arch/x86/kernel/cpu/common.c | 8

Re: [PATCH v3 03/15] xen/cpufreq: refactor cmdline "cpufreq=xxx"

2025-04-04 Thread Jan Beulich
On 01.04.2025 07:44, Penny, Zheng wrote: > [Public] > > Hi > >> -Original Message- >> From: Jan Beulich >> Sent: Wednesday, March 26, 2025 6:43 PM >> To: Penny, Zheng >> Cc: Huang, Ray ; Andrew Cooper >> ; Anthony PERARD ; >> Orzel, Michal ; Julien Grall ; Roger >> Pau Monné ; Stefano S

[RFC PATCH v1 10/15] KVM: VMX: Use WRMSRNS or its immediate form when available

2025-04-04 Thread Xin Li (Intel)
Signed-off-by: Xin Li (Intel) --- arch/x86/include/asm/msr-index.h | 6 ++ arch/x86/kvm/vmx/vmenter.S | 28 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h index e6134ef2263

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

2025-04-04 Thread Bertrand Marquis
Hi Julien, > On 30 Mar 2025, at 23:26, Julien Grall wrote: > > Hi Bertrand, > > On 27/03/2025 08:25, Bertrand Marquis wrote: >>> On 27 Mar 2025, at 00:14, Julien Grall wrote: +static int32_t ffa_get_sp_partinfo(uint32_t *uuid, uint32_t *sp_count, + v

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

2025-04-04 Thread Jason Andryuk
On 2025-03-20 10:35, Jürgen Groß wrote: On 20.03.25 15:28, Jason Andryuk wrote: On 2025-03-20 03:49, Juergen Gross wrote: Add a file operations fstat hook to the 9pfs frontend. Signed-off-by: Juergen Gross --- @@ -950,6 +952,32 @@ static int write_9pfs(struct file *file, const void *buf, s

Re: [PATCH] xen/arm: Drop process_shm_chosen()

2025-04-04 Thread Orzel, Michal
On 02/04/2025 08:18, Bertrand Marquis wrote: > > > Hi Michal, > >> On 1 Apr 2025, at 18:42, Orzel, Michal wrote: >> >> >> >> On 01/04/2025 17:53, Bertrand Marquis wrote: >>> >>> >>> Hi Michal, >>> On 1 Apr 2025, at 17:21, Orzel, Michal wrote: On 01/04/2025 16:49, Be

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

2025-04-04 Thread Bertrand Marquis
Hi Jens, Thanks a lot for the review. > On 20 Mar 2025, at 15:20, Jens Wiklander wrote: > > Hi Bertrand, > > On Mon, Mar 10, 2025 at 3:51 PM Bertrand Marquis > wrote: >> >> Create a CONFIG_FFA_VM_TO_VM parameter to activate FFA communication >> between VMs. >> When activated list VMs in the

Re: [PATCH] xen: simplify bitmap_to_xenctl_bitmap for little endian

2025-04-04 Thread Stefano Stabellini
On Wed, 19 Mar 2025, Jan Beulich wrote: > What about xenctl_bitmap_to_bitmap()? Let me see first if I managed to handle bitmap_to_xenctl_bitmap well. --- [PATCH v2] xen: simplify bitmap_to_xenctl_bitmap for little endian The little endian implementation of bitmap_to_xenctl_bitmap leads to unne

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

2025-04-04 Thread Oleksii Kurochko
On 3/17/25 4:46 PM, Jan Beulich wrote: On 11.03.2025 17:19, Oleksii Kurochko wrote: --- a/xen/arch/riscv/setup.c +++ b/xen/arch/riscv/setup.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -128,6 +129,8 @@ void __init noreturn start_xen(u

Re: [PATCH v3 2/5] xen/arm: Move some of the functions to common file

2025-04-04 Thread Julien Grall
Hi Ayan, On 31/03/2025 13:38, Ayan Kumar Halder wrote: On 30/03/2025 22:06, Julien Grall wrote: Hi Ayan, Hi Julien/Michal, Michal - I agree to use {READ/WRTIE}_SYSREG_ASM() instead of LOAD/STORE. I need your thoughts on the following. On 30/03/2025 19:03, Ayan Kumar Halder wrote: Added

[PATCH] x86/mm: Fix IS_ALIGNED() check in IS_LnE_ALIGNED()

2025-04-04 Thread Andrew Cooper
The current CI failures happen to be a latent bug triggered by a narrow set of properties of the initrd, which CI encountered by chance. One step during boot involves constructing directmap mappings for modules. With some probing at the point of creation, it is observed that there's a 4k mapping m

Re: Using Restricted DMA for virtio-pci

2025-04-04 Thread Michael S. Tsirkin
On Sun, Mar 30, 2025 at 04:07:56PM +0100, David Woodhouse wrote: > On Sun, 2025-03-30 at 09:42 -0400, Michael S. Tsirkin wrote: > > On Fri, Mar 28, 2025 at 05:40:41PM +, David Woodhouse wrote: > > > On Fri, 2025-03-21 at 18:42 +, David Woodhouse wrote: > > > > > > > > > > I don't mind as s

Re: Discussion on unexpected behavior of ARINC653 scheduler

2025-04-04 Thread Choi, Anderson
Andrew, > EXT email: be mindful of links/attachments. > > On 13/03/2025 9:27 am, Choi, Anderson wrote: >> May I know when you think it would be mainlined? And will it be applied to > all branches, like 4.19 and 4.20? > > FYI, backports of this and the xfree() bug have just happened, back to 4.18

Re: [PATCH] x86/mm: Fix IS_ALIGNED() check in IS_LnE_ALIGNED()

2025-04-04 Thread Andrew Cooper
On 19/03/2025 2:29 pm, Jan Beulich wrote: > On 19.03.2025 15:20, Andrew Cooper wrote: >> The current CI failures happen to be a latent bug triggered by a narrow set >> of >> properties of the initrd, which CI encountered by chance. > Plus properties of the host memory map. > >> One step during boo

[PATCH v2 3/7] xen/domain: introduce domid_top()

2025-04-04 Thread dmkhn
From: Denis Mukhin Introduce domid_top() in architecture-independent location to retrieve the highest non-system domain ID for use in console input switch logic. Replace max_init_domid with domid_top(), which obsoletes max_init_domid in the code base. Signed-off-by: Denis Mukhin --- Changes si

Re: [PATCH] sched/null: avoid another crash after failed domU creation

2025-04-04 Thread Jürgen Groß
On 04.04.25 09:24, Jan Beulich wrote: On 03.04.2025 23:48, Stewart Hildebrand wrote: The following sequence of events may lead a debug build of Xen to crash when using the null scheduler: 1. domain creation (e.g. d1) failed due to bad configuration 2. complete_domain_destroy() was deferred 3. d

Re: [RFC PATCH v1 01/15] x86/msr: Replace __wrmsr() with native_wrmsrl()

2025-04-04 Thread Ingo Molnar
* H. Peter Anvin wrote: > On March 31, 2025 3:17:30 AM PDT, Ingo Molnar wrote: > > > >* Xin Li (Intel) wrote: > > > >> - __wrmsr (MSR_AMD_DBG_EXTN_CFG, val | 3ULL << 3, val >> 32); > >> + native_wrmsrl(MSR_AMD_DBG_EXTN_CFG, val | 3ULL << 3); > > > >This is an improvement. > > > >> - _

[PATCH v2 1/2] x86/PVH: don't open-code elf_round_up()

2025-04-04 Thread Jan Beulich
Signed-off-by: Jan Beulich --- I was wondering whether in elf_round_up() itself we might better use ROUNDUP(). --- v2: New. --- a/xen/arch/x86/hvm/dom0_build.c +++ b/xen/arch/x86/hvm/dom0_build.c @@ -718,8 +718,7 @@ static int __init pvh_load_kernel( extra_space += sizeof(mod) + ROUNDUP(

Re: [PATCH v1 1/3] vpci: Hide capability when it fails to initialize

2025-04-04 Thread Chen, Jiqian
On 2025/3/27 17:25, Roger Pau Monné wrote: > On Thu, Mar 27, 2025 at 03:32:12PM +0800, Jiqian Chen wrote: >> When vpci fails to initialize a capability of a device, it just >> return error instead of catching and processing exception. That >> makes the entire device unusable. >> >> So, refactor REG

[PATCH v2 0/4] automation/cirrus-ci: add smoke tests of the FreeBSD builds

2025-04-04 Thread Roger Pau Monne
Hello, The aim of the series is to introduce a basic set of smoke tests using QEMU and XTF, to ensure some minimal run-time testing of the LLVM toolchain generated Xen binary. Thanks, Roger. Roger Pau Monne (4): automation/cirrus-ci: use matrix keyword to generate per-version build tasks

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

2025-04-04 Thread Jürgen Groß
On 20.03.25 22:07, Bjorn Helgaas wrote: On Wed, Feb 19, 2025 at 10:20:57AM +0100, Roger Pau Monne wrote: Setting pci_msi_ignore_mask inhibits the toggling of the mask bit for both MSI and MSI-X entries globally, regardless of the IRQ chip they are using. Only Xen sets the pci_msi_ignore_mask whe

  1   2   >