From patchwork Fri Apr 1 15:49:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 8726091 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9EABA9FC89 for ; Fri, 1 Apr 2016 15:52:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B4906203E3 for ; Fri, 1 Apr 2016 15:52:38 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E65FB203E5 for ; Fri, 1 Apr 2016 15:52:37 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1am1L0-0004OA-O6; Fri, 01 Apr 2016 15:50:18 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1am1Kz-0004Nb-CZ for xen-devel@lists.xen.org; Fri, 01 Apr 2016 15:50:17 +0000 Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id BC/E9-02987-8B89EF65; Fri, 01 Apr 2016 15:50:16 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrEIsWRWlGSWpSXmKPExsVyMfSOvu6OGf/ CDDqPMFks+biYxYHR4+ju30wBjFGsmXlJ+RUJrBnPft9kLXjOXfHxzxHmBsbJXF2MXBxCApMY JVbc/coE4rAIzGOWmNa8gRHEkRDoZ5VoPnSNtYuRE8iJkTg3azsbhF0tse35PDBbSEBNYtnhh cwQo54wSmw+tIodJMEmoCPxYtJOoCIODhEBD4k9H2tBapgFljFJzNs0iRGkRlggSmL9i4ksID aLgKpE8+7JTCA2r4C7xPats1gglslJnD/+kxnE5gSaM/nfKxaIxe4SD2fNYp/AKLCAkWEVo3p xalFZapGukV5SUWZ6RkluYmaOrqGhiV5uanFxYnpqTmJSsV5yfu4mRmBoMQDBDsaWOc6HGCU5 mJREeQ2n/QsT4kvKT6nMSCzOiC8qzUktPsSowcEh0Ldm9QVGKZa8/LxUJQneoulAdYJFqempF WmZOcDghymV4OBREuGtBUnzFhck5hZnpkOkTjEac2z5fW0tE8e2qffWMgmBTZIS5w0FKRUAKc 0ozYMbBIvKS4yyUsK8jEBnCvEUpBblZpagyr9iFOdgVBKGuIcnM68Ebt8roFOYgE7pkAY7pSQ RISXVwAhMLtanVq18wa9hmP00O9fy2f5r3rz3G7ZseXo838WhllduZ+Z/XkG9GY+dnhWU7Tx/ /cK1H582Or4x3Nh7UewHtyrHq9AL7zdO1ZCunfZU7dAlRScrIV6Jlm139h7wXzi18Mvp5aG7d nLNey/5bfpEPvZGpd1rW0MXBXnwX7tyys3Oucu3/K8SS3FGoqEWc1FxIgCauRykxQIAAA== X-Env-Sender: shannon.zhao@linaro.org X-Msg-Ref: server-3.tower-27.messagelabs.com!1459525814!34783870!1 X-Originating-IP: [209.85.220.47] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.28; banners=-,-,- X-VirusChecked: Checked Received: (qmail 47891 invoked from network); 1 Apr 2016 15:50:15 -0000 Received: from mail-pa0-f47.google.com (HELO mail-pa0-f47.google.com) (209.85.220.47) by server-3.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 1 Apr 2016 15:50:15 -0000 Received: by mail-pa0-f47.google.com with SMTP id tt10so93776080pab.3 for ; Fri, 01 Apr 2016 08:50:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tCWlkexA7GUWfSWmxd1rquAV1xKc2xJliarlVakTg94=; b=eV4mxdvL5KTH+3bs9lisp3P1nNUW9kb0mM3RFQGYU4QVjnFFSGNodn/USKHJyA+fJR veKinzm8fIZ4rO+UoX0sEfpLQ5lFqaE2YXCTl6L8YORmOmK2+7L2IHF5tiB7Pbd7OfjC Xhr28ei6+QPMmXxwtNzlhWxm/6GJtI4SoBkFY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=tCWlkexA7GUWfSWmxd1rquAV1xKc2xJliarlVakTg94=; b=CwnVH6Ux25i7byJTnPLpDpe4Peay0WZZQLpV9IasaYQrdP9JY6Tr1d4/REb097zDr4 nuAVB8MMpoCrJ0zNMFOHyUGHWPTIcYk/ow/Q+bLo4mZnvU/qQi8zH4Xk5yjT+6iwQsPq o2coNGJHxGuD4x7HczbkFw5GpnmK/TICqD/3RUcqGDcqQ2mIu34N8QxHlgGgERUOW1L7 tfeZ2CyURzxlGZaMBiMXUcPqOlLNuIa7F9VzHFR3PuiX9pZ027yQjt6+vA1R6YdkEgJx mMssESjz/LnF6Ka68CtmNySbc4n9dBAzxXCTa5F1592O46EmwmfyiWi/x4JRibHlK3J7 lN7Q== X-Gm-Message-State: AD7BkJK+reIaIfWQzstbbBPCixAI9AlW+MUDzg1FZIKDnPsCOFKo+fPtBK7IB47G3C3+Mrvl X-Received: by 10.67.14.138 with SMTP id fg10mr32062344pad.145.1459525814192; Fri, 01 Apr 2016 08:50:14 -0700 (PDT) Received: from localhost.localdomain ([167.160.116.218]) by smtp.gmail.com with ESMTPSA id yj1sm22536791pac.16.2016.04.01.08.50.06 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 01 Apr 2016 08:50:12 -0700 (PDT) From: Shannon Zhao To: linux-arm-kernel@lists.infradead.org, stefano.stabellini@citrix.com Date: Fri, 1 Apr 2016 23:49:02 +0800 Message-Id: <1459525755-36968-5-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1459525755-36968-1-git-send-email-shannon.zhao@linaro.org> References: <1459525755-36968-1-git-send-email-shannon.zhao@linaro.org> Cc: devicetree@vger.kernel.org, linux-efi@vger.kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, peter.huangpeng@huawei.com, julien.grall@arm.com, david.vrabel@citrix.com, zhaoshenglong@huawei.com, xen-devel@lists.xen.org, shannon.zhao@linaro.org Subject: [Xen-devel] [PATCH v10 04/17] arm/xen: Use xen_xlate_map_ballooned_pages to setup grant table X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use xen_xlate_map_ballooned_pages to setup grant table. Then it doesn't rely on DT or ACPI to pass the start address and size of grant table. Signed-off-by: Shannon Zhao Acked-by: Stefano Stabellini Reviewed-by: Julien Grall --- arch/arm/xen/enlighten.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index 75cd734..d94f726 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c @@ -282,18 +282,10 @@ static int __init xen_guest_init(void) { struct xen_add_to_physmap xatp; struct shared_info *shared_info_page = NULL; - struct resource res; - phys_addr_t grant_frames; if (!xen_domain()) return 0; - if (of_address_to_resource(xen_node, GRANT_TABLE_PHYSADDR, &res)) { - pr_err("Xen grant table base address not found\n"); - return -ENODEV; - } - grant_frames = res.start; - xen_events_irq = irq_of_parse_and_map(xen_node, 0); if (!xen_events_irq) { pr_err("Xen event channel interrupt not found\n"); @@ -328,7 +320,10 @@ static int __init xen_guest_init(void) if (xen_vcpu_info == NULL) return -ENOMEM; - if (gnttab_setup_auto_xlat_frames(grant_frames)) { + xen_auto_xlat_grant_frames.count = gnttab_max_grant_frames(); + if (xen_xlate_map_ballooned_pages(&xen_auto_xlat_grant_frames.pfn, + &xen_auto_xlat_grant_frames.vaddr, + xen_auto_xlat_grant_frames.count)) { free_percpu(xen_vcpu_info); return -ENOMEM; }