Re: [RFC PATCH v1 05/10] pmu.h: introduce a stacktrace area

2025-08-04 Thread Andriy Sultanov
On 7/25/25 5:07 PM, Edwin Török wrote: > diff --git a/xen/arch/x86/cpu/vpmu_amd.c b/xen/arch/x86/cpu/vpmu_amd.c > index a6117dfebf..024d0c1eb7 100644 > --- a/xen/arch/x86/cpu/vpmu_amd.c > +++ b/xen/arch/x86/cpu/vpmu_amd.c > @@ -543,7 +543,7 @@ static const struct arch_vpmu_ops *__init > common_in

RE: [PATCH v6 11/19] xen/x86: introduce "cpufreq=amd-cppc" xen cmdline and amd-cppc driver

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

[PATCH v4 0/2] kern/xen: Add Xen command line parsing

2025-08-04 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

[PATCH v4 2/2] kern/xen: Add Xen command line parsing

2025-08-04 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

[PATCH v4 1/2] include/xen: Rename MAX_GUEST_CMDLINE to GRUB_XEN_MAX_GUEST_CMDLINE

2025-08-04 Thread Aaron Rainbolt
The xen.h header was using an overly generic name to refer to the maximum length of the command line passed from Xen to a guest. Rename it to avoid confusion or conflicts in the future. Signed-off-by: Aaron Rainbolt --- include/xen/xen.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH v10 3/4] vpci/msi: Free MSI resources when init_msi() fails

2025-08-04 Thread Jiqian Chen
When init_msi() fails, current logic return fail and free MSI-related resources in vpci_deassign_device(). But the previous new changes will hide MSI capability and return success, it can't reach vpci_deassign_device() to remove resources if hiding success, so those resources must be removed in cle

[PATCH v10 1/4] vpci: Refactor vpci_remove_register to remove matched registers

2025-08-04 Thread Jiqian Chen
vpci_remove_register() only supports removing a register in a time, but the follow-on changes need to remove all registers within a range. So, refactor it to support removing all registers in a given region. And it is no issue to remove a non exist register, so remove the __must_check prefix. Not

RE: [PATCH v1 01/25] xen/x86: move domctl.o out of PV_SHIM_EXCLUSIVE

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

[PATCH v10 4/4] vpci/msix: Free MSIX resources when init_msix() fails

2025-08-04 Thread Jiqian Chen
When MSI-X initialization fails vPCI will hide the capability, but remove of handlers and data won't be performed until the device is deassigned. Introduce a MSI-X cleanup hook that will be called when initialization fails to cleanup MSI-X related hooks and free it's associated data. As all suppo

[PATCH v10 2/4] vpci/rebar: Free Rebar resources when init_rebar() fails

2025-08-04 Thread Jiqian Chen
When init_rebar() fails, current logic return fail and free Rebar-related resources in vpci_deassign_device(). But the previous new changes will hide Rebar capability and return success, it can't reach vpci_deassign_device() to remove resources if hiding success, so those resources must be removed

[PATCH v10 0/4] Support hiding capability when its initialization fails

2025-08-04 Thread Jiqian Chen
Hi, This series is to emulate extended capability list for dom0; hide legacy and extended capability when its initialization fails; above two parts had been merged. remove all related registers and other resources when initializing capability fails, including patch #1, #2, #3, #4. Best regards,

Re: [PATCH v4 1/8] xen/domain: introduce common emulation flags

2025-08-04 Thread dmkhn
+ Cc: Oleskii On Mon, Aug 04, 2025 at 11:46:36AM +0200, Jan Beulich wrote: > On 31.07.2025 21:21, dm...@proton.me wrote: > > --- a/xen/include/xen/sched.h > > +++ b/xen/include/xen/sched.h > > @@ -652,6 +652,8 @@ struct domain > > unsigned int *llc_colors; > > #endif > > > > +uint32_t em

Re: [PATCH v1 12/16] xen/domain: introduce domain-emu.h

2025-08-04 Thread dmkhn
On Mon, Aug 04, 2025 at 09:13:07AM +0200, Jan Beulich wrote: > On 01.08.2025 21:30, dm...@proton.me wrote: > > On Fri, Aug 01, 2025 at 08:02:56AM +0200, Jan Beulich wrote: > >> On 31.07.2025 22:55, dm...@proton.me wrote: > >>> On Wed, Jul 09, 2025 at 04:57:44PM +0200, Jan Beulich wrote: > On 2

Re: [PATCH v2] xen: rework error handling in vcpu_create

2025-08-04 Thread Stewart Hildebrand
On 8/3/25 09:19, Andrew Cooper wrote: > On 01/08/2025 9:24 pm, Stewart Hildebrand wrote: >> In vcpu_create after scheduler data is allocated, if >> vmtrace_alloc_buffer fails, it will jump to the wrong cleanup label >> resulting in a memory leak. >> >> Move sched_destroy_vcpu and destroy_waitqueue_

Re: [PATCH] console: make printk_ratelimit_{burst,ms} const

