Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cd8ddf1a2800026dd58433333cce7a65cbc6c6d2
Commit:     cd8ddf1a2800026dd58433333cce7a65cbc6c6d2
Parent:     af1e6844d60057774910a2d08bd75b67d73ba7d5
Author:     Thomas Gleixner <[EMAIL PROTECTED]>
AuthorDate: Wed Jan 30 13:34:08 2008 +0100
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Wed Jan 30 13:34:08 2008 +0100

    x86: clflush_page_range needs mfence
    
    clflush is an unordered operation with respect to other memory
    traffic, including other CLFLUSH instructions. This needs proper
    fencing with mfence.
    
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
---
 arch/x86/mm/pageattr.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index cdd2ea2..90b658a 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -25,12 +25,24 @@ within(unsigned long addr, unsigned long start, unsigned 
long end)
 /*
  * Flushing functions
  */
+
+
+/**
+ * clflush_cache_range - flush a cache range with clflush
+ * @addr:      virtual start address
+ * @size:      number of bytes to flush
+ *
+ * clflush is an unordered instruction which needs fencing with mfence
+ * to avoid ordering issues.
+ */
 void clflush_cache_range(void *addr, int size)
 {
        int i;
 
+       mb();
        for (i = 0; i < size; i += boot_cpu_data.x86_clflush_size)
                clflush(addr+i);
+       mb();
 }
 
 static void __cpa_flush_all(void *arg)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to