[PATCH] symbols: fix xensyms_read() hitting the final "end" symbol

2025-09-08 Thread Jan Beulich
A new "no (more) symbol" path there was lacking a necessary unlock. Fixes: d3b637fba31b ("symbols: arrange to know where functions end") Coverity ID: 1665212 Signed-off-by: Jan Beulich --- a/xen/common/symbols.c +++ b/xen/common/symbols.c @@ -202,7 +202,10 @@ int xensyms_read(uint32_t *symnum, c

[PATCH v7 03/16] emul/ns16x50: implement emulator stub

2025-09-08 Thread dmukhin
From: Denis Mukhin The change is the first on the way on introducing minimally functional NS16550-compatible UART emulator. Only one domain, defined via 'vuart=' parameter, will have UART emulator initially. The command line option is not documented yet because of the plan to adjust this code f

[PATCH v7 11/16] emul/ns16x50: implement FCR register (write-only)

2025-09-08 Thread dmukhin
From: Denis Mukhin Add emulation logic for FCR register. Note, that does not hook FIFO interrupt moderation to the FIFO management code for simplicity. Signed-off-by: Denis Mukhin --- Changes since v6: - dropped UART_IIR_THR handling from UART_FCR_CLTX case --- xen/common/emul/vuart/ns16x50.

[PATCH v7 00/16] x86: introduce NS16550-compatible UART emulator

2025-09-08 Thread dmukhin
x86 port of Xen lacks vUART facility similar to Arm's vpl011 to support x86 guest OS bring up in the embedded setups. This patch series introduces initial in-hypervisor emulator for NS8250/NS16x50-compatible UARTs under CONFIG_VUART_NS16X50. In parallel domain creation scenario (hyperlaunch), NS1

[PATCH v7 01/16] emul/vuart: introduce framework for UART emulators

2025-09-08 Thread dmukhin
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 framework is built under CONFIG_VUART_FRAMEWORK, which will be

[PATCH v7 07/16] emul/ns16x50: implement LCR/LSR registers

2025-09-08 Thread dmukhin
From: Denis Mukhin Add LCR/LSR registers implementation to the I/O port handler. Add implementation of ns16x50_dlab_get() and ns16x50_iir_check_lsi(). Signed-off-by: Denis Mukhin --- Changes since v6: - n/a --- xen/common/emul/vuart/ns16x50.c | 18 -- 1 file changed, 16 inser

[PATCH v7 09/16] emul/ns16x50: implement RBR register

2025-09-08 Thread dmukhin
From: Denis Mukhin Add RBR register emulation to the I/O port handlder. Add RX FIFO management code since RBR depends on RX FIFO. RX FIFO is not emulated as per UART specs for simplicity (not need to emulate baud rate). Emulator does not emulate NS8250 (no FIFO), NS16550a (16 bytes) or NS16750

[PATCH v7 05/16] emul/ns16x50: implement SCR register

2025-09-08 Thread dmukhin
From: Denis Mukhin Add SCR register emulation to the I/O port handler. Firmware (e.g. OVMF) may use SCR during the guest OS boot. Signed-off-by: Denis Mukhin --- Changes since v6: - default handling of non-DLL/DLM registers moved to the previous patch --- xen/common/emul/vuart/ns16x50.c | 9 +

[PATCH v7 06/16] emul/ns16x50: implement IER/IIR registers

2025-09-08 Thread dmukhin
From: Denis Mukhin Add interrupt enable register emulation (IER) and interrupt identity reason (IIR) register emulation to the I/O port handler. Also add routines for asserting/deasserting the virtual ns16x50 interrupt line as a dependent on IIR code. vPIC case is implemented (HVM), vIOAPIC cas

[PATCH v7 02/16] xen/8250-uart: update definitions

2025-09-08 Thread dmukhin
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/ds/symlink/tl16c550c.pdf See "7.7.2 FIFO Control Register (FC

[PATCH v7 12/16] emul/ns16550: implement dump_state() hook

2025-09-08 Thread dmukhin
From: Denis Mukhin Implement dump_state() vUART hook for debugging UART state machine over Xen console. dump_state() prints state of all emulated registers (including state-less IIR) and state of RX/TX FIFOs. Signed-off-by: Denis Mukhin --- Changes since v6: - n/a --- xen/common/emul/vuart/ns

[PATCH v7 13/16] emul/ns16x50: add Kconfig options

2025-09-08 Thread dmukhin
From: Denis Mukhin Add initial Kconfig options configure NS16550-capable emulator. Signed-off-by: Denis Mukhin --- Changes since v6: - new patch --- xen/common/emul/vuart/Kconfig | 19 +++ 1 file changed, 19 insertions(+) diff --git a/xen/common/emul/vuart/Kconfig b/xen/commo

[PATCH v7 14/16] x86/domain: enable per-domain I/O port bitmaps

2025-09-08 Thread dmukhin
From: Denis Mukhin Current design enables all HVM domains share the same I/O port bitmap. It is necessary for domains crafting its own I/O port address space depending on the user configuration. Ensure NS16550 emulator does not share I/O ports with the physical I/O ports, which is essential fo

Re: [PATCH v7 00/12] Introduce eSPI support

2025-09-08 Thread Stefano Stabellini
On Sun, 7 Sep 2025, Leonid Komarianskyi wrote: > Hello Stefano, > > Thank you for your comments and for providing the Eclair reports. > > On 06.09.25 03:17, Stefano Stabellini wrote: > > Hi Leonid, > > > > I was about to commit this but unfortunately it is introducing MISRA > > regressions. See:

Re: [PATCH v6 01/15] emul/vuart: introduce framework for UART emulators

2025-09-08 Thread dmukhin
On Sat, Sep 06, 2025 at 12:43:01PM +0300, Mykola Kvach wrote: > Hi Denis, > > On Sat, Sep 6, 2025 at 2:27 AM wrote: [..] > > + > > +const static struct vuart * > > +vuart_find_by_console_permission(const struct domain *d) > > Other functions that search for a console (e.g., by compatible string

[PATCH v2 3/7] arm64: mm: fully support nested lazy_mmu sections

2025-09-08 Thread Kevin Brodsky
Despite recent efforts to prevent lazy_mmu sections from nesting, it remains difficult to ensure that it never occurs - and in fact it does occur on arm64 in certain situations (CONFIG_DEBUG_PAGEALLOC). Commit 1ef3095b1405 ("arm64/mm: Permit lazy_mmu_mode to be nested") made nesting tolerable on ar

[PATCH v2 2/7] mm: introduce local state for lazy_mmu sections

2025-09-08 Thread Kevin Brodsky
arch_{enter,leave}_lazy_mmu_mode() currently have a stateless API (taking and returning no value). This is proving problematic in situations where leave() needs to restore some context back to its original state (before enter() was called). In particular, this makes it difficult to support the nest

[PATCH v2 4/7] x86/xen: support nested lazy_mmu sections (again)

2025-09-08 Thread Kevin Brodsky
Commit 49147beb0ccb ("x86/xen: allow nesting of same lazy mode") originally introduced support for nested lazy sections (LAZY_MMU and LAZY_CPU). It later got reverted by commit c36549ff8d84 as its implementation turned out to be intolerant to preemption. Now that the lazy_mmu API allows enter() to

[PATCH v2 6/7] sparc/mm: support nested lazy_mmu sections

2025-09-08 Thread Kevin Brodsky
The lazy_mmu API now allows nested sections to be handled by arch code: enter() can return a flag if called inside another lazy_mmu section, so that the matching call to leave() leaves any optimisation enabled. This patch implements that new logic for sparc: if there is an active batch, then enter

Re: [PATCH v6 03/15] emul/ns16x50: implement emulator stub

2025-09-08 Thread dmukhin
On Sat, Sep 06, 2025 at 11:37:28PM +0300, Mykola Kvach wrote: > Hi Denis, > > On Sat, Sep 6, 2025 at 2:27 AM wrote: > > > > From: Denis Mukhin > > > > The change is the first on the way on introducing minimally functional > > NS16550-compatible UART emulator. > > > > Define UART state and a set

Re: [PATCH v6 03/15] emul/ns16x50: implement emulator stub

2025-09-08 Thread Mykola Kvach
Hi Denis, On Sat, Sep 6, 2025 at 2:27 AM wrote: > > From: Denis Mukhin > > The change is the first on the way on introducing minimally functional > NS16550-compatible UART emulator. > > Define UART state and a set of emulated registers. > > Implement alloc/free vUART hooks. > > Stub out I/O port

Re: [PATCH v6 02/15] xen/8250-uart: update definitions

2025-09-08 Thread dmukhin
On Sat, Sep 06, 2025 at 05:57:02PM +0300, Mykola Kvach wrote: > Hi Denis, > > On Sat, Sep 6, 2025 at 2:27 AM wrote: [..] > > /* FIFO Control Register */ > > -#define UART_FCR_ENABLE 0x01/* enable FIFO */ > > -#define UART_FCR_CLRX 0x02/* clear Rx FIFO*/ > > -#defin

Re: [PATCH v6 00/15] x86: introduce NS16550-compatible UART emulator

2025-09-08 Thread Mykola Kvach
Hi Denis and Stefano I’d like to acknowledge the significant effort that went into this patch series -- it’s clear that a lot of work has been invested. On Sat, Sep 6, 2025 at 5:02 AM Stefano Stabellini wrote: > > Oleksii and all, > > I would like to consider patches 1-12 of this patch series fo

Re: [PATCH v2 7/7] mm: update lazy_mmu documentation

2025-09-08 Thread Yeoreum Yun
Reviewed-by: Yeoreum Yun On Mon, Sep 08, 2025 at 08:39:31AM +0100, Kevin Brodsky wrote: > We now support nested lazy_mmu sections on all architectures > implementing the API. Update the API comment accordingly. > > Acked-by: Mike Rapoport (Microsoft) > Signed-off-by: Kevin Brodsky > --- > incl

Re: [PATCH] x86/mcheck: allow varying bank counts per CPU

2025-09-08 Thread Jason Andryuk
On 2025-09-08 05:08, Jan Beulich wrote: On 05.09.2025 19:02, Jason Andryuk wrote: On 2025-09-05 12:52, Soham Dandapat wrote: In mca_cap_init function,the mcabanks_alloc allocates and initializes an mca_banks structure for managing MCA banks, setting up a bank map and storing the specified or

Re: [PATCH v9 1/8] xen/cpufreq: embed hwp into struct cpufreq_policy{}

2025-09-08 Thread Jan Beulich
On 08.09.2025 13:28, Penny, Zheng wrote: > [Public] > >> -Original Message- >> From: Jan Beulich >> Sent: Monday, September 8, 2025 6:02 PM >> To: Penny, Zheng >> Cc: Andryuk, Jason ; xen-devel@lists.xenproject.org >> Subject: Re: [PATCH v9 1/8] xen/cpufreq: embed hwp into struct >> cpu

Re: [PATCH v2 3/7] arm64: mm: fully support nested lazy_mmu sections

2025-09-08 Thread Yeoreum Yun
Reviewed-by: Yeoreum Yun On Mon, Sep 08, 2025 at 08:39:27AM +0100, Kevin Brodsky wrote: > Despite recent efforts to prevent lazy_mmu sections from nesting, it > remains difficult to ensure that it never occurs - and in fact it > does occur on arm64 in certain situations (CONFIG_DEBUG_PAGEALLOC).

[PATCH v2 7/7] mm: update lazy_mmu documentation

2025-09-08 Thread Kevin Brodsky
We now support nested lazy_mmu sections on all architectures implementing the API. Update the API comment accordingly. Acked-by: Mike Rapoport (Microsoft) Signed-off-by: Kevin Brodsky --- include/linux/pgtable.h | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a

Re: [PATCH v6 01/15] emul/vuart: introduce framework for UART emulators

2025-09-08 Thread Jan Beulich
On 08.09.2025 10:29, Mykola Kvach wrote: > On Sat, Sep 6, 2025 at 2:27 AM wrote: >> --- /dev/null >> +++ b/xen/common/emul/vuart/Kconfig >> @@ -0,0 +1,6 @@ >> +config VUART_FRAMEWORK >> + bool > > If VUART_FRAMEWORK has no dependencies, it can be enabled on any > architecture. For example,

Re: [PATCH] symbols: fix xensyms_read() hitting the final "end" symbol

2025-09-08 Thread Andrew Cooper
On 08/09/2025 10:22 am, Jan Beulich wrote: > A new "no (more) symbol" path there was lacking a necessary unlock. > > Fixes: d3b637fba31b ("symbols: arrange to know where functions end") > Coverity ID: 1665212 > Signed-off-by: Jan Beulich Acked-by: Andrew Cooper

Re: [PATCH v4 1/2] efi: Add a function to check if Secure Boot mode is enabled

2025-09-08 Thread Marek Marczykowski-Górecki
On Mon, Sep 08, 2025 at 11:41:55AM +0200, Jan Beulich wrote: > On 08.09.2025 11:35, Gerald Elder-Vass wrote: > >>> + size == 1 && data == 0) ) > >> > >> ... any reason it's literal 1 here? > > > > The size variable is also used as output from GetVariable and we should > > verify that the

