Re: [PATCH v3 2/7] arm/mpu: Provide access to the MPU region from the C code

2025-04-14 Thread Julien Grall
Hi Luca, On 15/04/2025 00:07, Luca Fancellu wrote: HI Julien, On 14 Apr 2025, at 12:41, Julien Grall wrote: Hi Luca, On 11/04/2025 23:56, Luca Fancellu wrote: Implement some utility function in order to access the MPU regions from the C world. Signed-off-by: Luca Fancellu --- v3 changes:

Re: [PATCH v7 2/3] xen/arm32: Create the same boot-time MPU regions as arm64

2025-04-14 Thread Orzel, Michal
On 14/04/2025 18:45, Ayan Kumar Halder wrote: > Create Boot-time MPU protection regions (similar to Armv8-R AArch64) for > Armv8-R AArch32. > Also, defined *_PRBAR macros for arm32. The only difference from arm64 is that > XN is 1-bit for arm32. > Define the system registers and macros in mpu/cp

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

2025-04-14 Thread Jan Beulich
On 14.04.2025 18:45, Ayan Kumar Halder wrote: > Enable early booting of Armv8-R AArch32 based systems. > > Added Luca's R-b in all the patches. > Added Michal's R-b in patch 1 and 3. > > Ayan Kumar Halder (3): > xen/arm: Move some of the functions to common file > xen/arm32: Create the same b

Re: linux-6.15-rc2/drivers/xen/balloon.c:346: Possible int/long mixup

2025-04-14 Thread Jürgen Groß
On 14.04.25 19:57, David Binderman wrote: Hello there, Static analyser cppcheck says: linux-6.15-rc2/drivers/xen/balloon.c:346:24: style: int result is assigned to long variable. If the variable is long to avoid loss of information, then you have loss of information. [truncLongCastAssignment]

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

2025-04-14 Thread H. Peter Anvin
On April 14, 2025 10:48:47 AM PDT, Xin Li wrote: >On 4/12/2025 4:10 PM, H. Peter Anvin wrote: >> Also,*in this specific case* IA32_SPEC_CTRL is architecturally >> nonserializing, i.e. WRMSR executes as WRMSRNS anyway. > >While the immediate form WRMSRNS could be faster because the MSR index >is a

Re: [PATCH v3 12/16] x86/hyperlaunch: add domain id parsing to domain config

2025-04-14 Thread Stefano Stabellini
On Mon, 14 Apr 2025, Alejandro Vallejo wrote: > Though I'm starting to get urges to rewrite many of this error handlers > as asserts, on the basis that "why do we think it's ok to boot with > malformed DTBs"? A safe system that doesn't boot is more helpful than an > unsafe one that boots everything

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

