From: Erdem Aktas Date: Fri, 13 Dec 2019 21:31:46 +0000 (-0800) Subject: percpu: Separate decrypted varaibles anytime encryption can be enabled X-Git-Tag: v4.19.103~52 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a5d0c3ff6553a2aabef438af6f16ad8a9cdd01ac;p=platform%2Fkernel%2Flinux-rpi.git percpu: Separate decrypted varaibles anytime encryption can be enabled commit 264b0d2bee148073c117e7bbbde5be7125a53be1 upstream. CONFIG_VIRTUALIZATION may not be enabled for memory encrypted guests. If disabled, decrypted per-CPU variables may end up sharing the same page with variables that should be left encrypted. Always separate per-CPU variables that should be decrypted into their own page anytime memory encryption can be enabled in the guest rather than rely on any other config option that may not be enabled. Fixes: ac26963a1175 ("percpu: Introduce DEFINE_PER_CPU_DECRYPTED") Cc: stable@vger.kernel.org # 4.15+ Signed-off-by: Erdem Aktas Signed-off-by: David Rientjes Signed-off-by: Dennis Zhou Signed-off-by: Greg Kroah-Hartman --- diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h index 2d2096b..90b8ce8 100644 --- a/include/linux/percpu-defs.h +++ b/include/linux/percpu-defs.h @@ -176,8 +176,7 @@ * Declaration/definition used for per-CPU variables that should be accessed * as decrypted when memory encryption is enabled in the guest. */ -#if defined(CONFIG_VIRTUALIZATION) && defined(CONFIG_AMD_MEM_ENCRYPT) - +#ifdef CONFIG_AMD_MEM_ENCRYPT #define DECLARE_PER_CPU_DECRYPTED(type, name) \ DECLARE_PER_CPU_SECTION(type, name, "..decrypted")