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

Re: [PATCH] xen/arm: Fix unreachable panic for vpl011 vIRQ


  • To: Michal Orzel <michal.orzel@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Wed, 23 Nov 2022 15:22:14 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.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=tJGdZSGA+Zz+MDqpTkkfwgrZXKIr7iCq3mH2Mrze9k0=; b=ObHKkPQeOSNpS/Rztggj7M8urCHfJTe/AqueJK5bSJ0grzB8NR1en+/4JsdbLUL+Hx62qOt6TXKc4jSNsg75ysTg0HLZounQ7CI5h74XKF3SeijFxXmgYM8mqcDx0AaOKwvhbRVeeANmApkGbue1Ve7iTfbznPhL1fvPYWD2Y+2+fqCZFtaDq+8pIW6C43TZTjkZyd+GSCTL26Ls9njXwu7wI/wde6+P5LDadrOw5GGbvVcfvOUSUAVZ6rupszc5SwOMUjd8dXeCI6/q5wN0DbNLAyDwIPJWKHFQzUR3XnGdbB9E61QVpuMMQOkmVZiW0V153uK2W5V5JYI0m3nRYw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MBlUlss1jq6MT/ASG/mxKCf0NgjHbpdRNPuqTK8Y3Abul/ayGwCaC96V4CM0td+FcfXporg0pXxSIIGtraHzbIuyPcrrVAZkqiD0GHo3BXm2nsnvlLyEKJksvroLqdrl4tdv0NaQROpd+l8fOGryEiQSr20eeiOzP2GdeKIA84mcMC70V+J39/TeEKWNxu0qAXiL4JZ7cL8ihI66LF9ShNngSSwjemgEJ/qQzvQRB/gOZr9Mqd+rXaBUpOteYu6jAy2Fies5jnmKIL5syOLymNBh5v3iUh3pXiUXfo00rd2M3JEzVx5WmtC7tGb1ZkNwLBc4cArQ+m1cwFANHSjtyA==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen developer discussion <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Wed, 23 Nov 2022 15:22:45 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHY/0lo6R8O+m1HBk2HOFtyHTk0r65MoCaA
  • Thread-topic: [PATCH] xen/arm: Fix unreachable panic for vpl011 vIRQ

Hi Michal,

> On 23 Nov 2022, at 14:39, Michal Orzel <michal.orzel@xxxxxxx> wrote:
> 
> When creating direct mapped domU, the vIRQ for vpl011 is taken from
> the SERHND_DTUART serial port using serial_irq. This function can return
> -1 (i.e. no interrupt found) in which case we should call a panic.
> However, vpl011_virq is defined as unsigned int which causes the panic
> to be unreachable, because less than zero comparison of an unsigned value
> can never be true. Fix it by defining vpl011_virq as int.
> 
> Fixes: 3580c8b2dfc3 ("xen/arm: if direct-map domain use native UART address 
> and IRQ number for vPL011")
> Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>


> ---
> To be considered to be taken for 4.17, although direct-map depends on
> CONFIG_STATIC_MEMORY which is marked as unsupported.

At this stage I do not think we should back port it for the release.
We should consider this as candidate for 4.17.1

Cheers
Bertrand

> ---
> xen/arch/arm/domain_build.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index bd30d3798c9a..71a3243f48c5 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -3897,7 +3897,7 @@ void __init create_domUs(void)
> 
>         if ( !dt_property_read_u32(node, "nr_spis", &d_cfg.arch.nr_spis) )
>         {
> -            unsigned int vpl011_virq = GUEST_VPL011_SPI;
> +            int vpl011_virq = GUEST_VPL011_SPI;
> 
>             d_cfg.arch.nr_spis = gic_number_lines() - 32;
> 
> -- 
> 2.25.1
> 




 


Rackspace

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