Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/dennis/percpu

Pull percpu updates from Dennis Zhou:
"Separate out variables that can be decrypted into their own page
anytime encryption can be enabled and fix __percpu annotations in
asm-generic for sparse"

* 'for-5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/dennis/percpu:
percpu: Separate decrypted varaibles anytime encryption can be enabled
percpu: fix __percpu annotation in asm-generic

+6 -7
+5 -5
include/asm-generic/percpu.h
··· 74 74 75 75 #define raw_cpu_generic_add_return(pcp, val) \ 76 76 ({ \ 77 - typeof(&(pcp)) __p = raw_cpu_ptr(&(pcp)); \ 77 + typeof(pcp) *__p = raw_cpu_ptr(&(pcp)); \ 78 78 \ 79 79 *__p += val; \ 80 80 *__p; \ ··· 82 82 83 83 #define raw_cpu_generic_xchg(pcp, nval) \ 84 84 ({ \ 85 - typeof(&(pcp)) __p = raw_cpu_ptr(&(pcp)); \ 85 + typeof(pcp) *__p = raw_cpu_ptr(&(pcp)); \ 86 86 typeof(pcp) __ret; \ 87 87 __ret = *__p; \ 88 88 *__p = nval; \ ··· 91 91 92 92 #define raw_cpu_generic_cmpxchg(pcp, oval, nval) \ 93 93 ({ \ 94 - typeof(&(pcp)) __p = raw_cpu_ptr(&(pcp)); \ 94 + typeof(pcp) *__p = raw_cpu_ptr(&(pcp)); \ 95 95 typeof(pcp) __ret; \ 96 96 __ret = *__p; \ 97 97 if (__ret == (oval)) \ ··· 101 101 102 102 #define raw_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \ 103 103 ({ \ 104 - typeof(&(pcp1)) __p1 = raw_cpu_ptr(&(pcp1)); \ 105 - typeof(&(pcp2)) __p2 = raw_cpu_ptr(&(pcp2)); \ 104 + typeof(pcp1) *__p1 = raw_cpu_ptr(&(pcp1)); \ 105 + typeof(pcp2) *__p2 = raw_cpu_ptr(&(pcp2)); \ 106 106 int __ret = 0; \ 107 107 if (*__p1 == (oval1) && *__p2 == (oval2)) { \ 108 108 *__p1 = nval1; \
+1 -2
include/linux/percpu-defs.h
··· 175 175 * Declaration/definition used for per-CPU variables that should be accessed 176 176 * as decrypted when memory encryption is enabled in the guest. 177 177 */ 178 - #if defined(CONFIG_VIRTUALIZATION) && defined(CONFIG_AMD_MEM_ENCRYPT) 179 - 178 + #ifdef CONFIG_AMD_MEM_ENCRYPT 180 179 #define DECLARE_PER_CPU_DECRYPTED(type, name) \ 181 180 DECLARE_PER_CPU_SECTION(type, name, "..decrypted") 182 181