From patchwork Thu Jun 23 09:08:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 12891969 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 B982CCCA480 for ; Thu, 23 Jun 2022 09:09:24 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.354674.581912 (Exim 4.92) (envelope-from ) id 1o4Ipt-0000p6-SS; Thu, 23 Jun 2022 09:09:13 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 354674.581912; Thu, 23 Jun 2022 09:09:13 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o4Ipt-0000ox-Ow; Thu, 23 Jun 2022 09:09:13 +0000 Received: by outflank-mailman (input) for mailman id 354674; Thu, 23 Jun 2022 09:09:11 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o4Ipr-0007sI-NR for xen-devel@lists.xenproject.org; Thu, 23 Jun 2022 09:09:11 +0000 Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com [216.71.155.168]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 247becdd-f2d4-11ec-b725-ed86ccbb4733; Thu, 23 Jun 2022 11:09:10 +0200 (CEST) Received: from mail-mw2nam12lp2047.outbound.protection.outlook.com (HELO NAM12-MW2-obe.outbound.protection.outlook.com) ([104.47.66.47]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 23 Jun 2022 05:09:08 -0400 Received: from DS7PR03MB5608.namprd03.prod.outlook.com (2603:10b6:5:2c9::18) by SJ0PR03MB5934.namprd03.prod.outlook.com (2603:10b6:a03:2d7::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.15; Thu, 23 Jun 2022 09:09:06 +0000 Received: from DS7PR03MB5608.namprd03.prod.outlook.com ([fe80::40af:d5f4:95eb:d534]) by DS7PR03MB5608.namprd03.prod.outlook.com ([fe80::40af:d5f4:95eb:d534%7]) with mapi id 15.20.5353.022; Thu, 23 Jun 2022 09:09:06 +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" X-Inumbo-ID: 247becdd-f2d4-11ec-b725-ed86ccbb4733 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1655975350; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=teZsxeWDp9URVH3hkJcqy+gk4GBwS4EaVwF+XzaeVfs=; b=B056hFASSlqeI68HuCKsr6IJFLrsn6hnaTRi84dItQOkECf7v3G5hfqM hFOWckji09i98BTpFcN5vY5JRwwC2dcGNgXUujHmLV/Pk+CtSyzj0siZO JM2dSEmBRJXaT4dYkPB1x0eqvAplPmrJrEI1b7at8hwd+9TBR2w3sGV7v E=; X-IronPort-RemoteIP: 104.47.66.47 X-IronPort-MID: 73582818 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:k1A9B6q035Dpbca6koab8tG/QgVeBmIFZBIvgKrLsJaIsI4StFCzt garIBnUO/2MM2Hyct0nP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NjLvoAC1Y5kJYczLgBkF5MWUrHo6mt jFpBkte+x19nPqZ2mw5SDg3gHxuQxen0PK+Bu9uz/OsMb5TDU1B45qnoRCaCbU7EImoZVVzL 9L93jxjesZMTrw2ADGo/TYXRBjkUS55VA4l/QIsnBZWYwCLJdMsI0k+l9PGptoJlO31GkeKp guMCjg3ocXTbvDBEqp/VWHgebcE0jbJy32DHTr4aeuonprdHMQ9Tps+CVQpAZEyHsHceg02w 31CNUXqFhwdL5nUUsEPpZmfSKWMB27ffueChPlHbzYfJt3SE7lmtrQ3Igfwt2MVdgh8KYS8a 6xIm+w81RCMX7TNQ== X-IronPort-AV: E=Sophos;i="5.92,215,1650945600"; d="scan'208";a="73582818" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jxNREDdB0xe/kGVku9qpnfEpDJPSPRrwFTUw5vncVHWX/0jTxJnD4q+tdWOVJD3efmacbSRTICjWs/1ub27albqJnO9IjLKWdfc/uEMhg0VCAw6BASDzkF0yL3xUSmelbg3TcBiNT8EdsZyAlxV+PuQ5ODcqiTGnY1Ce4MIYCoKnUxHQfui72yaYK6jNp+hI2f583LSv+7ro3CxfFeF494qPdIvfXgGhDfvFEjGxhuXyW8kOEiuHe1Ack4SoA+Gbgy3XLdtn+zO5jtHUf8RBAgShyo4BK5XP/bQmDaqQNCeAXgpO1888si1CGHQPvXgmC+0O/GzRKGcjm/i2756BHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=hH75V/WM2LVZxnBqVh030EFKsJy+Y/Gn6Q/hZLew5iQ=; b=Mp9Yor0QmzLrnUM8GAJLS6+NjewK9qxdw+LaZUKU/HP0eyFNDAazT0TbnHHorBdWB8rqDr/wDkiiAEUsXXjHBnAosDQfwAVDwtm+c/AecA3UMPJzqakh7f2j81qySPY5K3Cp4k5oh6TGI+Ce8fTg2111mRD8jv8pgk5WmuRaJ4pB1b5VgP1Vx2SHwdRIRg1zWpu96E8igXKvLuwhRQcUZGBElKc8MjildQ4kIYlRITOsZ9UH4rUxtx5pOmYSFlMnJLdwED1Ax9b63I+DtWFfu9hT9wtSnSgyMo8g9H0pRAnBUJ1ezm0QeeMpS2FbZJAOOqSP2gSqR3L+erDy3qyw2w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hH75V/WM2LVZxnBqVh030EFKsJy+Y/Gn6Q/hZLew5iQ=; b=PLQSUsm5MKc+ynRuSEWLoq7dvAFLAXt917zkejZ9loT33CTmnz4uqYhkG/9OLnXy2WQvhc/UD9vJfqC263zhO1SDX9SBfrvilwsaRr+V83gTmZuJLl7p4naIkIeIcbpISdAoamB74kt281mO6rHlC29662F9Dzde/cLnJajOpRc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com; From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Roger Pau Monne , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH 1/2] console/serial: set the default transmit buffer size in Kconfig Date: Thu, 23 Jun 2022 11:08:51 +0200 Message-Id: <20220623090852.29622-2-roger.pau@citrix.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623090852.29622-1-roger.pau@citrix.com> References: <20220623090852.29622-1-roger.pau@citrix.com> X-ClientProxiedBy: LO2P265CA0414.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a0::18) To DS7PR03MB5608.namprd03.prod.outlook.com (2603:10b6:5:2c9::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ca529437-7c94-4de7-6fb5-08da54f8063b X-MS-TrafficTypeDiagnostic: SJ0PR03MB5934:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9oP1EHGAYjd45eb4ek7C2AZhHljYdPt89+K29WOMl7D1gSSUuneUH8ZnAOOLLpvfJFFd6l4cgQd2uYoRyILbzKu1ApN3Z3cqnrD11voIUI/Lk/92uLXRpkLpVrUtSCAvdAR5ZPB2yalv296oZkxDsGV7jBEiTfHWUXFoJ+wjibzLpaFVg16WAYdWA+sUh8xJvum4CaLw5ZxjusXgdZNX6CCjtqMNX1WV7SZm20rFKUCN9UgM8SJ5dJQ0oQdbqvb4PvQYkB+ff17RchVeItgF/nx/4d+dtBh1ZBQaYQnVECRMfoFWMeyKl7951xbK0uSBXCUxAeQHhJ+X1BO8HPBzYqn+EJFlthsW3AKw1ENUMfT5U6Mf0N+EAzHwH1+iOmgskS5HdJh33Q7VHP6fRV23yVBVSIf0sDVNalslgSQkAgWhMAddVPavc6LWcC0jQc4eg1uoz6YkUgMuRlMLzb8J2aRtMdmefgExjIpYATG03dXrxfta1ibAddERXC7KnW58UGPWaKCDaFyqynPmodpsNLSQAnPjbN3CExUXLO9CWz4YSAaHM0ptce5x/gJNgX5MDeEK7z1wMjBCEz9XvgzW6lWS3mO3Wb/5bkJ9wf/gdX0kwQbh0aJyuzLPObH8o2IpVgh+8pdJJ8lPb/gs+vAuRBogOFslelQMQFWrNlODQTzStfbZtNauRCzQM0bNpA9oq9OA6R2qTOf/PGBw2blv8w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR03MB5608.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(396003)(136003)(366004)(39860400002)(346002)(376002)(6506007)(1076003)(8676002)(4326008)(83380400001)(6486002)(66476007)(6512007)(54906003)(86362001)(66556008)(6916009)(2616005)(26005)(66946007)(41300700001)(6666004)(186003)(478600001)(316002)(5660300002)(38100700002)(36756003)(82960400001)(2906002)(8936002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?CaBYSk+H/xxhlYt93YAKzOyfpJrN?= =?utf-8?q?SBbdJKjQQ1yOyQ+xRa5NV2Eji3kqbkuXBtfLRFWqlz58qq+w4EV8eGlgsBAf6dWbt?= =?utf-8?q?9JjvvE7mtg4z/fweGmLHoel5SUFfP260SstZBrIDxDCOJbKn8TbWHLljX3QV/eqQR?= =?utf-8?q?ni0eP5t+7LOU8+LE/i7bsKbLOw3cyZKcj1NCIpt1qifY3UfDTa/g8bjflNBxSB51A?= =?utf-8?q?NiMEhRRTyQVYf7XH9KIRON5jiSL4BenOkLBPOT/xIzvaohj2kfQalMaN2He4EWthY?= =?utf-8?q?kerseLO7nhpBkl1VlvWGiAcMJtxsoOqCXTamInFbg4PRrpGmfnIiLhrzgQ6+THdPE?= =?utf-8?q?Srju/kSkIje12GIXJB0OTve3yoUsPQulL2meXjNb64lLQFuLY2pkh4v/2Z9LYG7/Y?= =?utf-8?q?yEsGbv26Ma0w+knbMXdTcr3nukbLXGdDw5yjmoLKaEU7KggOyqvNsriVZfI9nhjE0?= =?utf-8?q?SSFE910TIzP5qdJV4FNADEhSvfv14LBkleHuJ4Z8fQf7o7YGB3W+XTUNbj+wQpwaE?= =?utf-8?q?hn3zc/tlGl89bd1mXpE0rUnZ9a5OaN7mWJH+REaPPAxPXueYfKoEZLHg7qiDFguZ4?= =?utf-8?q?SuNKWSWrr1VIyajI5pE2/T+rRnIiFG4nvwAujovCg78f+KawbiY1zCEDx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7CBKH?= =?utf-8?q?AKMfcNPGqPloyMAdspfVjpU8XErEgtDN6w=3D=3D?= X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: ca529437-7c94-4de7-6fb5-08da54f8063b X-MS-Exchange-CrossTenant-AuthSource: DS7PR03MB5608.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jun 2022 09:09:06.1245 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lsHlx25bGx41C4AxIPtnrjThZDsjyIjp3kgoeCqIpQwZB+UrHl/3tX3l5o1az4Xa5cQUI99vDkEFloGSs5u+hA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5934 Take the opportunity to convert the variable to read-only after init. No functional change intended. Signed-off-by: Roger Pau Monné --- xen/drivers/char/Kconfig | 10 ++++++++++ xen/drivers/char/serial.c | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/xen/drivers/char/Kconfig b/xen/drivers/char/Kconfig index e5f7b1d8eb..a349d55f18 100644 --- a/xen/drivers/char/Kconfig +++ b/xen/drivers/char/Kconfig @@ -74,3 +74,13 @@ config HAS_EHCI help This selects the USB based EHCI debug port to be used as a UART. If you have an x86 based system with USB, say Y. + +config SERIAL_TX_BUFSIZE + int "Size of the transmit serial buffer" + default 16384 + help + Controls the default size of the transmit buffer (in bytes) used by + the serial driver. Note the value provided will be rounder up to + PAGE_SIZE. + + Default value is 16384 (16KB). diff --git a/xen/drivers/char/serial.c b/xen/drivers/char/serial.c index 5ecba0af33..8d375a41e3 100644 --- a/xen/drivers/char/serial.c +++ b/xen/drivers/char/serial.c @@ -16,7 +16,8 @@ /* Never drop characters, even if the async transmit buffer fills. */ /* #define SERIAL_NEVER_DROP_CHARS 1 */ -unsigned int __read_mostly serial_txbufsz = 16384; +unsigned int __ro_after_init serial_txbufsz = ROUNDUP(CONFIG_SERIAL_TX_BUFSIZE, + PAGE_SIZE); size_param("serial_tx_buffer", serial_txbufsz); #define mask_serial_rxbuf_idx(_i) ((_i)&(serial_rxbufsz-1))