From nobody Tue Feb 10 11:56:25 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1661182078815942.862192813927; Mon, 22 Aug 2022 08:27:58 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.391469.629318 (Exim 4.92) (envelope-from ) id 1oQ9Kv-0003TU-TN; Mon, 22 Aug 2022 15:27:33 +0000 Received: by outflank-mailman (output) from mailman id 391469.629318; Mon, 22 Aug 2022 15:27:33 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oQ9Kv-0003TN-Qb; Mon, 22 Aug 2022 15:27:33 +0000 Received: by outflank-mailman (input) for mailman id 391469; Mon, 22 Aug 2022 15:27:32 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oQ9Kt-0003Dm-VS for xen-devel@lists.xenproject.org; Mon, 22 Aug 2022 15:27:32 +0000 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id ee1133b3-222e-11ed-bd2e-47488cf2e6aa; Mon, 22 Aug 2022 17:27:28 +0200 (CEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 7D1DA320099F; Mon, 22 Aug 2022 11:27:26 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 22 Aug 2022 11:27:27 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 22 Aug 2022 11:27:24 -0400 (EDT) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: ee1133b3-222e-11ed-bd2e-47488cf2e6aa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1661182046; x=1661268446; bh=sEQP7E6J6N sdiYDQ6i1IvqeCjtQRZXD8ynCmZHPXkuc=; b=nxvfjo0HIRZhWc4LS+bDDzczYM QBG1lXo2KdJM1WUBFKAR/Qli52fbGcqujbr1WA5uEsN/QzomxkbbGbqFQbAYvJx7 BPsy+JEUTmf59hsQYCBOmhvlZkXJbAGLexv0vkYYRY2UywF3kLy38k6iOfHdnFYc Je16lTKIvAbY5TUY3eBQU7j4oVA8SLyThcqshkakBnCP+yzXDwCgwL3g8oieODfp d1nxHw3N25ZsFNvINBJ2Bqfkbl0z2RCvqibUt96MYhboMwbqu+zh67/v4DvwryXv +aZSIIZqTmqskqQedPY6jitVtkVVNvO8ad6hlBclS2hTk1kMZ07fOYGg9sgA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1661182046; x= 1661268446; bh=sEQP7E6J6NsdiYDQ6i1IvqeCjtQRZXD8ynCmZHPXkuc=; b=L N0CRPxm5qcATgIdFxsAS/KBvSnBjajZcqRvnqtf1zQMJFq17ihjaljKT0mjjGZm9 Jk4TMay7TfKmDtv/dmNEyW4gY6vFI51RSNEx3YHMB/D5LU0yqWk7HAwNx6BFslpY sim4VFZHH3VA7gTH4Q6vhTi1y+4psVy+m7Fe7xIp0OdqXhzWHdQSsOZDpR7fKGCc mPm74eFmTr+WUKoUuxPjK5HQs2JWgt1meGLNgA1rvQIE8cZHeAQ4DWdigQSMrW2s Ge69Qzd8d6lQjrkfCTZm5eeHV7GyMCxnlJbHdtIkxnMRmZ9CmT+K9DxIkrctSgpy KXrDKjyshMwxt1N3gT9+g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdeijedgkeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeforghr vghkucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesih hnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpefg ueduhefgvdefheehudejheefudevueeghfekhfehleegveduteeuiedugffgffenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrghrmhgrrhgv khesihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhm X-ME-Proxy: Feedback-ID: i1568416f:Fastmail From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Cc: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Jan Beulich , Andrew Cooper , George Dunlap , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH v5 1/9] drivers/char: separate dbgp=xhci to dbc=xhci option Date: Mon, 22 Aug 2022 17:27:01 +0200 Message-Id: X-Mailer: git-send-email 2.35.3 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1661182080364100002 This allows configuring EHCI and XHCI consoles separately, simultaneously. Suggested-by: Jan Beulich Signed-off-by: Marek Marczykowski-G=C3=B3recki --- new in v5 --- docs/misc/xen-command-line.pandoc | 18 ++++++++++++------ xen/drivers/char/serial.c | 6 ++++++ xen/drivers/char/xhci-dbc.c | 20 ++++++++++---------- xen/include/xen/serial.h | 1 + 4 files changed, 29 insertions(+), 16 deletions(-) diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line= .pandoc index 9a79385a3712..0d07f0c75990 100644 --- a/docs/misc/xen-command-line.pandoc +++ b/docs/misc/xen-command-line.pandoc @@ -409,7 +409,7 @@ The following are examples of correct specifications: Specify the size of the console ring buffer. =20 ### console -> `=3D List of [ vga | com1[H,L] | com2[H,L] | pv | dbgp | none ]` +> `=3D List of [ vga | com1[H,L] | com2[H,L] | pv | dbgp | dbc | none ]` =20 > Default: `console=3Dcom1,vga` =20 @@ -428,7 +428,9 @@ cleared. This allows a single port to be shared by two= subsystems `pv` indicates that Xen should use Xen's PV console. This option is only available when used together with `pv-in-pvh`. =20 -`dbgp` indicates that Xen should use a USB debug port. +`dbgp` indicates that Xen should use a USB2 debug port. + +`dbc` indicates that Xen should use a USB3 debug port. =20 `none` indicates that Xen should not use a console. This option only makes sense on its own. @@ -721,14 +723,18 @@ Available alternatives, with their meaning, are: =20 ### dbgp > `=3D ehci[ | @pci:. ]` + +Specify the USB controller to use, either by instance number (when going +over the PCI busses sequentially) or by PCI device (must be on segment 0). + +### dbc > `=3D xhci[ | @pci:. ]` =20 Specify the USB controller to use, either by instance number (when going over the PCI busses sequentially) or by PCI device (must be on segment 0). =20 -Use `ehci` for EHCI debug port, use `xhci` for XHCI debug capability (outp= ut -only). XHCI driver will wait indefinitely for the debug host to connect - = make -sure the cable is connected. +Output only console. XHCI driver will wait indefinitely for the debug host= to +connect - make sure the cable is connected. =20 ### debug_stack_lines > `=3D ` @@ -1174,7 +1180,7 @@ virtualization, to allow the L1 hypervisor to use EPT= even if the L0 hypervisor does not provide `VM_ENTRY_LOAD_GUEST_PAT`. =20 ### gdb -> `=3D com1[H,L] | com2[H,L] | dbgp` +> `=3D com1[H,L] | com2[H,L] | dbgp | dbc` =20 > Default: `` =20 diff --git a/xen/drivers/char/serial.c b/xen/drivers/char/serial.c index 47899222cef8..7daaa61361bb 100644 --- a/xen/drivers/char/serial.c +++ b/xen/drivers/char/serial.c @@ -311,6 +311,12 @@ int __init serial_parse_handle(const char *conf) goto common; } =20 + if ( !strncmp(conf, "dbc", 3) && (!conf[3] || conf[3] =3D=3D ',') ) + { + handle =3D SERHND_DBC; + goto common; + } + if ( !strncmp(conf, "dtuart", 6) ) { handle =3D SERHND_DTUART; diff --git a/xen/drivers/char/xhci-dbc.c b/xen/drivers/char/xhci-dbc.c index ca7d4a62139e..eb35e3a2ee4f 100644 --- a/xen/drivers/char/xhci-dbc.c +++ b/xen/drivers/char/xhci-dbc.c @@ -1058,9 +1058,9 @@ static struct xhci_dbc_ctx ctx __aligned(16); static uint8_t out_wrk_buf[DBC_WORK_RING_CAP]; static struct xhci_string_descriptor str_buf[DBC_STRINGS_COUNT]; =20 -static char __initdata opt_dbgp[30]; +static char __initdata opt_dbc[30]; =20 -string_param("dbgp", opt_dbgp); +string_param("dbc", opt_dbc); =20 void __init xhci_dbc_uart_init(void) { @@ -1068,25 +1068,25 @@ void __init xhci_dbc_uart_init(void) struct dbc *dbc =3D &uart->dbc; const char *e; =20 - if ( strncmp(opt_dbgp, "xhci", 4) ) + if ( strncmp(opt_dbc, "xhci", 4) ) return; =20 memset(dbc, 0, sizeof(*dbc)); =20 - if ( isdigit(opt_dbgp[4]) ) + if ( isdigit(opt_dbc[4]) ) { - dbc->xhc_num =3D simple_strtoul(opt_dbgp + 4, &e, 10); + dbc->xhc_num =3D simple_strtoul(opt_dbc + 4, &e, 10); } - else if ( strncmp(opt_dbgp + 4, "@pci", 4) =3D=3D 0 ) + else if ( strncmp(opt_dbc + 4, "@pci", 4) =3D=3D 0 ) { unsigned int bus, slot, func; =20 - e =3D parse_pci(opt_dbgp + 8, NULL, &bus, &slot, &func); + e =3D parse_pci(opt_dbc + 8, NULL, &bus, &slot, &func); if ( !e || *e ) { printk(XENLOG_ERR - "Invalid dbgp=3D PCI device spec: '%s'\n", - opt_dbgp + 8); + "Invalid dbc=3D PCI device spec: '%s'\n", + opt_dbc + 8); return; } =20 @@ -1102,7 +1102,7 @@ void __init xhci_dbc_uart_init(void) dbc->dbc_str =3D str_buf; =20 if ( dbc_open(dbc) ) - serial_register_uart(SERHND_DBGP, &dbc_uart_driver, &dbc_uart); + serial_register_uart(SERHND_DBC, &dbc_uart_driver, &dbc_uart); } =20 #ifdef DBC_DEBUG diff --git a/xen/include/xen/serial.h b/xen/include/xen/serial.h index 4cd4ae5e6f1c..186afbed9c92 100644 --- a/xen/include/xen/serial.h +++ b/xen/include/xen/serial.h @@ -95,6 +95,7 @@ struct uart_driver { # define SERHND_COM1 (0<<0) # define SERHND_COM2 (1<<0) # define SERHND_DBGP (2<<0) +# define SERHND_DBC (3<<0) # define SERHND_DTUART (0<<0) /* Steal SERHND_COM1 value */ #define SERHND_HI (1<<2) /* Mux/demux each transferred char by MSB. = */ #define SERHND_LO (1<<3) /* Ditto, except that the MSB is cleared. = */ --=20 git-series 0.9.1