All of lore.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: X86 ML <x86@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Richard Weinberger <richard@nod.at>,
	Balbir Singh <sblbir@amazon.com>
Subject: [PATCH] arch/um: Add a dummy cacheflush.h header
Date: Tue, 22 Sep 2020 09:49:51 +0200	[thread overview]
Message-ID: <20200922074951.2192-1-bp@alien8.de> (raw)

From: Borislav Petkov <bp@suse.de>

... 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@kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Richard Weinberger <richard@nod.at>
Cc: Balbir Singh <sblbir@amazon.com>
---
 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


             reply	other threads:[~2020-09-22  7:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-22  7:49 Borislav Petkov [this message]
2020-09-22  9:41 ` [tip: x86/pti] arch/um: Add a dummy <asm/cacheflush.h> header tip-bot2 for Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200922074951.2192-1-bp@alien8.de \
    --to=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=richard@nod.at \
    --cc=sblbir@amazon.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.