diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2023-06-14 01:39:41 +0200 |
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2023-06-16 10:16:00 +0200 |
| commit | 439e17576eb47f26b78c5bbc72e344d4206d2327 (patch) | |
| tree | 6164d237ced8cf778a24bd41e9b6150b5add0e98 /arch/x86/kernel | |
| parent | 9df9d2f0471b4c4702670380b8d8a45b40b23a7d (diff) | |
| download | linux-439e17576eb47f26b78c5bbc72e344d4206d2327.tar.gz linux-439e17576eb47f26b78c5bbc72e344d4206d2327.tar.bz2 linux-439e17576eb47f26b78c5bbc72e344d4206d2327.zip | |
init, x86: Move mem_encrypt_init() into arch_cpu_finalize_init()
Invoke the X86ism mem_encrypt_init() from X86 arch_cpu_finalize_init() and
remove the weak fallback from the core code.
No functional change.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20230613224545.670360645@linutronix.de
Diffstat (limited to 'arch/x86/kernel')
| -rw-r--r-- | arch/x86/kernel/cpu/common.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 18612e5e757c..5ee8b31ef16c 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -18,6 +18,7 @@ #include <linux/init.h> #include <linux/kprobes.h> #include <linux/kgdb.h> +#include <linux/mem_encrypt.h> #include <linux/smp.h> #include <linux/cpu.h> #include <linux/io.h> @@ -2414,4 +2415,14 @@ void __init arch_cpu_finalize_init(void) } else { fpu__init_check_bugs(); } + + /* + * This needs to be called before any devices perform DMA + * operations that might use the SWIOTLB bounce buffers. It will + * mark the bounce buffers as decrypted so that their usage will + * not cause "plain-text" data to be decrypted when accessed. It + * must be called after late_time_init() so that Hyper-V x86/x64 + * hypercalls work when the SWIOTLB bounce buffers are decrypted. + */ + mem_encrypt_init(); } |
