From patchwork Wed Sep 18 13:15:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 20434 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f71.google.com (mail-qa0-f71.google.com [209.85.216.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4D56326114 for ; Wed, 18 Sep 2013 13:15:32 +0000 (UTC) Received: by mail-qa0-f71.google.com with SMTP id k15sf4864260qaq.2 for ; Wed, 18 Sep 2013 06:15:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version: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=owM2VXZ7YQX3REj0PHyCXA5JJ1AsEa72X9ccmKt0qs4=; b=mToAC8s66kxuQ4FkOdsuAKOvUWynDo7GZVUFnwsh+zLb0UyBqQMSSNDyrUPu2CnSUt KXKlVRmIKlcYAoszdBol6fWXdXkNnLtUTFg7UlxXSiu62GJvQp78TADHMcwQO20F1Mrp BsuhYCPTtqqB9LAGkwylnkuxii1mg3alICqql0eSm64VDHLzCD+X4vJ2SlLS8evOwc5o DOZry55zgRiIVRlQZSiSQysbb1gZ48VAv9X5ojyH7LFlkFVtZX6gG5JOrI805CgVoS2n 5BG5Mc2PHErJRvkrlpR+OhZS34eLKvEWjhi/Z/3GOEVkrhbUY+P/SGzf70TvWvDYT2YV gbWw== X-Gm-Message-State: ALoCoQn+EDp1xUsAZcDbBQU8lQuhJI7ih31HCLVm3NyLPgGO6l6uBpLxnFxlm1tpw48nYfJdHq/K X-Received: by 10.236.75.201 with SMTP id z49mr14891762yhd.0.1379510131885; Wed, 18 Sep 2013 06:15:31 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.83.7 with SMTP id m7ls3480922qey.0.gmail; Wed, 18 Sep 2013 06:15:31 -0700 (PDT) X-Received: by 10.220.88.13 with SMTP id y13mr15283434vcl.20.1379510131797; Wed, 18 Sep 2013 06:15:31 -0700 (PDT) Received: from mail-vb0-f43.google.com (mail-vb0-f43.google.com [209.85.212.43]) by mx.google.com with ESMTPS id i15si517601vep.16.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Sep 2013 06:15:31 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.43 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.43; Received: by mail-vb0-f43.google.com with SMTP id h11so5211119vbh.16 for ; Wed, 18 Sep 2013 06:15:31 -0700 (PDT) X-Received: by 10.221.32.133 with SMTP id sk5mr523829vcb.27.1379510131697; Wed, 18 Sep 2013 06:15:31 -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 u4csp217404vcz; Wed, 18 Sep 2013 06:15:31 -0700 (PDT) X-Received: by 10.14.174.8 with SMTP id w8mr1395739eel.84.1379510129466; Wed, 18 Sep 2013 06:15:29 -0700 (PDT) Received: from mail-ea0-f177.google.com (mail-ea0-f177.google.com [209.85.215.177]) by mx.google.com with ESMTPS id x42si1750241eea.254.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Sep 2013 06:15:29 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.177 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=209.85.215.177; Received: by mail-ea0-f177.google.com with SMTP id f15so3416379eak.22 for ; Wed, 18 Sep 2013 06:15:28 -0700 (PDT) X-Received: by 10.15.90.132 with SMTP id q4mr716717eez.98.1379510128830; Wed, 18 Sep 2013 06:15:28 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id n48sm2689190eeg.17.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Sep 2013 06:15:28 -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 v3 2/6] xen/arm: Initialize correctly IRQ routing Date: Wed, 18 Sep 2013 14:15:18 +0100 Message-Id: <1379510122-9467-3-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1379510122-9467-1-git-send-email-julien.grall@linaro.org> References: <1379510122-9467-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.212.43 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 Acked-by: Ian Campbell --- 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 091eb36..b969d23 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -258,9 +258,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;