Re: [PATCH 13/19] xen/dt: Move bootinfo functions to a new bootinfo.h

2025-05-30 Thread Stefano Stabellini
On Fri, 30 May 2025, Alejandro Vallejo wrote: > Part of an unpicking process to extract bootfdt contents independent of > bootinfo to a separate file for x86 to take. > > With this, bootfdt.h can be cleanly included from x86. A later patch > extracts the definitions so the functions may be called

Re: [PATCH 12/19] xen/dt: Move bootfdt functions to xen/bootfdt.h

2025-05-30 Thread Stefano Stabellini
On Fri, 30 May 2025, Alejandro Vallejo wrote: > Part of an unpicking process to extract bootfdt contents independent of > bootinfo > to a separate file for x86 to take. > > Move functions required for early FDT parsing from device_tree.h and arm's > setup.h onto bootfdt.h > > Declaration motion

[PATCH v2 1/1] kern/xen: Add Xen command line parsing

2025-05-30 Thread Aaron Rainbolt
Xen traditionally allows customizing guest behavior by passing arguments to the VM kernel via the kernel command line. This is no longer possible when using GRUB with Xen, as the kernel command line is decided by the GRUB configuration file within the guest, not data passed to the guest by Xen. To

Re: [PATCH 14/19] xen/dt: Rename bootfdt.c -> bootinfo-fdt.c

2025-05-30 Thread Stefano Stabellini
On Fri, 30 May 2025, Alejandro Vallejo wrote: > This file will eventually contain bootfdt helpers that make heavy use of > bootinfo. To simplify git history do the rename here explicitly. A later > patch extracts bootinfo-independent helpers into bootfdt.c. > > Doing so here would needlessly pollu

[PATCH v2 0/1] Xen: Add Xen command line parsing

2025-05-30 Thread Aaron Rainbolt
The purpose of this patch is to allow the Xen hypervisor to pass extra data to GRUB in the form of a kernel command line, allowing the host to customize the boot process of the guest. The command line from Xen is parsed, and any variables within that start with the string `xen_grub_env_` are expose

Re: [PATCH 16/19] xen/dt: Extract helper to map nodes to module kinds

2025-05-30 Thread Stefano Stabellini
On Fri, 30 May 2025, Alejandro Vallejo wrote: > This will be required later by x86 code in order to do early identification > of boot modules when booting off a DTB. > > Not a functional change. > > Signed-off-by: Alejandro Vallejo Reviewed-by: Stefano Stabellini > --- > xen/common/device-t

Re: [PATCH 04/19] xen: Add missing forward declaration to btcpupools_get_domain_pool_id

2025-05-30 Thread Stefano Stabellini
On Fri, 30 May 2025, Alejandro Vallejo wrote: > And remove the ifdef guard, as it's inconsequential. > > Signed-off-by: Alejandro Vallejo > --- > xen/include/xen/sched.h | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/xen/include/xen/sched.h b/xen/include/xen/sc

Re: [PATCH 06/19] xen: Clean up asm-generic/device.h

2025-05-30 Thread Stefano Stabellini
On Fri, 30 May 2025, Alejandro Vallejo wrote: > There's some pretense this header may be used without > CONFIG_HAS_DEVICE_TREE, but that's just wishful thinking. Only x86 lacks > that option, and it fully overrides this header, typedeffing struct > pci_dev to be device_t. > > Furthermore there's a

Re: [PATCH 07/19] arm/gnttab: Break cycle between asm/grant_table.h and xen/grant_table.h

2025-05-30 Thread Stefano Stabellini
On Fri, 30 May 2025, Jason Andryuk wrote: > On 2025-05-30 08:02, Alejandro Vallejo wrote: > > xen/grant_table is meant to pull asm/grant_table, when it exists. > > > > Signed-off-by: Alejandro Vallejo > > I think you can also remove this one: > xen/arch/arm/dom0less-build.c:#include > > With t

Re: [PATCH v4 2/2] xen/domain: rewrite emulation_flags_ok()

