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

2025-04-05 Thread Jan Beulich
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 Beulich wrote: On 20.03.2025 16:17, Marek Marczykowski-Górecki wrote

[PATCH] time: drop cast from NOW()

2025-04-05 Thread Jan Beulich
It gives the wrong impression of there being a type change, when get_s_time() really returns s_time_t itself (kind of naturally given its name). Signed-off-by: Jan Beulich --- unstable.orig/xen/include/xen/time.h2024-11-21 21:12:47.0 +0100 +++ unstable/xen/include/xen/time.h

[RFC PATCH v1 03/15] x86/msr: Simplify pmu_msr_{read,write}()

2025-04-05 Thread Xin Li (Intel)
Remove calling native_{read,write}_msr{_safe}() in pmu_msr_{read,write}(), and have them return false to let their caller to do that instead. Refactor pmu_msr_write() to take the input MSR value in an u64 argument, replacing the current dual u32 arguments. Suggested-by: H. Peter Anvin (Intel) Si

Re: [PATCH v2 4/6] xen/arm: dom0less seed xenstore grant table entry

2025-04-05 Thread Jason Andryuk
On 2025-04-01 08:16, Jan Beulich wrote: On 31.03.2025 23:43, 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 h

[PATCH v3 4/5] xen/arm32: Allow ARM_PA_BITS_40 only if !MPU

2025-04-05 Thread Ayan Kumar Halder
From: Michal Orzel ArmV8-R AArch32 does not support LPAE. The reason being PMSAv8-32 supports 32-bit physical address only. Signed-off-by: Michal Orzel Signed-off-by: Ayan Kumar Halder --- Changes from v1 - 1. New patch. v2 - 1. No changes xen/arch/arm/Kconfig | 2 +- 1 file changed, 1 in

[MINI-OS PATCH 07/12] kexec: build parameters for new kernel

2025-04-05 Thread Juergen Gross
Build the parameters for the new kernel, consisting of the hvm_start_info struct, the memory map and the command line. Signed-off-by: Juergen Gross --- arch/x86/kexec.c | 58 include/kexec.h | 4 kexec.c | 13 ++- 3 files c

Re: [PATCH v2] x86/vmx: Use asm goto() in _vmx_cpu_up()

2025-04-05 Thread Andrew Cooper
On 02/04/2025 10:56 am, Andrew Cooper wrote: > diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c > index 0ba65becec1e..8e99e6f73062 100644 > --- a/xen/arch/x86/hvm/vmx/vmcs.c > +++ b/xen/arch/x86/hvm/vmx/vmcs.c > @@ -785,6 +770,23 @@ static int _vmx_cpu_up(bool bsp) > vmx_

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

2025-04-05 Thread Jan Beulich
On 29.03.2025 01:13, Stefano Stabellini wrote: > On Wed, 26 Mar 2025, Penny Zheng wrote: >> The following functions are only used to deal with XEN_SYSCTL_physinfo, >> then they shall be wrapped: >> - arch_do_physinfo >> - get_outstanding_claims >> >> Signed-off-by: Penny Zheng > > Reviewed-by: St

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

2025-04-05 Thread Andrew Cooper
Petr reports: (XEN) MMIO emulation failed (1): d12v1 64bit @ 0010:f8057ba7dfbf -> 45 0f 20 c2 ... during introspection. This is MOV %cr8, which is wired up for hvm_mov_{to,from}_cr(); the VMExit fastpaths, but not for the full emulation slowpaths. Xen's handling of %cr8 turns out to be q

[PATCH] x86/MTRR: constrain AP sync and BSP restore

2025-04-05 Thread Jan Beulich
mtrr_set_all() has quite a bit of overhead, which is entirely useless when set_mtrr_state() really does nothing. Furthermore, with mtrr_state.def_type never initialized from hardware, post_set()'s unconditional writing of the MSR means would leave us running in UC mode after the sync. Signed-off-b

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

2025-04-05 Thread Andrew Cooper
Test, to try and figure out what inumbo is choking on. ~Andrew On 20/03/2025 3:59 pm, Andrew Cooper wrote: > Drop CentOS 7 entirely. It's way to old now. > > Ubuntu 22.04 is the oldest Ubuntu with a suitable version of Clang, so swap > the 16.04 clang builds for 22.04. > > Signed-off-by: Andrew

[PATCH v2 0/7] xen/console: cleanup console input switch logic

2025-04-05 Thread dmkhn
Currently, on x86, console input can be rotated in round-robin manner only between dom0, PV shim, and Xen itself. On Arm the input rotation can include domUs with vpl011. The patch series introduces the concept of "console focus", which is defined as the ID of the domain that currently owns the

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

