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: 8661601 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 86A289F36E for ; Thu, 24 Mar 2016 14:49:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AFCD2203B6 for ; Thu, 24 Mar 2016 14:49:05 +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 C0A30203A0 for ; Thu, 24 Mar 2016 14:49:04 +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 1aj6X5-0002vz-Le; Thu, 24 Mar 2016 14:46:43 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aj6X4-0002vQ-Dt for xen-devel@lists.xen.org; Thu, 24 Mar 2016 14:46:42 +0000 Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id 22/55-02984-1DDF3F65; Thu, 24 Mar 2016 14:46:41 +0000 X-Env-Sender: shannon.zhao@linaro.org X-Msg-Ref: server-4.tower-27.messagelabs.com!1458830799!32707841!1 X-Originating-IP: [209.85.220.50] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.11; banners=-,-,- X-VirusChecked: Checked Received: (qmail 56314 invoked from network); 24 Mar 2016 14:46:40 -0000 Received: from mail-pa0-f50.google.com (HELO mail-pa0-f50.google.com) (209.85.220.50) by server-4.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 24 Mar 2016 14:46:40 -0000 Received: by mail-pa0-f50.google.com with SMTP id td3so23709867pab.2 for ; Thu, 24 Mar 2016 07:46:40 -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=M7TUKTFjuHYWa3dL/x07Y/QHiaRD6t4u+IK/UtQiHPEonxwFo+EsY6cb33TsP2Mpyj ou9yfvjK0YPdlHc1iJ+7U4Lmb+KkPj4Gt7hzaGdH0Z/8n21dDUUOy0ghTL7KExTCUpyn 2TcvHDw6VYsiUMpfqfqqlwxDDkEgKCb+UXDySuyQ3PrrgjQjWHVtyRmiLUa9Ua83yjkT 8Whr4J+iqCSoWSG2jyvuQdDiIBNwmjZtPRZPtqKRTLO4407zmabiMdNnEOj51a7XQYyA TIGY9KDn/QePt9TmXSTxC/9en2TFze1AueRaMgdoLjISEp2Bjb2x3h3fw9IWPSGI1ruJ Nqfg== X-Gm-Message-State: AD7BkJI9/F6HHfNQLG5yzhfWXDBJ7GL28yYOkF7/OogLzSNvVkXi5z4vIME5hkSXgjJh6qPn 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 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> 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 Subject: [Xen-devel] [PATCH v7 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 --- 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; }