From patchwork Fri Aug 30 13:30:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 19632 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5151024694 for ; Fri, 30 Aug 2013 13:30:44 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id ii20sf2409333qab.1 for ; Fri, 30 Aug 2013 06:30:44 -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=MU/gLREXY/ORdNan0FebKS4Zm30Caho+UgVRRFHO4BE=; b=Ly4xhj7tP6YDigVsEgnZoieD15f8yIE+gRDQzUFmSOfC0VnJM1bNJSVc+Qmkfxu2wS eiOr09zmspd1Ug6xuKfhfz7M5XlmjGzS81ItlluHU2tr/iLovSQVUWwD7XrJl3OKUhRl Zir29VpU3OtOB9EQdp1JH0GuX6YUHneR3s+0s48YtUo/4Kp9Ev0bzEsRKMIKGPxhBFv8 g1thHflgZ4PFNpVD3fEMfxrjqa40rrhGhB9GN/ORx+0ahdxs/8YA+S0UxrJOc/3lQKZs 3/bWazC0sCuyD+0j3cEaUI4DT0qIeX06Zrej4/ZYiEoAwlrjvaxsI0IA5WxxNAc9qjwn e+/w== X-Received: by 10.236.191.233 with SMTP id g69mr466324yhn.54.1377869444122; Fri, 30 Aug 2013 06:30:44 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.35.233 with SMTP id l9ls1357095qej.60.gmail; Fri, 30 Aug 2013 06:30:43 -0700 (PDT) X-Received: by 10.58.137.167 with SMTP id qj7mr8317482veb.1.1377869443911; Fri, 30 Aug 2013 06:30:43 -0700 (PDT) Received: from mail-ve0-f178.google.com (mail-ve0-f178.google.com [209.85.128.178]) by mx.google.com with ESMTPS id w4si1044097vdo.78.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 30 Aug 2013 06:30:43 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.178; Received: by mail-ve0-f178.google.com with SMTP id ox1so1383222veb.9 for ; Fri, 30 Aug 2013 06:30:43 -0700 (PDT) X-Gm-Message-State: ALoCoQk2cHmww7BgXpjVGbKPqYEfZvegN27XwzDFNn8CLulgNQmlF579shSdSZMkOtgkOq31OnSl X-Received: by 10.58.211.227 with SMTP id nf3mr8470213vec.20.1377869443806; Fri, 30 Aug 2013 06:30:43 -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 u4csp88947vcz; Fri, 30 Aug 2013 06:30:43 -0700 (PDT) X-Received: by 10.194.205.164 with SMTP id lh4mr1748831wjc.46.1377869442857; Fri, 30 Aug 2013 06:30:42 -0700 (PDT) Received: from mail-we0-f178.google.com (mail-we0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id gt3si4077150wjc.173.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 30 Aug 2013 06:30:42 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=74.125.82.178; Received: by mail-we0-f178.google.com with SMTP id u54so1568032wes.23 for ; Fri, 30 Aug 2013 06:30:42 -0700 (PDT) X-Received: by 10.180.82.5 with SMTP id e5mr2428938wiy.15.1377869442431; Fri, 30 Aug 2013 06:30:42 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id o9sm4306202wiz.1.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 30 Aug 2013 06:30:40 -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 3/7] xen/arm: Initialize correctly IRQ routing Date: Fri, 30 Aug 2013 14:30:29 +0100 Message-Id: <1377869433-15385-4-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1377869433-15385-1-git-send-email-julien.grall@linaro.org> References: <1377869433-15385-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.128.178 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 37a73fb..cadc258 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;