2025-04-05 Thread Marek Marczykowski-Górecki
On Thu, Mar 20, 2025 at 10:18:28AM +, Anthony PERARD wrote: > On Wed, Mar 19, 2025 at 02:40:33PM +0100, Marek Marczykowski-Górecki wrote: > > There are clearly some build path embedding left. And > > -ffile-prefix-map=/-fdebug-prefix-map= doesn't work correctly with > > XEN_ROOT having xen/.. a

Re: [PATCH v9 2/8] iommu/arm: Introduce iommu_add_dt_pci_sideband_ids API

2025-04-05 Thread Mykyta Poturai
On 19.03.25 17:28, Jan Beulich wrote: > On 19.03.2025 16:21, Mykyta Poturai wrote: >> On 17.03.25 16:56, Jan Beulich wrote: >>> On 14.03.2025 14:34, Mykyta Poturai wrote: From: Oleksandr Tyshchenko The main purpose of this patch is to add a way to register PCI device (which is

[PATCH v2 4/6] x86/emulate: remove HAVE_AS_SSE4_2

2025-04-05 Thread dmkhn
From: Denis Mukhin The new toolchain baseline knows the crc32 instructions, no need to carry the workaround in the code. Resolves: https://gitlab.com/xen-project/xen/-/work_items/206 Signed-off-by: Denis Mukhin --- xen/arch/x86/arch.mk | 1 - xen/arch/x86/x86_emulate/x86_emul

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

2025-04-05 Thread Bjorn Helgaas
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 when routing physical interrupts over >

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

2025-04-05 Thread Jan Beulich
On 23.03.2025 15:57, Jürgen Groß wrote: > On 23.03.25 01:01, Samuel Thibault wrote: >> Juergen Gross, le ven. 21 mars 2025 10:31:44 +0100, a ecrit: >>> Add a file operations fstat hook to the 9pfs frontend. >>> >>> Signed-off-by: Juergen Gross >>> Reviewed-by: Jason Andryuk >>> --- >>> V2: >>> -

Re: [PATCH v2] x86/vmx: Use asm goto() in _vmx_cpu_up()

2025-04-05 Thread Andrew Cooper
On 02/04/2025 11:03 am, Jan Beulich wrote: > On 02.04.2025 11:56, Andrew Cooper wrote: >> --- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h >> +++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h >> @@ -559,25 +559,6 @@ static inline void __vmxoff(void) >> : : : "memory" ); >> } >> >> -static inline

Re: [PATCH] x86/msi: always propagate MSI register writes from __setup_msi_irq()

2025-04-05 Thread Jan Beulich
On 18.03.2025 09:47, Roger Pau Monne wrote: > After 8e60d47cf011 writes from __setup_msi_irq() will no longer be > propagated to the MSI registers if the IOMMU IRTE was already allocated. > Given the purpose of __setup_msi_irq() is MSI initialization, always > propagate the write to the hardware, r

Re: [PATCH v1 3/3] vpci/msi: Remove registers when init_msi() fails

2025-04-05 Thread Chen, Jiqian
On 2025/3/27 20:44, Roger Pau Monné wrote: > On Thu, Mar 27, 2025 at 03:32:14PM +0800, Jiqian Chen wrote: >> When init_msi() fails, the new codes will try to hide MSI >> capability, so it can't rely on vpci_deassign_device() to >> remove all MSI related registers anymore, those registers >> must be

[PATCH] xen/arm: Don't call process_shm_chosen() during ACPI boot

2025-04-05 Thread Michal Orzel
Static shared memory requires device-tree boot. At the moment, booting with ACPI enabled and CONFIG_STATIC_SHM=y results in a data abort when dereferencing node in process_shm() because dt_host is always NULL. Fixes: 09c0a8976acf ("xen/arm: enable statically shared memory on Dom0") Signed-off-by:

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

2025-04-05 Thread Jürgen Groß
On 02.04.25 13:36, 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 5/8] x86/domctl: Stop using XLAT_cpu_user_regs()

2025-04-05 Thread Andrew Cooper
On 17/03/2025 11:42 am, Jan Beulich wrote: > On 11.03.2025 22:10, Andrew Cooper wrote: >> --- a/xen/include/xlat.lst >> +++ b/xen/include/xlat.lst >> @@ -34,8 +34,6 @@ >> ? pmu_intel_ctxt arch-x86/pmu.h >> ? pmu_regsarch-x86/pmu.h >> >> -! cpu_user

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

2025-04-05 Thread Jason Andryuk
On 2025-04-02 05:25, Jan Beulich wrote: 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

Re: [XEN PATCH 1/1] xen/x86: drop wrappers of SVM instructions

