On 05.02.2026 02:36, [email protected] wrote: > From: Denis Mukhin <[email protected]> > > Introduce CONFIG_CONRING_ALIGN_PAGE_SIZE to control rounding down of the > user-defined conring buffer size.
What's wrong with the rounding? The more that, with the original behavior properly restored in patch 5, it'll be a power-of-2 multiple of PAGE_SIZE anyway? > Also, update the logline reporting the final conring buffer size to report > bytes instead of kilobytes, since the user-defined size may not necessarily > be kilobyte-alined. Yet making the number harder to grok. > Suggested-by: Andrew Cooper <[email protected]> Having talked to him, I don't think he meant what you're doing here. All he apparently meant is to stop using alloc_*heap_pages(), which needlessly supplies order-aligned memory. > --- a/xen/drivers/char/Kconfig > +++ b/xen/drivers/char/Kconfig > @@ -95,6 +95,13 @@ config SERIAL_TX_BUFSIZE > > Default value is 32768 (32KiB). > > +config CONRING_ALIGN_PAGE_SIZE > + bool > + default y IOW "def_bool y". But what's the point of the option when there's no prompt? > --- a/xen/drivers/char/console.c > +++ b/xen/drivers/char/console.c > @@ -470,12 +470,15 @@ void __init console_init_ring(void) > return; > > opt_conring_size = max(opt_conring_size, conring_size); > - size = ROUNDDOWN(opt_conring_size, PAGE_SIZE); > - if ( size != opt_conring_size ) > + if ( IS_ENABLED(CONFIG_CONRING_ALIGN_PAGE_SIZE) ) > { > - opt_conring_size = size; > - printk(XENLOG_WARNING "Rounding down console ring size to multiple > of %lu KiB.\n", > - PAGE_SIZE >> 10); > + size = ROUNDDOWN(opt_conring_size, PAGE_SIZE); > + if ( size != opt_conring_size ) > + { > + opt_conring_size = size; > + printk(XENLOG_WARNING "Rounding down console ring size to > multiple of %lu KiB.\n", This line wants splitting at the start of the string literal, and the full stop wants removing if already it is being touched. Jan
