From patchwork Tue Jan 28 01:03:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 23773 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f72.google.com (mail-pa0-f72.google.com [209.85.220.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3860F20143 for ; Tue, 28 Jan 2014 01:03:54 +0000 (UTC) Received: by mail-pa0-f72.google.com with SMTP id rd3sf16812251pab.7 for ; Mon, 27 Jan 2014 17:03:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=hgYpr/CIX+QuH3Yk0iTshsrQ4a372p/o8+Jz4egz2xg=; b=NfQ4eWXV2/vSnKLoP5sylfOsgk2+GUDzVX5qUuvbGDmGjB6p37vPu5m3lzBu4POUrN FRGSdFCPNxqUwGcnfizD6MiE3HiEaTnlkqXTfmv/LxV5FfxJALVZqU4koXF8QqH+Iww4 Bsgr0NhmmvMIn5tMqMTnJSrv43kw3IXNCXmgAkY95aT1OpXRAKn8x2PwwNjGFxt2gj6S WBdjMMvejADEuRnXCrTSCrK1PhCcA6BfqTFeIMDhiulQ+IXhfITuHHGYAVOKhZRoW142 Ajt0eHbQBOZDTCrEF+PxncKGu7aCgDwc749pcACdf2/mkJZZdFMZw5aoBvYT5GreXTUF bypg== X-Gm-Message-State: ALoCoQlvph8iZSqhoWKXn+IYvWFivcNy7fdMDE8ly/89gtokMPSRboWmm9WqTw//3NL0PR6qIWyd X-Received: by 10.66.240.4 with SMTP id vw4mr11748758pac.10.1390871033496; Mon, 27 Jan 2014 17:03:53 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.89.145 with SMTP id v17ls2005932qgd.82.gmail; Mon, 27 Jan 2014 17:03:53 -0800 (PST) X-Received: by 10.52.38.33 with SMTP id d1mr138071vdk.4.1390871033399; Mon, 27 Jan 2014 17:03:53 -0800 (PST) Received: from mail-vb0-f45.google.com (mail-vb0-f45.google.com [209.85.212.45]) by mx.google.com with ESMTPS id g4si5784056vch.148.2014.01.27.17.03.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 Jan 2014 17:03:53 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.45 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.45; Received: by mail-vb0-f45.google.com with SMTP id m10so3857141vbh.4 for ; Mon, 27 Jan 2014 17:03:53 -0800 (PST) X-Received: by 10.220.58.202 with SMTP id i10mr2473302vch.23.1390871033314; Mon, 27 Jan 2014 17:03:53 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp172348vcz; Mon, 27 Jan 2014 17:03:52 -0800 (PST) X-Received: by 10.14.48.1 with SMTP id u1mr23322306eeb.6.1390871032266; Mon, 27 Jan 2014 17:03:52 -0800 (PST) Received: from mail-ee0-f45.google.com (mail-ee0-f45.google.com [74.125.83.45]) by mx.google.com with ESMTPS id a9si23678549eem.216.2014.01.27.17.03.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 Jan 2014 17:03:52 -0800 (PST) Received-SPF: neutral (google.com: 74.125.83.45 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=74.125.83.45; Received: by mail-ee0-f45.google.com with SMTP id b15so2577063eek.4 for ; Mon, 27 Jan 2014 17:03:51 -0800 (PST) X-Received: by 10.14.39.3 with SMTP id c3mr28087973eeb.4.1390871031823; Mon, 27 Jan 2014 17:03:51 -0800 (PST) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id z49sm48960563eeo.10.2014.01.27.17.03.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Jan 2014 17:03:51 -0800 (PST) From: Julien Grall To: linux-kernel@vger.kernel.org, konrad.wilk@oracle.com, boris.ostrovsky@oracle.com, david.vrabel@citrix.com Cc: xen-devel@lists.xenproject.org, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, patches@linaro.org, Julien Grall Subject: [PATCH] xen/gnttab: Use phys_addr_t to describe the grant frame base address Date: Tue, 28 Jan 2014 01:03:45 +0000 Message-Id: <1390871025-29079-1-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.45 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On ARM, address size can be 32 bits or 64 bits (if CONFIG_ARCH_PHYS_ADDR_T_64BIT is enabled). We can't assume that the grant frame base address will always fits in an unsigned long. Use phys_addr_t instead of unsigned long as argument for gnttab_setup_auto_xlat_frames. Signed-off-by: Julien Grall Acked-by: Ian Campbell --- arch/arm/xen/enlighten.c | 6 +++--- drivers/xen/grant-table.c | 6 +++--- include/xen/grant_table.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index 2162172..293eeea 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c @@ -208,7 +208,7 @@ static int __init xen_guest_init(void) const char *version = NULL; const char *xen_prefix = "xen,xen-"; struct resource res; - unsigned long grant_frames; + phys_addr_t grant_frames; node = of_find_compatible_node(NULL, NULL, "xen,xen"); if (!node) { @@ -227,8 +227,8 @@ static int __init xen_guest_init(void) return 0; grant_frames = res.start; xen_events_irq = irq_of_parse_and_map(node, 0); - pr_info("Xen %s support found, events_irq=%d gnttab_frame_pfn=%lx\n", - version, xen_events_irq, (grant_frames >> PAGE_SHIFT)); + pr_info("Xen %s support found, events_irq=%d gnttab_frame=%pa\n", + version, xen_events_irq, &grant_frames); xen_domain_type = XEN_HVM_DOMAIN; xen_setup_features(); diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c index 1ce1c40..b84e3ab 100644 --- a/drivers/xen/grant-table.c +++ b/drivers/xen/grant-table.c @@ -837,7 +837,7 @@ unsigned int gnttab_max_grant_frames(void) } EXPORT_SYMBOL_GPL(gnttab_max_grant_frames); -int gnttab_setup_auto_xlat_frames(unsigned long addr) +int gnttab_setup_auto_xlat_frames(phys_addr_t addr) { xen_pfn_t *pfn; unsigned int max_nr_gframes = __max_nr_grant_frames(); @@ -849,8 +849,8 @@ int gnttab_setup_auto_xlat_frames(unsigned long addr) vaddr = xen_remap(addr, PAGE_SIZE * max_nr_gframes); if (vaddr == NULL) { - pr_warn("Failed to ioremap gnttab share frames (addr=0x%08lx)!\n", - addr); + pr_warn("Failed to ioremap gnttab share frames (addr=%pa)!\n", + &addr); return -ENOMEM; } pfn = kcalloc(max_nr_gframes, sizeof(pfn[0]), GFP_KERNEL); diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h index 5acb1e4..a5af2a2 100644 --- a/include/xen/grant_table.h +++ b/include/xen/grant_table.h @@ -185,7 +185,7 @@ struct grant_frames { }; extern struct grant_frames xen_auto_xlat_grant_frames; unsigned int gnttab_max_grant_frames(void); -int gnttab_setup_auto_xlat_frames(unsigned long addr); +int gnttab_setup_auto_xlat_frames(phys_addr_t addr); void gnttab_free_auto_xlat_frames(void); #define gnttab_map_vaddr(map) ((void *)(map.host_virt_addr))