2025-04-05 Thread Alexander Merritt
On 2025-04-02 10:56, Andrew Cooper wrote: On 02/04/2025 3:54 pm, Alexander M. Merritt wrote: I can fix both on commit if you're happy? ~Andrew Noted for future updates. Yes please go ahead. -Alex

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

2025-04-05 Thread Andrew Cooper
On 17/03/2025 11:38 am, 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_

[MINI-OS PATCH 05/12] kexec: finalize parameter location and size

2025-04-05 Thread Juergen Gross
Finalize the location and the size of the parameters for the new kernel. This is needed in order to avoid allocating new memory in the area occupied by the new kernel and parameters. Signed-off-by: Juergen Gross --- arch/x86/kexec.c | 15 +++ include/kexec.h | 3 +++ kexec.c

Re: [PATCH v8 RESEND 3/6] Arm32: use new-style entry annotations for entry code

2025-04-05 Thread Julien Grall
Hi Jan, On 13/03/2025 08:07, Jan Beulich wrote: Signed-off-by: Jan Beulich Tested-by: Luca Fancellu # arm Acked-by: Julien Grall --- Should the GLOBAL()s also be replaced? I guess the goal is to use helper from xen/linkage.h. So I would say yes. It doesn't need to be done in this serie

[MINI-OS PATCH 00/12] kexec: add kexec support to Mini-OS

2025-04-05 Thread Juergen Gross
Add basic kexec support to Mini-OS for running in x86 PVH mode. With this series applied it is possible to activate another kernel from within Mini-OS. Right now no Xen related teardown is done (so no reset of grant table, event channels, PV devices). These should be added via kexec callbacks whi

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

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

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

2025-04-05 Thread Jan Beulich
On 20.03.2025 13:51, Marek Marczykowski-Górecki wrote: > On Thu, Mar 20, 2025 at 10:18:28AM +, Anthony PERARD wrote: >> On Wed, Mar 19, 2025 at 02:40:33PM +0100, Marek Marczykowski-Górecki wrote: >>> There are clearly some build path embedding left. And >>> -ffile-prefix-map=/-fdebug-prefix-map

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

2025-04-05 Thread Alexander Merritt
On 2025-04-03 19:28, Andrew Cooper wrote: On 04/04/2025 12:22 am, Alexander M. Merritt wrote: The new toolchain baseline knows both the XSAVEOPT and CLWB instructions. I know that's what I wrote on the ticket, but what I'd forgotten was that we only use XSAVEOPT for it's operand. Really what

Re: [PATCH v2 6/6] xen/arm: Add capabilities to dom0less

2025-04-05 Thread Stefano Stabellini
On Wed, 2 Apr 2025, Jason Andryuk wrote: > On 2025-04-01 20:03, Stefano Stabellini wrote: > > On Mon, 31 Mar 2025, Jason Andryuk wrote: > > > Add capabilities property to dom0less to allow building a > > > disaggregated system. Only a single hardware domain and single xenstore > > > domain can be

Re: [PATCH 3/4] x86/traps: Move trap_init() into traps-setup.c

2025-04-05 Thread Jan Beulich
On 17.03.2025 20:20, Andrew Cooper wrote: > ... and rename to traps_init() for consistency. Move the declaration from > asm/system.h into asm/traps.h. > > This also involves moving init_ler() and variables. Move the declaration of > ler_msr from asm/msr.h to asm/traps.h. > > No functional chang

[PATCH v2 4/5] symbols: centralize and re-arrange $(all_symbols) calculation

2025-04-05 Thread Jan Beulich
For one there's no need for each architecture to have the same logic. Move to the root Makefile, also to calculate just once. And then re-arrange to permit FAST_SYMBOL_LOOKUP to be independent of LIVEPATCH, which may be useful in (at least) debugging. Signed-off-by: Jan Beulich --- Likely syms-w

Re: [QUESTION] Minimal Xen Configuration

2025-04-05 Thread Nicola Vetrini
On 2025-03-28 07:43, Kwon, Gihwan wrote: Dear Xen Community, I hope this message finds you well. I have heard that there exists a minimal Xen configuration optimized for safety-critical products, particularly in automotive applications, with the code size reduced to approximately 50k SLOC.

Re: [PATCH v3 7/7] arm/mpu: Create the skeleton for MPU compilation

2025-04-05 Thread Orzel, Michal
On 17/03/2025 21:07, Luca Fancellu wrote: > > > This commit introduces the skeleton for the MPU memory management > subsystem that allows the compilation on Arm64. > > Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel ~Michal

Re: [PATCH 2/4] x86/traps: Move percpu_traps_init() into traps-setup.c

