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: 8726161 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6CE03C0553 for ; Fri, 1 Apr 2016 15:53:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 943F9201FA for ; Fri, 1 Apr 2016 15:53:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 78262202EC for ; Fri, 1 Apr 2016 15:53:07 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1am1M5-0003g2-1c; Fri, 01 Apr 2016 15:51:25 +0000 Received: from mail-pa0-x235.google.com ([2607:f8b0:400e:c03::235]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1am1LH-00027S-CS for linux-arm-kernel@lists.infradead.org; Fri, 01 Apr 2016 15:50:38 +0000 Received: by mail-pa0-x235.google.com with SMTP id tt10so93776081pab.3 for ; Fri, 01 Apr 2016 08:50:14 -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=Mpaq6bvYscB7hhvdbRZDz7BD1QxP2E0cqGVfKXYusrJ6IBnXqHtYHqrTh5gR8Sb9K4 1ThpIzzimSpftvJByEoEqTTstTKz2XOhCfw/alCtxpuUn6dRO1AKSPEvD6KRI/OyIil5 BOEmHPTyA/dBLes4Dr6feXw9hp4ijW+YXHeDkfEbquaxoFLc4HZRCXzyy105Vs6ojyUD h9D/FZuqS6A8CHhjpMSfVdpYkuf5RssjuaO74m6WgQ565ZBHfRn4/yfjjLrfutU8vI1t dwiq9C8Z26plwxF2sYzRt5PZ01Ee6x5WEHHZsAN9T3123RcsmtDvnIu8VvFZ3IxRfrP3 d3NA== X-Gm-Message-State: AD7BkJJ9ixggCItEs6eVLG+3nDvqAlR8jUWOc5RKMZ0aRI2wDkDrS1+/LlBSRk6fEx0iHajV 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 Subject: [PATCH v10 04/17] arm/xen: Use xen_xlate_map_ballooned_pages to setup grant table 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160401_085035_800691_3B5F9FA5 X-CRM114-Status: GOOD ( 12.83 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,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; }