linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/mm: Unbreak modules that rely on external PAGE_KERNEL availability
@ 2017-11-08 20:18 Jiri Kosina
  2017-11-08 20:47 ` Thomas Gleixner
  0 siblings, 1 reply; 9+ messages in thread
From: Jiri Kosina @ 2017-11-08 20:18 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Tom Lendacky,
	Borislav Petkov, Linus Torvalds
  Cc: linux-kernel, linux-mm, x86

From: Jiri Kosina <jkosina@suse.cz>

Commit

  7744ccdbc16f0 ("x86/mm: Add Secure Memory Encryption (SME) support")

as a side-effect made PAGE_KERNEL all of a sudden unavailable to modules 
which can't make use of EXPORT_SYMBOL_GPL() symbols.

This is because once SME is enabled, sme_me_mask (which is introduced as 
EXPORT_SYMBOL_GPL) makes its way to PAGE_KERNEL through _PAGE_ENC, causing 
imminent build failure for all the modules which make use of all the 
EXPORT-SYMBOL()-exported API (such as vmap(), __vmalloc(), 
remap_pfn_range(), ...).

Exporting (as EXPORT_SYMBOL()) interfaces (and having done so for ages) 
that take pgprot_t argument, while making it impossible to -- all of a 
sudden -- pass PAGE_KERNEL to it, feels rather incosistent.

Restore the original behavior and make it possible to pass PAGE_KERNEL to 
all its EXPORT_SYMBOL() consumers.

Cc: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
---
 arch/x86/mm/mem_encrypt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c
index 16c5f37933a2..0286327e65fa 100644
--- a/arch/x86/mm/mem_encrypt.c
+++ b/arch/x86/mm/mem_encrypt.c
@@ -40,7 +40,7 @@ static char sme_cmdline_off[] __initdata = "off";
  * section is later cleared.
  */
 u64 sme_me_mask __section(.data) = 0;
-EXPORT_SYMBOL_GPL(sme_me_mask);
+EXPORT_SYMBOL(sme_me_mask);
 
 /* Buffer used for early in-place encryption by BSP, no locking needed */
 static char sme_early_buffer[PAGE_SIZE] __aligned(PAGE_SIZE);

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-11-08 22:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-08 20:18 [PATCH] x86/mm: Unbreak modules that rely on external PAGE_KERNEL availability Jiri Kosina
2017-11-08 20:47 ` Thomas Gleixner
2017-11-08 21:09   ` Linus Torvalds
2017-11-08 21:15     ` Borislav Petkov
2017-11-08 21:23       ` Linus Torvalds
2017-11-08 21:36         ` Tom Lendacky
2017-11-08 21:45         ` Borislav Petkov
2017-11-08 22:04           ` Tom Lendacky
2017-11-08 21:46         ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).