2025-04-05 Thread Andrew Cooper
On 18/03/2025 3:04 pm, Jan Beulich wrote: > On 17.03.2025 20:20, Andrew Cooper wrote: >> Move the declaration from asm/system.h into asm/traps.h. >> >> No functional change. >> >> Signed-off-by: Andrew Cooper > Acked-by: Jan Beulich Thanks. > >> --- a/xen/arch/x86/traps-setup.c >> +++ b/xen/arc

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

2025-04-05 Thread Luca Fancellu
Hi Michal, > On 1 Apr 2025, at 10:09, Michal Orzel wrote: > > 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 no

[PATCH v3 2/3] drivers: Change find_iommu_for_device function to take pci_sbdf_t, simplify code

2025-04-05 Thread Andrii Sultanov
Following a similar change to amd_iommu struct, change the find_iommu_for_device function to take pci_sbdf_t as a single parameter. This removes conversions in the majority of cases, Bloat-o-meter reports (on top of the first patch in the series): add/remove: 0/0 grow/shrink: 11/13 up/down: 90/-15

Re: [PATCH] xen: Swap 'const static' for 'static const'

2025-04-05 Thread Nicola Vetrini
On 2025-04-03 22:43, Andrew Cooper wrote: MISRA C:2012 Ammendment 3 (which is under consideration, but not used by Xen ^ typo yet) is more particular about the order of keywords. No functional change. Signed-off-by: Andrew Cooper Any specific reason not to give [1] and [2] t

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

2025-04-05 Thread Jan Beulich
On 31.03.2025 18:17, Julien Grall wrote: > On 31/03/2025 17:14, Jan Beulich wrote: >> On 31.03.2025 17:20, Oleksii Kurochko wrote: >>> 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 UBSA

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

2025-04-05 Thread Jens Wiklander
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 system with FF-A support in part_info_get. > > WARNING: There is no filtering for now and all VMs are liste

Re: [PATCH v2] x86/vmx: Use asm goto() in _vmx_cpu_up()

