]> Git Repo - J-linux.git/commitdiff
x86: cpa_flush_array wbinvd should be done on all CPUs
author[email protected] <[email protected]>
Fri, 22 May 2009 20:23:38 +0000 (13:23 -0700)
committerH. Peter Anvin <[email protected]>
Fri, 22 May 2009 20:33:59 +0000 (13:33 -0700)
cpa_flush_array seems to prefer wbinvd() over clflush at 4M threshold.
clflush needs to be done on only one CPU as per instruction definition.
wbinvd() however, should be done on all CPUs.

[ Impact: fix missing flush which could cause data corruption ]

Signed-off-by: Venkatesh Pallipadi <[email protected]>
Signed-off-by: Suresh Siddha <[email protected]>
Signed-off-by: H. Peter Anvin <[email protected]>
arch/x86/mm/pageattr.c

index 2cc019a3f71b536901d58616411d55c79a0a8e29..0f9052bcec4b7572cb8519f7972294fa716ac51a 100644 (file)
@@ -204,6 +204,11 @@ static void cpa_flush_range(unsigned long start, int numpages, int cache)
        }
 }
 
+static void wbinvd_local(void *unused)
+{
+       wbinvd();
+}
+
 static void cpa_flush_array(unsigned long *start, int numpages, int cache,
                            int in_flags, struct page **pages)
 {
@@ -219,7 +224,8 @@ static void cpa_flush_array(unsigned long *start, int numpages, int cache,
        /* 4M threshold */
        if (numpages >= 1024) {
                if (boot_cpu_data.x86 >= 4)
-                       wbinvd();
+                       on_each_cpu(wbinvd_local, NULL, 1);
+
                return;
        }
        /*
This page took 0.068008 seconds and 4 git commands to generate.