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

From: Borislav Petkov
Date: Tue Sep 22 2020 - 03:50:02 EST


From: Borislav Petkov <bp@xxxxxxx>

... 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")
Reported-by: Ingo Molnar <mingo@xxxxxxxxxx>
Signed-off-by: Borislav Petkov <bp@xxxxxxx>
Cc: Richard Weinberger <richard@xxxxxx>
Cc: Balbir Singh <sblbir@xxxxxxxxxx>
---
arch/um/include/asm/cacheflush.h | 9 +++++++++
1 file changed, 9 insertions(+)
create mode 100644 arch/um/include/asm/cacheflush.h

diff --git a/arch/um/include/asm/cacheflush.h b/arch/um/include/asm/cacheflush.h
new file mode 100644
index 000000000000..b9dee9760043
--- /dev/null
+++ b/arch/um/include/asm/cacheflush.h
@@ -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 */
--
2.21.0