From patchwork Sun Apr 28 23:01:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 16467 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f198.google.com (mail-ve0-f198.google.com [209.85.128.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CDFCA2395E for ; Sun, 28 Apr 2013 23:03:23 +0000 (UTC) Received: by mail-ve0-f198.google.com with SMTP id db10sf5820716veb.1 for ; Sun, 28 Apr 2013 16:02:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=N0ucrcKfwjCK6fHTIOwhXItIvVFEW+8ncYUkoEJn96M=; b=SfO/COCmy06YvjMu5KSv6TWjT5rD85upufLJ54VVFDNDJnA2/NEKZ9rBQFC7nb6OK+ WQ6rjb/XsNyeJafO5YmZOOYkV2tCaX6Pm9Xug6vgno60GqQkSaU6QPyn+E021BNNjk4W qDmGJWCuAyukVafP1bIqYX2vSxPse/lnIIzIsh4upce2JVXJmqQlna65uzJi/RC3d0En U47jfoaFH5rY1UcyvZayqNBIOMlX+fPO4HSYXhEEAdxDI1JA99SL7QzgitFDvqXQgwzh j/M742PnyvM8KcUKAqMSugO0nKEXXPKTtkUD41RzaSETDCRHwx/eVS2JHTeclOkt63vw L6cQ== X-Received: by 10.224.160.65 with SMTP id m1mr38778809qax.2.1367190142451; Sun, 28 Apr 2013 16:02:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.105.161 with SMTP id gn1ls2513341qeb.64.gmail; Sun, 28 Apr 2013 16:02:22 -0700 (PDT) X-Received: by 10.220.138.75 with SMTP id z11mr19513547vct.0.1367190142195; Sun, 28 Apr 2013 16:02:22 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id ir6si8974200vdb.52.2013.04.28.16.02.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 28 Apr 2013 16:02:22 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id lf10so5067536vcb.34 for ; Sun, 28 Apr 2013 16:02:22 -0700 (PDT) X-Received: by 10.52.71.4 with SMTP id q4mr27334926vdu.8.1367190142000; Sun, 28 Apr 2013 16:02:22 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp33777veb; Sun, 28 Apr 2013 16:02:21 -0700 (PDT) X-Received: by 10.180.188.3 with SMTP id fw3mr13969157wic.33.1367190140379; Sun, 28 Apr 2013 16:02:20 -0700 (PDT) Received: from mail-wg0-x22e.google.com (mail-wg0-x22e.google.com [2a00:1450:400c:c00::22e]) by mx.google.com with ESMTPS id t9si3452119wiv.68.2013.04.28.16.02.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 28 Apr 2013 16:02:20 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c00::22e is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=2a00:1450:400c:c00::22e; Received: by mail-wg0-f46.google.com with SMTP id e11so3152467wgh.1 for ; Sun, 28 Apr 2013 16:02:20 -0700 (PDT) X-Received: by 10.180.76.230 with SMTP id n6mr14149314wiw.28.1367190140008; Sun, 28 Apr 2013 16:02:20 -0700 (PDT) Received: from belegaer.uk.xensource.com. (firewall.ctxuk.citrix.com. [46.33.159.2]) by mx.google.com with ESMTPSA id k5sm18711393wiy.5.2013.04.28.16.02.18 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 28 Apr 2013 16:02:19 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Cc: ian.campbell@citrix.com, patches@linaro.org, anthony.perard@citrix.com, stefano.stabellini@eu.citrix.com, Julien Grall Subject: [RFC 01/29] xen/arm: lr must be included in range [0-nr_lr[ Date: Mon, 29 Apr 2013 00:01:44 +0100 Message-Id: X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: X-Gm-Message-State: ALoCoQm80s9aJ6gZ28SJrqFlDsO6asKQKipi9PmHFj6W+rsOqmkXio79tKOB6ywrRZuumDj6C1aX X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Signed-off-by: Julien Grall Acked-by: Ian Campbell --- xen/arch/arm/gic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index bc8faf2..bac2af2 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -512,7 +512,9 @@ static inline void gic_set_lr(int lr, unsigned int virtual_irq, { int maintenance_int = GICH_LR_MAINTENANCE_IRQ; - BUG_ON(lr > nr_lrs); + BUG_ON(lr >= nr_lrs); + BUG_ON(lr < 0); + BUG_ON(state & ~(GICH_LR_STATE_MASK<