[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v7 7/7] xen/console: make console buffer size configurable


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: dmukhin@xxxxxxxx
  • Date: Mon, 13 Jul 2026 11:16:19 -0700
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 148.163.138.245) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ford.com; dkim=pass (signature was verified) header.d=saarlouis.ford.com; dkim=pass (signature was verified) header.d=ford.com; arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4ktjYVJyGdNOdJlnbJpt9EEJgp53hevXtpmLI4lNADE=; b=YIDfVMNUzugTZf6z81KSXvUIFMPtFkGaj8k81xyAlWDlQBvkgQIdWCFWcxIyxN+SGQLR8L+QQcLspcGpCU6Jcmw+Iw3rsudho81f8PpNjIFvRV8NPKUZhw2mVI1c+x1E9rYZpxp/sj+OsGFtwOjhVismkyOvpIdPGbftUnekdhujkh3MYQHm7OjATI567KM9FTeC4TtMBK10awwUq+F5vGzPKGpGOP5YcAHb/aijSYOKfm3F4MHKdavEours8o2Rpcw+FIX+K22IskIFDOnaN308putjDo7c6QdTyfmf3gBZC0g6Aix4pVXjSFRWMXzodrP9MO+Kkk6ZKevRbHMpzQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ML+h+lm18NhNoWdOml8wSLacs8UVyNHb1lVH9eEJI/Ux2xGxRDAxw0By4v78ud+uIaYWh5c7rSghI064YdAQEB/P6jwxnn5ivBrzGKEa5DO+05hQuu0+2CvKGgf1iqTRtuU17N9KTK17+7im6IkIo7jjB1CWng/bv9nJn2qLoxX1DspvlmBd8Xah750AHbfdKyudGsHXqczXcM8d+isZFEamCxhZHknFSTxgs4ptikE1RWWrF4yMYJc6N/dZZ4DMX/sb3NLcCPCQNjMeGDTfBr0B8O21a0/OM6mUNXlEDBLN6FCj6lfzzkwcxFF+aHzP88IniYopiZDf4iFd8wMqVg==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
  • Cc: andrew.cooper3@xxxxxxxxxx, anthony.perard@xxxxxxxxxx, jbeulich@xxxxxxxx, julien@xxxxxxx, michal.orzel@xxxxxxx, roger.pau@xxxxxxxxxx, sstabellini@xxxxxxxxxx, dmukhin@xxxxxxxx
  • Delivery-date: Mon, 13 Jul 2026 18:16:55 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Pser-m365-app: SER-APP

From: Denis Mukhin <dmukhin@xxxxxxxx> 

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@xxxxxxxx>
---
Changes since v6:
- fixed Kconfig and documentation text
---
 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 dc779439cb69..a58531226091 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




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.