From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DC569EA7950 for ; Thu, 5 Feb 2026 01:36:33 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1221352.1529627 (Exim 4.92) (envelope-from ) id 1vnoI5-00029b-Id; Thu, 05 Feb 2026 01:36:17 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1221352.1529627; Thu, 05 Feb 2026 01:36:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vnoI5-00029U-Fd; Thu, 05 Feb 2026 01:36:17 +0000 Received: by outflank-mailman (input) for mailman id 1221352; Thu, 05 Feb 2026 01:36:16 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vnoI4-0001w6-CE for xen-devel@lists.xenproject.org; Thu, 05 Feb 2026 01:36:16 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.96) (envelope-from ) id 1vnoI4-003wQK-0H; Thu, 05 Feb 2026 01:36:15 +0000 Received: from [140.209.201.102] (helo=localhost) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vnoI3-00HVXD-1m; Thu, 05 Feb 2026 01:36:15 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From; bh=OmHZuBlSWJtfYojCeHKDKiy+Jl/+TAljxD/KKQZ0HFU=; b=n5+kAtOKhadDbzsHZdN1u0lU/w fL/5Y0aJF/yxV9x7oEsewB/E2kjfDJmz533UFMuyzR68vvyrAkJjk6cGhlllJmo0ZJc+POQpt6i0i 3lZpNMAMoT2m1zOhMbRd//TxTejqBCm8KNUc9RWR2/MacQyBUx3ioxT1h3TI3tylGPKo=; 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, Jason Andryuk Subject: [PATCH v5 2/6] xen/console: make console buffer size configurable Date: Wed, 4 Feb 2026 17:36:02 -0800 Message-ID: <20260205013606.3384798-3-dmukhin@ford.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260205013606.3384798-1-dmukhin@ford.com> References: <20260205013606.3384798-1-dmukhin@ford.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Denis Mukhin 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). Resolves: https://gitlab.com/xen-project/xen/-/issues/185 Signed-off-by: Denis Mukhin Reviewed-by: Jason Andryuk --- Changes since v4: - n/a --- docs/misc/xen-command-line.pandoc | 5 +++-- xen/drivers/char/Kconfig | 24 ++++++++++++++++++++++++ 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 c1f2def9f99c..87392142e8e9 100644 --- a/docs/misc/xen-command-line.pandoc +++ b/docs/misc/xen-command-line.pandoc @@ -425,10 +425,11 @@ The following are examples of correct specifications: ### conring_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. + ### 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..d083ba4c9cdf 100644 --- a/xen/drivers/char/Kconfig +++ b/xen/drivers/char/Kconfig @@ -95,6 +95,30 @@ 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. + Run-time console ring buffer size is the same as the boot console ring + buffer size, unless overridden via 'conring_size=' boot parameter. + + 27 => 128 MiB + 26 => 64 MiB + 25 => 32 MiB + 24 => 16 MiB + 23 => 8 MiB + 22 => 4 MiB + 21 => 2 MiB + 20 => 1 MiB + 19 => 512 KiB + 18 => 256 KiB + 17 => 128 KiB + 16 => 64 KiB + 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 86319600e0af..522b2f489a53 100644 --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -339,12 +339,12 @@ static void cf_check do_dec_thresh(unsigned char key, bool unused) * ******************************************************** */ -/* conring_size: allows a large console ring than default (16kB). */ +/* conring_size: override build-time CONFIG_CONRING_SHIFT setting. */ static uint32_t __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 *__read_mostly conring = _conring; static uint32_t __read_mostly conring_size = _CONRING_SIZE; -- 2.52.0