Re: [PATCH v6 03/15] emul/ns16x50: implement emulator stub

2025-09-08 Thread dmukhin
On Mon, Sep 08, 2025 at 11:37:03AM +0300, Mykola Kvach wrote: > > --- a/xen/common/emul/vuart/Kconfig > > +++ b/xen/common/emul/vuart/Kconfig > > @@ -3,4 +3,23 @@ config VUART_FRAMEWORK > > > > menu "UART Emulation" > > > > +config VUART_NS16X50 > > + bool "NS16550-compatible UART Emulator"

[PATCH v2 1/7] mm: remove arch_flush_lazy_mmu_mode()

2025-09-08 Thread Kevin Brodsky
This function has only ever been used in arch/x86, so there is no need for other architectures to implement it. Remove it from linux/pgtable.h and all architectures besides x86. The arm64 implementation is not empty but it is only called from arch_leave_lazy_mmu_mode(), so we can simply fold it th

Re: New Defects reported by Coverity Scan for XenProject

2025-09-08 Thread Jan Beulich
On 08.09.2025 14:48, Alejandro Vallejo wrote: > On Mon Sep 8, 2025 at 1:25 PM CEST, Jan Beulich wrote: >> On 08.09.2025 13:04, Alejandro Vallejo wrote: >>> On Mon Sep 8, 2025 at 12:19 PM CEST, Jan Beulich wrote: On 07.09.2025 16:37, scan-ad...@coverity.com wrote: > ** CID 1665362: In

