From: dmukhin@ford.com
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 v8 7/7] xen/console: make console buffer size configurable
Date: Mon, 27 Jul 2026 23:50:49 -0700 [thread overview]
Message-ID: <20260728065049.1318143-8-dmukhin@ford.com> (raw)
In-Reply-To: <20260728065049.1318143-1-dmukhin@ford.com>
From: Denis Mukhin <dmukhin@ford.com>
Add new CONRING_SHIFT Kconfig parameter to specify the boot console
buffer size as a power of 2.
The supported range is [14..27] -> [16KiB..128MiB].
Set default to 15 (32 KiB).
Update the documentation for 'conring_size=' command line option.
Resolves: https://gitlab.com/xen-project/xen/-/issues/185
Signed-off-by: Denis Mukhin <dmukhin@ford.com>
---
Changes since v7:
- n/a
---
docs/misc/xen-command-line.pandoc | 8 ++++++--
xen/drivers/char/Kconfig | 21 +++++++++++++++++++++
xen/drivers/char/console.c | 6 +++---
3 files changed, 30 insertions(+), 5 deletions(-)
diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 2be8772b329a..448c9bdb8254 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -425,10 +425,14 @@ The following are examples of correct specifications:
### conring_size
> `= <size>`
-> Default: `conring_size=16k`
-
Specify the size of the console ring buffer.
+The default console ring buffer size is selected at build-time via
+`CONFIG_CONRING_SHIFT` setting.
+
+The run-time console ring buffer size is the maximum of the build-time value
+and the value specified by the `conring_size=` command-line option.
+
### console
> `= List of [ vga | com1[H,L] | com2[H,L] | pv | dbgp | ehci | xhci | none ]`
diff --git a/xen/drivers/char/Kconfig b/xen/drivers/char/Kconfig
index 8e49a52c735b..a40a9929132b 100644
--- a/xen/drivers/char/Kconfig
+++ b/xen/drivers/char/Kconfig
@@ -95,6 +95,27 @@ config SERIAL_TX_BUFSIZE
Default value is 32768 (32KiB).
+config CONRING_SHIFT
+ int "Console ring buffer size (power of 2)"
+ range 14 27
+ default 15
+ help
+ Select the boot console ring buffer size as a power of 2.
+
+ The run-time console ring buffer is the maximum of the build-time
+ value and the value specified by the `conring_size=` command-line
+ option.
+
+ If `conring_size=` is not specified on the command line, the run-time
+ console ring buffer size is the maximum of this value and
+ `num_present_cpus() << (9 + xenlog_lower_thresh)`.
+
+ 27 => 128 MiB
+ 26 => 64 MiB
+ ...
+ 15 => 32 KiB (default)
+ 14 => 16 KiB
+
config XHCI
bool "XHCI DbC UART driver"
depends on X86
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index a1b8e5f5b507..76367c1dd705 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -340,12 +340,12 @@ static void cf_check do_dec_thresh(unsigned char key, bool unused)
* ********************************************************
*/
-/* conring_size: allows a larger console ring than default (16kB). */
+/* conring_size: override build-time CONFIG_CONRING_SHIFT setting. */
static unsigned int __initdata opt_conring_size;
size_param("conring_size", opt_conring_size);
-#define _CONRING_SIZE 16384
-#define CONRING_IDX_MASK(i) ((i)&(conring_size-1))
+#define _CONRING_SIZE (1U << CONFIG_CONRING_SHIFT)
+#define CONRING_IDX_MASK(i) ((i) & (conring_size - 1))
static char __initdata _conring[_CONRING_SIZE];
static char *__ro_after_init conring = _conring;
static unsigned int __ro_after_init conring_size = _CONRING_SIZE;
--
2.54.0
next prev parent reply other threads:[~2026-07-28 6:51 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-28 6:50 [PATCH v8 0/7] xen/console: some cleanups and configurable conring size dmukhin
2026-07-28 6:50 ` [PATCH v8 1/7] xen/console: do not use XENCONS_RING_IDX in console_init_ring() dmukhin
2026-08-10 20:03 ` Stefano Stabellini
2026-07-28 6:50 ` [PATCH v8 2/7] xen/console: use 'unsigned int' in contring_{flush,puts}() dmukhin
2026-08-10 20:05 ` Stefano Stabellini
2026-07-28 6:50 ` [PATCH v8 3/7] xen/console: switch conring runtime allocation to xvmalloc dmukhin
2026-08-10 20:19 ` Stefano Stabellini
2026-07-28 6:50 ` [PATCH v8 4/7] xen/serial: switch txbuf " dmukhin
2026-08-10 20:22 ` Stefano Stabellini
2026-07-28 6:50 ` [PATCH v8 5/7] xen/console: use memcpy() in conring_puts() dmukhin
2026-08-10 20:24 ` Stefano Stabellini
2026-08-10 21:36 ` Stefano Stabellini
2026-08-10 21:37 ` Andrew Cooper
2026-07-28 6:50 ` [PATCH v8 6/7] xen/serial: harden serial_tx_buffer checks dmukhin
2026-08-10 20:32 ` Stefano Stabellini
2026-07-28 6:50 ` dmukhin [this message]
2026-08-10 20:42 ` [PATCH v8 7/7] xen/console: make console buffer size configurable Stefano Stabellini
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=20260728065049.1318143-8-dmukhin@ford.com \
--to=dmukhin@ford.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--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.