Skip to contentSkip to conversation

arch/um: Add a dummy cacheflush.h header

PATCH Applied Borislav Petkov 2 participants 2 messages Sep 22, 2020 User-mode Linux (UML)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arch/um: Add a dummy cacheflush.h header

From: Borislav Petkov <[email protected]>

... in order to fix the defconfig build:

./arch/x86/include/asm/cacheflush.h: In function ‘l1d_flush_hw’:

  ./arch/x86/include/asm/cacheflush.h:15:6: error: implicit declaration of \
	  function ‘static_cpu_has’; did you mean ‘static_key_false’? [-Werror=implicit-function-declaration]
     15 |  if (static_cpu_has(X86_FEATURE_FLUSH_L1D)) {
        |      ^~~~~~~~~~~~~~
        |      static_key_false
  cc1: some warnings being treated as errors
  ./arch/x86/include/asm/cacheflush.h:16:3: error: implicit declaration of \
  function ‘wrmsrl’ [-Werror=implicit-function-declaration]
     16 |   wrmsrl(MSR_IA32_FLUSH_CMD, L1D_FLUSH);
        |
Fixes a9210620ec36 ("x86/mm: Optionally flush L1D on context switch")
Cc Richard Weinberger <[email protected]>
Cc Balbir Singh <[email protected]>
---
 arch/um/include/asm/cacheflush.h | 9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100644 arch/um/include/asm/cacheflush.h
arch/um/include/asm/cacheflush.h new file +9 -0
new file mode 100644
index 000000000000..b9dee9760043
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_UML_CACHEFLUSH_H
+#define _ASM_UML_CACHEFLUSH_H
+
+#undef ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
+#include <asm-generic/cacheflush.h>
+
+static inline int l1d_flush_hw(void) { return -EOPNOTSUPP; }
+#endif /* _ASM_UML_CACHEFLUSH_H */
Signature · 1 line
2.21.0
#1 lore raw

[tip: x86/pti] arch/um: Add a dummy <asm/cacheflush.h> header

The following commit has been merged into the x86/pti branch of tip:

The following commit has been merged into the x86/pti branch of tip:

Commit-ID:     e9c142f6f54db85c212ca64aefd4f2c232dac4ae
Gitweb:        https://git.kernel.org/tip/e9c142f6f54db85c212ca64aefd4f2c232dac4ae
Author:        Borislav Petkov <[email protected]>
AuthorDate:    Tue, 22 Sep 2020 09:49:51 +02:00
Committer:     Ingo Molnar <[email protected]>
CommitterDate: Tue, 22 Sep 2020 11:35:47 +02:00

arch/um: Add a dummy <asm/cacheflush.h> header

... in order to fix the defconfig build:

./arch/x86/include/asm/cacheflush.h: In function ‘l1d_flush_hw’:
./arch/x86/include/asm/cacheflush.h:15:6: error: implicit declaration of \
function ‘static_cpu_has’; did you mean ‘static_key_false’? [-Werror=implicit-function-declaration]

[ mingo: Changed the header guard to the existing nomenclature. ]

Fixes a9210620ec36 ("x86/mm: Optionally flush L1D on context switch")
---
 arch/um/include/asm/cacheflush.h |  9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100644 arch/um/include/asm/cacheflush.h
arch/um/include/asm/cacheflush.h new file +9 -0
new file mode 100644
index 0000000..f693cb9
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_UM_CACHEFLUSH_H
+#define _ASM_UM_CACHEFLUSH_H
+
+#undef ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
+#include <asm-generic/cacheflush.h>
+
+static inline int l1d_flush_hw(void) { return -EOPNOTSUPP; }
+#endif /* _ASM_UM_CACHEFLUSH_H */