2025-04-05 Thread Jan Beulich
On 02.04.2025 11:56, Andrew Cooper wrote: > --- a/xen/arch/x86/hvm/vmx/vmcs.c > +++ b/xen/arch/x86/hvm/vmx/vmcs.c > @@ -749,30 +749,15 @@ static int _vmx_cpu_up(bool bsp) > if ( bsp && (rc = vmx_cpu_up_prepare(cpu)) != 0 ) > return rc; > > -switch ( __vmxon(this_cpu(vmxon_region

Re: [PATCH 2/2] xen/dm: arm: Introduce inject_msi2 DM op

2025-04-05 Thread Mykyta Poturai
On 15.01.24 11:35, Jan Beulich wrote: > On 14.01.2024 11:01, Mykyta Poturai wrote: >> --- a/xen/include/public/hvm/dm_op.h >> +++ b/xen/include/public/hvm/dm_op.h >> @@ -444,6 +444,17 @@ struct xen_dm_op_nr_vcpus { >> }; >> typedef struct xen_dm_op_nr_vcpus xen_dm_op_nr_vcpus_t; >> >> +#defi

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

2025-04-05 Thread Juergen Gross
Add a file operations lseek hook to the 9pfs frontend. Just use the lseek_default() implementation. Signed-off-by: Juergen Gross Reviewed-by: Jason Andryuk Reviewed-by: Samuel Thibault --- 9pfront.c | 1 + 1 file changed, 1 insertion(+) diff --git a/9pfront.c b/9pfront.c index e676da35..89542

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

2025-04-05 Thread Andrew Cooper
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 > Signed-off-by: Denis Mukhin > --- > xen/arch/

Re: [PATCH v1 09/11] ci: adjust resolving network interface into PCI device

2025-04-05 Thread Stefano Stabellini
On Thu, 3 Apr 2025, Marek Marczykowski-Górecki wrote: > Change how PCI device lookup is done to handle also USB devices, in > which case get the USB controller. Instead of taking basename of the > 'device' symlink, resolve the full path (example: > /sys/devices/pci:00/:00:09.0/usb4/4-7/4-7:

Re: [PATCH v4 6/7] xen: introduce Kconfig ARCH_PAGING_MEMPOOL

2025-04-05 Thread Jan Beulich
On 01.04.2025 10:58, Luca Fancellu wrote: > From: Penny Zheng > > ARM MPU system doesn't need to use paging memory pool, as MPU memory > mapping table at most takes only one 4KB page, which is enough to > manage the maximum 255 MPU memory regions, for all EL2 stage 1 > translation and EL1 stage 2

Re: [PATCH v2 4/5] x86/shadow: fix UB pointer arithmetic in sh_mfn_is_a_page_table()

2025-04-05 Thread Roger Pau Monné
On Tue, Mar 18, 2025 at 12:53:30PM +, Andrew Cooper wrote: > On 18/03/2025 9:19 am, Roger Pau Monne wrote: > > UBSAN complains with: > > > > UBSAN: Undefined behaviour in arch/x86/mm/shadow/private.h:515:30 > > pointer operation overflowed 82e0 to 82dfffe0 > > [...] > > Xen

Re: [PATCH 2/7] x86/mkelf32: account for offset when detecting note segment placement

2025-04-05 Thread Jan Beulich
On 19.03.2025 15:16, Roger Pau Monné wrote: > On Wed, Mar 19, 2025 at 11:07:33AM +0100, Jan Beulich wrote: >> On 18.03.2025 18:35, Roger Pau Monne wrote: >>> mkelf32 attempt to check that the program header defined NOTE segment falls >>> inside of the LOAD segment, as the build-id should be loaded

Re: [PATCH 4/4] x86/traps: Introduce early_traps_init() and simplify setup

2025-04-05 Thread Jan Beulich
On 20.03.2025 18:56, Andrew Cooper wrote: > On 18/03/2025 3:26 pm, Jan Beulich wrote: >> The sole dependency is percpu_init_areas(), >> which runs - as even visible from patch context here - ahead of >> early_traps_init(). > > percpu_init_areas() isn't even a dependency.  Notice how it only starts

Re: [PATCH] xen/sched: call xfree() after local IRQ is enabled

2025-04-05 Thread Jan Beulich
On 18.03.2025 05:00, Anderson Choi wrote: > xen panic is observed with the following configuration. > > 1. Debug xen build (CONFIG_DEBUG=y) > 2. dom1 of an ARINC653 domain > 3. shutdown dom1 with xl command > > $ xl shutdown > > (XEN) > (XEN) Panic on CP

Re: [PATCH] ci: add yet another HW runner

2025-04-05 Thread Andrew Cooper
On 31/03/2025 2:16 pm, Marek Marczykowski-Górecki wrote: > On Fri, Mar 14, 2025 at 02:19:19PM -0700, Stefano Stabellini wrote: >> On Fri, 14 Mar 2025, Marek Marczykowski-Górecki wrote: >>> This is AMD Zen2 (Ryzen 5 4500U specifically), in a HP Probook 445 G7. >>> >>> This one has working S3, so add

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

2025-04-05 Thread Jan Beulich
On 27.03.2025 09:21, Roger Pau Monné wrote: > On Tue, Mar 25, 2025 at 08:18:11AM +0100, Jan Beulich wrote: >> In particular if we're running virtualized, the underlying hypervisor >> (which may be another Xen) may not surface MTRRs, and offer PAT only. > > At least for Xen, I think we offer MTRR u

[PATCH v2] x86: make Viridian support optional

2025-04-05 Thread Sergiy Kibrik
Add config option HVM_VIRIDIAN that covers viridian code within HVM. Calls to viridian functions guarded by is_viridian_domain() and related macros. Having this option may be beneficial by reducing code footprint for systems that are not using Hyper-V. Signed-off-by: Sergiy Kibrik CC: Alejandro V

[RFC PATCH v1 13/15] x86/msr: Use the alternatives mechanism to read MSR

2025-04-05 Thread Xin Li (Intel)
Also add support for the immediate form MSR read support. Suggested-by: H. Peter Anvin (Intel) Signed-off-by: Xin Li (Intel) --- arch/x86/include/asm/msr.h| 274 -- arch/x86/include/asm/paravirt.h | 40 arch/x86/include/asm/paravirt_types.h | 9

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

2025-04-05 Thread Xin Li
On 4/1/2025 12:52 AM, Ingo Molnar wrote: * 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

Re: [PATCH v9 7/8] xen/arm: enable dom0 to use PCI devices with pci-passthrough=no

2025-04-05 Thread Mykyta Poturai
On 17.03.25 17:07, Jan Beulich wrote: > On 14.03.2025 14:34, Mykyta Poturai wrote: >> --- a/xen/arch/arm/pci/pci.c >> +++ b/xen/arch/arm/pci/pci.c >> @@ -16,9 +16,18 @@ >> #include >> #include >> #include >> +#include >> #include >> #include >> >> +bool is_pci_passthrough_enabled

Re: [PATCH v3 08/15] xen/amd: export processor max frequency value

2025-04-05 Thread Jan Beulich
On 06.03.2025 09:39, Penny Zheng wrote: > --- a/xen/arch/x86/cpu/amd.c > +++ b/xen/arch/x86/cpu/amd.c > @@ -56,6 +56,8 @@ bool __initdata amd_virt_spec_ctrl; > > static bool __read_mostly fam17_c6_disabled; > > +DEFINE_PER_CPU_READ_MOSTLY(uint64_t, amd_max_freq_mhz); > + > static inline int r

[PATCH v2 2/6] xen/arm: dom0less hwdom construction

2025-04-05 Thread Jason Andryuk
When creating a hardware domain, have the dom0less code call construct_hwdom() which is shared with the dom0 code. The hardware domain requires building that best matches the dom0 build path. Re-use it to keep them in sync. The device tree node of the dom0less config is now passed into construct

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

2025-04-05 Thread Andrew Cooper
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_amd24182394 -24 but that's becaus

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

2025-04-05 Thread Jan Beulich
On 26.03.2025 06:50, Penny Zheng wrote: > Function avail_domheap_pages() is only invoked by get_outstanding_claims(), > so it could be inlined into its sole caller. > Move up avail_heap_pages() to avoid declaration before > get_outstanding_claims(). > > Signed-off-by: Penny Zheng > --- > v1 -> v2

[PATCH v1 0/3] xen/console: few cleanups in console driver

2025-04-05 Thread dmkhn
The patch series introduces a few cleanups aimed at reducing code duplication in the console driver. Originally, patches 2 and 3 were part of NS16550 emulator v3 series [1]. Patch 1 removes some code duplication for logging via conring facility. Patch 2 (see [2]) removes code duplication between

Re: [PATCH RFC] x86/vmx: Use asm goto() in _vmx_cpu_up()

2025-04-05 Thread Jan Beulich
On 02.04.2025 11:52, Andrew Cooper wrote: > On 02/04/2025 10:40 am, Jan Beulich wrote: >> On 02.04.2025 01:34, Andrew Cooper wrote: >>> With the new toolchain baseline, we can make use of asm goto() in certain >>> places, and the VMXON invocation is one example. >>> >>> This removes the logic to se

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

2025-04-05 Thread Andrew Cooper
On 20/03/2025 9:28 am, Jan Beulich wrote: > As per observation in practice, initrd->cmdline_pa is not normally zero. > Hence so far we always appended at least one byte. That alone may > already render insufficient the "allocation" made by find_memory(). > Things would be worse when there's actuall

[MINI-OS PATCH v2 2/2] 9pfs: add lseek file operation hook

2025-04-05 Thread Juergen Gross
Add a file operations lseek hook to the 9pfs frontend. Just use the lseek_default() implementation. Signed-off-by: Juergen Gross Reviewed-by: Jason Andryuk --- 9pfront.c | 1 + 1 file changed, 1 insertion(+) diff --git a/9pfront.c b/9pfront.c index 7257a07e..8bf3a91e 100644 --- a/9pfront.c +++

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

2025-04-05 Thread kernel test robot
el/git/xen/tip.git linux-next patch link: https://lore.kernel.org/r/20250404133459.16125-1-roger.pau%40citrix.com patch subject: [PATCH v2] x86/xen: fix balloon target initialization for PVH dom0 config: x86_64-buildonly-randconfig-001-20250405 (https://download.01.org/0day-ci/archiv

[RFC PATCH v1 00/15] MSR refactor with new MSR instructions support

2025-04-05 Thread Xin Li (Intel)
Obviously the existing MSR code and the pv_ops MSR access APIs need some love: https://lore.kernel.org/lkml/87y1h81ht4.ffs@tglx/ hpa has started a discussion about how to refactor it last October: https://lore.kernel.org/lkml/7a4de623-ecda-4369-a7ae-0c43ef328...@zytor.com/ The consensus so far is

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

2025-04-05 Thread Penny, Zheng
[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 Stabellini ; > xen-devel@lists.xenproject.org > Subject: R

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

2025-04-05 Thread Juergen Gross
Add a file operations fstat hook to the 9pfs frontend. Signed-off-by: Juergen Gross Reviewed-by: Jason Andryuk --- V2: - or file access mode into st_mode (Jason Andryuk) --- 9pfront.c | 29 + 1 file changed, 29 insertions(+) diff --git a/9pfront.c b/9pfront.c index

Re: [PATCH 4/4] x86/traps: Introduce early_traps_init() and simplify setup

2025-04-05 Thread Andrew Cooper
On 18/03/2025 3:26 pm, Jan Beulich wrote: > On 17.03.2025 20:20, Andrew Cooper wrote: >> Something I overlooked when last cleaning up exception handling is that a TSS >> is not necessary if IST isn't configured, and IST isn't necessary until we're >> running guest code. >> >> Introduce early_traps_

Re: [PATCH v2 1/6] x86/vmx: remove HAVE_AS_{EPT,VMX}, GAS_VMX_OP() and *_OPCODE

2025-04-05 Thread Denis Mukhin
On Thursday, April 3rd, 2025 at 12:10 PM, Andrew Cooper wrote: > > > On 03/04/2025 7:23 pm, dm...@proton.me wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > The new toolchain baseline knows the VMX instructions, > > no need to carry the workaround in the code. > > > > Move asm for v

Re: [XEN PATCH v1 3/4] x86:hvm: guard calls to nestedhvm routines

2025-04-05 Thread Jan Beulich
On 20.03.2025 11:38, Sergiy Kibrik wrote: > Check whether nested HVM is enabled for domain before calling > nestedhvm_vcpu_*() > and other not already guarded nestedhvm functions. > > Signed-off-by: Sergiy Kibrik > --- > xen/arch/x86/hvm/hvm.c | 6 -- > xen/arch/x86/hvm/svm/asid.c | 2

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

2025-04-05 Thread Jan Beulich
On 02.04.2025 11:21, Andrew Cooper wrote: > On 01/04/2025 11:09 am, Jan Beulich wrote: >> --- a/xen/common/bitmap.c >> +++ b/xen/common/bitmap.c >> @@ -359,12 +343,11 @@ static void bitmap_byte_to_long(unsigned >> >> #elif defined(__LITTLE_ENDIAN) >> >> -static void bitmap_long_to_byte(uint8_t

[PATCH v2 03/19] xen/xsm: wrap around xsm_sysctl with CONFIG_SYSCTL

2025-04-05 Thread Penny Zheng
As function xsm_sysctl() is solely invoked in sysctl.c, we need to wrap around it with CONFIG_SYSCTL Signed-off-by: Penny Zheng --- v1 -> v2 - remove unnecessary redundancy in dummy handler - re-place #ifdef into function body --- xen/include/xsm/xsm.h | 4 xen/xsm/dummy.c | 2 ++ xen

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

2025-04-05 Thread Hongbo
`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 `access()`, that will not look for anywhere in $PATH but the current d

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

2025-04-05 Thread Jan Beulich
On 06.03.2025 09:39, Penny Zheng wrote: > @@ -514,5 +515,14 @@ acpi_cpufreq_driver = { > > int __init acpi_cpufreq_register(void) > { > -return cpufreq_register_driver(&acpi_cpufreq_driver); > +int ret; > + > +ret = cpufreq_register_driver(&acpi_cpufreq_driver); > +if ( ret ) >

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

2025-04-05 Thread kernel test robot
el/git/xen/tip.git linux-next patch link: https://lore.kernel.org/r/20250404133459.16125-1-roger.pau%40citrix.com patch subject: [PATCH v2] x86/xen: fix balloon target initialization for PVH dom0 config: x86_64-buildonly-randconfig-003-20250405 (https://download.01.org/0day-ci/archiv

Re: [PATCH v9 7/8] xen/arm: enable dom0 to use PCI devices with pci-passthrough=no

2025-04-05 Thread Mykyta Poturai
On 21.03.25 15:41, Jan Beulich wrote: > On 21.03.2025 11:56, Mykyta Poturai wrote: >> On 17.03.25 17:07, Jan Beulich wrote: >>> On 14.03.2025 14:34, Mykyta Poturai wrote: --- a/xen/arch/arm/pci/pci.c +++ b/xen/arch/arm/pci/pci.c @@ -16,9 +16,18 @@ #include #include

Re: [PATCH] xen: Change xen-acpi-processor dom0 dependency

2025-04-05 Thread Jan Beulich
On 02.04.2025 16:24, Jürgen Groß wrote: > On 31.03.25 19:29, Jason Andryuk wrote: >> xen-acpi-processor functions under a PVH dom0 with only a >> xen_initial_domain() runtime check. Change the Kconfig dependency from >> PV dom0 to generic dom0 to reflect that. >> >> Suggested-by: Jan Beulich >> S

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

2025-04-05 Thread Bertrand Marquis
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, Bertrand Marquis wrote: Hi, > On 1 Apr

[PATCH v1 03/11] ci: enable XHCI console in Xen debug build on Alpine

2025-04-05 Thread Marek Marczykowski-Górecki
This build is used for hardware tests, and some runners use XHCI console Signed-off-by: Marek Marczykowski-Górecki --- automation/gitlab-ci/build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml index 2513908b059b..169bebe

Re: [PATCH v2] xen/arm/efi: merge neighboring banks

2025-04-05 Thread Stefano Stabellini
On Thu, 27 Mar 2025, Volodymyr Babchuk wrote: > Hi Stefano, > > Stefano Stabellini writes: > > > When booting from U-Boot bootefi, there can be a high number of > > neighboring RAM banks. See for example: > > > > (XEN) RAM: - 00bf > > (XEN) RAM: 00c0 - 00

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

2025-04-05 Thread Jürgen Groß
On 03.04.25 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) succeeds At thi

[PATCH v2 1/6] x86/vmx: remove HAVE_AS_{EPT,VMX}, GAS_VMX_OP() and *_OPCODE

2025-04-05 Thread dmkhn
From: Denis Mukhin The new toolchain baseline knows the VMX instructions, no need to carry the workaround in the code. Move asm for vmxoff directly on the only callsite in vmcs.c Updated formatting for all __xxx() calls to be consistent. Resolves: https://gitlab.com/xen-project/xen/-/work_item

[PATCH v4 4/7] arm/mpu: Kconfig symbols for MPU build

2025-04-05 Thread Luca Fancellu
The MPU system requires static memory to work, select that when building this memory management subsystem. While there, provide a restriction for the ARM_EFI Kconfig parameter to be built only when !MPU, the EFI stub is not used as there are no implementation of UEFI services for armv8-r. Signed-

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

2025-04-05 Thread Roger Pau Monné
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: > >> When vpci fails to initialize a capability of a device, it just > >> return error instead of catching and processing excep

Re: [PATCH] x86emul: replace _BYTES_PER_LONG

2025-04-05 Thread Andrew Cooper
On 31/03/2025 4:52 pm, 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: Andrew Cooper

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

2025-04-05 Thread Ayan Kumar Halder
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 MPU for arm32 xen/arch/arm/arm32/Makefile | 1 + xen/

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

2025-04-05 Thread Marek Marczykowski-Górecki
On Wed, Mar 19, 2025 at 01:43:59PM +0100, Jan Beulich wrote: > On 19.03.2025 12:58, Marek Marczykowski-Górecki wrote: > > On Wed, Mar 19, 2025 at 10:43:12AM +0100, Jan Beulich wrote: > >> On 19.03.2025 10:15, Jan Beulich wrote: > >>> On 18.03.2025 18:01, Marek Marczykowski-Górecki wrote: > ---

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

2025-04-05 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 --- The origin of the patch is: https://lore.kernel.org/xen-devel/20250103-vuart-ns8250

Re: [PATCH RFC for-4.19] docs/checklist: Start tagging new dev windows

2025-04-05 Thread Julien Grall
Hi, On 06/12/2024 19:47, Julien Grall wrote: Hi Andrew, Reviving this thread as we are preparing for Xen 4.20. On 16/07/2024 07:57, Jan Beulich wrote: On 15.07.2024 18:58, Julien Grall wrote: On 15/07/2024 17:46, Andrew Cooper wrote: Signed-off-by: Andrew Cooper With one remark below: R

[ANNOUNCE] Call for agenda items for April 3, 2025 Community Call @ 15:00 UTC

2025-04-05 Thread Cody Zuschlag
Hi everyone, We’re getting ready for April’s Xen Project Community Call on *Thursday, 3 April 2025* at *15:00 UTC* (4 pm UK time). We’d love for you to join. Feel free to just observe or jump in! This call is a great opportunity to see what the community is working on, align our various efforts, a

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

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

Re: [PATCH 13/23] xsm/dummy: Allow XS_PRIV XEN_SYSCTL_getdomaininfolist

2025-04-05 Thread Jason Andryuk
On 2025-03-17 10:13, Jan Beulich wrote: On 06.03.2025 23:03, Jason Andryuk wrote: To hyperlaunch xenstore, we want it to automatically introduce all domains it finds while initializing. To do that, change xsm_sysctl to allow XS_PRIV to call XEN_SYSCTL_getdomaininfolist. Xenstore can already ca

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

2025-04-05 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 v2: - dropped full stops in the updated log messages --- xen/arch/x86/d

Re: [PATCH] xen/arm/efi: merge neighboring banks

2025-04-05 Thread Stefano Stabellini
On Fri, 21 Mar 2025, Julien Grall wrote: > Hi Stefano, > > On 21/03/2025 21:14, Stefano Stabellini wrote: > > When booting from U-Boot bootefi, there can be a high number of > > neighboring RAM banks. See for example: > > > > (XEN) RAM: - 00bf > > (XEN) RAM: 0

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

2025-04-05 Thread Jason Andryuk
On 2025-03-20 03:49, Juergen Gross wrote: Add a file operations lseek hook to the 9pfs frontend. Just use the lseek_default() implementation. Signed-off-by: Juergen Gross lseek_default adjusts file->offset, and read_9pfs()/write_9pfs() are already using that. Reviewed-by: Jason Andryuk R

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

2025-04-05 Thread Andrew Cooper
On 01/04/2025 11:09 am, Jan Beulich wrote: > --- a/xen/common/bitmap.c > +++ b/xen/common/bitmap.c > @@ -359,12 +343,11 @@ static void bitmap_byte_to_long(unsigned > > #elif defined(__LITTLE_ENDIAN) > > -static void bitmap_long_to_byte(uint8_t *bp, const unsigned long *lp, > -

  1   2   >