Re: [PATCH v9 0/4] xen/arm: scmi: introduce SCI SCMI SMC single-agent support

2025-09-08 Thread Oleksii Kurochko
Hello everyone, Based on the message from the previous version, the MISRA issues have been fixed, and aside from one remaining documentation patch ("docs: arm: add docs for SCMI over SMC calls forwarding driver"), the patch series appears to be ready. I believe we can consider including it in 4

Re: [PATCH v7 00/12] Introduce eSPI support

2025-09-08 Thread Oleksii Kurochko
On 9/6/25 2:17 AM, Stefano Stabellini wrote: Hi Leonid, I was about to commit this but unfortunately it is introducing MISRA regressions. See: https://gitlab.com/xen-project/people/sstabellini/xen/-/tree/ppp6?ref_type=heads https://gitlab.com/xen-project/people/sstabellini/xen/-/jobs/112650051

Re: [PATCH v6 00/15] x86: introduce NS16550-compatible UART emulator

2025-09-08 Thread Oleksii Kurochko
Hello Everyone, On 9/8/25 11:04 AM, Mykola Kvach wrote: Hi Denis and Stefano I’d like to acknowledge the significant effort that went into this patch series -- it’s clear that a lot of work has been invested. On Sat, Sep 6, 2025 at 5:02 AM Stefano Stabellini wrote: Oleksii and all, I would

