From: Stefano Stabellini Subject: [PATCH v4 4/7] xen/x86: introduce more cache maintenance operations Date: Fri, 10 Oct 2014 12:43:57 +0100 Message-ID: <1412941440-5646-4-git-send-email-stefano.stabellini@eu.citrix.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xensource.com Cc: julien.grall@citrix.com, Ian.Campbell@citrix.com, Stefano Stabellini List-Id: xen-devel@lists.xenproject.org Signed-off-by: Stefano Stabellini --- Changes in v4: - remove _xen in the function names; - implement the functions using existing x86 flushing functions. --- xen/arch/x86/flushtlb.c | 6 ++++++ xen/include/asm-x86/page.h | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/flushtlb.c b/xen/arch/x86/flushtlb.c index 5d5d79c..3e5e287 100644 --- a/xen/arch/x86/flushtlb.c +++ b/xen/arch/x86/flushtlb.c @@ -152,3 +152,9 @@ void flush_area_local(const void *va, unsigned int flags) local_irq_restore(irqfl); } + +void clean_and_invalidate_dcache_va_range(const void *p, unsigned long size) +{ + int order = get_order_from_bytes(size); + flush_area_local(p, FLUSH_CACHE|FLUSH_ORDER(order)); +} diff --git a/xen/include/asm-x86/page.h b/xen/include/asm-x86/page.h index 9aa780e..e56be8a 100644 --- a/xen/include/asm-x86/page.h +++ b/xen/include/asm-x86/page.h @@ -344,8 +344,13 @@ static inline uint32_t cacheattr_to_pte_flags(uint32_t cacheattr) return ((cacheattr & 4) << 5) | ((cacheattr & 3) << 3); } -/* No cache maintenance required on x86 architecture. */ static inline void flush_page_to_ram(unsigned long mfn) {} +static inline void invalidate_dcache_va_range(const void *p, unsigned long size) {} +void clean_and_invalidate_dcache_va_range(const void *p, unsigned long size); +static inline void clean_dcache_va_range(const void *p, unsigned long size) +{ + clean_and_invalidate_dcache_va_range(p, size); +} /* return true if permission increased */ static inline bool_t -- 1.7.10.4