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

Re: [PATCH v2] xen/hvc: replace BUG_ON() with negative return value


  • To: Juergen Gross <jgross@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 7 Jul 2021 11:57:37 +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-SenderADCheck; bh=/QhUKPoOttNGnhHG+0R6LnihQok9X9UZmTs7NpNGzM8=; b=U8/62VVADpf0LfitwADzbvwq8uo78ALyfCQyLVg+JfHlxkoxqPjMDlZ1ZFfSrEf5urLLg+XbaCWcCw3toCGjqOSj7EBqntc2vPDAn8D5DZj6ODRxCgpEABV7d5+xHRRzMrGZUuRICyEnpMwy2gRw9jkFiWFifdpnR7B1Sapg5HLXOk8sCCq7aUw62Cht/IxJKcTCN8t01ekPigmypJ9bpO88gfmtr595xFLs/rpiPeJ4owdGGXPhABUQrc3lnH+XTbLTyp9qhBD62fuY03Z765D4RJ7Q1KrTp3GKa9X8i0LkGnj/9+IeXnkVRjIhRqut3MRVMkRzkyvr21cfPXeA9w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N6qD7UvxaMW9plEvoLeXQXV9Qk6g/PlkLVuhOJslST+QHbdAhU6UDHdxMXVZ3SqXMxWcAzCjMreEH4NvGRAeMRzjIVcYg2SZoo1MynJYRPHAGakQb9+rlPtwuFd7wHBfg+5J38INEvRkYo5tw4GjEax7HmzH5k0Wj0OdQnszJjJG0LfJUQfyCmzZl4xVM9zooXUww0aJFzUI5Asf4h8/LJCIY8qyRF1Bu7FIYCZYJjCBAV+BeYimcH+0TgtAlRhj5ZueQSCIEHMQ3qm6am5xocgKj4GL4ONm7hPzyNVntuOojlxUXiKtPUfqwpV2xGQV/8CgJMiQkxOwZsE4E2/xzQ==
  • Authentication-results: lists.ozlabs.org; dkim=none (message not signed) header.d=none;lists.ozlabs.org; dmarc=none action=none header.from=suse.com;
  • Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, Jiri Slaby <jirislaby@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 07 Jul 2021 09:57:46 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 07.07.2021 11:10, Juergen Gross wrote:
> Xen frontends shouldn't BUG() in case of illegal data received from
> their backends. So replace the BUG_ON()s when reading illegal data from
> the ring page with negative return values.
> 
> Signed-off-by: Juergen Gross <jgross@xxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

> --- a/drivers/tty/hvc/hvc_xen.c
> +++ b/drivers/tty/hvc/hvc_xen.c
> @@ -86,7 +86,11 @@ static int __write_console(struct xencons_info *xencons,
>       cons = intf->out_cons;
>       prod = intf->out_prod;
>       mb();                   /* update queue values before going on */

Largely unrelated note: While in general the barriers here may want
switching to virt_*mb(), this particular one looks to be too heavy
anyway: a read barrier is all that's needed here afaict, just like
there's only a write barrier between ring contents and producer
writing in __write_console().

And btw, since I've got puzzled by the linuxppc-dev@ in the recipients
list, I did look up relevant entries in ./MAINTAINERS. Shouldn't the
file be part of "XEN HYPERVISOR INTERFACE"?

Jan




 


Rackspace

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