Re: [PATCH v4 1/2] efi: Add a function to check if Secure Boot mode is enabled

2025-09-08 Thread Jan Beulich
On 05.09.2025 14:10, Gerald Elder-Vass wrote: > From: Ross Lagerwall > > Also cache it to avoid needing to repeatedly ask the firmware. > > Signed-off-by: Ross Lagerwall > Signed-off-by: Gerald Elder-Vass > --- > CC: Marek Marczykowski-Górecki > CC: "Daniel P. Smith" > CC: Jan Beulich > CC:

Re: [PATCH] symbols: fix xensyms_read() hitting the final "end" symbol

2025-09-08 Thread Mykola Kvach
Hi Jan, On Mon, Sep 8, 2025 at 12:22 PM Jan Beulich wrote: > > A new "no (more) symbol" path there was lacking a necessary unlock. > > Fixes: d3b637fba31b ("symbols: arrange to know where functions end") > Coverity ID: 1665212 > Signed-off-by: Jan Beulich > > --- a/xen/common/symbols.c > +++ b/x

Re: [PATCH] libxl: except Dom0 from setting PoD target

2025-09-08 Thread Anthony PERARD
On Wed, Aug 27, 2025 at 09:08:10PM -0400, Jason Andryuk wrote: > On 2025-08-27 01:53, Jan Beulich wrote: > > Dom0 is never started in PoD mode, and hence it can at "best" do harm if > > we try to set a PoD target for it. > > > > Signed-off-by: Jan Beulich > > Reviewed-by: Jason Andryuk Acked-b

