From patchwork Tue Feb 11 14:11:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 24457 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f199.google.com (mail-ob0-f199.google.com [209.85.214.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F0A7B206FF for ; Tue, 11 Feb 2014 14:13:01 +0000 (UTC) Received: by mail-ob0-f199.google.com with SMTP id vb8sf31015859obc.6 for ; Tue, 11 Feb 2014 06:13:00 -0800 (PST) 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:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=1e42STo9h+NhLbS7cLYBX2QNWExYTPP0TyOB+megMxY=; b=D+D9pdWnHmdUZEgvTfCihUDq0GnurVn7OIwpp8ccayncXXn5ZZTVPkSYkjCc1SkaRj JXOPriWSokX4kztoQQ4YFusabywNuPN/TAqgDLEzeLfjAi4+0JQNQHz3KeHJg38+CwHT fR2rPOVN4arhLUQSwm0jGAD82wE6GS3mfv5g2ww0UZEpaaMhUAAQALjooJrF6yOXA4/2 McW1AOGnI+JFcjOVaQUB5R+I9XAsL1v90dmqZcpzRjLpFUrG16Ejb7MOCbG01Hysojfk UPuilO55khU80gQRWJsGvIX8oDyU/VMt3ytLpcKWBZVlwofDt9bMsdjMnvzVDE2/qtvX 3oCw== X-Gm-Message-State: ALoCoQmbH+F/6LdyKerCyKoSD5GxLPiKLfmGoJNRpJSzpPcu8G1kb/16zaYn1l9OauM9u3KTudFn X-Received: by 10.43.79.196 with SMTP id zr4mr12574327icb.3.1392127980671; Tue, 11 Feb 2014 06:13:00 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.21.136 with SMTP id 8ls2460543qgl.27.gmail; Tue, 11 Feb 2014 06:13:00 -0800 (PST) X-Received: by 10.58.69.111 with SMTP id d15mr28325423veu.3.1392127980541; Tue, 11 Feb 2014 06:13:00 -0800 (PST) Received: from mail-vb0-f42.google.com (mail-vb0-f42.google.com [209.85.212.42]) by mx.google.com with ESMTPS id qt5si5947286vcb.23.2014.02.11.06.13.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 11 Feb 2014 06:13:00 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.42 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.42; Received: by mail-vb0-f42.google.com with SMTP id i11so2799868vbh.29 for ; Tue, 11 Feb 2014 06:13:00 -0800 (PST) X-Received: by 10.58.172.132 with SMTP id bc4mr234731vec.45.1392127980428; Tue, 11 Feb 2014 06:13:00 -0800 (PST) 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.174.196 with SMTP id u4csp249332vcz; Tue, 11 Feb 2014 06:13:00 -0800 (PST) X-Received: by 10.220.139.136 with SMTP id e8mr357148vcu.34.1392127979802; Tue, 11 Feb 2014 06:12:59 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id tt2si5927292vdc.87.2014.02.11.06.12.59 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 11 Feb 2014 06:12:59 -0800 (PST) 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 1WDE3P-0002aE-AS; Tue, 11 Feb 2014 14:11:15 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WDE3N-0002Yh-Cm for xen-devel@lists.xen.org; Tue, 11 Feb 2014 14:11:13 +0000 Received: from [85.158.137.68:12060] by server-16.bemta-3.messagelabs.com id 84/D1-29917-08F2AF25; Tue, 11 Feb 2014 14:11:12 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-3.tower-31.messagelabs.com!1392127870!1125740!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.9.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 6266 invoked from network); 11 Feb 2014 14:11:11 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-3.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 11 Feb 2014 14:11:11 -0000 X-IronPort-AV: E=Sophos;i="4.95,825,1384300800"; d="scan'208";a="101601027" Received: from accessns.citrite.net (HELO FTLPEX01CL03.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 11 Feb 2014 14:11:06 +0000 Received: from norwich.cam.xci-test.com (10.80.248.129) by smtprelay.citrix.com (10.13.107.80) with Microsoft SMTP Server id 14.2.342.4; Tue, 11 Feb 2014 09:11:04 -0500 Received: from drall.uk.xensource.com ([10.80.16.71] helo=drall.uk.xensource.com.) by norwich.cam.xci-test.com with esmtp (Exim 4.72) (envelope-from ) id 1WDE3E-00005n-Lk; Tue, 11 Feb 2014 14:11:04 +0000 From: Ian Campbell To: Date: Tue, 11 Feb 2014 14:11:04 +0000 Message-ID: <1392127864-2605-5-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1392127796.26657.130.camel@kazak.uk.xensource.com> References: <1392127796.26657.130.camel@kazak.uk.xensource.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: julien.grall@linaro.org, tim@xen.org, Ian Campbell , stefano.stabellini@eu.citrix.com Subject: [Xen-devel] [PATCH v5 5/5] xen: arm: correct terminology for cache flush macros 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: , 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: ian.campbell@citrix.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.42 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: The term "flush" is slightly ambiguous. The correct ARM term for for this operaton is clean, as opposed to clean+invalidate for which we also now have a function. This is a pure rename, no functional change. Signed-off-by: Ian Campbell Acked-by: Julien Grall --- This could easily be left for 4.5. --- xen/arch/arm/guestcopy.c | 2 +- xen/arch/arm/kernel.c | 2 +- xen/arch/arm/mm.c | 16 ++++++++-------- xen/arch/arm/smpboot.c | 2 +- xen/include/asm-arm/arm32/page.h | 2 +- xen/include/asm-arm/arm64/page.h | 2 +- xen/include/asm-arm/page.h | 10 +++++----- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/xen/arch/arm/guestcopy.c b/xen/arch/arm/guestcopy.c index bd0a355..af0af6b 100644 --- a/xen/arch/arm/guestcopy.c +++ b/xen/arch/arm/guestcopy.c @@ -24,7 +24,7 @@ static unsigned long raw_copy_to_guest_helper(void *to, const void *from, p += offset; memcpy(p, from, size); if ( flush_dcache ) - flush_xen_dcache_va_range(p, size); + clean_xen_dcache_va_range(p, size); unmap_domain_page(p - offset); len -= size; diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c index 6a5772b..1e3107d 100644 --- a/xen/arch/arm/kernel.c +++ b/xen/arch/arm/kernel.c @@ -58,7 +58,7 @@ void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len, int attrindx) set_fixmap(FIXMAP_MISC, p, attrindx); memcpy(dst, src + s, l); - flush_xen_dcache_va_range(dst, l); + clean_xen_dcache_va_range(dst, l); paddr += l; dst += l; diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c index 98d054b..af7b189 100644 --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -484,13 +484,13 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr) /* Clear the copy of the boot pagetables. Each secondary CPU * rebuilds these itself (see head.S) */ memset(boot_pgtable, 0x0, PAGE_SIZE); - flush_xen_dcache(boot_pgtable); + clean_xen_dcache(boot_pgtable); #ifdef CONFIG_ARM_64 memset(boot_first, 0x0, PAGE_SIZE); - flush_xen_dcache(boot_first); + clean_xen_dcache(boot_first); #endif memset(boot_second, 0x0, PAGE_SIZE); - flush_xen_dcache(boot_second); + clean_xen_dcache(boot_second); /* Break up the Xen mapping into 4k pages and protect them separately. */ for ( i = 0; i < LPAE_ENTRIES; i++ ) @@ -528,7 +528,7 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr) /* Make sure it is clear */ memset(this_cpu(xen_dommap), 0, DOMHEAP_SECOND_PAGES*PAGE_SIZE); - flush_xen_dcache_va_range(this_cpu(xen_dommap), + clean_xen_dcache_va_range(this_cpu(xen_dommap), DOMHEAP_SECOND_PAGES*PAGE_SIZE); #endif } @@ -539,7 +539,7 @@ int init_secondary_pagetables(int cpu) /* Set init_ttbr for this CPU coming up. All CPus share a single setof * pagetables, but rewrite it each time for consistency with 32 bit. */ init_ttbr = (uintptr_t) xen_pgtable + phys_offset; - flush_xen_dcache(init_ttbr); + clean_xen_dcache(init_ttbr); return 0; } #else @@ -574,15 +574,15 @@ int init_secondary_pagetables(int cpu) write_pte(&first[first_table_offset(DOMHEAP_VIRT_START+i*FIRST_SIZE)], pte); } - flush_xen_dcache_va_range(first, PAGE_SIZE); - flush_xen_dcache_va_range(domheap, DOMHEAP_SECOND_PAGES*PAGE_SIZE); + clean_xen_dcache_va_range(first, PAGE_SIZE); + clean_xen_dcache_va_range(domheap, DOMHEAP_SECOND_PAGES*PAGE_SIZE); per_cpu(xen_pgtable, cpu) = first; per_cpu(xen_dommap, cpu) = domheap; /* Set init_ttbr for this CPU coming up */ init_ttbr = __pa(first); - flush_xen_dcache(init_ttbr); + clean_xen_dcache(init_ttbr); return 0; } diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c index c53c765..a829957 100644 --- a/xen/arch/arm/smpboot.c +++ b/xen/arch/arm/smpboot.c @@ -378,7 +378,7 @@ int __cpu_up(unsigned int cpu) /* Open the gate for this CPU */ smp_up_cpu = cpu_logical_map(cpu); - flush_xen_dcache(smp_up_cpu); + clean_xen_dcache(smp_up_cpu); rc = arch_cpu_up(cpu); diff --git a/xen/include/asm-arm/arm32/page.h b/xen/include/asm-arm/arm32/page.h index cb6add4..b8221ca 100644 --- a/xen/include/asm-arm/arm32/page.h +++ b/xen/include/asm-arm/arm32/page.h @@ -20,7 +20,7 @@ static inline void write_pte(lpae_t *p, lpae_t pte) } /* Inline ASM to flush dcache on register R (may be an inline asm operand) */ -#define __flush_xen_dcache_one(R) STORE_CP32(R, DCCMVAC) +#define __clean_xen_dcache_one(R) STORE_CP32(R, DCCMVAC) /* Inline ASM to clean and invalidate dcache on register R (may be an * inline asm operand) */ diff --git a/xen/include/asm-arm/arm64/page.h b/xen/include/asm-arm/arm64/page.h index baf8903..3352821 100644 --- a/xen/include/asm-arm/arm64/page.h +++ b/xen/include/asm-arm/arm64/page.h @@ -15,7 +15,7 @@ static inline void write_pte(lpae_t *p, lpae_t pte) } /* Inline ASM to flush dcache on register R (may be an inline asm operand) */ -#define __flush_xen_dcache_one(R) "dc cvac, %" #R ";" +#define __clean_xen_dcache_one(R) "dc cvac, %" #R ";" /* Inline ASM to clean and invalidate dcache on register R (may be an * inline asm operand) */ diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h index 5a371da..e00be9e 100644 --- a/xen/include/asm-arm/page.h +++ b/xen/include/asm-arm/page.h @@ -229,26 +229,26 @@ extern size_t cacheline_bytes; /* Function for flushing medium-sized areas. * if 'range' is large enough we might want to use model-specific * full-cache flushes. */ -static inline void flush_xen_dcache_va_range(void *p, unsigned long size) +static inline void clean_xen_dcache_va_range(void *p, unsigned long size) { void *end; dsb(); /* So the CPU issues all writes to the range */ for ( end = p + size; p < end; p += cacheline_bytes ) - asm volatile (__flush_xen_dcache_one(0) : : "r" (p)); + asm volatile (__clean_xen_dcache_one(0) : : "r" (p)); dsb(); /* So we know the flushes happen before continuing */ } /* Macro for flushing a single small item. The predicate is always * compile-time constant so this will compile down to 3 instructions in * the common case. */ -#define flush_xen_dcache(x) do { \ +#define clean_xen_dcache(x) do { \ typeof(x) *_p = &(x); \ if ( sizeof(x) > MIN_CACHELINE_BYTES || sizeof(x) > alignof(x) ) \ - flush_xen_dcache_va_range(_p, sizeof(x)); \ + clean_xen_dcache_va_range(_p, sizeof(x)); \ else \ asm volatile ( \ "dsb sy;" /* Finish all earlier writes */ \ - __flush_xen_dcache_one(0) \ + __clean_xen_dcache_one(0) \ "dsb sy;" /* Finish flush before continuing */ \ : : "r" (_p), "m" (*_p)); \ } while (0)