Re: [PATCH v2 31/35] x86/hvm: introduce NS8250 UART emulator

2025-01-03 Thread Denis Mukhin
On Friday, December 13th, 2024 at 3:43 AM, Roger Pau Monné wrote: > > > On Thu, Dec 05, 2024 at 08:42:01PM -0800, Denis Mukhin via B4 Relay wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > Add initial in-hypervisor emulator for NS8250/NS16x50-compatible UARTs under > > CONFIG_HAS_VUART_N

Re: [PATCH v2 31/35] x86/hvm: introduce NS8250 UART emulator

2025-01-03 Thread Denis Mukhin
On Monday, December 16th, 2024 at 7:04 AM, Jan Beulich wrote: > > > On 06.12.2024 05:42, Denis Mukhin via B4 Relay wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > Add initial in-hypervisor emulator for NS8250/NS16x50-compatible UARTs under > > CONFIG_HAS_VUART_NS8250. > > > > In paral

Re: [PATCH v2 33/35] x86/domain: implement domain_has_vuart()

2025-01-03 Thread Denis Mukhin
On Friday, December 13th, 2024 at 12:45 PM, Stefano Stabellini wrote: > > > On Fri, 13 Dec 2024, Roger Pau Monné wrote: > > > On Thu, Dec 05, 2024 at 08:42:03PM -0800, Denis Mukhin via B4 Relay wrote: > > > > > From: Denis Mukhin dmuk...@ford.com > > > > > > Add new emulation flag for virtual UA

Re: [PATCH v2 33/35] x86/domain: implement domain_has_vuart()