Re: New Defects reported by Coverity Scan for XenProject

2025-09-08 Thread Alejandro Vallejo
On Mon Sep 8, 2025 at 1:25 PM CEST, Jan Beulich wrote: > On 08.09.2025 13:04, Alejandro Vallejo wrote: >> On Mon Sep 8, 2025 at 12:19 PM CEST, Jan Beulich wrote: >>> On 07.09.2025 16:37, scan-ad...@coverity.com wrote: ** CID 1665362: Integer handling issues (INTEGER_OVERFLOW) /xen/

Re: [PATCH v9 1/8] xen/cpufreq: embed hwp into struct cpufreq_policy{}

2025-09-08 Thread Jan Beulich
(re-adding the list) On 05.09.2025 06:58, Penny, Zheng wrote: > [Public] > >> -Original Message- >> From: Jan Beulich >> Sent: Thursday, September 4, 2025 7:51 PM >> To: Penny, Zheng ; Andryuk, Jason >> >> Cc: Andrew Cooper ; Roger Pau Monné >> ; xen-devel@lists.xenproject.org >> Subjec

Re: [PATCH v4 2/2] efi: Support using Shim's LoadImage protocol

2025-09-08 Thread Gerald Elder-Vass
>As already said on an earlier version, the use of !EFI_ERROR() here is a >behavioral change from ... > >> @@ -1591,12 +1638,8 @@ void EFIAPI __init noreturn efi_start(EFI_HANDLE ImageHandle, >> * device tree through the efi_check_dt_boot function, in this stage >> * verify it. >>

Re: New Defects reported by Coverity Scan for XenProject

2025-09-08 Thread Alejandro Vallejo
On Mon Sep 8, 2025 at 12:19 PM CEST, Jan Beulich wrote: > On 07.09.2025 16:37, scan-ad...@coverity.com wrote: >> ** CID 1665362: Integer handling issues (INTEGER_OVERFLOW) >> /xen/lib/find-next-bit.c: 104 in find_next_zero_bit() >> >> >> __

Re: [PATCH] x86/mcheck: allow varying bank counts per CPU

2025-09-08 Thread Jan Beulich
On 05.09.2025 19:02, Jason Andryuk wrote: > > > On 2025-09-05 12:52, Soham Dandapat wrote: >> In mca_cap_init function,the mcabanks_alloc allocates and >> initializes an mca_banks structure for managing MCA banks, >> setting up a bank map and storing the specified or default number >> of banks. >

Re: [PATCH v9 1/8] xen/cpufreq: embed hwp into struct cpufreq_policy{}

2025-09-08 Thread Jan Beulich
On 04.09.2025 20:53, Jason Andryuk wrote: > On 2025-09-04 07:50, Jan Beulich wrote: >> On 04.09.2025 08:35, Penny Zheng wrote: >>> @@ -259,7 +258,7 @@ static int cf_check hwp_cpufreq_target(struct >>> cpufreq_policy *policy, >>> unsigned int relation) >>>

Re: [PATCH v2 2/7] mm: introduce local state for lazy_mmu sections

2025-09-08 Thread Yeoreum Yun
Reviewed-by: Yeoreum Yun On Mon, Sep 08, 2025 at 08:39:26AM +0100, Kevin Brodsky wrote: > arch_{enter,leave}_lazy_mmu_mode() currently have a stateless API > (taking and returning no value). This is proving problematic in > situations where leave() needs to restore some context back to its > orig

Re: [PATCH v6 01/15] emul/vuart: introduce framework for UART emulators

2025-09-08 Thread Mykola Kvach
On Sat, Sep 6, 2025 at 2:27 AM 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 framework

Re: [PATCH v6 01/15] emul/vuart: introduce framework for UART emulators

2025-09-08 Thread dmukhin
On Mon, Sep 08, 2025 at 11:29:03AM +0300, Mykola Kvach wrote: > On Sat, Sep 6, 2025 at 2:27 AM wrote: [..] > > +++ b/xen/common/emul/vuart/Kconfig > > @@ -0,0 +1,6 @@ > > +config VUART_FRAMEWORK > > + bool > > If VUART_FRAMEWORK has no dependencies, it can be enabled on any > architecture.

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

2025-09-08 Thread Jason Gunthorpe
On Sun, Sep 07, 2025 at 11:25:09PM +0900, Takashi Sakamoto wrote: > Hi, > > I'm a present maintainer of Linux FireWire subsystem, and recent years > have been working to modernize the subsystem. > > On Fri, Sep 05, 2025 at 14:43:24PM -0300, Jason Gunthorpe wrote: > > There is only one user I foun

Re: [PATCH v2 0/7] Nesting support for lazy MMU mode

2025-09-08 Thread Lorenzo Stoakes
On Mon, Sep 08, 2025 at 08:39:24AM +0100, Kevin Brodsky wrote: > When the lazy MMU mode was introduced eons ago, it wasn't made clear > whether such a sequence was legal: > > arch_enter_lazy_mmu_mode() > ... > arch_enter_lazy_mmu_mode() > ... >

RE: [PATCH] x86/mcheck: allow varying bank counts per CPU

2025-09-08 Thread Dandapat, Soham
[Public] Hi Jan , Jason , Suggestion sounds good to me . I am ok with that . Thanks, Soham -Original Message- From: Jason Andryuk Sent: Monday, September 8, 2025 7:10 PM To: Jan Beulich ; Dandapat, Soham Cc: Andrew Cooper ; Roger Pau Monné ; xen-devel@lists.xenproject.org Subject: Re

[PATCH v7 15/16] xen/domain: allocate d->irq_caps before arch-specific initialization

2025-09-08 Thread dmukhin
From: Denis Mukhin Make sure that NS16550 emulator does not share virtual device IRQ with the physical one. This is needed for enabling NS16550 emulator for PVH hwdom (dom0). To do that, move per-domain interrupt rangeset allocation before arch-specific code. Add irqs_setup_access() to setup th

Re: [PATCH v6 11/13] xen/arm: Add support for system suspend triggered by hardware domain

2025-09-08 Thread Jan Beulich
On 09.09.2025 08:29, Mykola Kvach wrote: > On Wed, Sep 3, 2025 at 7:31 AM Mykola Kvach wrote: >> On Tue, Sep 2, 2025 at 5:33 PM Jan Beulich wrote: >>> On 02.09.2025 00:10, Mykola Kvach wrote: --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -1317,7 +1317,11 @@ int domain_shut