Re: [PATCH v2 11/11] automation/x86: add a xen.efi test with a strict NX OVMF build

2025-04-01 Thread Andrew Cooper
On 01/04/2025 2:08 pm, Roger Pau Monne wrote: > Such OVMF build does honor the PE sections attributes, and will not blindly > create all section mappings with read-write-execute permissions. > > Strict NX build is only available in the Fedora edk2-experimental > package, so add the required depende

Re: [PATCH v2 08/11] x86/boot: place trampoline code in a non-execute section

2025-04-01 Thread Andrew Cooper
On 01/04/2025 2:08 pm, Roger Pau Monne wrote: > The trampoline code is never executed in the position placed by the > loader. It's first copied to the low 1MB, and always executed from > there. > > Move the trampoline code from being in .init.text section into > .init.data, so it's not in an execu

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

2025-04-01 Thread Jan Beulich
On 26.03.2025 06:50, Penny Zheng wrote: > Function arch_do_sysctl is to perform arch-specific sysctl op. > Some functions, like psr_get_info for x86, DTB overlay support for arm, > are solely available through sysctl op, then they all shall be wrapped > with CONFIG_SYSCTL > Also, remove all #ifdef

[PATCH] xen/arch: Simplify $(TARGET)-syms rule

2025-04-01 Thread Andrew Cooper
In all cases, "-T $(obj)/xen.lds" can be factored out by appending to XEN_LDFLAGS. This takes the $(LD) commands from multi-line to single-line. x86 uses $(build_id_linker) for all links, so factor that out too. No functional change. Signed-off-by: Andrew Cooper --- CC: Anthony PERARD CC: Mic

Re: [PATCH] xen/arch: Simplify $(TARGET)-syms rule

2025-04-01 Thread Jan Beulich
On 01.04.2025 16:47, Andrew Cooper wrote: > In all cases, "-T $(obj)/xen.lds" can be factored out by appending to > XEN_LDFLAGS. This takes the $(LD) commands from multi-line to single-line. > > x86 uses $(build_id_linker) for all links, so factor that out too. > > No functional change. > > Sig

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

2025-04-01 Thread Orzel, Michal
On 01/04/2025 16:49, Bertrand Marquis wrote: > > > Hi, > >> On 1 Apr 2025, at 16:22, Orzel, Michal wrote: >> >> >> >> On 01/04/2025 14:57, Bertrand Marquis wrote: >>> >>> >>> Hi Michal, >>> On 1 Apr 2025, at 11:09, Michal Orzel wrote: There's no benefit in having process_shm_

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

2025-04-01 Thread Luca Fancellu
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 translation. Introduce ARCH_PAGING_MEMPOOL Kconfig c

[PATCH v4 3/7] xen/arm: Introduce frame_table and virt_to_page

2025-04-01 Thread Luca Fancellu
Introduce frame_table in order to provide the implementation of virt_to_page for MPU system, move the MMU variant in mmu/mm.h. Introduce FRAMETABLE_NR that is required for 'pdx_group_valid' in pdx.c, but leave the initialisation of the frame table to a later stage. Define FRAMETABLE_SIZE for MPU t

[PATCH v4 5/7] arm/mpu: Implement stubs for ioremap_attr on MPU

2025-04-01 Thread Luca Fancellu
Implement ioremap_attr() stub for MPU system; the implementation of ioremap() is the same between MMU and MPU system, and it relies on ioremap_attr(), so move the definition from mmu/pt.c to arm/mm.c. Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel --- v4 changes: - no changes v3 changes

[PATCH v4 2/7] xen/arm: Implement virt/maddr conversion in MPU system

2025-04-01 Thread Luca Fancellu
From: Penny Zheng virt_to_maddr and maddr_to_virt are used widely in Xen code. So even there is no VMSA in MPU system, we keep the interface in MPU to to avoid changing the existing common code. In order to do that, move the virt_to_maddr() and maddr_to_virt() definitions to mmu/mm.h, move the i

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

2025-04-01 Thread Luca Fancellu
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 --- The implementation of setup_virt_paging() is under arm64/mpu because it will have a different implementation from arm32. v4

