From a4a4c5b9f0cd7e2a0395f7a53199f02ce2c683d1 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Mon, 22 Aug 2011 13:16:54 -0700 Subject: [PATCH] use RCCE's method to flush the write combining buffers --- arch/x86/include/asm/svm.h | 12 +++++++++--- arch/x86/mm/page.c | 2 +- arch/x86/mm/svm.c | 3 ++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/arch/x86/include/asm/svm.h b/arch/x86/include/asm/svm.h index 1b0b3c1d..91e008ec 100644 --- a/arch/x86/include/asm/svm.h +++ b/arch/x86/include/asm/svm.h @@ -21,6 +21,10 @@ #define __ARCH_SVM_H__ #include +#include +#ifdef CONFIG_ROCKCREEK +#include +#endif #ifdef __cplusplus extern "C" { @@ -72,11 +76,13 @@ static inline void svm_invalidate(void) static inline void svm_flush(void) { - mb(); -#ifndef SVM_WT +#ifdef CONFIG_ROCKCREEK + // need to write to another line to make sure the write combine buffer gets flushed + *(int *)RCCE_fool_write_combine_buffer = 1; +#endif +#ifdef SVM_WB flush_cache(); #endif - //asm volatile ( ".byte 0x0f; .byte 0x0a;\n" ); // CL1FLUSHMB } #endif diff --git a/arch/x86/mm/page.c b/arch/x86/mm/page.c index 2bde433c..62dab193 100644 --- a/arch/x86/mm/page.c +++ b/arch/x86/mm/page.c @@ -356,7 +356,7 @@ size_t map_region(size_t viraddr, size_t phyaddr, uint32_t npages, uint32_t flag pgt->entries[index] |= PG_MPE; #endif if (flags & MAP_SVM) -#ifdef SVM_WT +#ifndef SVM_WB pgt->entries[index] |= PG_SVM|PG_PWT; #else pgt->entries[index] |= PG_SVM; diff --git a/arch/x86/mm/svm.c b/arch/x86/mm/svm.c index f3245071..2f09010a 100644 --- a/arch/x86/mm/svm.c +++ b/arch/x86/mm/svm.c @@ -228,7 +228,8 @@ int svm_emit_page(size_t phyaddr, int ue) change_page_permissions(viraddr, viraddr+PAGE_SIZE, VMA_NOACCESS|VMA_READ|VMA_CACHEABLE); page_owner[pageid] = ue; - mb(); + // need to write to another line to make sure the write combine buffer gets flushed + *(int *)RCCE_fool_write_combine_buffer = 1; } return 0;