From patchwork Wed Sep 11 11:59:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 19964 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f200.google.com (mail-ye0-f200.google.com [209.85.213.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1D05525E63 for ; Wed, 11 Sep 2013 11:59:52 +0000 (UTC) Received: by mail-ye0-f200.google.com with SMTP id r3sf9704599yen.11 for ; Wed, 11 Sep 2013 04:59:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=CUeqQs7anvAqVuyIHPpWIP3bjelHJlOycO6s3crufnQ=; b=jt/+IyjcyTCpuduIX43pGfVrW5VBl/nfJuRco++hjIaeESlj3uoht8D0drM7Eped7D MXgvpZDT1v/dmHxZIv3jRol/NdZM4Swxeu0envrFGk1rkMGyIz0CYDfVr1MX5fz2GgyM fMgpQTQ1vr2jjHSrV33l9pBpPnkpxt7vBiIACDAV4WIiqjq0NiY3Gmzocl8RzNjORSVZ G/Vv5nB79UtG8Oa8b/Lb0lTmHXDn7iJ3EiK7cuclINtJZCrHjZh+Um2fB1f1+SvpSpbU m4NMD2vVMsuBZEAMqZa4OqnkcKkaFvi/CRhmTgPkcezUgxENdKPCBhDwLZqZJDG6T/14 BVJg== X-Received: by 10.236.75.201 with SMTP id z49mr500660yhd.0.1378900791884; Wed, 11 Sep 2013 04:59:51 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.98.198 with SMTP id ek6ls198877qeb.45.gmail; Wed, 11 Sep 2013 04:59:51 -0700 (PDT) X-Received: by 10.58.100.144 with SMTP id ey16mr925910veb.25.1378900791656; Wed, 11 Sep 2013 04:59:51 -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 ed9si5906713vcb.6.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Sep 2013 04:59:51 -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 ia10so6014532vcb.34 for ; Wed, 11 Sep 2013 04:59:51 -0700 (PDT) X-Gm-Message-State: ALoCoQkXU+x3iIR74dd++fT7QjpaD4IzijolUVABXfrwJsQNL8/NNlSCpEtVoT10qZW1hSxdIdr5 X-Received: by 10.58.67.9 with SMTP id j9mr955194vet.22.1378900791563; Wed, 11 Sep 2013 04:59:51 -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.220.174.196 with SMTP id u4csp52078vcz; Wed, 11 Sep 2013 04:59:50 -0700 (PDT) X-Received: by 10.14.113.137 with SMTP id a9mr1718697eeh.3.1378900790452; Wed, 11 Sep 2013 04:59:50 -0700 (PDT) Received: from mail-ea0-f171.google.com (mail-ea0-f171.google.com [209.85.215.171]) by mx.google.com with ESMTPS id f46si4267063eeo.309.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Sep 2013 04:59:50 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.171 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=209.85.215.171; Received: by mail-ea0-f171.google.com with SMTP id n15so4573860ead.30 for ; Wed, 11 Sep 2013 04:59:49 -0700 (PDT) X-Received: by 10.15.83.2 with SMTP id b2mr1822686eez.28.1378900789681; Wed, 11 Sep 2013 04:59:49 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id p5sm39687866eeg.5.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Sep 2013 04:59:49 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Cc: stefano.stabellini@eu.citrix.com, ian.campbell@citrix.com, patches@linaro.org, Julien Grall Subject: [PATCH v2 2/6] xen/arm: Initialize correctly IRQ routing Date: Wed, 11 Sep 2013 12:59:40 +0100 Message-Id: <1378900784-16949-3-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1378900784-16949-1-git-send-email-julien.grall@linaro.org> References: <1378900784-16949-1-git-send-email-julien.grall@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. 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: , When Xen initialize the GIC distributor, we need to route all the IRQs to the boot CPU. The CPU ID can differ between Xen and the GIC. When ITARGETSR0 is read, each field will return a value that corresponds only to the processor reading the register. So Xen can use the PPI 0 to initialize correctly the routing. Signed-off-by: Julien Grall --- xen/arch/arm/gic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index 7f11df6..a10416d 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -275,9 +275,10 @@ void gic_route_dt_irq(const struct dt_irq *irq, const cpumask_t *cpu_mask, static void __init gic_dist_init(void) { uint32_t type; - uint32_t cpumask = 1 << smp_processor_id(); + uint32_t cpumask; int i; + cpumask = GICD[GICD_ITARGETSR] & 0xff; cpumask |= cpumask << 8; cpumask |= cpumask << 16;