[PATCH v4 0/7] MPU mm subsystem skeleton

2025-04-01 Thread Luca Fancellu
Hi all, this serie implements the skeleton for the MPU memory management subsystem, at the end of the serie it will be possible to compile the Arm64 arch using MPU. The minimum Arm Kconfig configuration is this one: CONFIG_UNSUPPORTED=y CONFIG_MPU=y CONFIG_XEN_START_ADDRESS=0x0 Luca Fancellu (5

[PATCH v5] xen: simplify bitmap_to_xenctl_bitmap for little endian

2025-04-01 Thread Jan Beulich
From: Stefano Stabellini The little endian implementation of bitmap_to_xenctl_bitmap leads to unnecessary xmallocs and xfrees. Given that Xen only supports little endian architectures, it is worth optimizing. This patch removes the need for the xmalloc on little endian architectures. Remove cla

[PATCH 0/2] CI: add another hw runner - KabyLake this time

2025-04-01 Thread Marek Marczykowski-Górecki
As usual, besides the patches, somebody need to click on "hal9003" runner in the relevant projects. Marek Marczykowski-Górecki (2): ci: create boot.ipxe for legacy boot ci: add Intel KabyLake HW runner automation/gitlab-ci/test.yaml | 89 +++- automation/scrip

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

2025-04-01 Thread Jan Beulich
On 01.04.2025 15:29, Jason Andryuk wrote: > On 2025-04-01 08:16, Jan Beulich wrote: >> On 31.03.2025 23:43, Jason Andryuk wrote: >>> This works with C xenstored. OCaml xenstored does not use grants and >>> would fail to foreign map the page. >> >> From the sentence it's not clear whether this is

Re: [PATCH v2 00/11] x86/EFI: prevent write-execute sections

2025-04-01 Thread Jan Beulich
On 01.04.2025 15:26, Roger Pau Monné wrote: > On Tue, Apr 01, 2025 at 03:13:52PM +0200, Jan Beulich wrote: >> On 01.04.2025 15:08, Roger Pau Monne wrote: >>> Hello, >>> >>> The following series aim to remove the presence of any write and execute >>> section in the PE Xen image. This is required to

Re: [PATCH v2 08/19] xen/sysctl: wrap around XEN_SYSCTL_lockprof_op

2025-04-01 Thread Jan Beulich
On 26.03.2025 06:50, Penny Zheng wrote: > --- a/xen/common/sysctl.c > +++ b/xen/common/sysctl.c > @@ -123,13 +123,13 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) > u_sysctl) > ret = perfc_control(&op->u.perfc_op); > break; > #endif > -#endif /* CONFIG_SYSCTL */ > >

Re: [PATCH v2 04/19] xen/sysctl: wrap around XEN_SYSCTL_readconsole

