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

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


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Wed, 23 Nov 2022 15:39:13 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=91ztrhNqOMOt8/1qRSE0i4yZUeitmA5IIjtHpwt4LOc=; b=bI00qXmRZDoS8HH2DBs2vJ7Pj8aO6T13E+PQnsBP6AiBUexkpVCj82CpK/0wfbGGWJaQ5bhlbN8Y+RIr5ygMMGu8r9NUMSKuGohqv/tuas4epHoQcmZmZHRJP1pHbbAk0o+9+F3uEyJMjxfIpuHwRCBygVYZdvVs9LuBEu6oswSZIjoxVsnXUIuqXfiWnxjU08tJ47Pe6s8cSG2/V/ZemzfIrAzlvj2/tWJfrgRsnq8pfRBddaBdiwNfl/aB5wQkmaIBXL0tNQqP7PMuM162p1DqA+8haitoic5HRp6qW2uUhThr9kjZNYNIy4DI/49zhUOrIhNFIr7dFLy/t3Lj9w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IlvCoCnJvtr3SEMZHHStaHq/TlUGPbLIzRquTq7wHSF+s+bXHVEoKFr09C9bAZuRfVwkncesiHM9teYX4LXjy7u2byuT4hCcJFTIw98FZ1EfyfXNvzVeU42OkgSOVK/IIG1axnpRyYp6dXtYx+vN/+NRR4w9swCgCDLFh2PbYZu6tOkW1v2ntVYfP9b8PCgGLki4TEUAcgVcrYR/lJhyAzhCCGMn8vQAch5aVeby5tRCX5e5rmMYSqZg9PG0SG38c7q4Rqsz0t0Qy218ttX6Lm9Sgu7ZZeqNo74TDV7rZQN+3WkitJ4qhT9WSe8t/e3A8ZhZJJ30R3vIujMLwvbabg==
  • Cc: Michal Orzel <michal.orzel@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Wed, 23 Nov 2022 14:39:43 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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>
---
To be considered to be taken for 4.17, although direct-map depends on
CONFIG_STATIC_MEMORY which is marked as unsupported.
---
 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®.