2025-08-04 Thread dmkhn
On Mon, Aug 04, 2025 at 09:10:34AM +0200, Jan Beulich wrote: > On 01.08.2025 20:58, dm...@proton.me wrote: > > On Fri, Aug 01, 2025 at 09:30:34AM +0200, Jan Beulich wrote: > >> Them not being altered by any means, their __read_mostly attribute is > >> actually counter-productive: It causes the comp

Re: [RESEND PATCH v3 1/1] kern/xen: Add Xen command line parsing

2025-08-04 Thread Aaron Rainbolt
On Mon, 4 Aug 2025 17:17:43 +0200 Daniel Kiper wrote: > On Sun, Aug 03, 2025 at 10:57:03AM -0500, Aaron Rainbolt wrote: > > On Fri, 1 Aug 2025 14:55:36 +0200 Daniel Kiper > > wrote: > > > On Fri, Jul 25, 2025 at 03:31:12PM -0500, Aaron Rainbolt wrote: > > > > Xen traditionally allows customi

[ANNOUNCE] Call for agenda items for August 7, 2025 Community Call @ 15:00 UTC

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

[PATCH] misra: remove default case in single-clause switch

2025-08-04 Thread Dmytro Prokopchuk1
MISRA Rule 16.4: Every switch statement shall have a default label. The default clause must contain either a statement or a comment prior to its terminating break statement. However, there is a documented deviation for this rule in Xen: 'docs/misra/deviations.rst': * - R16.4 - A switch statement

Re: [PATCH v2] xen: rework error handling in vcpu_create

