[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v1 2/2] xen/console: unify printout behavior for UART emulators
On 05.06.2025 02:57, dmkhn@xxxxxxxxx wrote: > On Wed, Jun 04, 2025 at 12:48:05PM +0200, Jan Beulich wrote: >> On 31.05.2025 02:04, dmkhn@xxxxxxxxx wrote: >>> --- a/xen/arch/x86/hvm/hvm.c >>> +++ b/xen/arch/x86/hvm/hvm.c >>> @@ -577,7 +577,7 @@ static int cf_check hvm_print_line( >>> if ( (cd->pbuf_idx == (DOMAIN_PBUF_SIZE - 1)) || (c == '\n') ) >>> { >>> cd->pbuf[cd->pbuf_idx] = '\0'; >>> - guest_printk(cd, XENLOG_G_DEBUG "%s\n", cd->pbuf); >>> + guest_printk(cd, "%s\n", cd->pbuf); >>> cd->pbuf_idx = 0; >>> } >> >> Why this and ... >> >>> @@ -755,7 +765,7 @@ static long >>> guest_console_write(XEN_GUEST_HANDLE_PARAM(char) buffer, >>> else >>> { >>> cd->pbuf[cd->pbuf_idx] = '\0'; >>> - guest_printk(cd, XENLOG_G_DEBUG "%s%s\n", cd->pbuf, kbuf); >>> + guest_printk(cd, "%s%s\n", cd->pbuf, kbuf); >>> cd->pbuf_idx = 0; >>> } >> >> ... this change? There's no compensation for it ... >> >>> @@ -1013,12 +1023,21 @@ void printk(const char *fmt, ...) >>> va_end(args); >>> } >>> >>> +/* >>> + * Print message from the guest on the diagnostic console. >>> + * Prefixes all messages w/ "(dX)" if domain X does not own physical >>> console >>> + * focus. >>> + */ >>> void guest_printk(const struct domain *d, const char *fmt, ...) >>> { >>> va_list args; >>> - char prefix[16]; >>> + char prefix[16] = ""; >>> + struct domain *consd; >>> >>> - snprintf(prefix, sizeof(prefix), "(d%d) ", d->domain_id); >>> + consd = console_get_domain(); >>> + if ( consd != d ) >>> + snprintf(prefix, sizeof(prefix), "(d%d) ", d->domain_id); >>> + console_put_domain(consd); >>> >>> va_start(args, fmt); >>> vprintk_common(fmt, args, prefix); >> >> ... here afaics, so it looks like you're undermining rate-limiting of >> those messages. > > I droppped behavior change for I/O debug port on x86 and HYPERVISOR_console_io > hypercall. > > But my understanding is that all guest debugging facilities, if enabled, > should > not be rate-limited. I certainly disagree there. How much rate limiting to apply to guest output is a matter of the guest_loglvl= command line option. Its default settings are the way they are for a reason. Jan
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |