From patchwork Thu Mar 24 14:44:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 8661721 Return-Path: X-Original-To: patchwork-linux-arm@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 733A29F36E for ; Thu, 24 Mar 2016 14:50:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8055F203B6 for ; Thu, 24 Mar 2016 14:50:01 +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 64C72203A0 for ; Thu, 24 Mar 2016 14:50:00 +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 1aj6Y5-0006pU-K0; Thu, 24 Mar 2016 14:47:45 +0000 Received: from mail-pa0-x236.google.com ([2607:f8b0:400e:c03::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aj6XM-0005yM-F6 for linux-arm-kernel@lists.infradead.org; Thu, 24 Mar 2016 14:47:02 +0000 Received: by mail-pa0-x236.google.com with SMTP id tt10so23980842pab.3 for ; Thu, 24 Mar 2016 07:46:39 -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=GnCCUCwf6/oEO/eXa0cjHmdwBzUoVkK6WcIk4jxFDoKu0PCzWZdKGpaYcZjFOKbLQa qp0NBJZL/WKaK17yV23Ldd9qrpi1lIQ/uQAqVjYZPx0ZrRqFF6laRSGj0XnZD5TC+1Ay UY7eo2kBI/gy4QqEO2/PVD18FCuB85JBATXxc= 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=UxB9ZGMddXDwXEVZhd/GUr1PbT9FXH6ZdAAZU0LYuh+9C+7Z4v1WQOc53RbECYrKzF Lr+zOcJq4BUMOjYZIRPsl1+SNpNmUHbMtEu93UorU8PJBvR1iir4O0ko2KwlCUODPAxi w//Xv4fgAGLg++Mw7Y8f5zzJ7v/I1NsflAyUNQcEb77gm1TtcmTNHX6CBRIoY65tSlD6 8o1bQCNz5pqg4QlIoU+h1hd+gJTXETQpoV6GDHulfqpmt/K3W8AcXyEVWffzvJ7O2wW2 KRMYUyqvx6RD0GVFMNSSShLHprOhlS8vlLNQvO16EAIG8gFV913ILQM4TMZe1mMLKHZy AX5g== X-Gm-Message-State: AD7BkJJiKdDAWFpMZYkShldcuOwArjB2ZCWi0Vx+2Tkho1SSaZQzPl3FQW//ycTyAl1Cf1Wy X-Received: by 10.66.255.39 with SMTP id an7mr13433707pad.2.1458830799107; Thu, 24 Mar 2016 07:46:39 -0700 (PDT) Received: from localhost.localdomain ([104.238.45.135]) by smtp.gmail.com with ESMTPSA id lq10sm10780673pab.36.2016.03.24.07.46.31 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 24 Mar 2016 07:46:37 -0700 (PDT) From: Shannon Zhao To: linux-arm-kernel@lists.infradead.org, stefano.stabellini@citrix.com, david.vrabel@citrix.com Subject: [PATCH v7 04/17] arm/xen: Use xen_xlate_map_ballooned_pages to setup grant table Date: Thu, 24 Mar 2016 22:44:23 +0800 Message-Id: <1458830676-27075-5-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1458830676-27075-1-git-send-email-shannon.zhao@linaro.org> References: <1458830676-27075-1-git-send-email-shannon.zhao@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160324_074700_722208_DF4DEB21 X-CRM114-Status: GOOD ( 12.91 ) 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, shannon.zhao@linaro.org, zhaoshenglong@huawei.com, xen-devel@lists.xen.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=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 --- 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; }