2025-05-30 Thread Teddy Astie
Hello, Le 31/05/2025 à 00:05, dm...@proton.me a écrit : > +/* PVH dom0/domU or HVM domU */ This one is actually PVH dom0. > +{ > +.caps = CAP_HVM | CAP_HWDOM, > +.min= X86_EMU_LAPIC | X86_EMU_IOAPIC | X86_EMU_VPCI, > +.opt= 0, > +

Re: [PATCH 15/19] xen/dt: Move bootinfo-independent helpers out of bootinfo-fdt.c

2025-05-30 Thread dmkhn
On Fri, May 30, 2025 at 02:02:23PM +0200, Alejandro Vallejo wrote: > ... back into bootfdt.c > > These will be required by x86 later on to detect modules in the early scan of > the FDT. They are independent of bootinfo, so it's cleaner for them to exist > in > a separate file. > > Not a function

[PATCH v1 2/2] xen/console: unify printout behavior for UART emulators

2025-05-30 Thread dmkhn
From: Denis Mukhin If virtual UART from domain X prints on the physical console, the behavior is updated to (see [1]): - console focus in domain X: do not prefix messages; - no console focus in domain X: prefix all messages with "(dX)". Use guest_printk() in all current in-hypervisor UART emulat

[PATCH v1 0/2] xen/console: updates to diagnostic messages prefixes

2025-05-30 Thread dmkhn
Patch 1 is purely cosmetic change, adds a symbol for hypervisor's messages. Patch 2 updates the logic how the domain prefix is formed. [1] Link to CI: https://gitlab.com/xen-project/people/dmukhin/xen/-/pipelines/1845446760 Denis Mukhin (2): xen/console: introduce CONSOLE_PREFIX xen/console

[PATCH v1 1/2] xen/console: introduce CONSOLE_PREFIX

2025-05-30 Thread dmkhn
From: Denis Mukhin Add CONSOLE_PREFIX symbol to keep the prefix of the hypervisor's diagnostic messages. No functional change. Signed-off-by: Denis Mukhin --- xen/drivers/char/console.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xen/drivers/char/console.c b/xen

Re: [PATCH 05/19] arm: Remove dependencies with membank(s) definitions from setup.h

2025-05-30 Thread Stefano Stabellini
On Fri, 30 May 2025, Alejandro Vallejo wrote: > ... as they can be forward-declared changing arrays for pointers in the > function > declarations. > > No functional change. > > Signed-off-by: Alejandro Vallejo > --- > xen/arch/arm/include/asm/setup.h | 10 ++ > 1 file changed, 6 insert

Re: [PATCH 03/19] riscv: Add missing forward declaration to intc.h

2025-05-30 Thread Stefano Stabellini
On Fri, 30 May 2025, Alejandro Vallejo wrote: > Very much not a functional change > > Signed-off-by: Alejandro Vallejo Reviewed-by: Stefano Stabellini > --- > xen/arch/riscv/include/asm/intc.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/xen/arch/riscv/include/asm/intc.h > b/

Re: [PATCH 02/19] x86: Add missing pci_dev forward declaration in asm/pci.h

2025-05-30 Thread Stefano Stabellini
On Fri, 30 May 2025, Alejandro Vallejo wrote: > Not a functional change. > > Signed-off-by: Alejandro Vallejo Reviewed-by: Stefano Stabellini > --- > xen/arch/x86/include/asm/pci.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/xen/arch/x86/include/asm/pci.h b/xen/arch/x86/includ

Re: [PATCH 08/19] xen/dt: Add BOOTMOD_MICROCODE

2025-05-30 Thread Stefano Stabellini
On Fri, 30 May 2025, Alejandro Vallejo wrote: > In preparation for x86 to start using bootmodule instead of boot_module > > Signed-off-by: Alejandro Vallejo Reviewed-by: Stefano Stabellini > --- > xen/common/device-tree/bootinfo.c | 1 + > xen/include/xen/bootfdt.h | 1 + > 2 files c

Re: [PATCH 09/19] x86: Preinitialise all modules to be of kind BOOTMOD_UNKNOWN

2025-05-30 Thread Stefano Stabellini
On Fri, 30 May 2025, Alejandro Vallejo wrote: > A later patch removes boot_module and replaces its uses with bootmodule. > The equivalent field for "type" doesn't have BOOTMOD_UNKNOWN as a zero > value, so it must be explicitly set in the static xen_boot_info. > > Not a functional change. > > Sig

Re: [PATCH v4 3/4] xen/console: remove max_init_domid dependency

2025-05-30 Thread dmkhn
On Thu, May 29, 2025 at 05:58:20PM -0700, Stefano Stabellini wrote: > On Thu, 29 May 2025, dm...@proton.me wrote: > > From: Denis Mukhin > > > > From: Denis Mukhin > > > > The physical console input rotation depends on max_init_domid symbol, which > > is > > managed differently across architectu

Re: [PATCH 07/19] arm/gnttab: Break cycle between asm/grant_table.h and xen/grant_table.h

2025-05-30 Thread Jason Andryuk
On 2025-05-30 08:02, Alejandro Vallejo wrote: xen/grant_table is meant to pull asm/grant_table, when it exists. Signed-off-by: Alejandro Vallejo I think you can also remove this one: xen/arch/arm/dom0less-build.c:#include With that, Reviewed-by: Jason Andryuk Regards, Jason

Re: [PATCH 02/19] x86: Add missing pci_dev forward declaration in asm/pci.h

2025-05-30 Thread Jason Andryuk
On 2025-05-30 08:02, Alejandro Vallejo wrote: Not a functional change. Signed-off-by: Alejandro Vallejo Some sort of reason would be good in the commit message. "struct pci_dev is used in function prototypes within the header. This is in preparation for including (transitively) in device t

Re: [PATCH 12/19] xen/dt: Move bootfdt functions to xen/bootfdt.h

2025-05-30 Thread dmkhn
On Fri, May 30, 2025 at 02:02:20PM +0200, Alejandro Vallejo wrote: > Part of an unpicking process to extract bootfdt contents independent of > bootinfo > to a separate file for x86 to take. > > Move functions required for early FDT parsing from device_tree.h and arm's > setup.h onto bootfdt.h >

Re: [PATCH 10/19] x86: Replace boot_module with bootmodule

2025-05-30 Thread Stefano Stabellini
On Fri, 30 May 2025, Alejandro Vallejo wrote: > These types resemble each other very closely in layout and intent, and > with "struct bootmodule" already in common code it makes perfect sense > to merge them. In order to do so, add an arch-specific area for > x86-specific tidbits. > > Signed-off-b

Re: [PATCH 12/19] xen/dt: Move bootfdt functions to xen/bootfdt.h

2025-05-30 Thread Stefano Stabellini
On Fri, 30 May 2025, Alejandro Vallejo wrote: > Part of an unpicking process to extract bootfdt contents independent of > bootinfo > to a separate file for x86 to take. > > Move functions required for early FDT parsing from device_tree.h and arm's > setup.h onto bootfdt.h > > Declaration motion

Re: [PATCH 15/19] xen/dt: Move bootinfo-independent helpers out of bootinfo-fdt.c

2025-05-30 Thread Stefano Stabellini
On Fri, 30 May 2025, Alejandro Vallejo wrote: > ... back into bootfdt.c > > These will be required by x86 later on to detect modules in the early scan of > the FDT. They are independent of bootinfo, so it's cleaner for them to exist > in > a separate file. > > Not a functional change. > > Signe

[PATCH v5 3/4] xen/console: remove max_init_domid dependency

2025-05-30 Thread dmkhn
From: Denis Mukhin The physical console input rotation depends on max_init_domid symbol, which is managed differently across architectures. Instead of trying to manage max_init_domid in the arch-common code the console input rotation code can be reworked by removing dependency on max_init_domid

[PATCH v5 2/4] xen/console: introduce console input permission

2025-05-30 Thread dmkhn
From: Denis Mukhin Add new flag to domain structure for marking permission to intercept the physical console input by the domain. Update console input switch logic accordingly. No functional change intended. Signed-off-by: Denis Mukhin --- Changes since v4: - kept input_allowed as a separate

[PATCH v5 1/4] xen/console: rename switch_serial_input() to console_switch_input()

2025-05-30 Thread dmkhn
From: Denis Mukhin Update the function name as per naming notation in the console driver. No functional change. Signed-off-by: Denis Mukhin Acked-by: Jan Beulich --- Changes since v4: - kept A-b --- xen/drivers/char/console.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff

[PATCH v5 4/4] xen/console: rename console_rx to console_domid

2025-05-30 Thread dmkhn
From: Denis Mukhin Update the symbol name to match the code better. No functional change. Signed-off-by: Denis Mukhin --- xen/drivers/char/console.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c index 3

[PATCH v5 0/4] xen/console: cleanup console input switch logic

2025-05-30 Thread dmkhn
The patch series originates from the NS16550 UART emulator series [1] (x86) which requires ability to switch physical console input to a PVH/HVM domain with an emulated UART. Currently, on x86, console input can be rotated in round-robin manner only between dom0, PV shim, and Xen itself. On Arm th

[PATCH v3 06/22] xen/arch/x86: reserve TXT memory during Slaunch

2025-05-30 Thread Sergii Dmytruk
From: Kacper Stojek TXT heap, SINIT and TXT private space are marked as reserved or unused in e820 to protect from unintended uses. Signed-off-by: Kacper Stojek Signed-off-by: Krystian Hebel Signed-off-by: Michał Żygowski Signed-off-by: Sergii Dmytruk --- xen/arch/x86/Makefile

[PATCH v3 11/22] x86/tpm.c: support extending PCRs of TPM2.0

2025-05-30 Thread Sergii Dmytruk
SHA1 and SHA256 are hard-coded here, but their support by the TPM is checked. Addition of event log for TPM2.0 will generalize the code further. Signed-off-by: Sergii Dmytruk --- xen/arch/x86/tpm.c | 464 +++-- 1 file changed, 452 insertions(+), 12 deleti

[PATCH v3 02/22] include/xen/slr-table.h: Secure Launch Resource Table definitions

2025-05-30 Thread Sergii Dmytruk
The file provides constants, structures and several helper functions for parsing SLRT. The data described by the structures is passed to Xen by a bootloader which initiated DRTM. Signed-off-by: Daniel P. Smith Signed-off-by: Ross Philipson Signed-off-by: Sergii Dmytruk --- xen/include/xen/slr

[PATCH v3 09/22] xen/lib: add implementation of SHA-1

2025-05-30 Thread Sergii Dmytruk
From: Krystian Hebel The code comes from [1] and is licensed under GPL-2.0 license. The initial version was a combination of: - include/crypto/sha1.h - include/crypto/sha1_base.h - lib/crypto/sha1.c - crypto/sha1_generic.c Changes: - includes, formatting, naming - renames and splicing of s

[PATCH v3 05/22] x86/boot/slaunch-early: early TXT checks and boot data retrieval

2025-05-30 Thread Sergii Dmytruk
From: Krystian Hebel The tests validate that important parts of memory are protected against DMA attacks, including Xen and MBI. Modules can be tested later, when it is possible to report issues to a user before invoking TXT reset. TPM event log validation is temporarily disabled due to an issue

[PATCH v3 14/22] x86/boot: choose AP stack based on APIC ID

2025-05-30 Thread Sergii Dmytruk
From: Krystian Hebel This is made as the first step of making parallel AP bring-up possible. It should be enough for pre-C code. Parallel AP bring-up is necessary because TXT by design releases all APs at once. In addition to that it reduces number of IPIs (and more importantly, delays between t

[PATCH v3 03/22] x86/boot: add MLE header and Secure Launch entry point

2025-05-30 Thread Sergii Dmytruk
From: Kacper Stojek Signed-off-by: Kacper Stojek Signed-off-by: Krystian Hebel Signed-off-by: Sergii Dmytruk --- docs/hypervisor-guide/x86/how-xen-boots.rst | 5 ++ xen/arch/x86/boot/head.S| 53 + 2 files changed, 58 insertions(+) diff --git a/docs/hy

[PATCH v3 16/22] x86/slaunch: process DRTM policy

2025-05-30 Thread Sergii Dmytruk
Go through entires in the DRTM policy of SLRT to hash and extend data that they describe into corresponding PCRs. Addresses are being zeroed on measuring platform-specific data to prevent measurements from changing when the only thing that has changed is an address. Addresses can vary due to boot

[PATCH v3 13/22] x86/tpm.c: implement event log for TPM2.0

2025-05-30 Thread Sergii Dmytruk
Signed-off-by: Sergii Dmytruk --- xen/arch/x86/include/asm/intel-txt.h | 33 ++ xen/arch/x86/tpm.c | 169 ++- 2 files changed, 175 insertions(+), 27 deletions(-) diff --git a/xen/arch/x86/include/asm/intel-txt.h b/xen/arch/x86/include/asm/intel-txt

[PATCH v3 21/22] x86/cpu: report SMX, TXT and SKINIT capabilities

2025-05-30 Thread Sergii Dmytruk
From: Michał Żygowski Report TXT capabilities so that dom0 can query the Intel TXT or AMD SKINIT support information using xl dmesg. Signed-off-by: Michał Żygowski Signed-off-by: Sergii Dmytruk --- xen/arch/x86/cpu/amd.c | 16 ++ xen/arch/x86/cpu/cpu.h | 1

[PATCH v3 22/22] MAINTAINERS: add a section for TrenchBoot Slaunch

2025-05-30 Thread Sergii Dmytruk
Signed-off-by: Sergii Dmytruk --- MAINTAINERS | 15 +++ 1 file changed, 15 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index c11b82eca9..5b1e67401a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -542,6 +542,21 @@ F: */configure F: */*.ac F: tools/ +TRENCHBOOT SECU

[PATCH v3 17/22] x86/acpi: disallow S3 on Secure Launch boot

2025-05-30 Thread Sergii Dmytruk
Secure Launch won't initiate DRTM on S3 resume (the code for starting DRTM is not part of Xen), so abort a request to perform S3 suspend to not lose the state of DRTM PCRs. Signed-off-by: Sergii Dmytruk --- xen/arch/x86/acpi/power.c | 8 1 file changed, 8 insertions(+) diff --git a/xen

[PATCH v3 20/22] x86/slaunch: support EFI boot

2025-05-30 Thread Sergii Dmytruk
When running on an EFI-enabled system, Xen needs to have access to Boot Services in order to initialize itself properly and reach a state in which a dom0 kernel can operate without issues. This means that DRTM must be started in the middle of Xen's initialization process. This effect is achieved

[PATCH v3 18/22] x86/boot/slaunch-early: find MBI and SLRT on AMD

2025-05-30 Thread Sergii Dmytruk
Use slr_entry_amd_info::boot_params_base on AMD with SKINIT to get MBI location. Another thing of interest is the location of SLRT which is bootloader's data after SKL. Signed-off-by: Krystian Hebel Signed-off-by: Sergii Dmytruk --- xen/arch/x86/boot/head.S | 38

[PATCH v3 10/22] x86/tpm.c: code for early hashing and extending PCRs (for TPM1.2)

2025-05-30 Thread Sergii Dmytruk
From: Krystian Hebel This file is built twice: for early 32b mode without paging to measure MBI and for 64b code to measure dom0 kernel and initramfs. Since MBI is small, the first case uses TPM to do the hashing. Kernel and initramfs on the other hand are too big, sending them to the TPM would t

[RFC PATCH v1 4/6] mm: Introduce arch_in_lazy_mmu_mode()

2025-05-30 Thread Ryan Roberts
Introduce new arch_in_lazy_mmu_mode() API, which returns true if the calling context is currently in lazy mmu mode or false otherwise. Each arch that supports lazy mmu mode must provide an implementation of this API. The API will shortly be used to prevent accidental lazy mmu mode nesting when per

[RFC PATCH v1 2/6] mm: Fix pte update and tlb maintenance ordering in migrate_vma_collect_pmd()

2025-05-30 Thread Ryan Roberts
migrate_vma_collect_pmd() was previously modifying ptes while in lazy mmu mode, then performing tlb maintenance for the modified ptes, then leaving lazy mmu mode. But any pte modifications during lazy mmu mode may be deferred until arch_leave_lazy_mmu_mode(), inverting the required ordering between

[PATCH v3 5/5] tools/golang: Regenerate bindings for trap_unmapped_accesses

2025-05-30 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Signed-off-by: Edgar E. Iglesias --- tools/golang/xenlight/helpers.gen.go | 6 ++ tools/golang/xenlight/types.gen.go | 1 + 2 files changed, 7 insertions(+) diff --git a/tools/golang/xenlight/helpers.gen.go b/tools/golang/xenlight/helpers.gen.go index 90846ea8e

[RFC PATCH v1 3/6] mm: Avoid calling page allocator from apply_to_page_range()

2025-05-30 Thread Ryan Roberts
Lazy mmu mode applies to the current task and permits pte modifications to be deferred and updated at a later time in a batch to improve performance. apply_to_page_range() calls its callback in lazy mmu mode and some of those callbacks call into the page allocator to either allocate or free pages.

[RFC PATCH v1 5/6] mm: Avoid calling page allocator while in lazy mmu mode

2025-05-30 Thread Ryan Roberts
Lazy mmu mode applies to the current task and permits pte modifications to be deferred and updated at a later time in a batch to improve performance. tlb_next_batch() is called in lazy mmu mode as follows: zap_pte_range arch_enter_lazy_mmu_mode do_zap_pte_range zap_present_ptes zap_p

[RFC PATCH v1 0/6] Lazy mmu mode fixes and improvements

2025-05-30 Thread Ryan Roberts
Hi All, I recently added support for lazy mmu mode on arm64. The series is now in Linus's tree so should be in v6.16-rc1. But during testing in linux-next we found some ugly corners (unexpected nesting). I was able to fix those issues by making the arm64 implementation more permissive (like the ot

[RFC PATCH v1 6/6] Revert "arm64/mm: Permit lazy_mmu_mode to be nested"

2025-05-30 Thread Ryan Roberts
Commit 491344301b25 ("arm64/mm: Permit lazy_mmu_mode to be nested") made the arm64 implementation of lazy_mmu_mode tolerant to nesting. But subsequent commits have fixed the core code to ensure that lazy_mmu_mode never gets nested (as originally intended). Therefore we can revert this commit and re

Re: [PATCH] xen/arm: vpsci: Fix typo in comment (SCCC changed to SSSC)

2025-05-30 Thread Mykola Kvach
Hi, @Michal Orzel On Fri, May 30, 2025 at 9:43 AM Orzel, Michal wrote: > > > > On 29/05/2025 21:40, Mykola Kvach wrote: > > From: Mykola Kvach > > > > Corrected a typo in a comment within vpsci.c: > NIT: use imperative mood in commit msg Thank you for pointing that out. I’ll correct it. > > >

[PATCH v3 12/22] x86/hvm: check for VMX in SMX if Slaunch is active

2025-05-30 Thread Sergii Dmytruk
From: Michał Żygowski Check whther IA32_FEATURE_CONTROL has the proper bits enabled to run VMX in SMX when slaunch is active. Signed-off-by: Michał Żygowski --- xen/arch/x86/hvm/vmx/vmcs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/a

[PATCH] tools/tests: Add install target for vPCI

2025-05-30 Thread Andrew Cooper
This lets it run automagically in CI. Signed-off-by: Andrew Cooper --- CC: Roger Pau Monné CC: Anthony PERARD --- tools/tests/vpci/Makefile | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/tests/vpci/Makefile b/tools/tests/vpci/Makefile index 62f21f341a01..9450f

Re: [RFC PATCH v1 0/6] Lazy mmu mode fixes and improvements

2025-05-30 Thread Lorenzo Stoakes
+cc Jann who is a specialist in all things page table-y and especially scary edge cases :) On Fri, May 30, 2025 at 03:04:38PM +0100, Ryan Roberts wrote: > Hi All, > > I recently added support for lazy mmu mode on arm64. The series is now in > Linus's tree so should be in v6.16-rc1. But during test

Re: [PATCH v2 1/3] xen/arm: Add way to disable traps on accesses to unmapped addresses

2025-05-30 Thread Julien Grall
On 29/05/2025 17:23, Edgar E. Iglesias wrote: On Thu, May 29, 2025 at 04:59:21PM +0100, Julien Grall wrote: Hi Edgar, Hi Julien, On 29/05/2025 16:50, Edgar E. Iglesias wrote: From: "Edgar E. Iglesias" Add a per-domain way to optionally disable traps for accesses to unmapped addresses

[PATCH] vmx: Introduce vcpu single context VPID invalidation

2025-05-30 Thread Teddy Astie
Introduce vpid_sync_vcpu_context to do a single-context invalidation on the vpid attached to the vcpu as a alternative to per-gva and all-contexts invlidations. Signed-off-by: Teddy Astie --- Extracted from SEV series. This will be used for instance in fixed-ASID patches (in SEV series). --- xen

Re: [PATCH v3 08/13] sched/wait: Add a waitqueue helper for fully exclusive priority waiters

2025-05-30 Thread K Prateek Nayak
Hello Sean, On 5/23/2025 5:22 AM, Sean Christopherson wrote: Add a waitqueue helper to add a priority waiter that requires exclusive wakeups, i.e. that requires that it be the _only_ priority waiter. The API will be used by KVM to ensure that at most one of KVM's irqfds is bound to a single eve

Re: [PATCH v3 00/13] KVM: Make irqfd registration globally unique

2025-05-30 Thread K Prateek Nayak
Hello Sean, On 5/23/2025 5:22 AM, Sean Christopherson wrote: Non-KVM folks, I am hoping to route this through the KVM tree (6.17 or later), as the non-KVM changes should be glorified nops. Please holler if you object to that idea. I've tested this series with the selftests and also ran KVM u

[PATCH] x86/svm: Move svm_domain structure to svm.h

2025-05-30 Thread Teddy Astie
struct svm_domain was in vmcb.h which is meant for VMCB specific operations and constants, move it to svm.h where it belongs. Signed-off-by: Teddy Astie --- xen/arch/x86/include/asm/hvm/domain.h | 1 + xen/arch/x86/include/asm/hvm/svm/svm.h | 11 +++ xen/arch/x86/include/asm/hvm/svm/

[PATCH] x86/hvmloader: don't set xenpci MMIO BAR as UC in MTRR

2025-05-30 Thread Roger Pau Monne
The Xen PCI device (vendor ID 0x5853) exposed to x86 HVM guests doesn't have the functionality of a traditional PCI device. The exposed MIO BAR is used by some guests (including Linux) as a safe place to map foreign memory, including the grant table itself. Traditionally BARs from devices have th

Re: [PATCH] x86/hvmloader: don't set xenpci MMIO BAR as UC in MTRR

2025-05-30 Thread Anthoine Bourgeois
On Fri, May 30, 2025 at 11:23:14AM +0200, Roger Pau Monne wrote: The Xen PCI device (vendor ID 0x5853) exposed to x86 HVM guests doesn't have the functionality of a traditional PCI device. The exposed MIO BAR is used by some guests (including Linux) as a safe place to map foreign memory, includi

Re: [RFC PATCH v1 3/6] mm: Avoid calling page allocator from apply_to_page_range()

2025-05-30 Thread Liam R. Howlett
* Ryan Roberts [250530 10:05]: > Lazy mmu mode applies to the current task and permits pte modifications > to be deferred and updated at a later time in a batch to improve > performance. apply_to_page_range() calls its callback in lazy mmu mode > and some of those callbacks call into the page allo

Re: [RFC PATCH v1 1/6] fs/proc/task_mmu: Fix pte update and tlb maintenance ordering in pagemap_scan_pmd_entry()

2025-05-30 Thread Ryan Roberts
On 30/05/2025 17:26, Jann Horn wrote: > On Fri, May 30, 2025 at 4:04 PM Ryan Roberts wrote: >> pagemap_scan_pmd_entry() was previously modifying ptes while in lazy mmu >> mode, then performing tlb maintenance for the modified ptes, then >> leaving lazy mmu mode. But any pte modifications during la

Re: [RFC PATCH v1 1/6] fs/proc/task_mmu: Fix pte update and tlb maintenance ordering in pagemap_scan_pmd_entry()

2025-05-30 Thread Jann Horn
On Fri, May 30, 2025 at 6:45 PM Ryan Roberts wrote: > On 30/05/2025 17:26, Jann Horn wrote: > > On Fri, May 30, 2025 at 4:04 PM Ryan Roberts wrote: > >> pagemap_scan_pmd_entry() was previously modifying ptes while in lazy mmu > >> mode, then performing tlb maintenance for the modified ptes, then

Re: [RFC PATCH v1 3/6] mm: Avoid calling page allocator from apply_to_page_range()

2025-05-30 Thread Ryan Roberts
On 30/05/2025 17:23, Liam R. Howlett wrote: > * Ryan Roberts [250530 10:05]: >> Lazy mmu mode applies to the current task and permits pte modifications >> to be deferred and updated at a later time in a batch to improve >> performance. apply_to_page_range() calls its callback in lazy mmu mode >> a

Re: [PATCH v4 2/4] xen/console: introduce console input permission

2025-05-30 Thread Stefano Stabellini
On Fri, 30 May 2025, dm...@proton.me wrote: > On Thu, May 29, 2025 at 05:58:00PM -0700, Stefano Stabellini wrote: > > On Thu, 29 May 2025, dm...@proton.me wrote: > > > Add new flag to domain structure for marking permission to intercept > > > the physical console input by the domain. > > > > > > Up

[PATCH v3 08/22] x86/slaunch: restore boot MTRRs after Intel TXT DRTM

2025-05-30 Thread Sergii Dmytruk
From: Krystian Hebel In preparation for TXT SENTER call, GRUB had to modify MTRR settings to be UC for everything except SINIT ACM. Old values are restored from SLRT where they were saved by the bootloader. Signed-off-by: Krystian Hebel Signed-off-by: Michał Żygowski Signed-off-by: Sergii Dmyt

Re: [RFC PATCH v1 0/6] Lazy mmu mode fixes and improvements

2025-05-30 Thread Ryan Roberts
On 30/05/2025 15:47, Lorenzo Stoakes wrote: > +cc Jann who is a specialist in all things page table-y and especially scary > edge cases :) > > On Fri, May 30, 2025 at 03:04:38PM +0100, Ryan Roberts wrote: >> Hi All, >> >> I recently added support for lazy mmu mode on arm64. The series is now in >>

Re: [RFC PATCH v1 1/6] fs/proc/task_mmu: Fix pte update and tlb maintenance ordering in pagemap_scan_pmd_entry()

2025-05-30 Thread Jann Horn
On Fri, May 30, 2025 at 4:04 PM Ryan Roberts wrote: > pagemap_scan_pmd_entry() was previously modifying ptes while in lazy mmu > mode, then performing tlb maintenance for the modified ptes, then > leaving lazy mmu mode. But any pte modifications during lazy mmu mode > may be deferred until arch_le

[RFC PATCH v1 1/6] fs/proc/task_mmu: Fix pte update and tlb maintenance ordering in pagemap_scan_pmd_entry()

2025-05-30 Thread Ryan Roberts
pagemap_scan_pmd_entry() was previously modifying ptes while in lazy mmu mode, then performing tlb maintenance for the modified ptes, then leaving lazy mmu mode. But any pte modifications during lazy mmu mode may be deferred until arch_leave_lazy_mmu_mode(), inverting the required ordering between

Re: [PATCH] tools/tests: Add install target for vPCI

2025-05-30 Thread Roger Pau Monné
On Fri, May 30, 2025 at 11:43:07AM +0100, Andrew Cooper wrote: > This lets it run automagically in CI. > > Signed-off-by: Andrew Cooper Acked-by: Roger Pau Monné I had sent something similar long time ago: https://lore.kernel.org/xen-devel/20230313121226.86557-1-roger@citrix.com/ But got

[PATCH 04/19] xen: Add missing forward declaration to btcpupools_get_domain_pool_id

2025-05-30 Thread Alejandro Vallejo
And remove the ifdef guard, as it's inconsequential. Signed-off-by: Alejandro Vallejo --- xen/include/xen/sched.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index 559d201e0c..b5a6a22c7f 100644 --- a/xen/include/xe

[PATCH 11/19] x86: Replace boot_domain with kernel_info

2025-05-30 Thread Alejandro Vallejo
kernel_info and boot_domain serve basically the same role. Unify them so they can be used in common code for domain building purposes across all architectures. kernel_info has a lot of fields x86 doesn't care about, but riscv and arm do. Hence rather than moving them to the arch-specific files, x8

[PATCH 00/19] Allow x86 to unflatten DTs

2025-05-30 Thread Alejandro Vallejo
This is the aftermath of this discussion: https://lore.kernel.org/xen-devel/da1wwruqlcag.ztvr1hxj8...@amd.com/https://lore.kernel.org/xen-devel/da1wwruqlcag.ztvr1hxj8...@amd.com/ It's a first round of cleanup and preparation to have a much easier time later when integrating dom0less boot into

[PATCH 06/19] xen: Clean up asm-generic/device.h

2025-05-30 Thread Alejandro Vallejo
There's some pretense this header may be used without CONFIG_HAS_DEVICE_TREE, but that's just wishful thinking. Only x86 lacks that option, and it fully overrides this header, typedeffing struct pci_dev to be device_t. Furthermore there's an include for xen/device_tree.h halfway through the header

[PATCH 07/19] arm/gnttab: Break cycle between asm/grant_table.h and xen/grant_table.h

2025-05-30 Thread Alejandro Vallejo
xen/grant_table is meant to pull asm/grant_table, when it exists. Signed-off-by: Alejandro Vallejo --- xen/arch/arm/domain_build.c| 1 - xen/arch/arm/include/asm/grant_table.h | 1 - xen/include/xen/grant_table.h | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff

[PATCH 03/19] riscv: Add missing forward declaration to intc.h

2025-05-30 Thread Alejandro Vallejo
Very much not a functional change Signed-off-by: Alejandro Vallejo --- xen/arch/riscv/include/asm/intc.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/arch/riscv/include/asm/intc.h b/xen/arch/riscv/include/asm/intc.h index 52ba196d87..81f74736ba 100644 --- a/xen/arch/riscv/include/a

[PATCH 05/19] arm: Remove dependencies with membank(s) definitions from setup.h

2025-05-30 Thread Alejandro Vallejo
... as they can be forward-declared changing arrays for pointers in the function declarations. No functional change. Signed-off-by: Alejandro Vallejo --- xen/arch/arm/include/asm/setup.h | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/include/asm/setu

[PATCH 02/19] x86: Add missing pci_dev forward declaration in asm/pci.h

2025-05-30 Thread Alejandro Vallejo
Not a functional change. Signed-off-by: Alejandro Vallejo --- xen/arch/x86/include/asm/pci.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/arch/x86/include/asm/pci.h b/xen/arch/x86/include/asm/pci.h index bed99437cc..2e67cba8b9 100644 --- a/xen/arch/x86/include/asm/pci.h +++ b/xen/ar

[PATCH 13/19] xen/dt: Move bootinfo functions to a new bootinfo.h

2025-05-30 Thread Alejandro Vallejo
Part of an unpicking process to extract bootfdt contents independent of bootinfo to a separate file for x86 to take. With this, bootfdt.h can be cleanly included from x86. A later patch extracts the definitions so the functions may be called too. Not a functional change. Signed-off-by: Alejandro

[PATCH 15/19] xen/dt: Move bootinfo-independent helpers out of bootinfo-fdt.c

2025-05-30 Thread Alejandro Vallejo
... back into bootfdt.c These will be required by x86 later on to detect modules in the early scan of the FDT. They are independent of bootinfo, so it's cleaner for them to exist in a separate file. Not a functional change. Signed-off-by: Alejandro Vallejo --- xen/common/device-tree/Makefile

[PATCH 17/19] xen/dt: ifdef out DEV_DT-related bits from device_tree.{c,h}

2025-05-30 Thread Alejandro Vallejo
... which means, device-tree.c stops requiring strictly CONFIG_HAS_DEVICE_TREE and may function without it. Not a functional change on architectures that currently use these files, as they already select CONFIG_HAS_DEVICE_TREE. Signed-off-by: Alejandro Vallejo --- xen/common/device-tree/device-

[PATCH 09/19] x86: Preinitialise all modules to be of kind BOOTMOD_UNKNOWN

2025-05-30 Thread Alejandro Vallejo
A later patch removes boot_module and replaces its uses with bootmodule. The equivalent field for "type" doesn't have BOOTMOD_UNKNOWN as a zero value, so it must be explicitly set in the static xen_boot_info. Not a functional change. Signed-off-by: Alejandro Vallejo --- xen/arch/x86/setup.c | 1

Re: [PATCH 01/19] licence: Add missing SPDX line to bootfdt.h

2025-05-30 Thread Orzel, Michal
On 30/05/2025 14:02, Alejandro Vallejo wrote: > Signed-off-by: Alejandro Vallejo > --- > xen/include/xen/bootfdt.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/xen/include/xen/bootfdt.h b/xen/include/xen/bootfdt.h > index 80a90e53c0..847f019559 100644 > --- a/xen/include/xen/bootf

Re: [PATCH] tools: Add install/uninstall targets to tests/x86_emulator

2025-05-30 Thread Andrew Cooper
On 21/05/2025 8:06 am, Jan Beulich wrote: > On 20.05.2025 23:02, Andrew Cooper wrote: >> On 16/05/2024 12:07 pm, Alejandro Vallejo wrote: >>> Bring test_x86_emulator in line with other tests by adding >>> install/uninstall rules. >>> >>> Signed-off-by: Alejandro Vallejo >>> --- >>> tools/tests/x8

Re: [PATCH v3 02/14] xen/riscv: introduce support of Svpbmt extension and make it mandatory

2025-05-30 Thread Oleksii Kurochko
On 5/22/25 9:26 AM, Jan Beulich wrote: On 21.05.2025 18:03, Oleksii Kurochko wrote: Svpbmt extension is necessary for chaning the memory type for a page contains a combination of attributes that indicate the cacheability, idempotency, and ordering properties for access to that page. As a part

[PATCH v3 00/22] x86: Trenchboot Secure Launch DRTM (Xen)

2025-05-30 Thread Sergii Dmytruk
The aim of the [TrenchBoot] project is to provide an implementation of DRTM that is generic enough to cover various use cases: - Intel TXT and AMD SKINIT on x86 CPUs - legacy and UEFI boot - TPM1.2 and TPM2.0 - (in the future) DRTM on Arm CPUs DRTM is a version of a measured launch that starts

[PATCH v3 15/22] x86/smpboot.c: TXT AP bringup

2025-05-30 Thread Sergii Dmytruk
From: Krystian Hebel On Intel TXT, APs are started in one of two ways, depending on ACM which reports it in its information table. In both cases, all APs are started simultaneously after BSP requests them to do so. Two possible ways are: - GETSEC[WAKEUP] instruction, - MONITOR address. GETSEC[WA

Re: [PATCH] x86/svm: Move svm_domain structure to svm.h

2025-05-30 Thread Andrew Cooper
On 30/05/2025 9:53 am, Teddy Astie wrote: > struct svm_domain was in vmcb.h which is meant for VMCB specific operations > and > constants, move it to svm.h where it belongs. > > Signed-off-by: Teddy Astie > --- > xen/arch/x86/include/asm/hvm/domain.h | 1 + > xen/arch/x86/include/asm/hvm/svm/

[PATCH 08/19] xen/dt: Add BOOTMOD_MICROCODE

2025-05-30 Thread Alejandro Vallejo
In preparation for x86 to start using bootmodule instead of boot_module Signed-off-by: Alejandro Vallejo --- xen/common/device-tree/bootinfo.c | 1 + xen/include/xen/bootfdt.h | 1 + 2 files changed, 2 insertions(+) diff --git a/xen/common/device-tree/bootinfo.c b/xen/common/device-tre

Re: [RFC PATCH v1 3/6] mm: Avoid calling page allocator from apply_to_page_range()

2025-05-30 Thread Liam R. Howlett
* Ryan Roberts [250530 12:50]: ... > > > > > > These wrappers are terrible for readability and annoying for argument > > lists too. > > Agreed. > > > > > Could we do something like the pgtbl_mod_mask or zap_details and pass > > through a struct or one unsigned int for create and lazy_mmu? >

Re: [PATCH v6 2/6] xen/arm: ffa: Rework partinfo_get implementation

2025-05-30 Thread Julien Grall
Hi Bertrand, On 22/05/2025 16:08, Bertrand Marquis wrote: This patch is in preparation for VM to VM support in order to do the changes on the SP handling part of partinfo_get before adding support for the VM part. This patches is doing the following changes: - split partinfo_get into 3 function

Re: [PATCH] BCM2711 reboot fix

2025-05-30 Thread Julien Grall
Hi Evgeny, Thank you for the patch. Let me start with the process, patches are submitted inline rather than in attachment. git-send-email commmand can do that for you. Now regarding the patch. I understand that newer kernel will use the new compatible. But I would assume there is still some dev

Re: [PATCH v6 3/6] xen/arm: ffa: Introduce VM to VM support

2025-05-30 Thread Julien Grall
Hi Bertrand, On 22/05/2025 16:08, Bertrand Marquis wrote: diff --git a/xen/arch/arm/tee/ffa_partinfo.c b/xen/arch/arm/tee/ffa_partinfo.c index dfa0b23eaf38..66ea1860e97a 100644 --- a/xen/arch/arm/tee/ffa_partinfo.c +++ b/xen/arch/arm/tee/ffa_partinfo.c @@ -150,6 +150,67 @@ out: return ret;

Re: [PATCH v6 4/6] xen/arm: ffa: Add buffer full notification support

2025-05-30 Thread Julien Grall
Hi Bertrand, On 22/05/2025 16:08, Bertrand Marquis wrote: Add support to raise a Rx buffer full notification to a VM. This function will be used for indirect message support between VM and is only activated if CONFIG_FFA_VM_TO_VM is selected. Even if there are 32 framework notifications possibl

Re: [PATCH] tools/tests: Add install target for vPCI

2025-05-30 Thread Roger Pau Monné
On Fri, May 30, 2025 at 01:29:49PM +0100, Andrew Cooper wrote: > On 30/05/2025 11:57 am, Roger Pau Monné wrote: > > On Fri, May 30, 2025 at 11:43:07AM +0100, Andrew Cooper wrote: > >> This lets it run automagically in CI. > >> > >> Signed-off-by: Andrew Cooper > > Acked-by: Roger Pau Monné > > >

[PATCH] xen/arm64: head: document missing input registers for MMU functions

2025-05-30 Thread Mykola Kvach
From: Mykola Kvach Add missing input register descriptions to enable_secondary_cpu_mm and enable_boot_cpu_mm functions. Specifically: - x19 is used in enable_boot_cpu_mm as physical start address. - x20 is used in both functions for physical offset passed to load_paddr. This update improves cod

  1   2   >