From patchwork Thu Nov 6 10:12:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frediano Ziglio X-Patchwork-Id: 40267 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1C9CC24237 for ; Thu, 6 Nov 2014 10:14:37 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id gq15sf1555193lab.2 for ; Thu, 06 Nov 2014 02:14:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=C3KQfUh9W5EIW1Gud0O+pZzGUas9gj3tqght7zCeEUE=; b=NQKqL++KlcIHX6VWyD0BpBsVDqSuRYZt4863k92Wz6lvFIG+khnlrYbykbr2r0WTCD JavHyIShDLrYVnnX6yrzNNiGJZc+jbGs9Y03iDrssuMXvx28oEvoP21C+mgH6+d/Py+R B/b06mYLWdBwya0jG1u4u/INUEh4A+idgtBX7OCVZViKUZqqfwhP5dmEEl/E31HwvNeH zF7HqgOZy7MCak3bTa+Rwtd4GMP6eU6JGclF3hSDEfFWR6uOzkkAdYfRwFQI8A/osu/B TgfqWHS/quDOevqJX0S7q90ft9XkgpS7XP+VdjiKF/NwsyTpoJaDCciuLVjlfVOnwXEz /16g== X-Gm-Message-State: ALoCoQk43T7+YvlbIAAStZKRLnt4hNmcqLzehVER8AUr8mUDVPn7g722ravOKYf0c0TWTl4TbD48 X-Received: by 10.194.176.106 with SMTP id ch10mr21008wjc.6.1415268876052; Thu, 06 Nov 2014 02:14:36 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.169 with SMTP id ld9ls66792lab.12.gmail; Thu, 06 Nov 2014 02:14:35 -0800 (PST) X-Received: by 10.152.26.226 with SMTP id o2mr4136781lag.50.1415268875895; Thu, 06 Nov 2014 02:14:35 -0800 (PST) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id la5si10769574lac.99.2014.11.06.02.14.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Nov 2014 02:14:35 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by mail-lb0-f169.google.com with SMTP id 10so632173lbg.14 for ; Thu, 06 Nov 2014 02:14:35 -0800 (PST) X-Received: by 10.152.116.102 with SMTP id jv6mr4116863lab.40.1415268875807; Thu, 06 Nov 2014 02:14:35 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp21670lbc; Thu, 6 Nov 2014 02:14:35 -0800 (PST) X-Received: by 10.229.37.70 with SMTP id w6mr5200794qcd.11.1415268874602; Thu, 06 Nov 2014 02:14:34 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id l69si11020081qge.70.2014.11.06.02.14.34 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 06 Nov 2014 02:14:34 -0800 (PST) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XmK4T-00005q-Ki; Thu, 06 Nov 2014 10:13:41 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XmK4R-0008VO-Na for xen-devel@lists.xen.org; Thu, 06 Nov 2014 10:13:39 +0000 Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id DE/29-02954-3D94B545; Thu, 06 Nov 2014 10:13:39 +0000 X-Env-Sender: frediano.ziglio@huawei.com X-Msg-Ref: server-12.tower-27.messagelabs.com!1415268814!11777768!1 X-Originating-IP: [119.145.14.66] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTE5LjE0NS4xNC42NiA9PiA4NTI3\n X-StarScan-Received: X-StarScan-Version: 6.12.4; banners=-,-,- X-VirusChecked: Checked Received: (qmail 19954 invoked from network); 6 Nov 2014 10:13:38 -0000 Received: from szxga03-in.huawei.com (HELO szxga03-in.huawei.com) (119.145.14.66) by server-12.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 6 Nov 2014 10:13:38 -0000 Received: from 172.24.2.119 (EHLO szxeml460-hub.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id AWS31148; Thu, 06 Nov 2014 18:13:33 +0800 (CST) Received: from localhost.localdomain (10.47.67.20) by szxeml460-hub.china.huawei.com (10.82.67.203) with Microsoft SMTP Server id 14.3.158.1; Thu, 6 Nov 2014 18:13:22 +0800 From: Frediano Ziglio To: Ian Campbell , Stefano Stabellini , Tim Deegan , Julien Grall , Date: Thu, 6 Nov 2014 10:12:11 +0000 Message-ID: <1415268731-6519-8-git-send-email-frediano.ziglio@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1415268731-6519-1-git-send-email-frediano.ziglio@huawei.com> References: <1415268731-6519-1-git-send-email-frediano.ziglio@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.47.67.20] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020209.545B49CD.00F1, ss=1, re=0.001, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: d2fef5729ecab7e5c9cbbbd0b97b1760 Cc: zoltan.kiss@huawei.com, xen-devel@lists.xen.org Subject: [Xen-devel] [PATCH v3 7/7] xen/arm: Handle translated addresses for hardware domains in GICv2 X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: frediano.ziglio@huawei.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: Translated address could have an offset applied to them. Replicate same value for device node to avoid improper address computation in the OS. Signed-off-by: Frediano Ziglio --- xen/arch/arm/gic-v2.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c index 2f6bbd5..c2666df 100644 --- a/xen/arch/arm/gic-v2.c +++ b/xen/arch/arm/gic-v2.c @@ -631,7 +631,7 @@ static int gicv2_make_dt_node(const struct domain *d, const struct dt_device_node *gic = dt_interrupt_controller; const void *compatible = NULL; u32 len; - __be32 *new_cells, *tmp; + const __be32 *regs; int res = 0; compatible = dt_get_property(gic, "compatible", &len); @@ -664,18 +664,18 @@ static int gicv2_make_dt_node(const struct domain *d, if ( res ) return res; + /* copy GICC and GICD regions */ + regs = dt_get_property(gic, "reg", &len); + if ( !regs ) + { + dprintk(XENLOG_ERR, "Can't find reg property for the gic node\n"); + return -FDT_ERR_XEN(ENOENT); + } + len = dt_cells_to_size(dt_n_addr_cells(node) + dt_n_size_cells(node)); len *= 2; /* GIC has two memory regions: Distributor + CPU interface */ - new_cells = xzalloc_bytes(len); - if ( new_cells == NULL ) - return -FDT_ERR_XEN(ENOMEM); - - tmp = new_cells; - dt_set_range(&tmp, node, d->arch.vgic.dbase, PAGE_SIZE); - dt_set_range(&tmp, node, d->arch.vgic.cbase, PAGE_SIZE * 2); - res = fdt_property(fdt, "reg", new_cells, len); - xfree(new_cells); + res = fdt_property(fdt, "reg", regs, len); return res; }