From patchwork Thu Sep 22 06:37:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 673179 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sfnt80cQxz9t0q for ; Thu, 22 Sep 2016 17:19:12 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.b=jw71CJmN; dkim-atps=neutral Received: from localhost ([::1]:56268 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmyHl-0006qw-Fr for incoming@patchwork.ozlabs.org; Thu, 22 Sep 2016 03:19:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmxeW-0007fr-1Q for qemu-devel@nongnu.org; Thu, 22 Sep 2016 02:38:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmxeS-0006Rs-Nm for qemu-devel@nongnu.org; Thu, 22 Sep 2016 02:38:35 -0400 Received: from ozlabs.org ([103.22.144.67]:37351) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmxeS-0006Hs-88; Thu, 22 Sep 2016 02:38:32 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 3sfmyc4L50z9vDY; Thu, 22 Sep 2016 16:37:59 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1474526280; bh=f5FsjjbeMq4ySEqNtZD/BimYm3ZL5a3IzjaYHvI/y/k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jw71CJmNxfBjoGfnlklg04hS/g/NHzSdsaPOflPXZRlJf54gOUf9u7d/Z8tt/ISeN dG4K1Uyi4dILzG3X2x4GseX8d4Di657nBbtloFOZg/tcgiG8o10eFTKxyQUC0s08qG KTJTZ3MJ1KFf2b5oDcRUz+ifnsZL1YGvQypoeMGI= From: David Gibson To: peter.maydell@linaro.org Date: Thu, 22 Sep 2016 16:37:39 +1000 Message-Id: <1474526262-27011-42-git-send-email-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474526262-27011-1-git-send-email-david@gibson.dropbear.id.au> References: <1474526262-27011-1-git-send-email-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 103.22.144.67 Subject: [Qemu-devel] [PULL 41/44] ppc/xics: An ICS with offset 0 is assumed to be uninitialized X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nikunj A Dadhania , agraf@suse.de, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Signed-off-by: David Gibson --- 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 2db9f93..5aac67a 100644 --- a/include/hw/ppc/xics.h +++ b/include/hw/ppc/xics.h @@ -149,7 +149,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)); }