Received: from eggs.gnu.org ([2001:4830:134:3::10]:55241) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bls5W-0002wB-GI for qemu-devel@nongnu.org; Mon, 19 Sep 2016 02:30:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bls5R-000849-GY for qemu-devel@nongnu.org; Mon, 19 Sep 2016 02:29:57 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:50900) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bls5R-00083n-7f for qemu-devel@nongnu.org; Mon, 19 Sep 2016 02:29:53 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u8J6SjiR125377 for ; Mon, 19 Sep 2016 02:29:52 -0400 Received: from e23smtp07.au.ibm.com (e23smtp07.au.ibm.com [202.81.31.140]) by mx0a-001b2d01.pphosted.com with ESMTP id 25hxp0b209-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 19 Sep 2016 02:29:52 -0400 Received: from localhost by e23smtp07.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 19 Sep 2016 16:29:50 +1000 From: Nikunj A Dadhania Date: Mon, 19 Sep 2016 11:59:32 +0530 In-Reply-To: <1474266577-11704-1-git-send-email-nikunj@linux.vnet.ibm.com> References: <1474266577-11704-1-git-send-email-nikunj@linux.vnet.ibm.com> Message-Id: <1474266577-11704-5-git-send-email-nikunj@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v4 4/9] ppc/xics: An ICS with offset 0 is assumed to be uninitialized List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-ppc@nongnu.org, david@gibson.dropbear.id.au Cc: qemu-devel@nongnu.org, nikunj@linux.vnet.ibm.com, benh@kernel.crashing.org, clg@kaod.org From: Benjamin Herrenschmidt This will make life easier for dealing with dynamically configured ICSes such as PHB3 Signed-off-by: Benjamin Herrenschmidt Reviewed-by: David Gibson Signed-off-by: Nikunj A Dadhania --- include/hw/ppc/xics.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h index 1ea40bd..e49a2da 100644 --- a/include/hw/ppc/xics.h +++ b/include/hw/ppc/xics.h @@ -151,7 +151,7 @@ struct ICSState { static inline bool ics_valid_irq(ICSState *ics, uint32_t nr) { - return (nr >= ics->offset) + return (ics->offset != 0) && (nr >= ics->offset) && (nr < (ics->offset + ics->nr_irqs)); } -- 2.7.4