From patchwork Mon Mar 17 14:05:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 26370 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8229C202FA for ; Mon, 17 Mar 2014 14:07:35 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id if11sf13490554vcb.0 for ; Mon, 17 Mar 2014 07:07:35 -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=9YftDSk58Bqr6HE4TtwwlsYa+AUlkFQpcGtQgXk2GUY=; b=TNexuIS9WSlh5XfwrSOscoTSPi3f02ty4D1nGEAUToI/ONG55T6C7QddCkGGLC0e10 3lfXuN0MzvFhWDb3aZ+rAT78GpvLxddFBuOz6oVV2gjk3IuCVHGwR7gW1eJK5nUsXkef OFj8VAdz+5AnTdK6jYHaylw2ao7YMnkeBZAMeWxBuPJXccUvC0n5qCXu4jF0dxQ2TPVN 7alrKbIOjMWXxkO1hQt8zAV5GE1KWZI05dGfAZGzuDTQMoLX7ebPeVNvFE0BFVnjKXZ8 pRBx03F19+EmKUT7p2jQSobxv2lrQDSakwCjY6y9h/z2meXFTFHbHlBz0fQWjck2Ntlh Ygbg== X-Gm-Message-State: ALoCoQmo8ngCTI/DKfBOFa5P9DOH47En1rBdrhWoHOE68LWZP3hVTnV2zR6gur8RDoXW2UkyNEH0 X-Received: by 10.58.253.72 with SMTP id zy8mr6133324vec.10.1395065255297; Mon, 17 Mar 2014 07:07:35 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.89.70 with SMTP id u64ls937177qgd.80.gmail; Mon, 17 Mar 2014 07:07:35 -0700 (PDT) X-Received: by 10.52.120.6 with SMTP id ky6mr440513vdb.38.1395065255144; Mon, 17 Mar 2014 07:07:35 -0700 (PDT) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id xo2si2832016vec.62.2014.03.17.07.07.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Mar 2014 07:07:35 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.172 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.172; Received: by mail-ve0-f172.google.com with SMTP id jx11so5682607veb.17 for ; Mon, 17 Mar 2014 07:07:35 -0700 (PDT) X-Received: by 10.52.189.33 with SMTP id gf1mr5949896vdc.26.1395065255038; Mon, 17 Mar 2014 07:07:35 -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 i9csp130047vck; Mon, 17 Mar 2014 07:07:34 -0700 (PDT) X-Received: by 10.52.113.1 with SMTP id iu1mr651418vdb.35.1395065254600; Mon, 17 Mar 2014 07:07:34 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id cp10si2824005ved.128.2014.03.17.07.07.33 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 17 Mar 2014 07:07:34 -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 1WPYBR-0002H2-J7; Mon, 17 Mar 2014 14:06:29 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WPYBO-0002E9-1U for xen-devel@lists.xenproject.org; Mon, 17 Mar 2014 14:06:26 +0000 Received: from [85.158.137.68:37363] by server-12.bemta-3.messagelabs.com id 7D/CB-14831-16107235; Mon, 17 Mar 2014 14:06:25 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-8.tower-31.messagelabs.com!1395065184!1106839!1 X-Originating-IP: [74.125.83.45] 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 6248 invoked from network); 17 Mar 2014 14:06:24 -0000 Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com) (74.125.83.45) by server-8.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 17 Mar 2014 14:06:24 -0000 Received: by mail-ee0-f45.google.com with SMTP id d17so4135022eek.18 for ; Mon, 17 Mar 2014 07:06:24 -0700 (PDT) X-Received: by 10.14.220.193 with SMTP id o41mr24059788eep.22.1395065175336; Mon, 17 Mar 2014 07:06:15 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id x3sm39716538eep.17.2014.03.17.07.06.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Mar 2014 07:06:14 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 17 Mar 2014 14:05:52 +0000 Message-Id: <1395065165-15915-3-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1395065165-15915-1-git-send-email-julien.grall@linaro.org> References: <1395065165-15915-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] [PATCH v2 02/15] xen/arm: Remove the parameter "attrindx" in copy_from_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.172 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_from_paddr 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_from_paddr to map every page with BUFFERABLE attribute. Signed-off-by: Julien Grall Acked-by: Ian Campbell --- Changes in v2: - s/copy_paddr/copy_from_paddr/ in commit message - Fix compilation on ARM64 (forgot to remove one BUFFERABLE in setup.c) --- xen/arch/arm/domain_build.c | 2 +- xen/arch/arm/kernel.c | 15 +++++++-------- xen/arch/arm/setup.c | 4 ++-- xen/include/asm-arm/setup.h | 2 +- 4 files changed, 11 insertions(+), 12 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 4a3016a..d59e7f8 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -491,7 +491,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 */ @@ -628,7 +628,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; setup_frametable_mappings(ram_start, ram_end); 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);