Mike Rapoport 6d47c23b16 set_memory: allow querying whether set_direct_map_*() is actually enabled
On arm64, set_direct_map_*() functions may return 0 without actually
changing the linear map.  This behaviour can be controlled using kernel
parameters, so we need a way to determine at runtime whether calls to
set_direct_map_invalid_noflush() and set_direct_map_default_noflush() have
any effect.

Extend set_memory API with can_set_direct_map() function that allows
checking if calling set_direct_map_*() will actually change the page
table, replace several occurrences of open coded checks in arm64 with the
new function and provide a generic stub for architectures that always
modify page tables upon calls to set_direct_map APIs.

[arnd@arndb.de: arm64: kfence: fix header inclusion ]

Link: https://lkml.kernel.org/r/20210518072034.31572-4-rppt@kernel.org
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Acked-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Christopher Lameter <cl@linux.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Elena Reshetova <elena.reshetova@intel.com>
Cc: Hagen Paul Pfeifer <hagen@jauu.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Palmer Dabbelt <palmerdabbelt@google.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rick Edgecombe <rick.p.edgecombe@intel.com>
Cc: Roman Gushchin <guro@fb.com>
Cc: Shakeel Butt <shakeelb@google.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tycho Andersen <tycho@tycho.ws>
Cc: Will Deacon <will@kernel.org>
Cc: kernel test robot <lkp@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-07-08 11:48:20 -07:00
..
2021-04-26 16:32:11 -07:00
2021-07-05 11:48:14 -07:00
2021-07-05 12:10:34 -07:00
2021-07-01 14:54:03 -07:00
2021-07-05 11:21:51 -07:00
2021-06-03 14:04:18 -07:00
2021-07-02 13:22:47 -07:00
2021-05-06 19:24:11 -07:00
2021-06-30 12:21:16 -07:00
2021-06-18 08:53:35 -06:00
2021-05-24 21:13:05 -07:00
2021-05-19 00:33:40 +02:00
2021-06-15 18:01:06 +02:00
2021-07-02 15:14:36 -07:00
2021-06-30 14:33:25 -07:00
2021-07-05 13:42:16 -07:00
2021-06-25 19:57:01 -04:00
2021-04-30 11:20:40 -07:00
2021-06-29 10:53:48 -07:00
2021-04-26 15:03:23 -07:00
2021-05-17 20:01:35 +02:00
2021-06-01 10:29:21 +01:00
2021-07-02 12:54:34 -07:00
2021-05-12 20:11:17 +02:00
2021-04-28 12:37:53 -07:00
2021-06-17 13:09:27 -04:00
2021-06-15 17:46:57 +02:00
2021-07-01 11:06:02 -07:00
2021-07-02 12:08:10 -07:00
2021-06-29 10:53:53 -07:00
2021-07-01 11:06:05 -07:00
2021-05-07 11:23:41 -07:00
2021-06-28 11:22:40 -07:00
2021-07-03 11:49:33 -07:00
2021-07-01 11:06:03 -07:00
2021-06-12 13:08:57 -07:00
2021-06-07 14:11:47 -07:00
2021-06-30 15:51:09 -07:00
2021-05-05 13:24:11 -07:00
2021-07-01 11:06:03 -07:00
2021-05-10 16:03:35 -07:00
2021-06-24 15:49:32 +02:00
2021-07-01 11:06:03 -07:00
2021-07-01 11:06:03 -07:00
2021-05-21 22:13:13 +02:00
2021-05-13 18:29:11 +02:00
2021-05-13 16:57:17 +02:00
2021-06-30 12:12:56 -07:00