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

Re: [PATCH] ns16550c: avoid crash in ns16550_endboot in PV shim mode


  • To: David Woodhouse <dwmw2@xxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 20 Oct 2023 08:17:51 +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=aTwms9+MKt+WkL4ozlEIwyXsRkILlNw0fYcZHV7kwrE=; b=VrU5ZXcQKLgP1Ik0VszzWQDcOQjfEg7UptY/SWcDYgXOUio1zCqWNRuL33own6QSEwkVmNJGmyGoUQzSLIiSp57q8JogTN9Re6jqLnVURo46SmExOb+Oq+y/tpPC3kzdXDW6Elnof52/jblixRIl+Lp22bLUMxT56G4qEook5mZ+u20J+GZc0KPcT+s7NACeHVskw51Pd8RqmjxZO72TCyc1s/OgAJVj5NELIukqMZY/G6W06zZQTfRwjEABMseiwKupb0ynZFWNlT6nJVU2s+lBiIM+TVmte/9M8QgwZ5UpuCTFM97vX5HFCYeAw5BBrtXi052U43kcKGPGnrqopA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WevBsIbsNg6wrcjL7zvP1LDrBOqeb6k/3RgzExAIrZ7RH/nMYjViqGaOdr1mSgMDzZ/CIVkHuRsNuBNXQjmfSg9eGBCqRseYH7ParQ7rN1OIrEzkIF5Y0h5Jc+gt/GkJct5FMruSQYbU0wj+1/jI9Fxoyz8G9DYzwEyPpWdD6pLAP8Nl+u8DPPTXX+nkS5Bh1WuqZTzKHtoThDOY1XoVPd1k8k+MjZy3xa8hX038S+SeZkJw8UWsHmM3OSq/yHnktcY7f1tInmQ8TcSFPHIK5T3Lnf/BiU3W19it1ljI+Ik3R6ycKBa+ww7QIwWO6QamoWWik0Lx7oBAp611bhVVxg==
  • 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: Fri, 20 Oct 2023 06:18:07 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 19.10.2023 18:21, David Woodhouse wrote:
> --- a/xen/drivers/char/ns16550.c
> +++ b/xen/drivers/char/ns16550.c
> @@ -586,6 +586,8 @@ static void __init cf_check ns16550_endboot(struct 
> serial_port *port)
>  
>      if ( uart->remapped_io_base )
>          return;
> +    if (!hardware_domain)
> +        return;
>      rv = ioports_deny_access(hardware_domain, uart->io_base, uart->io_base + 
> 7);
>      if ( rv != 0 )
>          BUG();

Considering this is the only use of hardware_domain in the driver, fixing
it like this (with style adjusted) is certainly an option. I'd like to
ask though whether it makes sense for execution to make it here in shim
mode, where there's no serial port anyway (unless we start supporting
pass-through [of possibly even non-PCI devices] for the shim). I wonder
whether we wouldn't want to bypass ns16550_init() - likely as well as the
EHCI and XHCI ones - instead, until (if ever) such passing through was
actually deemed necessary to support.

Jan



 


Rackspace

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