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: 64866 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp810960lbc; Fri, 1 Apr 2016 08:50:38 -0700 (PDT) X-Received: by 10.202.76.10 with SMTP id z10mr1499554oia.64.1459525823683; Fri, 01 Apr 2016 08:50:23 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r3si7821820oig.7.2016.04.01.08.50.23; Fri, 01 Apr 2016 08:50:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932414AbcDAPuT (ORCPT + 29 others); Fri, 1 Apr 2016 11:50:19 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:34649 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759312AbcDAPuP (ORCPT ); Fri, 1 Apr 2016 11:50:15 -0400 Received: by mail-pa0-f44.google.com with SMTP id fe3so93886221pab.1 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=lu8IZCJFM5/+Zbr/potNmDa8yv+wSuZ2GvfVyuRSNleu+yCFBAZr3xzcktYUAU4e7l 56+E1LjCD4KuVI9W8UDQczC3ChWiRQuVY8/leYVrNp0nO4ZcVYDgVkKczwgO+BkbbIcw 0or6Onmp1SjZOt0HeJkMqutO1OW6s12YocSb9WK3PZfn7nSPh+GyLptbG3qKpGFDozWb S0Ho9YLk7dT4ar2BeSNdM+VVYPbFWW4FHmmvYU+eqRIEq5m9kGhZhqU2SIpvNZRrrlbt Jk6EF4N1YLvWcEgCHImyPxUoOpByRa6DeZhRdStQYhX5jVuPSeuRAeAYYfPFdlbDqRkv VDlg== X-Gm-Message-State: AD7BkJIwL/iN7XGnqbJElUF0vMluf7d7PfhnyndWVePuBiyoYKcZ+YAPt2tOOlcAcnBTpu9e 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 Cc: david.vrabel@citrix.com, devicetree@vger.kernel.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, julien.grall@arm.com, peter.huangpeng@huawei.com, xen-devel@lists.xen.org, zhaoshenglong@huawei.com, shannon.zhao@linaro.org 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.1.4 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; }