Merge branch 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[cascardo/linux.git] / arch / x86 / mm / pageattr.c
index a718e0d..931930a 100644 (file)
@@ -919,11 +919,13 @@ static int change_page_attr_set_clr(unsigned long *addr, int numpages,
 
        /*
         * On success we use clflush, when the CPU supports it to
-        * avoid the wbindv. If the CPU does not support it and in the
-        * error case we fall back to cpa_flush_all (which uses
-        * wbindv):
+        * avoid the wbindv. If the CPU does not support it, in the
+        * error case, and during early boot (for EFI) we fall back
+        * to cpa_flush_all (which uses wbinvd):
         */
-       if (!ret && cpu_has_clflush) {
+       if (early_boot_irqs_disabled)
+               __cpa_flush_all((void *)(long)cache);
+       else if (!ret && cpu_has_clflush) {
                if (cpa.flags & (CPA_PAGES_ARRAY | CPA_ARRAY)) {
                        cpa_flush_array(addr, numpages, cache,
                                        cpa.flags, pages);