2025-04-14 Thread Orzel, Michal
On 11/04/2025 13:04, Ayan Kumar Halder wrote: > Add stubs to enable compilation. > > is_xen_heap_page() and is_xen_heap_mfn() are not implemented for arm32 MPU. > Thus, introduce the stubs for these functions in asm/mpu/mm.h and move the > original code to asm/mmu/mm.h (as it is used for arm32

Re: [PATCH v3 6/6] CI: Include microcode for x86 hardware jobs

2025-04-14 Thread Andrew Cooper
On 14/04/2025 6:45 pm, Anthony PERARD wrote: > On Mon, Apr 14, 2025 at 12:09:03PM +0100, Andrew Cooper wrote: >> diff --git a/automation/gitlab-ci/build.yaml >> b/automation/gitlab-ci/build.yaml >> index 1b82b359d01f..ac5367874526 100644 >> --- a/automation/gitlab-ci/build.yaml >> +++ b/automation

[PATCH v2 7/8] xen/common: dom0less: introduce common domain-build.c

2025-04-14 Thread Oleksii Kurochko
Some functions of Arm's domain_build.c could be reused by dom0less or other features connected to domain construction/build. The following functions are moved to common: - get_allocation_size(). - allocate_domheap_memory(). - guest_map_pages(). - allocate_bank_memory(). - add_hwdom_free_regions().

[PATCH v2 0/8] Move parts of Arm's Dom0less to common code

2025-04-14 Thread Oleksii Kurochko
Some parts of Arm's Dom0less solution could be moved to common code as they are not truly Arm-specific. Most of the code is moved as is, with only minor changes introduced to provide abstractions that hide Arm-specific details, while maintaining functional equivalence with original Arm's code. Th

Re: [PATCH v3 11/16] x86/hyperlaunch: locate dom0 initrd with hyperlaunch

2025-04-14 Thread Alejandro Vallejo
On Mon Apr 14, 2025 at 6:06 PM BST, Alejandro Vallejo wrote: > On Thu Apr 10, 2025 at 12:34 PM BST, Jan Beulich wrote: >> On 08.04.2025 18:07, Alejandro Vallejo wrote: >> >>> +printk(" ramdisk: boot module %d\n", idx); >>> +bi->mods[idx].type = BOOTMOD_RAMDISK; >>> +

Re: [PATCH v3 09/16] x86/hyperlaunch: locate dom0 kernel with hyperlaunch

2025-04-14 Thread Alejandro Vallejo
On Wed Apr 9, 2025 at 10:24 PM BST, Denis Mukhin wrote: > On Tuesday, April 8th, 2025 at 9:07 AM, Alejandro Vallejo > wrote: > >> >> >> From: "Daniel P. Smith" dpsm...@apertussolutions.com >> >> >> Look for a subnode of type `multiboot,kernel` within a domain node. If >> found, locate it usin

Re: [PATCH v3 5/6] CI: save toolstack artifact as cpio.gz

2025-04-14 Thread Anthony PERARD
On Mon, Apr 14, 2025 at 12:09:02PM +0100, Andrew Cooper wrote: > From: Marek Marczykowski-Górecki > > This avoids the need to re-compress it in every test job. This saves minutes > of wallclock time. > > Signed-off-by: Marek Marczykowski-Górecki > Reviewed-by: Andrew Cooper Reviewed-by: Anth

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

2025-04-14 Thread Xin Li
On 4/12/2025 4:10 PM, H. Peter Anvin wrote: Also,*in this specific case* IA32_SPEC_CTRL is architecturally nonserializing, i.e. WRMSR executes as WRMSRNS anyway. While the immediate form WRMSRNS could be faster because the MSR index is available *much* earlier in the pipeline, right?

Re: [PATCH v3 14/16] x86/hyperlaunch: add memory parsing to domain config

2025-04-14 Thread Alejandro Vallejo
On Wed Apr 9, 2025 at 11:29 PM BST, Denis Mukhin wrote: > On Tuesday, April 8th, 2025 at 9:07 AM, Alejandro Vallejo > wrote: > >> >> >> From: "Daniel P. Smith" dpsm...@apertussolutions.com >> >> >> Add three properties, memory, mem-min, and mem-max, to the domain node device >> tree parsing t

Re: [PATCH v3 14/16] x86/hyperlaunch: add memory parsing to domain config

2025-04-14 Thread Alejandro Vallejo
On Thu Apr 10, 2025 at 1:03 PM BST, Jan Beulich wrote: > On 08.04.2025 18:07, Alejandro Vallejo wrote: >> @@ -212,6 +213,39 @@ static int __init process_domain_node( >> else >> printk("PV\n"); >> } >> +else if ( strncmp(prop_name, "memory", name_len) =

Re: [PATCH v3 15/16] x86/hyperlaunch: add max vcpu parsing of hyperlaunch device tree

2025-04-14 Thread Alejandro Vallejo
On Wed Apr 9, 2025 at 11:33 PM BST, Denis Mukhin wrote: > On Tuesday, April 8th, 2025 at 9:07 AM, Alejandro Vallejo > wrote: > >> >> >> From: "Daniel P. Smith" dpsm...@apertussolutions.com >> >> >> Introduce the `cpus` property, named as such for dom0less compatibility, that >> represents the

Re: [PATCH v3 08/16] x86/hyperlaunch: Add helpers to locate multiboot modules

2025-04-14 Thread Nicola Vetrini
On 2025-04-14 17:05, Jan Beulich wrote: On 14.04.2025 15:37, Alejandro Vallejo wrote: On Thu Apr 10, 2025 at 11:42 AM BST, Jan Beulich wrote: On 08.04.2025 18:07, Alejandro Vallejo wrote: +/* + * Locate a multiboot module given its node offset in the FDT. + * + * The module location may be giv

[PATCH v4 3/3] drivers: Make ioapic_sbdf and hpet_sbdf contain pci_sbdf_t

2025-04-14 Thread Andrii Sultanov
From: Andrii Sultanov Following a similar change to amd_iommu struct, make two more structs take pci_sbdf_t directly instead of seg and bdf separately. This lets us drop several conversions from the latter to the former and simplifies several comparisons and assignments. Bloat-o-meter reports: a

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

2025-04-14 Thread Francesco Lavra
On 2025-03-31 at 8:22, Xin Li (Intel) wrote: > diff --git a/arch/x86/xen/xen-asm.S b/arch/x86/xen/xen-asm.S > index e672632b1cc0..6e7a9daa03d4 100644 > --- a/arch/x86/xen/xen-asm.S > +++ b/arch/x86/xen/xen-asm.S > @@ -399,3 +399,37 @@ SYM_CODE_END(xen_entry_SYSCALL_compat) > RET > SYM_FUNC_E

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

2025-04-14 Thread Andrii Sultanov
From: 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/shrin

[ImageBuilder] uboot-script-gen: fix arm64 xen u-boot image generation

2025-04-14 Thread Grygorii Strashko
From: Grygorii Strashko The current code in generate_uboot_images() does not detect arm64 properly and always generates ARM u-boot image. This causes Xen boot issues. Fix it by searching for "ARM64" for AArch64 binary detection. - mkimage -l xen.ub Before: Image Type: ARM Linux Kernel Image (

[ImageBuilder] uboot-script-gen: add xen xsm policy loading support

2025-04-14 Thread Grygorii Strashko
From: Grygorii Strashko This patch adds Xen XSM policy loading support. The configuration file XEN_POLICY specifies Xen hypervisor XSM policy binary to load. Signed-off-by: Grygorii Strashko --- README.md| 2 ++ scripts/uboot-script-gen | 33 +

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

2025-04-14 Thread Orzel, Michal
On 11/04/2025 13:04, Ayan Kumar Halder wrote: > regions.inc is added to hold the common earlyboot MPU regions configuration NIT: I mentioned this a few times already. Please use imperative mood in commit msg. > between arm64 and arm32. > > prepare_xen_region, fail_insufficient_regions() will

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

2025-04-14 Thread Penny Zheng
Users need to set "cpufreq=amd-cppc" in xen cmdline to enable amd-cppc driver, which selects ACPI Collaborative Performance and Power Control (CPPC) on supported AMD hardware to provide a finer grained frequency control mechanism. `verbose` option can also be included to support verbose print. Whe

[PATCH v4 02/15] xen/cpufreq: extract _PSD info from "struct xen_processor_performance"

2025-04-14 Thread Penny Zheng
Since we need to re-use _PSD info, containing "shared_type" and "struct xen_psd_package", for CPPC mode, we move all "#define XEN_CPUPERF_SHARED_TYPE_xxx" up as common values, and introduce a new helper check_psd_pminfo() to wrap _PSD info check. In cpufreq_add/del_cpu(), a new helper get_psd_info

[PATCH v4 03/15] xen/x86: introduce new sub-hypercall to propagate CPPC data

2025-04-14 Thread Penny Zheng
In order to provide backward compatibility with existing governors that represent performance as frequency, like ondemand, the _CPC table can optionally provide processor frequency range values, Lowest frequency and Norminal frequency, to let OS use Lowest Frequency/ Performance and Nominal Frequen

[PATCH v4 08/15] xen/amd: introduce amd_process_freq() to get processor frequency

2025-04-14 Thread Penny Zheng
When _CPC table could not provide processor frequency range values for Xen governor, we need to read processor max frequency as anchor point. So we extract amd cpu core frequency calculation logic from amd_log_freq(), and wrap it as a new helper amd_process_freq(). Signed-off-by: Penny Zheng ---

[PATCH v4 00/15] amd-cppc CPU Performance Scaling Driver

2025-04-14 Thread Penny Zheng
amd-cppc is the AMD CPU performance scaling driver that introduces a new CPU frequency control mechanism on modern AMD APU and CPU series in Xen. The new mechanism is based on Collaborative Processor Performance Control (CPPC) which provides finer grain frequency management than legacy ACPI hardwar

[PATCH v4 07/15] xen/cpufreq: fix core frequency calculation for AMD Family 1Ah CPUs

2025-04-14 Thread Penny Zheng
AMD Family 1Ah CPU needs a different COF(Core Operating Frequency) formula, due to a change in the PStateDef MSR layout in AMD Family 1Ah. In AMD Family 1Ah, Core current operating frequency in MHz is calculated as follows: CoreCOF = Core::X86::Msr::PStateDef[CpuFid[11:0]] * 5MHz We introduce

[PATCH v4 06/15] xen/cpufreq: disable px statistic info in amd-cppc mode

2025-04-14 Thread Penny Zheng
We need to bypass construction of px statistic info in cpufreq_statistic_init() for amd-cppc mode, as P-states is not necessary there. Signed-off-by: Penny Zheng --- v3 -> v4: - remove unnecessary stub for cpufreq_statistic_exit() --- xen/drivers/cpufreq/utility.c | 3 +++ 1 file changed, 3 inse

[PATCH v4 15/15] xen/xenpm: Adapt SET/GET_CPUFREQ_CPPC xen_sysctl_pm_op for amd-cppc driver

2025-04-14 Thread Penny Zheng
Introduce helper set_amd_cppc_para and get_amd_cppc_para to SET/GET CPPC-related para for amd-cppc/amd-cppc-epp driver. Signed-off-by: Penny Zheng --- v1 -> v2: - Give the variable des_perf an initializer of 0 - Use the strncmp()s directly in the if() --- v3 -> v4 - refactor comments - remove dou

[PATCH v4 12/15] tools/xenpm: Print CPPC parameters for amd-cppc driver

2025-04-14 Thread Penny Zheng
HWP, amd-cppc, amd-cppc-epp are all the implementation of ACPI CPPC (Collaborative Processor Performace Control), so we introduce cppc_mode flag to print CPPC-related para. And HWP and amd-cppc-epp are both governor-less driver, so we introduce hw_auto flag to bypass governor-related print. Valid

[PATCH v4 13/15] tools/xenpm: fix unnecessary scaling_available_frequencies in CPPC mode

2025-04-14 Thread Penny Zheng
In `xenpm get-cpufreq-para `, para scaling_available_frequencies only has meaningful value when cpufreq driver in legacy P-states mode. So we drop the "has_num" condition check, and mirror the ->gov_num check for both ->freq_num and ->cpu_num in xc_get_cpufreq_para(). In get_cpufreq_para(), add "f

[PATCH v4 14/15] tools/xenpm: remove px_cap dependency check for average frequency

2025-04-14 Thread Penny Zheng
In `xenpm start` command, the monitor of average frequency shall not depend on the existence of legacy P-states, so removing "px_cap" dependancy check. Signed-off-by: Penny Zheng --- v3 -> v4: - new commit --- tools/misc/xenpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

Re: [PATCH 2/5] xen/io: provide helpers for multi size MMIO accesses

2025-04-14 Thread Jan Beulich
On 14.04.2025 09:49, Julien Grall wrote: > On 14/04/2025 15:07, Jan Beulich wrote: >> On 11.04.2025 12:54, Roger Pau Monne wrote: >>> Several handlers have the same necessity of reading from an MMIO region >>> using 1, 2, 4 or 8 bytes accesses.  So far this has been open-coded in the >>> function i

Re: [PATCH] CI: fix waiting for final test message (again)

2025-04-14 Thread Andrew Cooper
On 13/04/2025 2:47 pm, Marek Marczykowski-Górecki wrote: > The previous attempt has correct diagnosis, but added -notransfer flag > in a wrong place - it should be used in the first (outer) match out of > two, not the second (inner) one. > > Fixes: 1e12cbd6af2c ("CI: fix waiting for final test mess

Re: [PATCH v3 11/16] x86/hyperlaunch: locate dom0 initrd with hyperlaunch

2025-04-14 Thread Alejandro Vallejo
On Wed Apr 9, 2025 at 11:07 PM BST, Denis Mukhin wrote: > On Tuesday, April 8th, 2025 at 9:07 AM, Alejandro Vallejo > wrote: > >> >> >> From: "Daniel P. Smith" dpsm...@apertussolutions.com >> >> >> Look for a subnode of type `multiboot,ramdisk` within a domain node and >> parse via the fdt_re

Re: [PATCH v1 02/14] xen/riscv: introduce smp_clear_cpu_maps()

2025-04-14 Thread Jan Beulich
On 14.04.2025 17:05, Oleksii Kurochko wrote: > On 4/10/25 3:10 PM, Jan Beulich wrote: >> On 08.04.2025 17:57, Oleksii Kurochko wrote: >>> +void __init smp_clear_cpu_maps(void) >>> +{ >>> +cpumask_clear(&cpu_possible_map); >>> +cpumask_clear(&cpu_online_map); >> What's the point of these? Al

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

2025-04-14 Thread Ayan Kumar Halder
Enable early booting of Armv8-R AArch32 based systems. Added Luca's R-b in all the patches. Added Michal's R-b in patch 1 and 3. 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 v7 2/3] xen/arm32: Create the same boot-time MPU regions as arm64

2025-04-14 Thread Ayan Kumar Halder
Create Boot-time MPU protection regions (similar to Armv8-R AArch64) for Armv8-R AArch32. Also, defined *_PRBAR macros for arm32. The only difference from arm64 is that XN is 1-bit for arm32. Define the system registers and macros in mpu/cpregs.h. Introduce WRITE_SYSREG_ASM() to write to system re

Re: [PATCH v3 13/16] x86/hyperlaunch: specify dom0 mode with device tree

2025-04-14 Thread Alejandro Vallejo
On Wed Apr 9, 2025 at 11:24 PM BST, Denis Mukhin wrote: > On Tuesday, April 8th, 2025 at 9:07 AM, Alejandro Vallejo > wrote: > >> >> >> From: "Daniel P. Smith" dpsm...@apertussolutions.com >> >> >> Enable selecting the mode in which the domain will be built and ran. This >> includes: >> >> -

Re: [PATCH v3 15/16] x86/hyperlaunch: add max vcpu parsing of hyperlaunch device tree

2025-04-14 Thread Alejandro Vallejo
On Thu Apr 10, 2025 at 1:08 PM BST, Jan Beulich wrote: > On 08.04.2025 18:07, Alejandro Vallejo wrote: >> From: "Daniel P. Smith" >> >> Introduce the `cpus` property, named as such for dom0less compatibility, that >> represents the maximum number of vpcus to allocate for a domain. In the >> devi

[PATCH AUTOSEL 6.14 07/34] xen: Change xen-acpi-processor dom0 dependency

2025-04-14 Thread Sasha Levin
From: Jason Andryuk [ Upstream commit 0f2946bb172632e122d4033e0b03f85230a29510 ] 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 Signed-off-by: J

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

2025-04-14 Thread Oleksii Kurochko
On 4/10/25 10:48 AM, Jan Beulich wrote: On 09.04.2025 21:01, Oleksii Kurochko wrote: --- a/xen/arch/riscv/include/asm/mm.h +++ b/xen/arch/riscv/include/asm/mm.h @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -35,6 +36,11 @@ static inline void *madd

Re: [PATCH 3/5] x86/hvm: fix handling of accesses to partial r/o MMIO pages

2025-04-14 Thread Roger Pau Monné
On Mon, Apr 14, 2025 at 08:33:44AM +0200, Jan Beulich wrote: > On 11.04.2025 12:54, Roger Pau Monne wrote: > > The current logic to handle accesses to MMIO pages partially read-only is > > based on the (now removed) logic used to handle accesses to the r/o MMCFG > > region(s) for PVH v1 dom0. Howe

[PATCH 07/11] drm/xen: Test for imported buffers with drm_gem_is_imported()

2025-04-14 Thread Thomas Zimmermann
Instead of testing import_attach for imported GEM buffers, invoke drm_gem_is_imported() to do the test. The helper tests the dma_buf itself while import_attach is just an artifact of the import. Prepares to make import_attach optional. Signed-off-by: Thomas Zimmermann Cc: Oleksandr Andrushchenko

Re: [PATCH v2 0/5] Fix lazy mmu mode

2025-04-14 Thread Alexander Gordeev
On Mon, Apr 14, 2025 at 02:22:53PM +0100, Ryan Roberts wrote: > On 10/04/2025 17:07, Alexander Gordeev wrote: > >> I'm planning to implement lazy mmu mode for arm64 to optimize vmalloc. As > >> part > >> of that, I will extend lazy mmu mode to cover kernel mappings in vmalloc > >> table > >> walk

[PATCH AUTOSEL 6.6 06/24] xen: Change xen-acpi-processor dom0 dependency

2025-04-14 Thread Sasha Levin
From: Jason Andryuk [ Upstream commit 0f2946bb172632e122d4033e0b03f85230a29510 ] 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 Signed-off-by: J

Re: [PATCH v3 09/16] x86/hyperlaunch: locate dom0 kernel with hyperlaunch

2025-04-14 Thread Alejandro Vallejo
On Thu Apr 10, 2025 at 11:58 AM BST, Jan Beulich wrote: > On 08.04.2025 18:07, Alejandro Vallejo wrote: >> From: "Daniel P. Smith" >> >> Look for a subnode of type `multiboot,kernel` within a domain node. If >> found, locate it using the multiboot module helper to generically ensure >> it lives i

Re: [PATCH v3 2/7] arm/mpu: Provide access to the MPU region from the C code

2025-04-14 Thread Luca Fancellu
HI Julien, > On 14 Apr 2025, at 12:41, Julien Grall wrote: > > Hi Luca, > > On 11/04/2025 23:56, Luca Fancellu wrote: >> Implement some utility function in order to access the MPU regions >> from the C world. >> Signed-off-by: Luca Fancellu >> --- >> v3 changes: >> - Moved PRBAR0_EL2/PRLAR0_E

Re: [PATCH v1 01/14] xen/riscv: implement get_s_time()

2025-04-14 Thread Oleksii Kurochko
On 4/10/25 2:52 PM, Jan Beulich wrote: On 08.04.2025 17:57, Oleksii Kurochko wrote: @@ -23,6 +24,11 @@ static inline cycles_t get_cycles(void) return csr_read(CSR_TIME); } +static inline s_time_t ticks_to_ns(uint64_t ticks) +{ +return muldiv64(ticks, SECONDS(1), 1000 * cpu_khz);

Re: [PATCH 3/5] x86/hvm: fix handling of accesses to partial r/o MMIO pages

2025-04-14 Thread Jan Beulich
On 14.04.2025 15:53, Roger Pau Monné wrote: > On Mon, Apr 14, 2025 at 08:33:44AM +0200, Jan Beulich wrote: >> On 11.04.2025 12:54, Roger Pau Monne wrote: >>> --- >>> xen/arch/x86/hvm/emulate.c | 47 +- >>> xen/arch/x86/hvm/hvm.c | 89 +++-

[PATCH v2 2/8] xen/common: dom0less: make some parts of Arm's CONFIG_DOM0LESS common

2025-04-14 Thread Oleksii Kurochko
Move some parts of Arm's Dom0Less code to be reused by other architectures. At the moment, RISC-V is going to reuse these parts. Move dom0less-build.h from the Arm-specific directory to asm-generic as these header is expected to be the same across acrhictectures with some updates: add the followin

[PATCH v2 6/8] xen/common: dom0less: introduce common kernel.c

2025-04-14 Thread Oleksii Kurochko
The following functions don't have arch specific things so it is moved to common: - kernel_prboe() - kernel_load() - output_length() Functions necessary for dom0less are only moved. The following changes are done: - Swap __init and return type of kernel_decompress() function to be consistent wi

[PATCH v2 1/8] xen/arm: drop declaration of handle_device_interrupts()

2025-04-14 Thread Oleksii Kurochko
There is no any users of handle_device_interrupts() thereby it could be dropped. Signed-off-by: Oleksii Kurochko --- Changes in V2: - New patch. --- xen/arch/arm/include/asm/domain_build.h | 11 --- 1 file changed, 11 deletions(-) diff --git a/xen/arch/arm/include/asm/domain_build.h b/

Re: [PATCH v3 1/6] CI: Rename intermediate artefacts in qemu-* scripts

2025-04-14 Thread Anthony PERARD
On Mon, Apr 14, 2025 at 12:08:58PM +0100, Andrew Cooper wrote: > Right now, we have initrd.cpio.gz as domU, and initrd.tar.gz as the base for > dom0. > > Rename initrd.cpio.gz to domU-rootfs.cpio.gz, and xen-rootfs.cpio.gz to > dom0-rootfs.cpio.gz to make it clearer which is which. Rename the VM

Re: [PATCH v3 12/16] x86/hyperlaunch: add domain id parsing to domain config

2025-04-14 Thread Alejandro Vallejo
On Thu Apr 10, 2025 at 12:49 PM BST, Jan Beulich wrote: > On 08.04.2025 18:07, Alejandro Vallejo wrote: >> From: "Daniel P. Smith" >> >> Introduce the ability to specify the desired domain id for the domain >> definition. The domain id will be populated in the domid property of the >> domain >> n

Re: [PATCH v3 3/6] CI: remove now unused alpine-3.18-arm64-rootfs job and its container

2025-04-14 Thread Anthony PERARD
On Mon, Apr 14, 2025 at 12:09:00PM +0100, Andrew Cooper wrote: > From: Marek Marczykowski-Górecki > > This got moved to test-artifacts. > > Signed-off-by: Marek Marczykowski-Górecki > Reviewed-by: Andrew Cooper Acked-by: Anthony PERARD Thanks, -- Anthony PERARD

Re: [PATCH v3 11/16] x86/hyperlaunch: locate dom0 initrd with hyperlaunch

2025-04-14 Thread Alejandro Vallejo
On Thu Apr 10, 2025 at 12:34 PM BST, Jan Beulich wrote: > On 08.04.2025 18:07, Alejandro Vallejo wrote: >> --- a/xen/arch/x86/domain-builder/fdt.c >> +++ b/xen/arch/x86/domain-builder/fdt.c >> @@ -195,6 +195,35 @@ static int __init process_domain_node( >> !((char *)__va(bd->kernel

Re: [PATCH v3 4/6] CI: Switch to new argo artefact

2025-04-14 Thread Andrew Cooper
On 14/04/2025 6:24 pm, Anthony PERARD wrote: > On Mon, Apr 14, 2025 at 12:09:01PM +0100, Andrew Cooper wrote: >> diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml >> index 51229cbe561d..d46da1c43d05 100644 >> --- a/automation/gitlab-ci/test.yaml >> +++ b/automation/gitlab

[PATCH v2 5/8] asm-generic: move some parts of Arm's domain_build.h to common

2025-04-14 Thread Oleksii Kurochko
Nothing changed. Only some functions declaration are moved to xen/include/ headers as they are expected to be used by common code of domain builing or dom0less. Signed-off-by: Oleksii Kurochko --- Chnages in v2: - Add missed declaration of construct_hwdom(). - Drop unnessary blank line. -

[PATCH v2 3/8] asm-generic: move parts of Arm's asm/kernel.h to common code

2025-04-14 Thread Oleksii Kurochko
Move the following parts to common with the following changes: - struct kernel_info: - Create arch_kernel_info for arch specific kernel information. At the moment, it contains domain_type for Arm. - Rename vpl011 to vuart to have more generic name suitable for other archs. - s/phandle_gic

[PATCH v4] xen/riscv: Increase XEN_VIRT_SIZE

2025-04-14 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 3/5] x86/hvm: fix handling of accesses to partial r/o MMIO pages

2025-04-14 Thread Roger Pau Monné
On Mon, Apr 14, 2025 at 05:24:32PM +0200, Jan Beulich wrote: > On 14.04.2025 15:53, Roger Pau Monné wrote: > > On Mon, Apr 14, 2025 at 08:33:44AM +0200, Jan Beulich wrote: > >> On 11.04.2025 12:54, Roger Pau Monne wrote: > >>> @@ -1981,7 +2056,9 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigne

Re: [PATCH v1 02/14] xen/riscv: introduce smp_clear_cpu_maps()

2025-04-14 Thread Oleksii Kurochko
On 4/10/25 3:10 PM, Jan Beulich wrote: On 08.04.2025 17:57, Oleksii Kurochko wrote: Initialize cpu_{possible, online, present}_map by using smp_clear_cpu_maps(). Drop DEFINE_PER_CPU(unsigned int, cpu_id) from stubs.c as this variable isn't expected to be used in RISC-V at all. Move declaratio

[PATCH v2 8/8] xen/common: dom0less: introduce common dom0less-build.c

2025-04-14 Thread Oleksii Kurochko
Part of Arm's dom0less-build.c could be common between architectures which are using device tree files to create guest domains. Thereby move some parts of Arm's dom0less-build.c to common code with minor changes. As a part of theses changes the following changes are introduced: - Introduce make_ar

[PATCH v2 4/8] arm/static-shmem.h: drop inclusion of asm/setup.h

2025-04-14 Thread Oleksii Kurochko
Nothing is dependent from asm/setup.h in asm/static-shmem.h so inclusion of asm/setup.h is droped. After this drop the following compilation error related to impicit declaration of the following functions device_tree_get_reg and map_device_irqs_to_domain, device_tree_get_u32 occur during compilati

[PATCH v3 2/6] CI: avoid repacking initrd as part of the test job

2025-04-14 Thread Andrew Cooper
From: Marek Marczykowski-Górecki Use the new test-artifacts which provide rootfs.cpio.gz rather than initrd.tar.gz. rootfs.cpio.gz also has all the necessary top-level directories, and includes the rc_verbose setting, so these modifications can be dropped. Having that, do not repack the whole i

Re: [PATCH v3 4/6] CI: Switch to new argo artefact

2025-04-14 Thread Anthony PERARD
On Mon, Apr 14, 2025 at 12:09:01PM +0100, Andrew Cooper wrote: > diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml > index 51229cbe561d..d46da1c43d05 100644 > --- a/automation/gitlab-ci/test.yaml > +++ b/automation/gitlab-ci/test.yaml > @@ -242,7 +242,7 @@ xilinx-smoke-do

Re: [PATCH v3 08/16] x86/hyperlaunch: Add helpers to locate multiboot modules

2025-04-14 Thread Jan Beulich
On 14.04.2025 15:37, Alejandro Vallejo wrote: > On Thu Apr 10, 2025 at 11:42 AM BST, Jan Beulich wrote: >> On 08.04.2025 18:07, Alejandro Vallejo wrote: >>> +/* >>> + * Locate a multiboot module given its node offset in the FDT. >>> + * >>> + * The module location may be given via either FDT proper

Re: [PATCH v3 7/7] arm/mpu: Implement setup_mpu for MPU system

2025-04-14 Thread Luca Fancellu
HI Julien, > On 14 Apr 2025, at 13:12, Julien Grall wrote: > > Hi Luca, > > On 11/04/2025 23:56, Luca Fancellu wrote: >> Implement the function setup_mpu that will logically track the MPU >> regions defined by hardware registers, start introducing data >> structures and functions to track the s

Re: [PATCH v3 10/16] x86/hyperlaunch: obtain cmdline from device tree

2025-04-14 Thread Jan Beulich
On 14.04.2025 16:23, Alejandro Vallejo wrote: > On Thu Apr 10, 2025 at 12:12 PM BST, Jan Beulich wrote: >> On 08.04.2025 18:07, Alejandro Vallejo wrote: >>> --- a/xen/arch/x86/domain-builder/fdt.c >>> +++ b/xen/arch/x86/domain-builder/fdt.c >>> @@ -189,6 +189,12 @@ static int __init process_domain_

Re: [PATCH v3 1/7] arm/mpu: Introduce MPU memory region map structure

2025-04-14 Thread Luca Fancellu
Hi Michal, > On 14 Apr 2025, at 11:17, Orzel, Michal wrote: > > > > On 11/04/2025 16:56, Luca Fancellu wrote: >> From: Penny Zheng >> >> Introduce pr_t typedef which is a structure having the prbar >> and prlar members, each being structured as the registers of >> the aarch64 armv8-r archite

Re: [PATCH v3 1/7] arm/mpu: Introduce MPU memory region map structure

2025-04-14 Thread Luca Fancellu
Hi Michal, > On 14 Apr 2025, at 16:01, Orzel, Michal wrote: > > > > On 14/04/2025 16:50, Luca Fancellu wrote: >> Hi Michal, >> >>> On 14 Apr 2025, at 11:17, Orzel, Michal wrote: >>> >>> >>> >>> On 11/04/2025 16:56, Luca Fancellu wrote: From: Penny Zheng Introduce pr_t typ

[PATCH v2.1 4/7] Shrink the rootfs substantially

2025-04-14 Thread Andrew Cooper
bash, busybox, musl and zlib are all in the base container. python3 and ncurses are in principle used by bits of Xen, but not in anything we test in CI. argp-standlone, curl, dbus, libfdt, libgcc and sudo aren't used at all (for x86 at least). libbz2 and libuuid were pulled in transitively befor

Re: [PATCH v3 6/6] CI: Include microcode for x86 hardware jobs

2025-04-14 Thread Marek Marczykowski-Górecki
On Mon, Apr 14, 2025 at 06:47:07PM +0100, Andrew Cooper wrote: > On 14/04/2025 6:45 pm, Anthony PERARD wrote: > > On Mon, Apr 14, 2025 at 12:09:03PM +0100, Andrew Cooper wrote: > >> diff --git a/automation/gitlab-ci/build.yaml > >> b/automation/gitlab-ci/build.yaml > >> index 1b82b359d01f..ac53678

Re: [PATCH v3 6/6] CI: Include microcode for x86 hardware jobs

2025-04-14 Thread Anthony PERARD
On Mon, Apr 14, 2025 at 12:09:03PM +0100, Andrew Cooper wrote: > diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml > index 1b82b359d01f..ac5367874526 100644 > --- a/automation/gitlab-ci/build.yaml > +++ b/automation/gitlab-ci/build.yaml > @@ -306,6 +306,7 @@ alpine-3.18

linux-6.15-rc2/drivers/xen/balloon.c:346: Possible int/long mixup

2025-04-14 Thread David Binderman
Hello there, Static analyser cppcheck says: linux-6.15-rc2/drivers/xen/balloon.c:346:24: style: int result is assigned to long variable. If the variable is long to avoid loss of information, then you have loss of information. [truncLongCastAssignment] Source code is unsigned long i, size

Re: [PATCH v3 08/16] x86/hyperlaunch: Add helpers to locate multiboot modules

2025-04-14 Thread Alejandro Vallejo
On Mon Apr 14, 2025 at 4:05 PM BST, Jan Beulich wrote: > On 14.04.2025 15:37, Alejandro Vallejo wrote: >> On Thu Apr 10, 2025 at 11:42 AM BST, Jan Beulich wrote: >>> On 08.04.2025 18:07, Alejandro Vallejo wrote: +/* + * Locate a multiboot module given its node offset in the FDT. + *

Re: [PATCH v3 6/6] CI: Include microcode for x86 hardware jobs

2025-04-14 Thread Andrew Cooper
On 14/04/2025 6:55 pm, Marek Marczykowski-Górecki wrote: > On Mon, Apr 14, 2025 at 06:47:07PM +0100, Andrew Cooper wrote: >> On 14/04/2025 6:45 pm, Anthony PERARD wrote: >>> On Mon, Apr 14, 2025 at 12:09:03PM +0100, Andrew Cooper wrote: diff --git a/automation/gitlab-ci/build.yaml b/auto

Re: [PATCH v3 12/16] x86/hyperlaunch: add domain id parsing to domain config

2025-04-14 Thread Alejandro Vallejo
On Wed Apr 9, 2025 at 11:15 PM BST, Denis Mukhin wrote: > On Tuesday, April 8th, 2025 at 9:07 AM, Alejandro Vallejo > wrote: > >> >> >> From: "Daniel P. Smith" dpsm...@apertussolutions.com >> >> >> Introduce the ability to specify the desired domain id for the domain >> definition. The domain

Re: [PATCH v3 16/16] x86/hyperlaunch: add capabilities to boot domain

2025-04-14 Thread Alejandro Vallejo
On Wed Apr 9, 2025 at 11:39 PM BST, Denis Mukhin wrote: > On Tuesday, April 8th, 2025 at 9:07 AM, Alejandro Vallejo > wrote: > >> >> >> From: "Daniel P. Smith" dpsm...@apertussolutions.com >> >> >> Introduce the ability to assign capabilities to a domain via its definition >> in >> device tr

[XEN PATCH] tools/tests: Fix newly introduced Makefile

2025-04-14 Thread Anthony PERARD
From: Anthony PERARD Fix few issue with this new directory: - clean generated files - and ignore those generated files - include the dependency files generated by `gcc`. - rework prerequisites: "test-rangeset.o" also needs the generated files "list.h" and "rangeset.h". Technically, both only

Re: [PATCH v2 0/5] Fix lazy mmu mode

2025-04-14 Thread Ryan Roberts
On 10/04/2025 17:07, Alexander Gordeev wrote: > On Mon, Mar 03, 2025 at 02:15:34PM +, Ryan Roberts wrote: > > Hi Ryan, > >> I'm planning to implement lazy mmu mode for arm64 to optimize vmalloc. As >> part >> of that, I will extend lazy mmu mode to cover kernel mappings in vmalloc >> table

Re: [PATCH v3 16/16] x86/hyperlaunch: add capabilities to boot domain

2025-04-14 Thread Alejandro Vallejo
On Thu Apr 10, 2025 at 1:18 PM BST, Jan Beulich wrote: > On 08.04.2025 18:07, Alejandro Vallejo wrote: >> From: "Daniel P. Smith" >> >> Introduce the ability to assign capabilities to a domain via its definition >> in >> device tree. The first capability enabled to select is the control domain >

[PATCH v4 1/3] drivers: Change amd_iommu struct to contain pci_sbdf_t, simplify code

2025-04-14 Thread Andrii Sultanov
From: Andrii Sultanov Following on from 250d87dc3ff9 ("x86/msi: Change __msi_set_enable() to take pci_sbdf_t"), make struct amd_iommu contain pci_sbdf_t directly instead of specifying seg+bdf separately and regenerating sbdf_t from them, which simplifies code. Bloat-o-meter reports: add/remove:

Re: [PATCH v2 2/7] Overhaul how Argo is built and packged

2025-04-14 Thread Marek Marczykowski-Górecki
On Mon, Apr 14, 2025 at 11:18:38AM +0100, Andrew Cooper wrote: > --- a/scripts/build-linux.sh > +++ b/scripts/build-linux.sh > @@ -8,7 +8,7 @@ fi > set -ex -o pipefail > > WORKDIR="${PWD}" > -COPYDIR="${WORKDIR}/binaries/" > +COPYDIR="${WORKDIR}/binaries" Is this change intentional? It has wor

[PATCH v2 7/7] Package microcode for the x86 hardware runners

2025-04-14 Thread Andrew Cooper
They are all out of date, to different degrees. Install jq into the x86_64 build container so we can parse the Github latest release information in an acceptable way. The resulting archive must be uncompressed, in order to work during early boot. Signed-off-by: Andrew Cooper Reviewed-by: Jason

Re: [PATCH v2 2/7] Overhaul how Argo is built and packged

2025-04-14 Thread Andrew Cooper
On 14/04/2025 11:35 am, Marek Marczykowski-Górecki wrote: > On Mon, Apr 14, 2025 at 11:18:38AM +0100, Andrew Cooper wrote: >> --- a/scripts/build-linux.sh >> +++ b/scripts/build-linux.sh >> @@ -8,7 +8,7 @@ fi >> set -ex -o pipefail >> >> WORKDIR="${PWD}" >> -COPYDIR="${WORKDIR}/binaries/" >> +C

Re: [PATCH v2 0/2] Add support for MSI injection on Arm

2025-04-14 Thread Julien Grall
Hi Mykyta, On 14/04/2025 18:51, Mykyta Poturai wrote: This series adds the base support for MSI injection on Arm. This is needed to streamline virtio-pci interrupt triggering. With this patches, MSIs can be triggered in guests by issuing the new DM op, inject_msi2. This op is similar to inject_

[PATCH RFC 7/6] CI: Adjust how domU is packaged in dom0

2025-04-14 Thread Andrew Cooper
Package domU in /boot for dom0 and insert into the uncompressed part of dom0's rootfs, rather than recompressing it as part of the overlay. Signed-off-by: Andrew Cooper --- CC: Anthony PERARD CC: Stefano Stabellini CC: Michal Orzel CC: Doug Goldstein CC: Marek Marczykowski-Górecki A little

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

2025-04-14 Thread Ayan Kumar Halder
Hi, I will keep Michal's R-b with one small change. On 11/04/2025 12:04, Ayan Kumar Halder wrote: regions.inc is added to hold the common earlyboot MPU regions configuration between arm64 and arm32. prepare_xen_region, fail_insufficient_regions() will be used by both arm32 and arm64. Thus, the

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

2025-04-14 Thread Jan Beulich
On 14.04.2025 13:48, Oleksii Kurochko wrote: > > On 4/10/25 10:48 AM, Jan Beulich wrote: >> On 09.04.2025 21:01, Oleksii Kurochko wrote: >>> --- a/xen/arch/riscv/include/asm/mm.h >>> +++ b/xen/arch/riscv/include/asm/mm.h >>> @@ -9,6 +9,7 @@ >>> #include >>> #include >>> #include >>> +#inc

[PATCH v2 1/2] arm: vgic: Add the ability to trigger MSIs from the Hypervisor

2025-04-14 Thread Mykyta Poturai
From: Mykyta Poturai Add the vgic_its_trigger_msi() function to the vgic interface. This function allows to inject MSIs from the Hypervisor to the guest. Which is useful for userspace PCI backend drivers. Signed-off-by: Mykyta Poturai --- v1->v2: * replace -1 with -ENOENT * reduce guest memory

[PATCH v2 0/2] Add support for MSI injection on Arm

2025-04-14 Thread Mykyta Poturai
This series adds the base support for MSI injection on Arm. This is needed to streamline virtio-pci interrupt triggering. With this patches, MSIs can be triggered in guests by issuing the new DM op, inject_msi2. This op is similar to inject_msi, but it allows to specify the source id of the MSI.

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

2025-04-14 Thread Roger Pau Monné
On Fri, Apr 11, 2025 at 09:45:26AM -0400, Jason Andryuk wrote: > On 2025-04-11 03:31, Roger Pau Monné wrote: > > Thanks Jason for getting back, I'm intrigued by this issue :). > > > > On Thu, Apr 10, 2025 at 04:55:54PM -0400, Jason Andryuk wrote: > > > On 2025-04-04 06:28, Roger Pau Monné wrote: >

Re: [PATCH 2/5] xen/io: provide helpers for multi size MMIO accesses

2025-04-14 Thread Jan Beulich
On 11.04.2025 12:54, Roger Pau Monne wrote: > Several handlers have the same necessity of reading from an MMIO region > using 1, 2, 4 or 8 bytes accesses. So far this has been open-coded in the > function itself. Instead provide a new handler that encapsulates the > accesses. > > Since the added

Re: [PATCH v1 08/14] xen/riscv: imsic_init() implementation

2025-04-14 Thread Jan Beulich
On 08.04.2025 17:57, Oleksii Kurochko wrote: > --- /dev/null > +++ b/xen/arch/riscv/imsic.c > @@ -0,0 +1,286 @@ > +/* SPDX-License-Identifier: MIT */ > + > +/* > + * xen/arch/riscv/imsic.c > + * > + * RISC-V Incoming MSI Controller support > + * > + * (c) 2023 Microchip Technology Inc. > + * (c) 20

[PATCH v4 01/15] xen/cpufreq: move "init" flag into common structure

2025-04-14 Thread Penny Zheng
AMD cpufreq cores will be intialized in two modes, legacy P-state mode, and CPPC mode. So "init" flag shall be extracted from specific "struct xen_processor_perf", and placed in the common "struct processor_pminfo". Signed-off-by: Penny Zheng --- v3 -> v4: - new commit --- xen/drivers/acpi/pmsta

  1   2   >