From patchwork Wed Mar 12 16:15:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 26146 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f70.google.com (mail-oa0-f70.google.com [209.85.219.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B8DE2236AD for ; Wed, 12 Mar 2014 16:17:46 +0000 (UTC) Received: by mail-oa0-f70.google.com with SMTP id n16sf40546917oag.5 for ; Wed, 12 Mar 2014 09:17:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe:list-post :list-help:list-subscribe:mime-version:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :list-archive:content-type:content-transfer-encoding; bh=9rSjZbzsKVM/BfgCoGFqVzZjbmo3bpBNvLKQFa0nGEo=; b=irHqsp4tBi82MImvb8J1QJ899JJYMFsmK0R3kBKS8hxxfXOAm0JWztW4eIM/Gd4Tpd uLRozoI1hTII2thnQzRJAspJVD3OU+gEjaU6vG4wTRlE5IGvnE1bESzBArjlcJmuh3OR bm/UIPqi7yw/Zs50B5qy+BuwFtljx4cSyx3L3+IOpjtQJCw0R8vpEc5HhMR8oR/QplTg VaKGSp2WSCgcteq287XA0cy0y3DrkrFBUp1bkML1iL+1XxR982pSE6VIpAbM09ItiKH9 LK1G+VA8f4en8c2TO32nC+M7zLJ1VBH3hABSSKsZKk2axffYh0AhiRonOWzl7xpfUJju OuVQ== X-Gm-Message-State: ALoCoQlUTv5glMaUb6Bb+2kRM4GSf1QMqMeVEfnuMxJMkBcY/QSCnOnknAGltRnvZAikQinDmb8B X-Received: by 10.182.230.168 with SMTP id sz8mr19772328obc.9.1394641066273; Wed, 12 Mar 2014 09:17:46 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.101.12 with SMTP id t12ls1238915qge.1.gmail; Wed, 12 Mar 2014 09:17:46 -0700 (PDT) X-Received: by 10.52.34.137 with SMTP id z9mr10682529vdi.12.1394641065939; Wed, 12 Mar 2014 09:17:45 -0700 (PDT) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id oj4si6926566vcb.125.2014.03.12.09.17.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Mar 2014 09:17:45 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id cz12so10255552veb.2 for ; Wed, 12 Mar 2014 09:17:45 -0700 (PDT) X-Received: by 10.58.162.168 with SMTP id yb8mr19466159veb.9.1394641065858; Wed, 12 Mar 2014 09:17:45 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp301326vck; Wed, 12 Mar 2014 09:17:45 -0700 (PDT) X-Received: by 10.140.83.203 with SMTP id j69mr53494278qgd.42.1394641065242; Wed, 12 Mar 2014 09:17:45 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id cf7si5245782qcb.114.2014.03.12.09.17.44 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 12 Mar 2014 09:17:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WNlpQ-0007De-L9; Wed, 12 Mar 2014 16:16:24 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WNlpO-0007CR-Tu for xen-devel@lists.xenproject.org; Wed, 12 Mar 2014 16:16:23 +0000 Received: from [85.158.137.68:32546] by server-9.bemta-3.messagelabs.com id 81/B5-30063-65880235; Wed, 12 Mar 2014 16:16:22 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-14.tower-31.messagelabs.com!1394640981!186812!1 X-Originating-IP: [74.125.82.179] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.11.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 28985 invoked from network); 12 Mar 2014 16:16:21 -0000 Received: from mail-we0-f179.google.com (HELO mail-we0-f179.google.com) (74.125.82.179) by server-14.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 12 Mar 2014 16:16:21 -0000 Received: by mail-we0-f179.google.com with SMTP id x48so11498049wes.38 for ; Wed, 12 Mar 2014 09:16:21 -0700 (PDT) X-Received: by 10.194.9.99 with SMTP id y3mr2191694wja.60.1394640980943; Wed, 12 Mar 2014 09:16:20 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id dk9sm70840335wjb.4.2014.03.12.09.16.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Mar 2014 09:16:20 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Wed, 12 Mar 2014 16:15:57 +0000 Message-Id: <1394640969-25583-3-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1394640969-25583-1-git-send-email-julien.grall@linaro.org> References: <1394640969-25583-1-git-send-email-julien.grall@linaro.org> Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com Subject: [Xen-devel] [RFC 02/14] xen/arm: Remove the parameter "attrindx" in copy_paddr X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org 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.128.171 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 Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: copy_addr is only used with BUFFERABLE, there is some place where DEV_SHARED was used by mistake. The parameter "attrindx" can be safely remove and let copy_paddr to map every page with BUFFERABLE attribute. Signed-off-by: Julien Grall --- xen/arch/arm/domain_build.c | 2 +- xen/arch/arm/kernel.c | 15 +++++++-------- xen/arch/arm/setup.c | 2 +- xen/include/asm-arm/setup.h | 2 +- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 5ca2f15..7bb2c28 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -976,7 +976,7 @@ static void initrd_load(struct kernel_info *kinfo) dst = map_domain_page(ma>>PAGE_SHIFT); - copy_from_paddr(dst + s, paddr + offs, l, BUFFERABLE); + copy_from_paddr(dst + s, paddr + offs, l); unmap_domain_page(dst); offs += l; diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c index 492ce6d..0bc7eb1 100644 --- a/xen/arch/arm/kernel.c +++ b/xen/arch/arm/kernel.c @@ -40,7 +40,7 @@ struct minimal_dtb_header { * @paddr: source physical address * @len: length to copy */ -void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len, int attrindx) +void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len) { void *src = (void *)FIXMAP_ADDR(FIXMAP_MISC); @@ -52,7 +52,7 @@ void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len, int attrindx) s = paddr & (PAGE_SIZE-1); l = min(PAGE_SIZE - s, len); - set_fixmap(FIXMAP_MISC, p, attrindx); + set_fixmap(FIXMAP_MISC, p, BUFFERABLE); memcpy(dst, src + s, l); clean_xen_dcache_va_range(dst, l); @@ -145,7 +145,7 @@ static void kernel_zimage_load(struct kernel_info *info) dst = map_domain_page(ma>>PAGE_SHIFT); - copy_from_paddr(dst + s, paddr + offs, l, BUFFERABLE); + copy_from_paddr(dst + s, paddr + offs, l); unmap_domain_page(dst); offs += l; @@ -178,7 +178,7 @@ static int kernel_try_zimage64_prepare(struct kernel_info *info, if ( size < sizeof(zimage) ) return -EINVAL; - copy_from_paddr(&zimage, addr, sizeof(zimage), DEV_SHARED); + copy_from_paddr(&zimage, addr, sizeof(zimage)); if ( zimage.magic0 != ZIMAGE64_MAGIC_V0 && zimage.magic1 != ZIMAGE64_MAGIC_V1 ) @@ -223,7 +223,7 @@ static int kernel_try_zimage32_prepare(struct kernel_info *info, if ( size < ZIMAGE32_HEADER_LEN ) return -EINVAL; - copy_from_paddr(zimage, addr, sizeof(zimage), DEV_SHARED); + copy_from_paddr(zimage, addr, sizeof(zimage)); if (zimage[ZIMAGE32_MAGIC_OFFSET/4] != ZIMAGE32_MAGIC) return -EINVAL; @@ -239,8 +239,7 @@ static int kernel_try_zimage32_prepare(struct kernel_info *info, */ if ( addr + end - start + sizeof(dtb_hdr) <= size ) { - copy_from_paddr(&dtb_hdr, addr + end - start, - sizeof(dtb_hdr), DEV_SHARED); + copy_from_paddr(&dtb_hdr, addr + end - start, sizeof(dtb_hdr)); if (be32_to_cpu(dtb_hdr.magic) == DTB_MAGIC) { end += be32_to_cpu(dtb_hdr.total_size); @@ -311,7 +310,7 @@ static int kernel_try_elf_prepare(struct kernel_info *info, if ( info->kernel_img == NULL ) panic("Cannot allocate temporary buffer for kernel"); - copy_from_paddr(info->kernel_img, addr, size, BUFFERABLE); + copy_from_paddr(info->kernel_img, addr, size); if ( (rc = elf_init(&info->elf.elf, info->kernel_img, size )) != 0 ) goto err; diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 9480f42..959744e 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -488,7 +488,7 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size) /* Copy the DTB. */ fdt = mfn_to_virt(alloc_boot_pages(dtb_pages, 1)); - copy_from_paddr(fdt, dtb_paddr, dtb_size, BUFFERABLE); + copy_from_paddr(fdt, dtb_paddr, dtb_size); device_tree_flattened = fdt; /* Add non-xenheap memory */ diff --git a/xen/include/asm-arm/setup.h b/xen/include/asm-arm/setup.h index 44a3b4d..b09f688 100644 --- a/xen/include/asm-arm/setup.h +++ b/xen/include/asm-arm/setup.h @@ -5,7 +5,7 @@ void arch_init_memory(void); -void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len, int attrindx); +void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len); void arch_get_xen_caps(xen_capabilities_info_t *info);