From patchwork Thu Apr 7 12:03:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 8771991 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 D5A5C9FC82 for ; Thu, 7 Apr 2016 12:10:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D929E2026F for ; Thu, 7 Apr 2016 12:10:37 +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 EC59D2020F for ; Thu, 7 Apr 2016 12:10:35 +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 1ao8k1-0003YN-1X; Thu, 07 Apr 2016 12:08:53 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ao8k0-0003Y2-EL for xen-devel@lists.xen.org; Thu, 07 Apr 2016 12:08:52 +0000 Received: from [85.158.143.35] by server-2.bemta-6.messagelabs.com id 69/B3-09532-3DD46075; Thu, 07 Apr 2016 12:08:51 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrEIsWRWlGSWpSXmKPExsVSPpHPUfeyL1u 4wcvdUhZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8a2piUsBcd5Kq5P3c/WwPiSq4uRi0NI4BSj xN8/D5khnN2MEhN/HWDsYuTkYBPQlfi4cQp7FyMHh4iAi8Sxz14gNcwC25gkjrZuYwOpERaIk tjd+ZMFxGYRUJG4/m8lK4jNK+AhMenxMSYQW0JAQ2Jl7wSwGk4BT4m29olgNUJANTta5jFB1A tKnJz5BKyGWUBC4uCLF8wQvYoSbetPskHYkhIHV9xgATlCAuTqzwtOM4IcJyFgKnH5Q8oERsF ZSEbNQjJqASPTKkb14tSistQiXUO9pKLM9IyS3MTMHF1DAzO93NTi4sT01JzEpGK95PzcTYzA 8GQAgh2MO587HWKU5GBSEuWd7soWLsSXlJ9SmZFYnBFfVJqTWnyIUYODQ6BvzeoLjFIsefl5q UoSvLU+QHWCRanpqRVpmTnACIIpleDgURLh3QuS5i0uSMwtzkyHSJ1iVJQS5w0DSQiAJDJK8+ DaYFF7iVFWSpiXEegoIZ6C1KLczBJU+VeM4hyMSsK8PSBTeDLzSuCmvwJazAS0+AI/2OKSRIS UVANjy+SGrT22aSZKLU93NHhs/fBpnmP+Z5bvt8Re393ruHDKc5mD6zbHbeFbc0+mQ0g9SGvH 7m2P1iq99Nro13eUY5/rjil6e/02Cq30usI9t9kwKVZsaooUE0e213p5RSP/3TadtaUKy78xb b6xavOuUy+Kf+t+u1iyJ22a1Yml5XyC+ffYrjBtU2Ipzkg01GIuKk4EAD0wVIDVAgAA X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-9.tower-21.messagelabs.com!1460030926!8001468!1 X-Originating-IP: [119.145.14.65] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTE5LjE0NS4xNC42NSA9PiA3NzQ2Mw==\n X-StarScan-Received: X-StarScan-Version: 8.28; banners=-,-,- X-VirusChecked: Checked Received: (qmail 14104 invoked from network); 7 Apr 2016 12:08:50 -0000 Received: from unknown (HELO szxga02-in.huawei.com) (119.145.14.65) by server-9.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 7 Apr 2016 12:08:50 -0000 Received: from 172.24.1.47 (EHLO SZXEML424-HUB.china.huawei.com) ([172.24.1.47]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DEU23419; Thu, 07 Apr 2016 20:04:20 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by SZXEML424-HUB.china.huawei.com (10.82.67.153) with Microsoft SMTP Server id 14.3.235.1; Thu, 7 Apr 2016 20:04:07 +0800 From: Shannon Zhao To: , Date: Thu, 7 Apr 2016 20:03:21 +0800 Message-ID: <1460030614-16112-5-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1460030614-16112-1-git-send-email-zhaoshenglong@huawei.com> References: <1460030614-16112-1-git-send-email-zhaoshenglong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.57064CC5.0382, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 57b0b034ad1e53dbe71294dbb528239a Cc: devicetree@vger.kernel.org, linux-efi@vger.kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, xen-devel@lists.xen.org, julien.grall@arm.com, david.vrabel@citrix.com, peter.huangpeng@huawei.com, shannon.zhao@linaro.org Subject: [Xen-devel] [PATCH v11 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: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 From: Shannon Zhao 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; }