2025-04-01 Thread Jan Beulich
On 26.03.2025 06:50, Penny Zheng wrote: > --- a/xen/common/sysctl.c > +++ b/xen/common/sysctl.c > @@ -58,6 +58,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) > u_sysctl) > > switch ( op->cmd ) > { > +#ifdef CONFIG_SYSCTL > case XEN_SYSCTL_readconsole: > ret = xs

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

2025-04-01 Thread Penny, Zheng
[Public] > -Original Message- > From: Jan Beulich > Sent: Tuesday, April 1, 2025 5:02 PM > To: Penny, Zheng > Cc: xen-devel@lists.xenproject.org; Huang, Ray ; > Andrew Cooper ; Roger Pau Monné > ; Anthony PERARD ; Orzel, > Michal ; Julien Grall ; Stefano > Stabellini > Subject: Re: [PAT

Re: [PATCH v2 1/6] xen: introduce hardware domain create flag

2025-04-01 Thread Jason Andryuk
On 2025-04-01 08:00, Jan Beulich wrote: On 31.03.2025 23:43, Jason Andryuk wrote: --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -820,11 +820,15 @@ struct domain *domain_create(domid_t domid, d->is_privileged = flags & CDF_privileged; /* Sort out our idea of is_hardware_do

Re: [PATCH v2 1/6] xen: introduce hardware domain create flag

2025-04-01 Thread Jan Beulich
On 01.04.2025 14:39, Jason Andryuk wrote: > On 2025-04-01 08:00, Jan Beulich wrote: >> On 31.03.2025 23:43, Jason Andryuk wrote: >>> --- a/xen/common/domain.c >>> +++ b/xen/common/domain.c >>> @@ -820,11 +820,15 @@ struct domain *domain_create(domid_t domid, >>> d->is_privileged = flags & CDF

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

2025-04-01 Thread Bertrand Marquis
Hi Julien, > On 30 Mar 2025, at 23:38, Julien Grall wrote: > > Hi Bertrand, > > On 27/03/2025 08:37, Bertrand Marquis wrote: >>> 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

Re: [PATCH v3 1/3] xen: gcov: add support for gcc 14

2025-04-01 Thread Jan Beulich
On 01.04.2025 03:17, Volodymyr Babchuk wrote: > gcc 14 (with patch "Add condition coverage (MC/DC)") introduced 9th > gcov counter. Also this version can call new merge function > __gcov_merge_ior(), so we need a new stub for it. > > Signed-off-by: Volodymyr Babchuk > Reviewed-by: Jan Beulich A

[PATCH v2 7/7] xen/console: introduce console_get_focus()

2025-04-01 Thread dmkhn
From: Denis Mukhin Add console_get_focus() as a console public API to the retrieve current console owner domain ID. Make console_{get,put}_domain() private and simplify vpl011 code a bit. Signed-off-by: Denis Mukhin --- xen/arch/arm/vpl011.c | 5 + xen/drivers/char/console.c | 9

Re: [PATCH v2 00/11] x86/EFI: prevent write-execute sections

2025-04-01 Thread Jan Beulich
On 01.04.2025 15:08, Roger Pau Monne wrote: > Hello, > > The following series aim to remove the presence of any write and execute > section in the PE Xen image. This is required to support the NX > compatible flag in the PE header. By the end of the series the > resulting PE image has no reloca

[PATCH v2 03/11] x86/mkreloc: use the string table to get names

2025-04-01 Thread Roger Pau Monne
When using PE format names greater than 8 characters are placed in the string table, and a reference using the '/' format is placed in the name field. Read the string table if present, and decode names as required. No functional change intended, but the name references printed in error messages a

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

2025-04-01 Thread Bertrand Marquis
Hi Michal, > On 1 Apr 2025, at 11: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

Re: [PATCH v2 06/11] x86/efi: discard .text.header for PE binary

2025-04-01 Thread Jan Beulich
On 01.04.2025 15:08, Roger Pau Monne wrote: > The multiboot headers are not consumed in the PE binary, hence discard them > in the linker script when doing a PE build. > > That removes some relocations that otherwise appear due to the usage of the > start and __efi64_mb2_start symbols in the multi

[PATCH v2 09/11] x86/efi: avoid a relocation in efi_arch_post_exit_boot()

2025-04-01 Thread Roger Pau Monne
Instead of using the absolute __start_xen address, calculate it as an offset from the current instruction pointer. The relocation would be problematic if the loader has acknowledged the Xen image section attributes, and mapped .init.text with just read and execute permissions. No functional chang

Re: [PATCH v2 10/19] xen/sysctl: introduce CONFIG_PM_STATS

2025-04-01 Thread Jan Beulich
On 26.03.2025 06:50, Penny Zheng wrote: > We intend to introduce CONFIG_PM_STATS for wrapping all operations > regarding performance management statistics. > The major codes reside in xen/drivers/acpi/pmstat.c, including two main > pm-related sysctl op: do_get_pm_info() and do_pm_op(). > So This co

[PATCH v2 10/11] x86/efi: do not merge all .init sections

2025-04-01 Thread Roger Pau Monne
As a result of having no relocations against text sections, there's no need for a single .init section that's read-write-execute, as .init.text is no longer modified. Remove the bodge and fallback to the layout used by ELF images with an .init.text and .init.data section. The resulting PE section

[PATCH v2 08/11] x86/boot: place trampoline code in a non-execute section

2025-04-01 Thread Roger Pau Monne
The trampoline code is never executed in the position placed by the loader. It's first copied to the low 1MB, and always executed from there. Move the trampoline code from being in .init.text section into .init.data, so it's not in an executable section. This allows applying the relocations safe

[PATCH v2 00/11] x86/EFI: prevent write-execute sections

2025-04-01 Thread Roger Pau Monne
Hello, The following series aim to remove the presence of any write and execute section in the PE Xen image. This is required to support the NX compatible flag in the PE header. By the end of the series the resulting PE image has no relocations that apply to text sections, as text sections are

[PATCH v2 07/11] x86/efi: discard multiboot related entry code for PE binary

2025-04-01 Thread Roger Pau Monne
The multiboot and PVH entry points are not used in the PE binary, hence discard them in the linker script when doing a PE build. That removes some relocations that otherwise appear due to the entry point code in head.S not being position independent. No functional change intended. Signed-off-by:

[PATCH v2 02/11] x86/mkreloc: fix obtaining PE image base address

2025-04-01 Thread Roger Pau Monne
The base address is in the pe32_opt_hdr, not after it. Previous to commit f7f42acc the base was read standalone (as the first field of pe32_opt_hdr). However with the addition of reading the full contents of pe32_opt_hdr, such read will also fetch the base. The current attempt to read the ba

[PATCH v2 06/11] x86/efi: discard .text.header for PE binary

2025-04-01 Thread Roger Pau Monne
The multiboot headers are not consumed in the PE binary, hence discard them in the linker script when doing a PE build. That removes some relocations that otherwise appear due to the usage of the start and __efi64_mb2_start symbols in the multiboot2 header. No functional change intended. Signed-

[PATCH v2 04/11] x86/mkreloc: print the linear address of relocations to read-only sections

2025-04-01 Thread Roger Pau Monne
Expand the warning message about relocations generated against read-only sections, so it also contains the linear address of the offending relocation, like: Warning: relocation to r/o section .text:0048 @ 0x82d040200048 Signed-off-by: Roger Pau Monné --- xen/arch/x86/efi/mkreloc.c | 5 +

[PATCH v2 11/11] automation/x86: add a xen.efi test with a strict NX OVMF build

2025-04-01 Thread Roger Pau Monne
Such OVMF build does honor the PE sections attributes, and will not blindly create all section mappings with read-write-execute permissions. Strict NX build is only available in the Fedora edk2-experimental package, so add the required dependencies to run a QEMU EFI job on the Fedora 41 container

Re: [PATCH v2 06/11] x86/efi: discard .text.header for PE binary

2025-04-01 Thread Andrew Cooper
On 01/04/2025 2:18 pm, Jan Beulich wrote: > On 01.04.2025 15:08, Roger Pau Monne wrote: >> The multiboot headers are not consumed in the PE binary, hence discard them >> in the linker script when doing a PE build. >> >> That removes some relocations that otherwise appear due to the usage of the >>

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

2025-04-01 Thread Xin Li
On 3/31/2025 10:13 PM, H. Peter Anvin wrote: On March 31, 2025 2:45:43 PM PDT, Andrew Cooper wrote: On 31/03/2025 9:22 am, Xin Li (Intel) wrote: __wrmsr() is the lowest level primitive MSR write API, and its direct use is NOT preferred. Use its wrapper function native_wrmsrl() instead. No f

Re: [PATCH v2 00/11] x86/EFI: prevent write-execute sections

2025-04-01 Thread Roger Pau Monné
On Tue, Apr 01, 2025 at 03:13:52PM +0200, Jan Beulich wrote: > On 01.04.2025 15:08, Roger Pau Monne wrote: > > Hello, > > > > The following series aim to remove the presence of any write and execute > > section in the PE Xen image. This is required to support the NX > > compatible flag in the PE

[PATCH v4 1/7] arm/mpu: Add HYPERVISOR_VIRT_START and avoid a check in xen.lds.S

2025-04-01 Thread Luca Fancellu
The define HYPERVISOR_VIRT_START is required by the common code, even if MPU system doesn't use virtual memory, define it in mpu/layout.h in order to reuse existing code. Disable a check in the linker script for arm for !MMU systems. Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel --- v4

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

2025-04-01 Thread Jason Andryuk
On 2025-04-01 08:16, Jan Beulich wrote: On 31.03.2025 23:43, Jason Andryuk wrote: --- a/xen/arch/arm/dom0less-build.c +++ b/xen/arch/arm/dom0less-build.c @@ -865,6 +865,10 @@ static void __init initialize_domU_xenstore(void) rc = alloc_xenstore_evtchn(d); if ( rc < 0 )

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

2025-04-01 Thread Stefano Stabellini
On Tue, 1 Apr 2025, 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 v1 3/3] vpci/msi: Remove registers when init_msi() fails

2025-04-01 Thread Roger Pau Monné
On Mon, Mar 31, 2025 at 09:43:11AM +, Chen, Jiqian wrote: > On 2025/3/31 16:53, Roger Pau Monné wrote: > > On Mon, Mar 31, 2025 at 08:13:50AM +, Chen, Jiqian wrote: > >> On 2025/3/27 20:44, Roger Pau Monné wrote: > >>> On Thu, Mar 27, 2025 at 03:32:14PM +0800, Jiqian Chen wrote: > When

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

2025-04-01 Thread Stewart Hildebrand
On 3/30/25 18:08, Julien Grall wrote: > Hi Steward, > > On 25/03/2025 17:27, Stewart Hildebrand wrote: >> We expect mmio read handlers to leave the bits above the access size >> zeroed. Add an ASSERT to check this aspect of read handler behavior. >> >> Suggested-by: Roger Pau Monné >> Signed-off-

Re: [PATCH v2 03/11] x86/mkreloc: use the string table to get names

2025-04-01 Thread Jan Beulich
On 01.04.2025 15:08, Roger Pau Monne wrote: > --- a/xen/arch/x86/efi/mkreloc.c > +++ b/xen/arch/x86/efi/mkreloc.c > @@ -17,6 +17,12 @@ > #define PE_BASE_RELOC_HIGHLOW 3 > #define PE_BASE_RELOC_DIR64 10 > > +/* The size of a symbol table entry is always 18 bytes. */ > +#define SYM_SIZE 18 > +

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

2025-04-01 Thread Oleksii Kurochko
On 3/31/25 6:14 PM, 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 UBSAN config increased the size of the Xen binary. Increase X

Re: Domain IDs and Capabilities

2025-04-01 Thread Jason Andryuk
On 2025-04-01 04:07, Jan Beulich wrote: On 31.03.2025 23:46, Jason Andryuk wrote: It is useful for a domain to know its own domid. Xenstored has command line flags to set --master-domid (the local domid) and --priv-domid, but it would be better to autodetect those. Also, domids are necessary t

Re: [PATCH v1 0/5] x86/asm: cleanups after toolchain baseline upgrade

2025-04-01 Thread Andrew Cooper
On 01/04/2025 11:21 pm, dm...@proton.me wrote: > Patches 1-4 remove various compiler workarounds in the hypervisor code > for Intel's VMX instructions. > > Patch 5 removes compiler workaround for missing clac/stac instructions. > > CI: https://gitlab.com/xen-project/people/dmukhin/xen/-/pipelines/1

[PATCH v1 3/5] x86/vmx: remove GAS_VMX_OP()

2025-04-01 Thread dmkhn
From: Denis Mukhin Remove unneeded GAS_VMX_OP() macro, now that all used VMX instuctions are natively supported by the baseline compiler. Signed-off-by: Denis Mukhin --- xen/arch/x86/include/asm/hvm/vmx/vmx.h | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a

[PATCH v1 0/5] x86/asm: cleanups after toolchain baseline upgrade

2025-04-01 Thread dmkhn
Patches 1-4 remove various compiler workarounds in the hypervisor code for Intel's VMX instructions. Patch 5 removes compiler workaround for missing clac/stac instructions. CI: https://gitlab.com/xen-project/people/dmukhin/xen/-/pipelines/1747394875 Denis Mukhin (5): x86/vmx: remove HAVE_AS_VM

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

2025-04-01 Thread Stefano Stabellini
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 specified. Multiple control domains are possible. > > Introduce bootfdt.h to contain these constants. >

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

2025-04-01 Thread Stefano Stabellini
On Tue, 1 Apr 2025, Jan Beulich wrote: > From: Stefano Stabellini > > The little endian implementation of bitmap_to_xenctl_bitmap leads to > unnecessary xmallocs and xfrees. Given that Xen only supports little > endian architectures, it is worth optimizing. > > This patch removes the need for th

Re: [PATCH 2/2] ci: add Intel KabyLake HW runner

2025-04-01 Thread Stefano Stabellini
On Tue, 1 Apr 2025, Marek Marczykowski-Górecki wrote: > This is Intel i7-7567U in NUC 7i7BNH. This one is an older one, with no > firmware updates (last update from 2023) and no microcode udpates > either. While this firmware supports UEFI, network boot works only in > legacy mode - thus legacy is

Re: [PATCH v2 01/11] automation/dockers: add to README how to rebuild all containers

2025-04-01 Thread Stefano Stabellini
On Tue, 1 Apr 2025, Roger Pau Monne wrote: > Document in the README how to rebuild all containers. This is helpful when > populating a local docker registry for testing purposes. > > Signed-off-by: Roger Pau Monné Reviewed-by: Stefano Stabellini > --- > automation/build/README.md | 7 ++

[PATCH v1 1/5] x86/vmx: remove HAVE_AS_VMX

2025-04-01 Thread dmkhn
From: Denis Mukhin Remove the workaround under HAVE_AS_VMX for older compilers, as the minimally required GCC 5.1 / Binutils 2.25, and Clang 11 natively support the VMX instructions used in the hypervisor code. Signed-off-by: Denis Mukhin --- xen/arch/x86/arch.mk | 3 +-- xe

[PATCH v1 4/5] x86/vmx: remove *_OPCODE

2025-04-01 Thread dmkhn
From: Denis Mukhin Remove all *_OPCODE definitions from vmx.h now that all used VMX instructions are natively supported by the baseline compiler. Use vmxon and vmxoff instructions directly. Update __vmxon() to account for vmxon use. Resolves: https://gitlab.com/xen-project/xen/-/work_items/202

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

2025-04-01 Thread Andrew Cooper
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 set up rc (including a fixup section where bactraces have no connection to the invoking function), the logic to decode it, and the default case which

[PATCH v1 2/5] x86/vmx: remove HAVE_AS_EPT

2025-04-01 Thread dmkhn
From: Denis Mukhin Remove the workaround under HAVE_AS_EPT for older compilers, as the minimally required GCC 5.1 / Binutils 2.25, and Clang 11 natively support the VMX instructions used in the hypervisor code. Signed-off-by: Denis Mukhin --- xen/arch/x86/arch.mk | 1 - xen/

[PATCH v1 5/5] x86/asm: remove HAVE_AS_CLAC_STAC

2025-04-01 Thread dmkhn
From: Denis Mukhin The new toolchain baseline knows the STAC/CLAC instructions, no need to carry the workaround in the code. Resolves: https://gitlab.com/xen-project/xen/-/work_items/203 Signed-off-by: Denis Mukhin --- xen/arch/x86/arch.mk | 1 - xen/arch/x86/include/asm/asm-d

Re: [PATCH v1 5/5] x86/asm: remove HAVE_AS_CLAC_STAC

2025-04-01 Thread Andrew Cooper
On 01/04/2025 11:21 pm, dm...@proton.me wrote: > From: Denis Mukhin > > The new toolchain baseline knows the STAC/CLAC instructions, > no need to carry the workaround in the code. > > Resolves: https://gitlab.com/xen-project/xen/-/work_items/203 > Signed-off-by: Denis Mukhin Reviewed-by: Andrew

Re: [PATCH v1 4/5] x86/vmx: remove *_OPCODE

2025-04-01 Thread Andrew Cooper
On 01/04/2025 11:21 pm, dm...@proton.me wrote: > diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmx.h > b/xen/arch/x86/include/asm/hvm/vmx/vmx.h > index 10c0619108..1d63e49288 100644 > --- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h > +++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h > @@ -507,15 +487,17 @

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

2025-04-01 Thread Stefano Stabellini
On Tue, 1 Apr 2025, Jason Andryuk wrote: > On 2025-04-01 08:16, Jan Beulich wrote: > > On 31.03.2025 23:43, Jason Andryuk wrote: > > > > --- a/xen/arch/arm/dom0less-build.c > > > +++ b/xen/arch/arm/dom0less-build.c > > > @@ -865,6 +865,10 @@ static void __init initialize_domU_xenstore(void) > > >

Re: [PATCH v2 3/6] xen/arm: dom0less delay xenstore initialization

2025-04-01 Thread Stefano Stabellini
On Mon, 31 Mar 2025, Jason Andryuk wrote: > 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

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

2025-04-01 Thread Jan Beulich
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_shift; >>> +const unsigned long xen_virt_end_vpn = >>> +xen_virt_starn_vpn + ((XEN_VIRT_SIZE >> vpn1_shift)

Re: [PATCH v2 07/11] x86/efi: discard multiboot related entry code for PE binary

2025-04-01 Thread Jan Beulich
On 01.04.2025 15:08, Roger Pau Monne wrote: > --- a/xen/arch/x86/xen.lds.S > +++ b/xen/arch/x86/xen.lds.S > @@ -63,6 +63,7 @@ SECTIONS >. = __image_base__; >/DISCARD/ : { > *(.text.header) > +*(.init.multiboot) >} > #endif > > @@ -208,6 +209,7 @@ SECTIONS > _sinittex

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

2025-04-01 Thread Oleksii Kurochko
On 4/1/25 1:59 PM, Julien Grall wrote: On 01/04/2025 07:24, Jan Beulich wrote: 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 l

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

2025-04-01 Thread Bertrand Marquis
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 2025, at 16:22, Orzel, Michal wrote: >>> >>> >>> >>> On 01/04/2025 14:57, Bertrand Marquis wrote: Hi Michal, > On 1 Apr

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

2025-04-01 Thread Xin Li
On 4/1/2025 9:10 PM, Ingo Molnar wrote: Yeah, I moved it over to: git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git WIP.x86/msr On it now. Thanks! Xin

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

2025-04-01 Thread Ingo Molnar
* Xin Li wrote: > Hi Ingo, > > Is this branch public? > > I wanted to rebase on it and then incooperate your review comments, but > couldn't find the branch. Yeah, I moved it over to: git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git WIP.x86/msr Thanks, Ingo

Re: [PATCH 1/2] ci: create boot.ipxe for legacy boot

2025-04-01 Thread Stefano Stabellini
On Tue, 1 Apr 2025, Marek Marczykowski-Górecki wrote: > Hardware runners that use legacy boot use iPXE instead of grub2. Create > boot.ipxe for those too - with exact same options. > > Signed-off-by: Marek Marczykowski-Górecki Reviewed-by: Stefano Stabellini > --- > Right now this applies to

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

2025-04-01 Thread Jan Beulich
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 domain *d, >> { >> if ( !opt_allow_unsafe ) >> {

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

2025-04-01 Thread Orzel, Michal
On 31/03/2025 23:43, Jason Andryuk wrote: > 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

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

2025-04-01 Thread Julien Grall
On 01/04/2025 07:24, Jan Beulich wrote: 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 rea

Re: [PATCH v2 1/6] xen: introduce hardware domain create flag

2025-04-01 Thread Jan Beulich
On 31.03.2025 23:43, Jason Andryuk wrote: > --- a/xen/common/domain.c > +++ b/xen/common/domain.c > @@ -820,11 +820,15 @@ struct domain *domain_create(domid_t domid, > d->is_privileged = flags & CDF_privileged; > > /* Sort out our idea of is_hardware_domain(). */ > -if ( domid == 0

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

2025-04-01 Thread Jan Beulich
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 hardware domain to be able to map ot

Re: [PATCH v2 06/19] xen/sysctl: wrap around XEN_SYSCTL_sched_id

2025-04-01 Thread Jan Beulich
On 26.03.2025 06:50, Penny Zheng wrote: > --- a/xen/common/sysctl.c > +++ b/xen/common/sysctl.c > @@ -72,10 +72,12 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) > u_sysctl) > ret = tb_control(&op->u.tbuf_op); > break; > > +#ifdef CONFIG_SYSCTL > case XEN_SYSCTL_sc

Re: [PATCH v3 1/4] xen/riscv: introduce preinit_xen_time()

2025-04-01 Thread Jan Beulich
On 28.03.2025 17:58, Oleksii Kurochko wrote: > preinit_xen_time() does two things: > 1. Parse timebase-frequency properpy of /cpus node to initialize cpu_khz >variable. > 2. Initialize boot_clock_cycles with the current time counter value to >have starting point for Xen. > > timebase-frequ

Re: [PATCH v2 02/11] x86/mkreloc: fix obtaining PE image base address

2025-04-01 Thread Jan Beulich
On 01.04.2025 15:08, Roger Pau Monne wrote: > The base address is in the pe32_opt_hdr, not after it. > > Previous to commit f7f42acc the base was read standalone (as the first > field of pe32_opt_hdr). However with the addition of reading the full > contents of pe32_opt_hdr, such read will al

Re: [PATCH v2 02/11] x86/mkreloc: fix obtaining PE image base address

2025-04-01 Thread Andrew Cooper
On 01/04/2025 2:08 pm, Roger Pau Monne wrote: > The base address is in the pe32_opt_hdr, not after it. > > Previous to commit f7f42acc the base was read standalone (as the first This is slightly awkward grammar. "Prior to commit" is the more normal phrasing. > field of pe32_opt_hdr). However

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

2025-04-01 Thread Orzel, Michal
On 01/04/2025 14:57, Bertrand Marquis wrote: > > > Hi Michal, > >> On 1 Apr 2025, at 11: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_s

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

2025-04-01 Thread Orzel, Michal
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 2025, at 16:22, Orzel, Michal wrote: On 01/04/2025 14:57, Bertrand

Re: [PATCH v2 04/11] x86/mkreloc: print the linear address of relocations to read-only sections

2025-04-01 Thread Jan Beulich
On 01.04.2025 15:08, Roger Pau Monne wrote: > --- a/xen/arch/x86/efi/mkreloc.c > +++ b/xen/arch/x86/efi/mkreloc.c > @@ -270,8 +270,9 @@ static void diff_sections(const unsigned char *ptr1, > const unsigned char *ptr2, > > if ( !(sec->flags & IMAGE_SCN_MEM_WRITE) ) > fprintf

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

2025-04-01 Thread Jan Beulich
On 26.03.2025 06:50, Penny Zheng wrote: > --- a/xen/common/Makefile > +++ b/xen/common/Makefile > @@ -69,7 +69,7 @@ obj-$(CONFIG_COMPAT) += $(addprefix compat/,domain.o > memory.o multicall.o xlat.o > ifneq ($(CONFIG_PV_SHIM_EXCLUSIVE),y) > obj-y += domctl.o > obj-$(CONFIG_VM_EVENT) += monitor.

[PATCH v2 05/11] xen: remove -N from the linker command line

2025-04-01 Thread Roger Pau Monne
It's unclear why -N is being used in the first place. It was added by commit 4676bbf96dc8 back in 2002 without any justification. When building a PE image it's actually detrimental to forcefully set the .text section as writable. The GNU LD man page contains the following warning regarding the -

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

2025-04-01 Thread Jason Andryuk
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 endif +obj-y += domain-builder/ The set of subdirs needed i