2025-01-03 Thread Denis Mukhin
On Monday, December 16th, 2024 at 7:11 AM, Jan Beulich wrote: > > > On 06.12.2024 05:42, Denis Mukhin via B4 Relay wrote: > > > --- a/tools/libs/light/libxl_x86.c > > +++ b/tools/libs/light/libxl_x86.c > > @@ -8,7 +8,11 @@ int libxl__arch_domain_prepare_config(libxl__gc gc, > > { > > switch(d_co

Re: [PATCH v2 33/35] x86/domain: implement domain_has_vuart()

2025-01-03 Thread Denis Mukhin
On Friday, December 13th, 2024 at 4:23 AM, Roger Pau Monné wrote: > > > On Thu, Dec 05, 2024 at 08:42:03PM -0800, Denis Mukhin via B4 Relay wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > Add new emulation flag for virtual UART on x86 and plumb it through the > > stack. > > > > This ch

Re: [PATCH v2 24/35] xen/console: introduce hwdom_crashconsole=

2025-01-03 Thread Denis Mukhin
On Thursday, December 12th, 2024 at 4:29 AM, Roger Pau Monné wrote: > > > On Thu, Dec 05, 2024 at 08:41:54PM -0800, Denis Mukhin via B4 Relay wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > The new command line switch `hwdom_crashconsole=BOOL` allows to switch > > serial > > console in

Re: [PATCH v2 10/35] xen/domain: add get_initial_domain_id()

2025-01-03 Thread Denis Mukhin
On Wednesday, December 11th, 2024 at 8:50 AM, Roger Pau Monné wrote: > > > On Thu, Dec 05, 2024 at 08:41:40PM -0800, Denis Mukhin via B4 Relay wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > Move get_initial_domain_id() to a public API and enable for all > > architectures. > > That i

Re: [PATCH v2 32/35] x86/hvm: add debugging facility to NS8250 UART emulator

2025-01-03 Thread Denis Mukhin
On Monday, December 16th, 2024 at 7:08 AM, Jan Beulich wrote: > > > On 06.12.2024 05:42, Denis Mukhin via B4 Relay wrote: > > > +static void ns8250_keyhandler_init(void) > > +{ > > + register_keyhandler('1', ns8250_keyhandler_show, > > + "dump virtual NS8250 state", 0); > > + register_keyhandler

Re: [PATCH v2 32/35] x86/hvm: add debugging facility to NS8250 UART emulator

2025-01-03 Thread Denis Mukhin
On Friday, December 13th, 2024 at 4:08 AM, Roger Pau Monné wrote: > > > On Thu, Dec 05, 2024 at 08:42:02PM -0800, Denis Mukhin via B4 Relay wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > Enable keyhandler mechanism for dumping state of emulated NS8250 on the > > console. > > > > Signed

Re: [PATCH v2 00/35] Introduce NS8250 UART emulator

2025-01-03 Thread Denis Mukhin
On Monday, December 16th, 2024 at 1:04 AM, Roger Pau Monné wrote: > > > On Sat, Dec 14, 2024 at 07:05:15PM +0100, Marek Marczykowski-Górecki wrote: > > > On Thu, Dec 05, 2024 at 08:41:30PM -0800, Denis Mukhin via B4 Relay wrote: > > > > > The patch series introduces initial in-hypervisor emulato

Re: [PATCH v2 00/35] Introduce NS8250 UART emulator

2025-01-03 Thread Denis Mukhin
On Saturday, December 14th, 2024 at 10:05 AM, Marek Marczykowski-Górecki wrote: > > > On Thu, Dec 05, 2024 at 08:41:30PM -0800, Denis Mukhin via B4 Relay wrote: > > > The patch series introduces initial in-hypervisor emulator for > > NS8250/NS16x50-compatible UARTs under CONFIG_HAS_VUART_NS8250.

Re: [PATCH v2 20/35] xen/console: introduce console_owner_domid()

2025-01-03 Thread Denis Mukhin
On Thursday, December 12th, 2024 at 2:18 AM, Roger Pau Monné wrote: > > > On Thu, Dec 05, 2024 at 08:41:50PM -0800, Denis Mukhin via B4 Relay wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > console_owner_domid() is introduced to obtain the "console owner" domain ID. > > > > The call i

Re: [PATCH v2 20/35] xen/console: introduce console_owner_domid()

2025-01-03 Thread Denis Mukhin
On Tuesday, December 10th, 2024 at 11:33 PM, Jan Beulich wrote: > > > On 10.12.2024 23:11, Jason Andryuk wrote: > > > On 2024-12-05 23:41, Denis Mukhin via B4 Relay wrote: > > > > > From: Denis Mukhin dmuk...@ford.com > > > > > > console_owner_domid() is introduced to obtain the "console owner

Re: [PATCH v2 20/35] xen/console: introduce console_owner_domid()

2025-01-03 Thread Denis Mukhin
On Tuesday, December 10th, 2024 at 11:28 PM, Jan Beulich wrote: > > > On 06.12.2024 05:41, Denis Mukhin via B4 Relay wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > console_owner_domid() is introduced to obtain the "console owner" domain ID. > > > > The call is used in NS8250 emulator

Re: [PATCH v2 20/35] xen/console: introduce console_owner_domid()

2025-01-03 Thread Denis Mukhin
On Tuesday, December 10th, 2024 at 2:11 PM, Jason Andryuk wrote: > > > On 2024-12-05 23:41, Denis Mukhin via B4 Relay wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > console_owner_domid() is introduced to obtain the "console owner" domain ID. > > > > The call is used in NS8250 emulato

Re: [PATCH v2 16/35] xen/console: introduce printk_common()

2025-01-03 Thread Denis Mukhin
On Thursday, December 12th, 2024 at 5:03 PM, Stefano Stabellini wrote: > > > On Thu, 12 Dec 2024, Jan Beulich wrote: > > > On 12.12.2024 13:15, Roger Pau Monné wrote: > > > > > On Thu, Dec 12, 2024 at 12:57:25PM +0100, Jan Beulich wrote: > > > > > > > On 12.12.2024 10:14, Roger Pau Monné wrote

Re: [PATCH v2 30/35] x86/hvm: add helpers for raising guest IRQs

2025-01-03 Thread Denis Mukhin
On Thursday, December 12th, 2024 at 8:18 AM, Roger Pau Monné wrote: > > > On Thu, Dec 05, 2024 at 08:42:00PM -0800, Denis Mukhin via B4 Relay wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > Added convenience wrappers for asserting/de-asserting interrupts in the > > hardware emulation co

Re: [PATCH v2 28/35] xen/8250-uart: add missing definitions

2025-01-03 Thread Denis Mukhin
On Thursday, December 12th, 2024 at 6:29 AM, Roger Pau Monné wrote: > > > On Thu, Dec 05, 2024 at 08:41:58PM -0800, Denis Mukhin via B4 Relay wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > Added missing definitions needed for NS8250 UART emulator. > > > > Signed-off-by: Denis Mukhin dm

Re: [PATCH v2 28/35] xen/8250-uart: add missing definitions

2025-01-03 Thread Denis Mukhin
On Thursday, December 12th, 2024 at 7:07 AM, Jan Beulich wrote: > > > On 06.12.2024 05:41, Denis Mukhin via B4 Relay wrote: > > > --- a/xen/include/xen/8250-uart.h > > +++ b/xen/include/xen/8250-uart.h > > @@ -32,16 +32,22 @@ > > #define UART_MCR 0x04 /* Modem control / > > #define UART_LSR 0x05

Re: [PATCH v2 29/35] x86/hvm: add HVM-specific Kconfig

2025-01-03 Thread Denis Mukhin
On Thursday, December 12th, 2024 at 7:06 AM, Roger Pau Monné wrote: > > > On Thu, Dec 05, 2024 at 08:41:59PM -0800, Denis Mukhin via B4 Relay wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > Add separate menu for configuring HVM build-time settings. > > That will help organizing HVM-spec

Re: [PATCH v2 09/35] x86/domain: print emulation_flags

2025-01-03 Thread Denis Mukhin
On Wednesday, December 11th, 2024 at 7:19 AM, Roger Pau Monné wrote: > > > On Thu, Dec 05, 2024 at 08:41:39PM -0800, Denis Mukhin via B4 Relay wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > Print d->arch.emulation_flags on the console for better traceability while > > debugging in-hy

Re: [PATCH v2 27/35] xen/console: flush console ring to physical console

2025-01-03 Thread Denis Mukhin
On Thursday, December 12th, 2024 at 6:21 AM, Roger Pau Monné wrote: > > > On Thu, Dec 05, 2024 at 08:41:57PM -0800, Denis Mukhin via B4 Relay wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > Messages printed before the serial and VGA consoles are initialized end up > > in > > the intern

Re: [PATCH v2 09/35] x86/domain: print emulation_flags

2025-01-03 Thread Denis Mukhin
On Tuesday, December 10th, 2024 at 5:30 AM, Jan Beulich wrote: > > > On 06.12.2024 05:41, Denis Mukhin via B4 Relay wrote: > > > Print d->arch.emulation_flags on the console for better traceability while > > debugging in-hypervisor hardware emulators. > > > Personally I disagree with such extr

Re: [PATCH v2 26/35] xen/console: make console buffer size configurable

2025-01-03 Thread Denis Mukhin
On Thursday, December 12th, 2024 at 4:47 AM, Roger Pau Monné wrote: > > > On Thu, Dec 05, 2024 at 08:41:56PM -0800, Denis Mukhin via B4 Relay wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > Add new CONRING_LOG_SHIFT Kconfig parameter to specify the boot console > > buffer > > size as a

Re: [PATCH v2 23/35] xen/console: introduce console_write()

2025-01-03 Thread Denis Mukhin
On Thursday, December 12th, 2024 at 4:04 AM, Roger Pau Monné wrote: > > > On Thu, Dec 05, 2024 at 08:41:53PM -0800, Denis Mukhin via B4 Relay wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > PV Linux kernel uses HYPERVISOR_console_io hypercall for early console which > > ends up being ha

Re: [PATCH v2 19/35] xen/console: introduce console_set_owner()

2025-01-03 Thread Denis Mukhin
On Thursday, December 12th, 2024 at 2:12 AM, Roger Pau Monné wrote: > > > On Thu, Dec 05, 2024 at 08:41:49PM -0800, Denis Mukhin via B4 Relay wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > console_set_owner() is introduced for setting the new console owner. > > > > Switches console own

Re: [PATCH v2 19/35] xen/console: introduce console_set_owner()

2025-01-03 Thread Denis Mukhin
On Thursday, December 12th, 2024 at 3:59 AM, Jan Beulich wrote: > > > On 12.12.2024 11:12, Roger Pau Monné wrote: > > > On Thu, Dec 05, 2024 at 08:41:49PM -0800, Denis Mukhin via B4 Relay wrote: > > > > > +static struct domain *rcu_lock_domain_console_by_id(domid_t domid) > > > +{ > > > + struct

Re: [PATCH v2 15/35] xen/console: rename console_rx to console_owner

2025-01-03 Thread Denis Mukhin
On Thursday, December 12th, 2024 at 12:58 AM, Roger Pau Monné wrote: > > > On Thu, Dec 05, 2024 at 08:41:45PM -0800, Denis Mukhin via B4 Relay wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > Preparation for the follow on change to switch console_owner to > > domid_t address space. > > >

Re: [PATCH v2 22/35] xen/console: introduce handle_keypress_in_domain()

2025-01-03 Thread Denis Mukhin
On Thursday, December 12th, 2024 at 2:51 AM, Roger Pau Monné wrote: > > > On Thu, Dec 05, 2024 at 08:41:52PM -0800, Denis Mukhin via B4 Relay wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > With introduction of NS8250 emulator for x86, the logic of switching console > > focus gets more

Re: [PATCH v2 21/35] xen/console: introduce console_init_owner()

2025-01-03 Thread Denis Mukhin
On Thursday, December 12th, 2024 at 2:23 AM, Roger Pau Monné wrote: > > > On Thu, Dec 05, 2024 at 08:41:51PM -0800, Denis Mukhin via B4 Relay wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > console_init_owner() is introduced for selecting the boot-time console > > owner. > > > > Signed

Re: [PATCH v2 21/35] xen/console: introduce console_init_owner()

2025-01-03 Thread Denis Mukhin
On Tuesday, December 10th, 2024 at 11:31 PM, Jan Beulich wrote: > > > On 06.12.2024 05:41, Denis Mukhin via B4 Relay wrote: > > > --- a/xen/drivers/char/console.c > > +++ b/xen/drivers/char/console.c > > @@ -554,6 +554,22 @@ static void console_find_owner(void) > > console_set_owner(DOMID_XEN)

Re: [PATCH v2 17/35] xen/console: introduce consoled_is_enabled()

2025-01-03 Thread Denis Mukhin
On Thursday, December 12th, 2024 at 1:31 AM, Roger Pau Monné wrote: > > > On Thu, Dec 05, 2024 at 08:41:47PM -0800, Denis Mukhin via B4 Relay wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > There are few places which check pv_shim console under CONFIG_PV_SHIM in xen > > console driver.

Re: [PATCH v2 14/35] xen/console: rename switch_serial_input() to console_find_owner()

2025-01-03 Thread Denis Mukhin
On Wednesday, December 11th, 2024 at 9:22 AM, Roger Pau Monné wrote: > > > On Tue, Dec 10, 2024 at 03:13:20PM +0100, Jan Beulich wrote: > > > On 06.12.2024 05:41, Denis Mukhin via B4 Relay wrote: > > > > > From: Denis Mukhin dmuk...@ford.com > > > > > > Updated the name to highlight the logic of

Re: [PATCH v2 13/35] xen/console: rename console_input_domain

2025-01-03 Thread Denis Mukhin
On Wednesday, December 11th, 2024 at 9:17 AM, Roger Pau Monné wrote: > > > On Thu, Dec 05, 2024 at 08:41:43PM -0800, Denis Mukhin via B4 Relay wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > console_input_domain() takes an RCU lock to protect domain structure. > > That implies call to r

Re: [PATCH v2 11/35] xen/domain: enable max_init_domid for all architectures

2025-01-03 Thread Denis Mukhin
On Wednesday, December 11th, 2024 at 9:00 AM, Roger Pau Monné wrote: > > > On Thu, Dec 05, 2024 at 08:41:41PM -0800, Denis Mukhin via B4 Relay wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > Move max_init_domid to a public API and enable for all architectures. > > That is pre-requisite

Re: [PATCH v2 34/35] xen/console: enable console owners w/ emulated NS8250

2025-01-03 Thread Denis Mukhin
On Tuesday, December 10th, 2024 at 11:38 PM, Jan Beulich wrote: > > > On 10.12.2024 23:46, Jason Andryuk wrote: > > > On 2024-12-05 23:42, Denis Mukhin via B4 Relay wrote: > > > > > From: Denis Mukhin dmuk...@ford.com > > > > > > Enable console focus for domains w/ virtual NS8250. > > > > > >

Re: [PATCH v2 08/35] x86/domain: introduce domain_has_vuart()

2025-01-03 Thread Denis Mukhin
On Wednesday, December 11th, 2024 at 7:13 AM, Roger Pau Monné wrote: > > > On Thu, Dec 05, 2024 at 08:41:38PM -0800, Denis Mukhin via B4 Relay wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > Introduce domain_has_vuart() for x86 port to be used in the console driver. > > > > Signed-off

Re: [PATCH v2 01/35] xen: introduce resource.h

2025-01-03 Thread Denis Mukhin
On Wednesday, December 11th, 2024 at 3:01 AM, Roger Pau Monné wrote: > > > On Thu, Dec 05, 2024 at 08:41:31PM -0800, Denis Mukhin via B4 Relay wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > Move resource definitions to a new architecture-agnostic shared header file. > > > > It will b

Re: [PATCH v2 34/35] xen/console: enable console owners w/ emulated NS8250

2025-01-03 Thread Denis Mukhin
On Tuesday, December 10th, 2024 at 2:46 PM, Jason Andryuk wrote: > > > On 2024-12-05 23:42, Denis Mukhin via B4 Relay wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > Enable console focus for domains w/ virtual NS8250. > > > > Code change allows to capture the output from the guest OS

Re: [PATCH v2 19/35] xen/console: introduce console_set_owner()

2025-01-03 Thread Denis Mukhin
On Tuesday, December 10th, 2024 at 7:02 AM, Jan Beulich wrote: > > > On 06.12.2024 05:41, Denis Mukhin via B4 Relay wrote: > > > --- a/xen/drivers/char/console.c > > +++ b/xen/drivers/char/console.c > > @@ -463,82 +463,100 @@ static void cf_check dump_console_ring_key(unsigned > > char key) > >

Re: [PATCH v2 18/35] xen/console: introduce use of 'is_console' flag

2025-01-03 Thread Denis Mukhin
On Tuesday, December 10th, 2024 at 6:52 AM, Jan Beulich wrote: > > > On 06.12.2024 05:41, Denis Mukhin via B4 Relay wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > The code now inspects d->is_console flag to decide whether the console focus > > should move to the domain w/ console aft

Re: [PATCH v2 17/35] xen/console: introduce consoled_is_enabled()

2025-01-03 Thread Denis Mukhin
On Tuesday, December 10th, 2024 at 6:31 AM, Jan Beulich wrote: > > > On 06.12.2024 05:41, Denis Mukhin via B4 Relay wrote: > > > --- a/xen/drivers/char/consoled.c > > +++ b/xen/drivers/char/consoled.c > > @@ -43,13 +43,13 @@ struct xencons_interface *consoled_get_ring_addr(void) > > static char

Re: [PATCH v2 10/35] xen/domain: add get_initial_domain_id()

2025-01-03 Thread Denis Mukhin
On Tuesday, December 10th, 2024 at 5:50 AM, Jan Beulich wrote: > > > On 06.12.2024 05:41, Denis Mukhin via B4 Relay wrote: > > > Move get_initial_domain_id() to a public API and enable for all > > architectures. > > That is pre-requisite change for console focus switch logic cleanup. > > > Yet

Re: [PATCH v2 16/35] xen/console: introduce printk_common()

2025-01-03 Thread Denis Mukhin
On Tuesday, December 10th, 2024 at 6:27 AM, Jan Beulich wrote: > > > On 06.12.2024 05:41, Denis Mukhin via B4 Relay wrote: > > > Introduce new printk() variant for convenient printouts which skip '(XEN)' > > prefix on xen console. This is needed for the case when physical console is > > owned by

Re: [PATCH v2 14/35] xen/console: rename switch_serial_input() to console_find_owner()

2025-01-03 Thread Denis Mukhin
On Tuesday, December 10th, 2024 at 6:13 AM, Jan Beulich wrote: > > > On 06.12.2024 05:41, Denis Mukhin via B4 Relay wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > Updated the name to highlight the logic of selection the physical console > > owner: existing code does not switch only ser

Re: [PATCH v2 13/35] xen/console: rename console_input_domain

2025-01-03 Thread Denis Mukhin
On Tuesday, December 10th, 2024 at 6:01 AM, Jan Beulich wrote: > > > On 06.12.2024 05:41, Denis Mukhin via B4 Relay wrote: > > > console_input_domain() takes an RCU lock to protect domain structure. > > That implies call to rcu_unlock_domain() after use. > > > > Rename console_input_domain() to

Re: [PATCH v2 11/35] xen/domain: enable max_init_domid for all architectures

2025-01-03 Thread Denis Mukhin
On Tuesday, December 10th, 2024 at 5:57 AM, Jan Beulich wrote: > > > On 06.12.2024 05:41, Denis Mukhin via B4 Relay wrote: > > > --- a/xen/common/domain.c > > +++ b/xen/common/domain.c > > @@ -65,6 +65,9 @@ DEFINE_RCU_READ_LOCK(domlist_read_lock); > > static struct domain *domain_hash[DOMAIN_HAS

Re: [PATCH v2 12/35] xen/console: move vpl011-related code to vpl011 emulator

2025-01-03 Thread Denis Mukhin
On Tuesday, December 10th, 2024 at 5:33 AM, Jan Beulich wrote: > > > On 06.12.2024 05:41, Denis Mukhin via B4 Relay wrote: > > > --- a/xen/arch/arm/include/asm/vpl011.h > > +++ b/xen/arch/arm/include/asm/vpl011.h > > @@ -69,7 +69,7 @@ struct vpl011_init_info { > > int domain_vpl011_init(struct d

Re: [PATCH 09/36] riscv/domain: introduce domain_has_vuart()

2025-01-03 Thread Denis Mukhin
ent vuart layer which can > call into vpl011, duart or ns8250. > This way, domain_has_vuart() will move there, along w/ APIs which > hooked into Xen console driver (e.g. ns8250's vuart_putchar()) will be > all there as well. > I kept this stub as is for now (in the follow on v2). I ended up w/ domain_has_vuart() defined in xen/domain.h in v3: https://lore.kernel.org/xen-devel/20250103-vuart-ns8250-v3-v1-6-c5d36b31d...@ford.com/ > > > Thanks. > > > > ~ Oleksii

Re: [PATCH v2 08/35] x86/domain: introduce domain_has_vuart()

2025-01-03 Thread Denis Mukhin
On Tuesday, December 10th, 2024 at 5:26 AM, Jan Beulich wrote: > > > On 06.12.2024 05:41, Denis Mukhin via B4 Relay wrote: > > > --- a/xen/arch/x86/include/asm/domain.h > > +++ b/xen/arch/x86/include/asm/domain.h > > @@ -506,6 +506,9 @@ struct arch_domain > > #define has_pirq(d) (!!((d)->arch.

Re: [PATCH v2 03/35] xen/ctype: introduce isconsole()

2025-01-03 Thread Denis Mukhin
On Tuesday, December 10th, 2024 at 5:22 AM, Jan Beulich wrote: > > > On 06.12.2024 05:41, Denis Mukhin via B4 Relay wrote: > > > There are several console drivers which have same checks w.r.t. printable > > characters. The check is moved to new isconsole() macro and re-used in > > the console dr

Re: [PATCH v2 02/35] xen/irq: introduce NO_IRQ

2025-01-03 Thread Denis Mukhin
On Tuesday, December 10th, 2024 at 5:17 AM, Jan Beulich wrote: > > > On 06.12.2024 05:41, Denis Mukhin via B4 Relay wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > Introduce definition for IRQ resource checks. > > > How does this fit ... > > > --- a/xen/include/xen/irq.h > > +++ b/xen

Re: [PATCH v2 01/35] xen: introduce resource.h

2025-01-03 Thread Denis Mukhin
On Tuesday, December 10th, 2024 at 5:13 AM, Jan Beulich wrote: > > > On 06.12.2024 05:41, Denis Mukhin via B4 Relay wrote: > > > --- /dev/null > > +++ b/xen/include/xen/resource.h > > @@ -0,0 +1,40 @@ > > +/* SPDX-License-Identifier: GPL-2.0 */ > > > GPL-2.0-only Fixed. > > > +/* > > + * Syste

[PATCH v3 23/24] docs/misc: update console documentation

2025-01-03 Thread Denis Mukhin via B4 Relay
From: Denis Mukhin Minor update related to virtual UART support. Also: s/pv/PV/g s/hvm/HVM/g Signed-off-by: Denis Mukhin --- docs/misc/console.txt | 50 ++ 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/docs/misc/console.txt b

[PATCH v3 18/24] xen/include: introduce resource.h

2025-01-03 Thread Denis Mukhin via B4 Relay
From: Denis Mukhin Move common resource definitions to a new architecture-agnostic shared header file. Signed-off-by: Denis Mukhin --- It will be used in follow on NS8250 emulator code to describe legacy PC COM resources. --- --- xen/common/device-tree/device-tree.c | 21 +

[PATCH v3 15/24] xen/console: make console buffer size configurable

2025-01-03 Thread Denis Mukhin via B4 Relay
From: Denis Mukhin Add new CONRING_SIZE Kconfig parameter to specify the boot console buffer size in bytes. The value is rounded to the nearest power of 2 to match existing conring_size= behavior. The supported range is [16KiB..128MiB]. Bump default size to 32 KiB. Link: https://gitlab.com/xen

[PATCH v3 17/24] xen/console: flush console ring to physical console

2025-01-03 Thread Denis Mukhin via B4 Relay
From: Denis Mukhin Internal console ring is used to hold Xen messages before external consoles (serial, VGA) consoles are fully initialized. Ensure all messages are sent to all external consoles after their initialization is completed. Link: https://gitlab.com/xen-project/xen/-/issues/184 Signe

[PATCH v3 11/24] xen/domain: move get_initial_domain_id() to arch-independent header

2025-01-03 Thread Denis Mukhin via B4 Relay
From: Denis Mukhin Honor 'hardware_domid=' parameter across all architectures and update max_init_domid correctly so that toolstack and, subsequently, console driver could iterate across known domains more efficiently. Also, move max_init_domid to arch-independent location. Signed-off-by: Denis

[PATCH v3 22/24] x86/hvm: enable NS16550-compatible UART emulator

2025-01-03 Thread Denis Mukhin via B4 Relay
From: Denis Mukhin Introduce new emulation flag for virtual UART on x86 and plumb it through domain creation code so NS16550 emulator is enabled properly. Virtual UART facility is enabled for HVM domains only. Enabling it for PVH domains requires some work, as vPIC is not enabled in PVH. Also,

[PATCH v3 19/24] xen/8250-uart: add missing definitions

2025-01-03 Thread Denis Mukhin via B4 Relay
From: Denis Mukhin Added missing definitions needed for NS8250 UART emulator. Re-used newly introduced MSR definitions in the existing ns16550 driver. Also, fixed indentation in a comment for FCR register. Signed-off-by: Denis Mukhin --- xen/drivers/char/ns16550.c | 6 ++-- xen/include/xen

[PATCH v3 24/24] xen/console: unify printout behavior for UART emulators

2025-01-03 Thread Denis Mukhin via B4 Relay
From: Denis Mukhin If virtual UART prints on the physical console, the behavior is updated to: - no prefix for Dom0 output; - DOM$NUM for DomUs when not in focus, otherwise no prefix. Introduce printk_noprefix() for convenient printouts which skip '(XEN)' prefix on the physical console. This is

[PATCH v3 21/24] x86/hvm: introduce NS16550-compatible UART emulator

2025-01-03 Thread Denis Mukhin via B4 Relay
From: Denis Mukhin Add initial in-hypervisor emulator for NS8250/NS16x50-compatible UARTs under CONFIG_VUART_NS16550. x86 port of Xen lacks vUART facility similar to Arm's vpl011 to support x86 guest OS bring up in the embedded setups. In parallel domain creation scenario (hyperlaunch), NS16550

[PATCH v3 04/24] xen/console: introduce console_{get,put}_domain()

2025-01-03 Thread Denis Mukhin via B4 Relay
From: Denis Mukhin console_input_domain() takes an RCU lock to protect domain structure. That implies call to rcu_unlock_domain() after use. Introduce a pair of console_get_domain() / console_put_domain() to highlight the correct use of the call within the code interacting with Xen console drive

[PATCH v3 20/24] x86/hvm: add HVM-specific Kconfig

2025-01-03 Thread Denis Mukhin via B4 Relay
From: Denis Mukhin Add separate menu for configuring HVM build-time settings to help organizing HVM-specific options. Signed-off-by: Denis Mukhin --- xen/arch/x86/Kconfig | 76 +--- xen/arch/x86/hvm/Kconfig | 74 ++

[PATCH v3 10/24] xen/console: introduce use of 'is_console' flag

2025-01-03 Thread Denis Mukhin via B4 Relay
From: Denis Mukhin The code inspects d->is_console flag to decide whether the console focus should move to the domain with console after administrator uses key combination to switch the console focus. Console owner switch logic updated accordingly. Signed-off-by: Denis Mukhin --- xen/arch/ar

[PATCH v3 07/24] xen/console: introduce framework for UART emulators

2025-01-03 Thread Denis Mukhin via B4 Relay
From: Denis Mukhin Introduce a driver framework to abstract UART emulators in the hypervisor. That allows for architecture-independent handling of virtual UARTs from Xen console driver and simplifies enabling new architecture-dependent UART emulators. The framework is built under CONFIG_HAS_VUA

[PATCH v3 05/24] xen/console: introduce consoled_is_enabled()

2025-01-03 Thread Denis Mukhin via B4 Relay
From: Denis Mukhin There are few places which check pv_shim console under CONFIG_PV_SHIM in xen console driver. Instead of #ifdef-ing, use new consoled_is_enabled() to customize the logic. Header file now can be included w/o CONFIG_X86. Signature of consoled_guest_{rx,tx} has changed so the err

[PATCH v3 09/24] xen/console: rename console_rx to console_owner

2025-01-03 Thread Denis Mukhin via B4 Relay
From: Denis Mukhin Update the symbol name to prepare for the follow on semantic change of console owner identifier. Signed-off-by: Denis Mukhin --- xen/drivers/char/console.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/xen/drivers/char/console.c

[PATCH v3 08/24] xen/console: rename switch_serial_input() to console_switch_input()

2025-01-03 Thread Denis Mukhin via B4 Relay
From: Denis Mukhin Updated the name to highlight the physical console input selection logic: existing code does not switch only serial console, it also switches debugging console (debug I/O port and console hypercall). Signed-off-by: Denis Mukhin --- xen/drivers/char/console.c | 6 +++--- 1 fi

[PATCH v3 03/24] arm/vuart: add hwdom prefix to UART emulator

2025-01-03 Thread Denis Mukhin via B4 Relay
From: Denis Mukhin Using "vuart" in UART emulator designed for hardware domain debugging is confusing in generic Arm code (e.g. vpl011 is also "vuart"). Fix that by adding hwdom prefix to all symbols in arm/vuart.c. Also, remove domain_has_vuart() from arm/vuart.c since it is not needed. Signed

[PATCH v3 13/24] xen/console: introduce hwdom_crashconsole=

2025-01-03 Thread Denis Mukhin via B4 Relay
From: Denis Mukhin The new command line switch `hwdom_crashconsole=BOOL` allows to switch serial console input focus to xen for machine state inspection using keyhandler mechanism after the hardware domain crashes. The new command line switch is aliased via `dom0=...,crashconsole` knob. Such fu

[PATCH v3 00/24] x86: introduce NS16550-compatible UART emulator

2025-01-03 Thread Denis Mukhin via B4 Relay
/virtdev-uart.h | 72 ++ xen/include/xen/xen.lds.h| 10 + 69 files changed, 1913 insertions(+), 479 deletions(-) --- base-commit: 7e6edeaee38c66266a941bfa66d17b492fbe change-id: 20250103-vuart-ns8250-v3-f8e1110777fe Best regards, -- Denis Mukhin

[PATCH v3 01/24] xen/ctype: introduce is_console_printable()

2025-01-03 Thread Denis Mukhin via B4 Relay
From: Denis Mukhin There are several console drivers which have same checks w.r.t. printable characters. The check is moved to new is_console_printable() function and re-used in the UART emulation / guest logging code. Also, MISRA rule 21.13 for ctype.h has been exploited while working on the co

[PATCH v3 12/24] xen/console: introduce console_{get,set}_owner()

2025-01-03 Thread Denis Mukhin via B4 Relay
From: Denis Mukhin Switch console_owner address spaces from integers mapped to domain IDs to straight domain IDs, which simplifies console focus handling code. console_set_owner() is introduced for setting the new console owner. This is a public API to Xen console driver (it will be used in the

[PATCH v3 16/24] xen/console: introduce console_write()

2025-01-03 Thread Denis Mukhin via B4 Relay
From: Denis Mukhin PV Linux kernel uses HYPERVISOR_console_io hypercall for early console which ends up being handled by Xen's console driver's guest_console_write(). guest_console_write() duplicates the code from __putstr(), elimitate code duplication. Signed-off-by: Denis Mukhin --- xen/dri

[PATCH v3 06/24] xen/domain: introduce hardware emulation flags

2025-01-03 Thread Denis Mukhin via B4 Relay
From: Denis Mukhin Define an architecture-independent location for describing hardware emulation flags for configuring in-hypervisor emulators. Print d->arch.emulation_flags from 'q' keyhandler for better traceability while debugging in-hypervisor hardware emulators. Also, expanded the error me

[PATCH v3 14/24] xen/console: simplify console owner switch hint

2025-01-03 Thread Denis Mukhin via B4 Relay
From: Denis Mukhin Update the hint with the combination of keys to press for the physical console focus switch between the domains. Signed-off-by: Denis Mukhin --- xen/drivers/char/console.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/drivers/char/console.c b/xe

[PATCH v3 02/24] arm/vuart: move vpl011-related code to vpl011 emulator

2025-01-03 Thread Denis Mukhin via B4 Relay
From: Denis Mukhin Xen console driver has vpl011-related logic which shall belong vpl011 emulator code (Arm port). Move vpl011-related code from arch-independent console driver to Arm's vpl011.c. Signed-off-by: Denis Mukhin --- xen/arch/arm/include/asm/vpl011.h | 2 +- xen/arch/arm/vpl011.c

Re: [PATCH v2 1/2] x86/uaccess: rework user access speculative harden guards

2025-01-03 Thread Stefano Stabellini
Hi Nicola, one question below On Wed, 27 Nov 2024, Nicola Vetrini wrote: > > #define AMD_OSVW_ERRATUM(osvw_id, ...) osvw_id, __VA_ARGS__, 0 > > > > where we're using the C99 form rather than the GNU extension, and where > > hence __VA_ARGS__ would - by extrapolation of the Misra rule - need > >

Re: [PATCH 4/5] xen/perfc: Cleanup

2025-01-03 Thread Stefano Stabellini
On Thu, 2 Jan 2025, Andrew Cooper wrote: > * Strip trailing whitspace. > * Remove PRIperfc. It has never been used and isn't useful. > > Signed-off-by: Andrew Cooper Reviewed-by: Stefano Stabellini > --- > CC: Jan Beulich > CC: Roger Pau Monné > CC: Stefano Stabellini > CC: Julien Grall

Re: [PATCH 3/5] xen/perfc: Trim includes

2025-01-03 Thread Stefano Stabellini
On Thu, 2 Jan 2025, Andrew Cooper wrote: > This is mostly for the removal of xen/lib.h and xen/smp.h from perfc.h. All > that is needed is xen/macros.h. > > Trim and sort the includes for perfc.c too. There's no need for smp.h, > keyhandler.h or mm.h, but cpumask.h is needed. > > Signed-off-by:

Re: [PATCH 2/5] xen/perfc: Add perfc_defn.h to asm-generic

2025-01-03 Thread Stefano Stabellini
On Thu, 2 Jan 2025, Andrew Cooper wrote: > ... and hook it up for RISC-V and PPC. > > On RISC-V at least, no combination of headers pulls in errno.h, so include it > explicitly. > > Guard the hypercalls array declaration based on NR_hypercalls existing. This > is sufficient to get PERF_COUNTERS

Re: [PATCH 1/5] xen/perfc: Drop arch_perfc_{gather,reset}()

2025-01-03 Thread Stefano Stabellini
On Thu, 2 Jan 2025, Andrew Cooper wrote: > These were only ever used by the IA64 port, which was droped in commit > 570c311ca2c7 ("remove ia64"). > > Remove them, and clean up the arm/x86 stub headers. > > Signed-off-by: Andrew Cooper Reviewed-by: Stefano Stabellini > --- > CC: Jan Beulich

[PATCH] xen: update pvcalls_front_accept prototype

2025-01-03 Thread Stefano Stabellini
Signed-off-by: Stefano Stabellini --- drivers/xen/pvcalls-front.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/xen/pvcalls-front.h b/drivers/xen/pvcalls-front.h index f694ad77379f..881ef14660bc 100644 --- a/drivers/xen/pvcalls-front.h +++ b/drivers/xen/pvcalls-front

Re: [XEN PATCH v2] eclair-analysis: tidy toolchain.ecl configuration and mark Rule 1.1 clean

2025-01-03 Thread Stefano Stabellini
On Sun, 22 Dec 2024, Nicola Vetrini wrote: > Reformat the list of GNU extensions and non-standard tokens used by Xen > in the ECLAIR configuration to make it easier to review any changes to it. > > The extension "ext_missing_varargs_arg", which captures the GNU extension that > allows variadic fun

[RFC] docs: FRED support in Xen

2025-01-03 Thread Andrew Cooper
Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné An initial RFC discussion and plan. Open TODOs are at the end. This can be viewed online at: https://andrewcoop-xen.readthedocs.io/en/docs-devel/hypervisor-guide/x86/fred.html I've got an 8-patch series doing the cpu_use

Re: Linux 6.13-rc5 Xen HVM with PCI passthrough (USB controller) crash

2025-01-03 Thread Geert Uytterhoeven
Hi Marek, On Fri, Jan 3, 2025 at 7:10 PM Marek Marczykowski-Górecki wrote: > On Fri, Jan 03, 2025 at 02:00:28AM +, Andrew Cooper wrote: > > On 03/01/2025 12:42 am, Marek Marczykowski-Górecki wrote: > > > On Fri, Jan 03, 2025 at 01:18:31AM +0100, Marek Marczykowski-Górecki > > > wrote: > > >>

Re: Linux 6.13-rc5 Xen HVM with PCI passthrough (USB controller) crash

2025-01-03 Thread Marek Marczykowski-Górecki
On Fri, Jan 03, 2025 at 02:00:28AM +, Andrew Cooper wrote: > On 03/01/2025 12:42 am, Marek Marczykowski-Górecki wrote: > > On Fri, Jan 03, 2025 at 01:18:31AM +0100, Marek Marczykowski-Górecki wrote: > >> On Thu, Jan 02, 2025 at 08:39:16PM +0100, Marek Marczykowski-Górecki wrote: > >>> On Thu, J

Re: Help With Identifying CPUID faulting logic in Xen code

2025-01-03 Thread Fonyuy-Asheri Caleb
Thank you Caleb - Original Message - > From: "Andrew Cooper" > To: "Fonyuy-Asheri Caleb" , "xen-devel" > > Cc: "Jan Beulich" > Sent: Friday, January 3, 2025 3:35:43 PM > Subject: Re: Help With Identifying CPUID faulting logic in Xen code > On 03/01/2025 2:25 pm, Fonyuy-Asheri Caleb w

Re: Help With Identifying CPUID faulting logic in Xen code

2025-01-03 Thread Andrew Cooper
On 03/01/2025 2:25 pm, Fonyuy-Asheri Caleb wrote: > Hello, > > I am interested in finding understanding how xen handles CPUID > faulting and  > VM exits in general. Please can someone indicate to me the concerned > files?  > > I want to know how xen detects the execution of the CPUID instruction an

Help With Identifying CPUID faulting logic in Xen code

2025-01-03 Thread Fonyuy-Asheri Caleb
Hello, I am interested in finding understanding how xen handles CPUID faulting and VM exits in general. Please can someone indicate to me the concerned files? I want to know how xen detects the execution of the CPUID instruction and ensures a guest only gets the features defined in cpuid-auto

Re: [XEN PATCH v1] xen: mem_access: conditionally compile vm_event.c & monitor.c

2025-01-03 Thread Ayan Kumar Halder
On 02/01/2025 19:34, Stefano Stabellini 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. On Mon, 30 Dec 2024, Sergiy Kibrik wrote: From: Stefano Stabellini Ex