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

Re: [PATCH v6 01/10] drivers/char: allow using both dbgp=xhci and dbgp=ehci


  • To: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 6 Sep 2022 17:07:27 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • 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=Umexq5UWJnA97aYzPkpzxzfWCxk71cJvwc4Lp5srJgg=; b=Jubbda9TwEZyjIVQ+J32kZ5clNq5AQFOPq2I5otl4PFatF+WvgKOZ74d16/MQXl/VVWJfngSpIJKKWHyCFri69MscyheairB6SQSgZTUmuFsHOs02c2EqHaUjpc6Wtd5F9pPr57A86Hfx2pOiLjl12sllZMShxF+obqxSpZJJQ8Rt/oNTWPQW1LGNjhgCVZqx8vZE8pvfTqvjZFzMGmZwYQlOjVVJb3+jiGtDnmguDe0hd2/RuwH0We8gbvKQArRSht/GS2huf+k0+GvkBnmyhZbNilNdE0UxkcRlx8UdQAFhShFUTQS5oIkFhTOihO2Vhx/egjbddw6WX2wC9uwAQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R82mIS7JIoFCRyzz41wwGmdXhuFixEpqjNeCWV4RPMuJ0raThafLYHBOaZvoeZHIlHgMllFjQFlhtXWYZn3yvtWznN5p7dVDVeHIk/EeB5iHiUkZDjxGuQ2m8SVj9FLnuNXgM8VQS19XNfqqqgsjsl5L2uRo+W6H9H00mg+Uk5A/XhCROwksCQnn8xXA+8N8cRlJnSEPzFNaaIWeqVmya04ZEjRmB0WVEuydFuMP6b8nFyG100WZtWb3OlO8DjixZVaoeZUGcuZyBBcs9bGbBFLJMvXcL5gY3ROt8T/s8sKzt/Hbu/znRc0/+/QcQxdGP+1KjjttKa9XW51fRWx+rg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 06 Sep 2022 15:07:49 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 02.09.2022 15:17, Marek Marczykowski-Górecki wrote:
> This allows configuring EHCI and XHCI consoles separately,
> simultaneously.
> 
> This changes string_param() to custom_param() in both ehci and xhci
> drivers. Both drivers parse only values applicable to them.
> 
> While at it, drop unnecessary memset() of a static variable.

Are you sure of this? What if there are two "dbgp=xhci,..." options
on the command line, the latter intended to override the earlier but
malformed. Then ->enabled would be left set from parsing the first
instance, afaict.

> --- 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.
>  
>  ### console
> -> `= List of [ vga | com1[H,L] | com2[H,L] | pv | dbgp | none ]`
> +> `= List of [ vga | com1[H,L] | com2[H,L] | pv | dbgp | xhci | none ]`

Personally I consider "dbc" more in line with "dbgp", but I'm okay
with "xhci". We may want to allow for "ehci" then as an alias of
"dbgp", though (in a separate, later patch).

> --- a/xen/drivers/char/ehci-dbgp.c
> +++ b/xen/drivers/char/ehci-dbgp.c
> @@ -1464,7 +1464,18 @@ static struct uart_driver __read_mostly 
> ehci_dbgp_driver = {
>  static struct ehci_dbgp ehci_dbgp = { .state = dbgp_unsafe, .phys_port = 1 };
>  
>  static char __initdata opt_dbgp[30];
> -string_param("dbgp", opt_dbgp);
> +
> +static int __init parse_ehci_dbgp(const char *opt)
> +{
> +    if ( strncmp(opt, "ehci", 4) )
> +        return 0;
> +
> +    strlcpy(opt_dbgp, opt, sizeof(opt_dbgp));
> +
> +    return 0;
> +}
> +
> +custom_param("dbgp", parse_ehci_dbgp);

We commonly don't put a blank line between the function and this
construct. (Same again further down then.)

> --- a/xen/drivers/char/xhci-dbc.c
> +++ b/xen/drivers/char/xhci-dbc.c
> @@ -245,6 +245,7 @@ struct dbc {
>      uint64_t xhc_dbc_offset;
>      void __iomem *xhc_mmio;
>  
> +    bool enable; /* whether dbgp=xhci was set at all */

In dbc_init_xhc() there's an assumption that the "sbdf" field is
always non-zero. Do you really need this separate flag then?

Jan



 


Rackspace

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