Skip to content

Commit 322bf2d

Browse files
committed
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
2 parents 1716f53 + 264b0d2 commit 322bf2d

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

‎include/asm-generic/percpu.h‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ do { \
7474

7575
#define raw_cpu_generic_add_return(pcp, val) \
7676
({ \
77-
typeof(&(pcp)) __p = raw_cpu_ptr(&(pcp)); \
77+
typeof(pcp) *__p = raw_cpu_ptr(&(pcp)); \
7878
\
7979
*__p += val; \
8080
*__p; \
8181
})
8282

8383
#define raw_cpu_generic_xchg(pcp, nval) \
8484
({ \
85-
typeof(&(pcp)) __p = raw_cpu_ptr(&(pcp)); \
85+
typeof(pcp) *__p = raw_cpu_ptr(&(pcp)); \
8686
typeof(pcp) __ret; \
8787
__ret = *__p; \
8888
*__p = nval; \
@@ -91,7 +91,7 @@ do { \
9191

9292
#define raw_cpu_generic_cmpxchg(pcp, oval, nval) \
9393
({ \
94-
typeof(&(pcp)) __p = raw_cpu_ptr(&(pcp)); \
94+
typeof(pcp) *__p = raw_cpu_ptr(&(pcp)); \
9595
typeof(pcp) __ret; \
9696
__ret = *__p; \
9797
if (__ret == (oval)) \
@@ -101,8 +101,8 @@ do { \
101101

102102
#define raw_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \
103103
({ \
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)); \
106106
int __ret = 0; \
107107
if (*__p1 == (oval1) && *__p2 == (oval2)) { \
108108
*__p1 = nval1; \

‎include/linux/percpu-defs.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,7 @@
175175
* Declaration/definition used for per-CPU variables that should be accessed
176176
* as decrypted when memory encryption is enabled in the guest.
177177
*/
178-
#if defined(CONFIG_VIRTUALIZATION) && defined(CONFIG_AMD_MEM_ENCRYPT)
179-
178+
#ifdef CONFIG_AMD_MEM_ENCRYPT
180179
#define DECLARE_PER_CPU_DECRYPTED(type, name) \
181180
DECLARE_PER_CPU_SECTION(type, name, "..decrypted")
182181

0 commit comments

Comments
 (0)