From: dmukhin@xen.org
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech,
jbeulich@suse.com, julien@xen.org, michal.orzel@amd.com,
roger.pau@citrix.com, sstabellini@kernel.org, dmukhin@ford.com
Subject: [PATCH v5 6/6] xen/console: add conring buffer size alignment setting
Date: Wed, 4 Feb 2026 17:36:06 -0800 [thread overview]
Message-ID: <20260205013606.3384798-7-dmukhin@ford.com> (raw)
In-Reply-To: <20260205013606.3384798-1-dmukhin@ford.com>
From: Denis Mukhin <dmukhin@ford.com>
Introduce CONFIG_CONRING_ALIGN_PAGE_SIZE to control rounding down of the
user-defined conring buffer size.
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.
Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Denis Mukhin <dmukhin@ford.com>
---
Changes since v4:
- new patch
---
xen/drivers/char/Kconfig | 7 +++++++
xen/drivers/char/console.c | 15 +++++++++------
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/xen/drivers/char/Kconfig b/xen/drivers/char/Kconfig
index d083ba4c9cdf..1b96fbc3ed7c 100644
--- 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
+ help
+ This selects the console ring buffer size alignment (rounding down)
+ to a multiple of PAGE_SIZE.
+
config CONRING_SHIFT
int "Console ring buffer size (power of 2)"
range 14 27
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 9394ab2a89eb..c13818715a52 100644
--- 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",
+ PAGE_SIZE >> 10);
+ }
}
if ( opt_conring_size >= GB(2) )
{
@@ -512,7 +515,7 @@ void __init console_init_ring(void)
nrspin_unlock_irqrestore(&console_lock, flags);
- printk("Allocated console ring of %u KiB.\n", opt_conring_size >> 10);
+ printk("Allocated console ring of %u bytes.\n", opt_conring_size);
}
/*
--
2.52.0
next prev parent reply other threads:[~2026-02-05 1:36 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-05 1:36 [PATCH v5 0/6] xen/console: configurable conring size dmukhin
2026-02-05 1:36 ` [PATCH v5 1/6] xen/console: group conring code together dmukhin
2026-02-09 16:38 ` Jan Beulich
2026-02-11 19:47 ` dmukhin
2026-02-05 1:36 ` [PATCH v5 2/6] xen/console: make console buffer size configurable dmukhin
2026-02-05 8:43 ` Jan Beulich
2026-02-06 1:52 ` dmukhin
2026-02-05 1:36 ` [PATCH v5 3/6] xen/console: promote conring{,_size} to __ro_after_init dmukhin
2026-02-09 16:40 ` Jan Beulich
2026-02-11 19:47 ` dmukhin
2026-02-05 1:36 ` [PATCH v5 4/6] xen/console: use memcpy() in console_init_ring() dmukhin
2026-02-09 16:56 ` Jan Beulich
2026-02-05 1:36 ` [PATCH v5 5/6] xen/console: update conring memory allocation dmukhin
2026-02-09 17:02 ` Jan Beulich
2026-05-08 21:45 ` dmukhin
2026-02-10 15:08 ` Jan Beulich
2026-02-05 1:36 ` dmukhin [this message]
2026-02-10 15:10 ` [PATCH v5 6/6] xen/console: add conring buffer size alignment setting Jan Beulich
2026-05-08 21:46 ` dmukhin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260205013606.3384798-7-dmukhin@ford.com \
--to=dmukhin@xen.org \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=dmukhin@ford.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.