2025-08-04 Thread Stewart Hildebrand
On 8/4/25 03:57, Jan Beulich wrote: > On 01.08.2025 22:24, Stewart Hildebrand wrote: >> @@ -839,6 +839,9 @@ void sched_destroy_vcpu(struct vcpu *v) >> { >> struct sched_unit *unit = v->sched_unit; >> >> +if ( !unit ) >> +return; >> + >> kill_timer(&v->periodic_timer); >>

Re: [PATCH v3 05/20] xen/riscv: construct the P2M pages pool for guests

2025-08-04 Thread Jan Beulich
On 31.07.2025 17:58, Oleksii Kurochko wrote: > Implement p2m_set_allocation() to construct p2m pages pool for guests > based on required number of pages. > > This is implemented by: > - Adding a `struct paging_domain` which contains a freelist, a > counter variable and a spinlock to `struct arch

Re: [PATCH v3 04/20] xen/riscv: introduce things necessary for p2m initialization

2025-08-04 Thread Jan Beulich
On 31.07.2025 17:58, Oleksii Kurochko wrote: > --- a/xen/arch/riscv/include/asm/p2m.h > +++ b/xen/arch/riscv/include/asm/p2m.h > @@ -3,11 +3,45 @@ > #define ASM__RISCV__P2M_H > > #include > +#include > +#include > +#include > > #include > > #define paddr_bits PADDR_BITS > > +/* Get

[PATCH] x86/HVM: polish hvm_asid_init() a little

2025-08-04 Thread Jan Beulich
While the logic there covers asymmetric cases, the resulting log messages would likely raise more confusion than clarify anything. Split the BSP action from the AP one, indicating the odd CPU in the AP log message, thus avoiding the impression that global state would have changed. While there also

Re: [PATCH v9 5/8] vpci: Refactor vpci_remove_register to remove matched registers

2025-08-04 Thread Roger Pau Monné
On Thu, Jul 31, 2025 at 06:28:14AM +, Chen, Jiqian wrote: > On 2025/7/30 19:23, Andrew Cooper wrote: > > On 28/07/2025 6:03 am, Jiqian Chen wrote: > >> vpci_remove_register() only supports removing a register in a time, > >> but the follow-on changes need to remove all registers within a range.

Re: [XEN][PATCH 3/3] xen/riscv: irq: drop unreachable pirq callbacks

2025-08-04 Thread Oleksii Kurochko
On 8/1/25 12:08 PM, Grygorii Strashko wrote: From: Grygorii Strashko Hence all common pIRQ code is under CONFIG_HAS_PIRQ idefs corresponding RISCV arch pIRQ callbacks become unreachable, so drop them. Signed-off-by: Grygorii Strashko --- xen/arch/riscv/stubs.c | 20 1 f

Re: [PATCH v3 03/20] xen/riscv: introduce VMID allocation and manegement

2025-08-04 Thread Jan Beulich
On 31.07.2025 17:58, Oleksii Kurochko wrote: > Current implementation is based on x86's way to allocate VMIDs: > VMIDs partition the physical TLB. In the current implementation VMIDs are > introduced to reduce the number of TLB flushes. Each time the guest's > virtual address space changes,

Re: [RESEND PATCH v3 1/1] kern/xen: Add Xen command line parsing

2025-08-04 Thread Daniel Kiper
On Sun, Aug 03, 2025 at 10:57:03AM -0500, Aaron Rainbolt wrote: > On Fri, 1 Aug 2025 14:55:36 +0200 Daniel Kiper wrote: > > On Fri, Jul 25, 2025 at 03:31:12PM -0500, Aaron Rainbolt wrote: > > > Xen traditionally allows customizing guest behavior by passing > > > arguments to the VM kernel via the

Re: [PATCH v2 1/3] vpci: allow queueing of mapping operations

2025-08-04 Thread Roger Pau Monné
On Mon, Aug 04, 2025 at 03:57:24PM +0200, Jan Beulich wrote: > On 04.08.2025 15:55, Roger Pau Monné wrote: > > On Fri, Aug 01, 2025 at 05:06:32PM -0400, Stewart Hildebrand wrote: > >> On 7/25/25 03:58, Roger Pau Monné wrote: > >>> On Thu, Jul 24, 2025 at 06:44:32PM +0200, Roger Pau Monné wrote: > >

Re: [PATCH v3 08/20] xen/riscv: add new p2m types and helper macros for type classification

2025-08-04 Thread Jan Beulich
On 31.07.2025 17:58, Oleksii Kurochko wrote: > - Extended p2m_type_t with additional types: p2m_mmio_direct, > p2m_grant_map_{rw,ro}. > - Added macros to classify memory types: P2M_RAM_TYPES, P2M_GRANT_TYPES. > - Introduced helper predicates: p2m_is_ram(), p2m_is_any_ram(). > - Define p2m_mmio_di

Re: [PATCH v3 09/20] xen/dom0less: abstract Arm-specific p2m type name for device MMIO mappings

2025-08-04 Thread Jan Beulich
On 31.07.2025 17:58, Oleksii Kurochko wrote: > Rename `p2m_mmio_direct_dev` to a more architecture-neutral alias > `p2m_mmio_direct` to avoid leaking Arm-specific naming into common Xen code, > such as dom0less passthrough property handling. > > This helps reduce platform-specific terminology in s

Re: [PATCH v2] xen/arm, xen/common: Add Kconfig option to control Dom0 boot

2025-08-04 Thread Oleksii Moisieiev
Hi Michal, On 29/07/2025 10:22, Orzel, Michal wrote: > On 28/07/2025 19:07, Oleksii Moisieiev wrote: >> This commit introduces a new Kconfig option, `CONFIG_DOM0_BOOT`, to >> allow for building Xen without support for booting a regular domain (Dom0). >> This functionality is primarily intended for

Re: [PATCH v2] xen/arm, xen/common: Add Kconfig option to control Dom0 boot

2025-08-04 Thread Oleksii Moisieiev
On 30/07/2025 01:10, dm...@proton.me wrote: > On Tue, Jul 29, 2025 at 10:20:54AM +0200, Jan Beulich wrote: >> On 28.07.2025 23:28, dm...@proton.me wrote: >>> On Mon, Jul 28, 2025 at 05:07:30PM +, Oleksii Moisieiev wrote: This commit introduces a new Kconfig option, `CONFIG_DOM0_BOOT`, to

Re: [PATCH v2 1/3] vpci: allow queueing of mapping operations

2025-08-04 Thread Jan Beulich
On 04.08.2025 15:55, Roger Pau Monné wrote: > On Fri, Aug 01, 2025 at 05:06:32PM -0400, Stewart Hildebrand wrote: >> On 7/25/25 03:58, Roger Pau Monné wrote: >>> On Thu, Jul 24, 2025 at 06:44:32PM +0200, Roger Pau Monné wrote: On Wed, Jul 23, 2025 at 12:37:41PM -0400, Stewart Hildebrand wrote:

Re: [PATCH v2 1/3] vpci: allow queueing of mapping operations

2025-08-04 Thread Roger Pau Monné
On Fri, Aug 01, 2025 at 05:06:32PM -0400, Stewart Hildebrand wrote: > On 7/25/25 03:58, Roger Pau Monné wrote: > > On Thu, Jul 24, 2025 at 06:44:32PM +0200, Roger Pau Monné wrote: > >> On Wed, Jul 23, 2025 at 12:37:41PM -0400, Stewart Hildebrand wrote: > >>> @@ -283,7 +297,48 @@ static int __init a

Re: [PATCH v3 02/20] xen/riscv: introduce sbi_remote_hfence_gvma_vmid()

2025-08-04 Thread Jan Beulich
On 31.07.2025 17:58, Oleksii Kurochko wrote: > It instructs the remote harts to execute one or more HFENCE.GVMA instructions > by making an SBI call, covering the range of guest physical addresses between > start_addr and start_addr + size only for the given VMID. > > The remote fence operation ap

Re: [PATCH v3 01/20] xen/riscv: implement sbi_remote_hfence_gvma()

2025-08-04 Thread Jan Beulich
On 31.07.2025 17:58, Oleksii Kurochko wrote: > Instruct the remote harts to execute one or more HFENCE.GVMA instructions, > covering the range of guest physical addresses between start_addr and > start_addr + size for all VMIDs. > > The remote fence operation applies to the entire address space if

Re: [PATCH v3 7/8] pdx: introduce a new compression algorithm based on region offsets

2025-08-04 Thread Jan Beulich
On 04.08.2025 15:08, Roger Pau Monné wrote: > On Tue, Jul 29, 2025 at 04:16:15PM +0200, Jan Beulich wrote: >> On 24.07.2025 13:04, Roger Pau Monne wrote: >>> --- a/xen/common/pdx.c >>> +++ b/xen/common/pdx.c >>> @@ -24,6 +24,7 @@ >>> #include >>> #include >>> #include >>> +#include >>> >>>

Re: [PATCH v3 7/8] pdx: introduce a new compression algorithm based on region offsets

2025-08-04 Thread Roger Pau Monné
On Tue, Jul 29, 2025 at 04:16:15PM +0200, Jan Beulich wrote: > On 24.07.2025 13:04, Roger Pau Monne wrote: > > --- a/xen/common/pdx.c > > +++ b/xen/common/pdx.c > > @@ -24,6 +24,7 @@ > > #include > > #include > > #include > > +#include > > > > /** > > * Maximum (non-inclusive) usable pd

[RFC PATCH v3] tools/xentop: Add physical CPU statistics support

2025-08-04 Thread Jahan Murudi
Introduce a new '-p/--pcpus' flag to display physical CPU utilization metrics using xc_interface. This provides hypervisor-level CPU usage insights alongside existing domain statistics. This helps correlate VM resource usage with host CPU load patterns. Changes: - Add pcpu.c/pcpu.h for PCPU stat c

Re: [PATCH 5/5] xen/arm: map static memory on demand

2025-08-04 Thread Ayan Kumar Halder
Hi Hari, On 30/07/2025 09:45, Hari Limaye wrote: CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email. From: Penny Zheng In the function `init_staticmem_pages` we need to h

Re: [PATCH 4/5] arm/mpu: Implement ioremap_attr for MPU

2025-08-04 Thread Ayan Kumar Halder
Hi Hari, On 30/07/2025 09:45, Hari Limaye wrote: CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email. From: Luca Fancellu Introduce helpers (un)map_mm_range() in order to

Re: [PATCH 2/5] arm/mpu: Implement setup_mm for MPU systems

2025-08-04 Thread Ayan Kumar Halder
Hi Hari, On 30/07/2025 09:45, Hari Limaye wrote: CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email. From: Luca Fancellu Implement `setup_mm` for MPU systems. This varian

Re: [PATCH v1 04/25] xen: consolidate CONFIG_VM_EVENT

2025-08-04 Thread Jan Beulich
On 03.08.2025 11:47, Penny Zheng wrote: > File hvm/vm_event.c and x86/vm_event.c are the extend to vm_event handling > routines, and its compilation shall be guarded by CONFIG_VM_EVENT too. > Futhermore, features about monitor_op and memory access are both based on > vm event subsystem, so monitor.

Re: [PATCH 3/5] arm/mpu: Implement transient mapping

2025-08-04 Thread Ayan Kumar Halder
Hi Hari, On 30/07/2025 09:45, Hari Limaye wrote: CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email. From: Luca Fancellu Add a scheme to distinguish transient MPU regions

[PATCH v1 16/16] nvme-pci: unmap MMIO pages with appropriate interface

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky Block layer maps MMIO memory through dma_map_phys() interface with help of DMA_ATTR_MMIO attribute. There is a need to unmap that memory with the appropriate unmap function. Signed-off-by: Leon Romanovsky --- drivers/nvme/host/pci.c | 18 +- 1 file changed

[PATCH v1 15/16] block-dma: properly take MMIO path

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky Make sure that CPU is not synced and IOMMU is configured to take MMIO path by providing newly introduced DMA_ATTR_MMIO attribute. Signed-off-by: Leon Romanovsky --- block/blk-mq-dma.c | 13 +++-- include/linux/blk-mq-dma.h | 6 +- include/linux/blk_ty

[PATCH v1 13/16] mm/hmm: properly take MMIO path

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky In case peer-to-peer transaction traverses through host bridge, the IOMMU needs to have IOMMU_MMIO flag, together with skip of CPU sync. The latter was handled by provided DMA_ATTR_SKIP_CPU_SYNC flag, but IOMMU flag was missed, due to assumption that such memory can be trea

[PATCH v1 08/16] kmsan: convert kmsan_handle_dma to use physical addresses

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky Convert the KMSAN DMA handling function from page-based to physical address-based interface. The refactoring renames kmsan_handle_dma() parameters from accepting (struct page *page, size_t offset, size_t size) to (phys_addr_t phys, size_t size). A PFN_VALID check is added t

[PATCH v1 09/16] dma-mapping: handle MMIO flow in dma_map|unmap_page

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky Extend base DMA page API to handle MMIO flow. Signed-off-by: Leon Romanovsky --- kernel/dma/mapping.c | 24 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c index 709405d46b2b4..f5f051737e5

[PATCH v1 12/16] mm/hmm: migrate to physical address-based DMA mapping API

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky Convert HMM DMA operations from the legacy page-based API to the new physical address-based dma_map_phys() and dma_unmap_phys() functions. This demonstrates the preferred approach for new code that should use physical addresses directly rather than page+offset parameters. T

[PATCH v1 14/16] block-dma: migrate to dma_map_phys instead of map_page

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky After introduction of dma_map_phys(), there is no need to convert from physical address to struct page in order to map page. So let's use it directly. Signed-off-by: Leon Romanovsky --- block/blk-mq-dma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --g

[PATCH v1 05/16] iommu/dma: rename iommu_dma_*map_page to iommu_dma_*map_phys

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky Rename the IOMMU DMA mapping functions to better reflect their actual calling convention. The functions iommu_dma_map_page() and iommu_dma_unmap_page() are renamed to iommu_dma_map_phys() and iommu_dma_unmap_phys() respectively, as they already operate on physical addresses

[PATCH v1 11/16] dma-mapping: export new dma_*map_phys() interface

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky Introduce new DMA mapping functions dma_map_phys() and dma_unmap_phys() that operate directly on physical addresses instead of page+offset parameters. This provides a more efficient interface for drivers that already have physical addresses available. The new functions are

[PATCH v1 10/16] xen: swiotlb: Open code map_resource callback

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky General dma_direct_map_resource() is going to be removed in next patch, so simply open-code it in xen driver. Signed-off-by: Leon Romanovsky --- drivers/xen/swiotlb-xen.c | 21 - 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/xen

Re: [PATCH 1/5] arm/mpu: Implement setup_frametable_mappings for MPU systems

2025-08-04 Thread Ayan Kumar Halder
Hi Hari, On 30/07/2025 09:45, Hari Limaye wrote: CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email. From: Luca Fancellu Implement the MPU variant of `setup_frametable_ma

[PATCH v1 07/16] dma-mapping: convert dma_direct_*map_page to be phys_addr_t based

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky Convert the DMA direct mapping functions to accept physical addresses directly instead of page+offset parameters. The functions were already operating on physical addresses internally, so this change eliminates the redundant page-to-physical conversion at the API boundary.

[PATCH v1 03/16] dma-debug: refactor to use physical addresses for page mapping

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky Convert the DMA debug infrastructure from page-based to physical address-based mapping as a preparation to rely on physical address for DMA mapping routines. The refactoring renames debug_dma_map_page() to debug_dma_map_phys() and changes its signature to accept a phys_addr

[PATCH v1 04/16] dma-mapping: rename trace_dma_*map_page to trace_dma_*map_phys

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky As a preparation for following map_page -> map_phys API conversion, let's rename trace_dma_*map_page() to be trace_dma_*map_phys(). Signed-off-by: Leon Romanovsky --- include/trace/events/dma.h | 4 ++-- kernel/dma/mapping.c | 4 ++-- 2 files changed, 4 insertions(+

[PATCH v1 00/16] dma-mapping: migrate to physical address-based API

2025-08-04 Thread Leon Romanovsky
Changelog: v1: * Added new DMA_ATTR_MMIO attribute to indicate PCI_P2PDMA_MAP_THRU_HOST_BRIDGE path. * Rewrote dma_map_* functions to use thus new attribute v0: https://lore.kernel.org/all/cover.1750854543.git.l...@kernel.org/ ---

[PATCH v1 06/16] iommu/dma: extend iommu_dma_*map_phys API to handle MMIO memory

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky Combine iommu_dma_*map_phys with iommu_dma_*map_resource interfaces in order to allow single phys_addr_t flow. Signed-off-by: Leon Romanovsky --- drivers/iommu/dma-iommu.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/io

[PATCH v1 01/16] dma-mapping: introduce new DMA attribute to indicate MMIO memory

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky This patch introduces the DMA_ATTR_MMIO attribute to mark DMA buffers that reside in memory-mapped I/O (MMIO) regions, such as device BARs exposed through the host bridge, which are accessible for peer-to-peer (P2P) DMA. This attribute is especially useful for exporting dev

[PATCH v1 02/16] iommu/dma: handle MMIO path in dma_iova_link

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky Make sure that CPU is not synced if MMIO path is taken. Signed-off-by: Leon Romanovsky --- drivers/iommu/dma-iommu.c | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index ea2e

Re: [PATCH v1 03/25] xen/x86: complement PG_log_dirty wrapping

2025-08-04 Thread Jan Beulich
On 03.08.2025 11:47, Penny Zheng wrote: > We have PG_log_dirty flag to wrap codes about paging log-dirty support. > The main entry is paging_domctl(), Yet paging_domctl() serves other paging modes, too. In fact for the shim PG_SH_forced is actually a mode that could plausibly come into use (even i

Re: [PATCH v1 02/25] xen/x86: consolidate vram tracking support

2025-08-04 Thread Jan Beulich
On 03.08.2025 11:47, Penny Zheng wrote: > Flag PG_log_dirty is for paging log dirty support, not vram tracking support. > However data structure sh_dirty_vram{} and function paging_log_dirty_range() > designed for vram tracking support, are guarded with PG_log_dirty. The struct decl is guarded by

[PATCH] x86/CPU: extend is_forced_cpu_cap()'s "reach"

2025-08-04 Thread Jan Beulich
"cpuid=no-rdrand" cannot actually be used to suppress the respective boot warning on certain AMD hardware. That's because cleared_caps[] are only applied after the ->c_init() hooks ran, i.e. cpu_has() still returns true in init_amd(). Fixes: 93401e28a84b ("x86: clear RDRAND CPUID bit on AMD family

Re: [PATCH v2] xen/x86: fix xen.efi boot crash from some bootloaders

2025-08-04 Thread Jan Beulich
On 04.08.2025 13:00, Andrew Cooper wrote: > On 04/08/2025 10:34 am, Jan Beulich wrote: >> On 24.07.2025 16:07, Yann Sionneau wrote: >>> xen.efi PE does not boot when loaded from shim or some patched >>> downstream grub2. >>> >>> What happens is the bootloader would honour the MEM_DISCARDABLE >>> fl

Re: [PATCH v4 7/8] tools/xl: enable NS16550-compatible UART emulator for PVH (x86)

2025-08-04 Thread Jan Beulich
On 31.07.2025 21:22, dm...@proton.me wrote: > From: Denis Mukhin > > Enable virtual NS16550 for PVH domains in xl. > > {map,unmap}_domain_emuirq_pirq() infrastructure is modified by adding new > type of interrupt resources 'IRQ_EMU' which means 'emulated device IRQ' > (similarly to IRQ_MSI_EMU)

Re: [PATCH v2] xen/x86: fix xen.efi boot crash from some bootloaders

2025-08-04 Thread Andrew Cooper
On 04/08/2025 10:34 am, Jan Beulich wrote: > On 24.07.2025 16:07, Yann Sionneau wrote: >> xen.efi PE does not boot when loaded from shim or some patched >> downstream grub2. >> >> What happens is the bootloader would honour the MEM_DISCARDABLE >> flag of the .reloc section meaning it would not load

Re: [PATCH v4 6/8] tools/xl: enable NS16550-compatible UART emulator for HVM (x86)

2025-08-04 Thread Jan Beulich
On 31.07.2025 21:22, dm...@proton.me wrote: > --- a/xen/arch/x86/domain.c > +++ b/xen/arch/x86/domain.c > @@ -780,9 +780,10 @@ static bool emulation_flags_ok(const struct domain *d, > uint32_t emflags) > /* HVM domU */ > { > .caps = CAP_HVM | CAP_DOMU, > -

Re: [PATCH v4 5/8] emul/vuart-ns16550: introduce NS16550-compatible UART emulator (x86)

2025-08-04 Thread Jan Beulich
On 31.07.2025 21:22, dm...@proton.me wrote: > From: Denis Mukhin > > Add initial in-hypervisor emulator for NS8250/NS16x50-compatible UARTs under > CONFIG_VUART_NS16550 for x86 port of Xen. > > x86 port of Xen lacks vUART facility similar to Arm's SBSA emulator to support > x86 guest OS bring u

Re: [PATCH v3 4/8] pdx: allow per-arch optimization of PDX conversion helpers

2025-08-04 Thread Roger Pau Monné
On Tue, Jul 29, 2025 at 03:54:24PM +0100, Andrew Cooper wrote: > On 24/07/2025 12:04 pm, Roger Pau Monne wrote: > > diff --git a/xen/arch/arm/include/asm/Makefile > > b/xen/arch/arm/include/asm/Makefile > > index 4565baca6a4d..cec13c889dab 100644 > > --- a/xen/arch/arm/include/asm/Makefile > > +++

Re: [PATCH v4 4/8] xen/8250-uart: update definitions

2025-08-04 Thread Jan Beulich
On 31.07.2025 21:22, dm...@proton.me wrote: > From: Denis Mukhin > > Added missing definitions needed for NS16550 UART emulator. > > Newly introduced MSR definitions re-used in the existing ns16550 driver. > > Also, corrected FCR DMA definition bit#3 (0x08) as per: > https://www.ti.com/lit/d

Re: [PATCH v4 3/8] x86/domain: allocate d->{iomem,irq}_caps before arch-specific initialization

2025-08-04 Thread Jan Beulich
On 31.07.2025 21:21, dm...@proton.me wrote: > From: Denis Mukhin > > Move IRQ/IOMEM rangesets allocation before arch_domain_create(). > > That guarantees that arch-specific code could access those rangesets to > register traps for emulation. > > It is necessary for those emulators registering

Re: [PATCH v4 2/8] emul/vuart: introduce framework for UART emulators

2025-08-04 Thread Jan Beulich
On 31.07.2025 21:21, dm...@proton.me wrote: > From: Denis Mukhin > > Introduce a driver framework to abstract UART emulators in the hypervisor. > > That allows for architecture-independent handling of virtual UARTs in the > console driver and simplifies enabling new UART emulators. > > The fra

Re: [PATCH] x86/CPU: correct reset_cpuinfo() comment

2025-08-04 Thread Roger Pau Monné
On Wed, Jul 23, 2025 at 02:00:55PM +0200, Jan Beulich wrote: > Part of it stated the opposite of what actual behavior is. > > Fixes: 7126b7f806d5 ("x86/CPU: re-work populating of cpu_data[]") > Reported-by: Juergen Gross > Signed-off-by: Jan Beulich Acked-by: Roger Pau Monné Thanks, Roger.

Re: [PATCH v4 1/8] xen/domain: introduce common emulation flags

2025-08-04 Thread Jan Beulich
On 31.07.2025 21:21, dm...@proton.me wrote: > --- a/xen/include/xen/sched.h > +++ b/xen/include/xen/sched.h > @@ -652,6 +652,8 @@ struct domain > unsigned int *llc_colors; > #endif > > +uint32_t emulation_flags; Just one further remark: The field probably never should have been of this

Re: [PATCH v2] xen/x86: fix xen.efi boot crash from some bootloaders

2025-08-04 Thread Jan Beulich
On 24.07.2025 16:07, Yann Sionneau wrote: > xen.efi PE does not boot when loaded from shim or some patched > downstream grub2. > > What happens is the bootloader would honour the MEM_DISCARDABLE > flag of the .reloc section meaning it would not load its content > into memory. > > But Xen is parsi

Re: [PATCH v6 11/19] xen/x86: introduce "cpufreq=amd-cppc" xen cmdline and amd-cppc driver

2025-08-04 Thread Jan Beulich
On 04.08.2025 10:09, Penny, Zheng wrote: > [Public] > >> -Original Message- >> From: Jan Beulich >> Sent: Thursday, July 17, 2025 12:00 AM >> To: Penny, Zheng >> Cc: Huang, Ray ; Andrew Cooper >> ; Anthony PERARD ; >> Orzel, Michal ; Julien Grall ; Roger >> Pau >> Monné ; Stefano Stabel

Re: [PATCH v6 11/19] xen/x86: introduce "cpufreq=amd-cppc" xen cmdline and amd-cppc driver

2025-08-04 Thread Jan Beulich
On 04.08.2025 10:09, Penny, Zheng wrote: > [Public] > >> -Original Message- >> From: Jan Beulich >> Sent: Thursday, July 17, 2025 12:00 AM >> To: Penny, Zheng >> Cc: Huang, Ray ; Andrew Cooper >> ; Anthony PERARD ; >> Orzel, Michal ; Julien Grall ; Roger >> Pau >> Monné ; Stefano Stabel

Re: [PATCH v1 05/25] xen: introduce CONFIG_DOMCTL

2025-08-04 Thread Jan Beulich
On 04.08.2025 10:29, Penny, Zheng wrote: > [Public] > >> -Original Message- >> From: Jan Beulich >> Sent: Monday, August 4, 2025 3:41 PM >> To: Penny, Zheng >> Cc: Huang, Ray ; Andrew Cooper >> ; Anthony PERARD ; >> Orzel, Michal ; Julien Grall ; Roger >> Pau >> Monné ; Stefano Stabelli

Re: [PATCH v1 3/3] xen/pci: add discovered PCI device at boot

2025-08-04 Thread Jan Beulich
On 01.08.2025 11:22, Mykyta Poturai wrote: > Create add_discovered_pci_devices function that calls pci_device_add > on every PCI device discovered. > The devices will be added to dom_io so that they can be assigned > later to other domains. And why's the intermediate step necessary? IOW can't they

RE: [PATCH v1 05/25] xen: introduce CONFIG_DOMCTL

2025-08-04 Thread Penny, Zheng
[Public] > -Original Message- > From: Jan Beulich > Sent: Monday, August 4, 2025 3:41 PM > To: Penny, Zheng > Cc: Huang, Ray ; Andrew Cooper > ; Anthony PERARD ; > Orzel, Michal ; Julien Grall ; Roger Pau > Monné ; Stefano Stabellini ; > xen- > de...@lists.xenproject.org > Subject: Re:

Re: [PATCH v1 2/3] xen/pci: modify pci_add_device to handle device add by Xen

2025-08-04 Thread Jan Beulich
On 01.08.2025 11:22, Mykyta Poturai wrote: > From: Luca Fancellu > > Currently pci_add_device is called from hypercalls requested by Dom0 > to add pci devices and when the device has no domain associated with > it, it is assumed that hardware_domain is the owner. > > On the dom0less scenario, th

Re: [PATCH v1 1/3] arm/pci: Add pci-scan boot argument

2025-08-04 Thread Jan Beulich
On 01.08.2025 11:22, Mykyta Poturai wrote: > From: Edward Pickup > > This patch adds a Xen boot arguments that, if enabled, causes a call to > existing code to scan pci devices enumerated by the firmware. > > This patch also makes an existing debug function viewable outside its > translation uni

RE: [PATCH v6 11/19] xen/x86: introduce "cpufreq=amd-cppc" xen cmdline and amd-cppc driver

2025-08-04 Thread Penny, Zheng
[Public] > -Original Message- > From: Jan Beulich > Sent: Thursday, July 17, 2025 12:00 AM > To: Penny, Zheng > Cc: Huang, Ray ; Andrew Cooper > ; Anthony PERARD ; > Orzel, Michal ; Julien Grall ; Roger Pau > Monné ; Stefano Stabellini ; > xen- > de...@lists.xenproject.org > Subject: Re

Re: [RFC] Next steps for MISRA C Rule 17.7 in XEN

2025-08-04 Thread Jan Beulich
On 02.08.2025 19:48, Dmytro Prokopchuk1 wrote: > There are a lot of MISRA C R17.7 violations in the XEN. > This rule states: "The value returned by a function having non-void > return type shall be used". > > Actually, need to decide how to deal with these violations. > Quick analyze shown that t

Re: [PATCH v2] xen: rework error handling in vcpu_create

2025-08-04 Thread Jan Beulich
On 01.08.2025 22:24, Stewart Hildebrand wrote: > @@ -839,6 +839,9 @@ void sched_destroy_vcpu(struct vcpu *v) > { > struct sched_unit *unit = v->sched_unit; > > +if ( !unit ) > +return; > + > kill_timer(&v->periodic_timer); > kill_timer(&v->singleshot_timer); > kil

Re: [PATCH v1 00/25] Introduce CONFIG_DOMCTL

2025-08-04 Thread Jan Beulich
On 03.08.2025 11:47, Penny Zheng wrote: > It can be beneficial for some dom0less systems to further reduce Xen footprint > via disabling some hypercalls handling code, which may not to be used & > required in such systems. Each hypercall has a separate option to keep > configuration flexible. > >

Re: [PATCH v1 01/25] xen/x86: move domctl.o out of PV_SHIM_EXCLUSIVE

2025-08-04 Thread Jan Beulich
On 03.08.2025 11:47, Penny Zheng wrote: > In order to fix CI error of a randconfig picking both PV_SHIM_EXCLUSIVE=y and > HVM=y results in hvm.c being built, but domctl.c not being built, which leaves > a few functions, like domctl_lock_acquire/release() undefined, causing linking > to fail. > To f

Re: [PATCH v1 05/25] xen: introduce CONFIG_DOMCTL

2025-08-04 Thread Jan Beulich
On 03.08.2025 11:47, Penny Zheng wrote: > --- a/xen/common/Kconfig > +++ b/xen/common/Kconfig > @@ -627,6 +627,10 @@ config SYSCTL > This option shall only be disabled on some dom0less systems, or > PV shim on x86, to reduce Xen footprint. > > +config DOMCTL > + bool "Enable d

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

2025-08-04 Thread Bertrand Marquis
Hi Demi, > On 3 Aug 2025, at 06:24, Demi Marie Obenour wrote: > > On 7/17/25 08:11, Bertrand Marquis wrote: >> Create a CONFIG_FFA_VM_TO_VM parameter to activate FFA communication >> between VMs. >> When activated list VMs in the system with FF-A support in part_info_get. >> >> When VM to VM is

Re: [PATCH v6 10/19] xen/cpufreq: introduce new sub-hypercall to propagate CPPC data

2025-08-04 Thread Jan Beulich
On 04.08.2025 08:47, Penny, Zheng wrote: > [Public] > >> -Original Message- >> From: Jan Beulich >> Sent: Wednesday, July 16, 2025 11:39 PM >> To: Penny, Zheng >> Cc: Huang, Ray ; Andrew Cooper >> ; Roger Pau Monné ; >> Anthony PERARD ; Orzel, Michal >> ; Julien Grall ; Stefano Stabellin

Re: [PATCH v6 05/19] xen/cpufreq: refactor cmdline "cpufreq=xxx"

2025-08-04 Thread Jan Beulich
On 04.08.2025 07:47, Penny, Zheng wrote: >> -Original Message- >> From: Jan Beulich >> Sent: Wednesday, July 16, 2025 11:01 PM >> >> On 11.07.2025 05:50, Penny Zheng wrote: >>> --- a/xen/drivers/cpufreq/cpufreq.c >>> +++ b/xen/drivers/cpufreq/cpufreq.c >>> @@ -64,12 +64,53 @@ LIST_HEAD_REA

Re: [PATCH v6 05/19] xen/cpufreq: refactor cmdline "cpufreq=xxx"

2025-08-04 Thread Jan Beulich
On 04.08.2025 08:04, Penny, Zheng wrote: >> -Original Message- >> From: Jan Beulich >> Sent: Wednesday, July 16, 2025 11:01 PM >> >> On 11.07.2025 05:50, Penny Zheng wrote: >>> --- a/xen/drivers/cpufreq/cpufreq.c >>> +++ b/xen/drivers/cpufreq/cpufreq.c >>> @@ -64,12 +64,53 @@ LIST_HEAD_REA

Re: [PATCH v1 12/16] xen/domain: introduce domain-emu.h

2025-08-04 Thread Jan Beulich
On 01.08.2025 21:30, dm...@proton.me wrote: > On Fri, Aug 01, 2025 at 08:02:56AM +0200, Jan Beulich wrote: >> On 31.07.2025 22:55, dm...@proton.me wrote: >>> On Wed, Jul 09, 2025 at 04:57:44PM +0200, Jan Beulich wrote: On 24.06.2025 05:56, dm...@proton.me wrote: > @@ -458,16 +459,16 @@ str

Re: [PATCH] console: make printk_ratelimit_{burst,ms} const

2025-08-04 Thread Jan Beulich
On 01.08.2025 20:58, dm...@proton.me wrote: > On Fri, Aug 01, 2025 at 09:30:34AM +0200, Jan Beulich wrote: >> Them not being altered by any means, their __read_mostly attribute is >> actually counter-productive: It causes the compiler to instantiate the >> variables, when already with just the attr