diff options
Diffstat (limited to 'include/asm-generic')
107 files changed, 178 insertions, 54 deletions
diff --git a/include/asm-generic/4level-fixup.h b/include/asm-generic/4level-fixup.h index 928fd66b1271..89f3b03b1445 100644 --- a/include/asm-generic/4level-fixup.h +++ b/include/asm-generic/4level-fixup.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _4LEVEL_FIXUP_H #define _4LEVEL_FIXUP_H diff --git a/include/asm-generic/5level-fixup.h b/include/asm-generic/5level-fixup.h index b5ca82dc4175..dfbd9d990637 100644 --- a/include/asm-generic/5level-fixup.h +++ b/include/asm-generic/5level-fixup.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _5LEVEL_FIXUP_H #define _5LEVEL_FIXUP_H diff --git a/include/asm-generic/asm-prototypes.h b/include/asm-generic/asm-prototypes.h index 939869c772b1..2fa2bc208383 100644 --- a/include/asm-generic/asm-prototypes.h +++ b/include/asm-generic/asm-prototypes.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #include <linux/bitops.h> #undef __memset extern void *__memset(void *, int, __kernel_size_t); diff --git a/include/asm-generic/atomic-long.h b/include/asm-generic/atomic-long.h index 288cc9e96395..34a028a7bcc5 100644 --- a/include/asm-generic/atomic-long.h +++ b/include/asm-generic/atomic-long.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_ATOMIC_LONG_H #define _ASM_GENERIC_ATOMIC_LONG_H /* @@ -243,4 +244,7 @@ static inline long atomic_long_add_unless(atomic_long_t *l, long a, long u) #define atomic_long_inc_not_zero(l) \ ATOMIC_LONG_PFX(_inc_not_zero)((ATOMIC_LONG_PFX(_t) *)(l)) +#define atomic_long_cond_read_acquire(v, c) \ + ATOMIC_LONG_PFX(_cond_read_acquire)((ATOMIC_LONG_PFX(_t) *)(v), (c)) + #endif /* _ASM_GENERIC_ATOMIC_LONG_H */ diff --git a/include/asm-generic/audit_change_attr.h b/include/asm-generic/audit_change_attr.h index a1865537339b..331670807cf0 100644 --- a/include/asm-generic/audit_change_attr.h +++ b/include/asm-generic/audit_change_attr.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifdef __NR_chmod __NR_chmod, #endif diff --git a/include/asm-generic/audit_dir_write.h b/include/asm-generic/audit_dir_write.h index 7b61db4fe72b..da09fb986459 100644 --- a/include/asm-generic/audit_dir_write.h +++ b/include/asm-generic/audit_dir_write.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifdef __NR_rename __NR_rename, #endif @@ -30,3 +31,6 @@ __NR_renameat, __NR_linkat, __NR_symlinkat, #endif +#ifdef __NR_renameat2 +__NR_renameat2, +#endif diff --git a/include/asm-generic/audit_read.h b/include/asm-generic/audit_read.h index 3b249cb857dc..7bb7b5a83ae2 100644 --- a/include/asm-generic/audit_read.h +++ b/include/asm-generic/audit_read.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifdef __NR_readlink __NR_readlink, #endif diff --git a/include/asm-generic/audit_write.h b/include/asm-generic/audit_write.h index 274575d7129f..f9f1d0ae11d9 100644 --- a/include/asm-generic/audit_write.h +++ b/include/asm-generic/audit_write.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #include <asm-generic/audit_dir_write.h> __NR_acct, #ifdef __NR_swapon @@ -19,3 +20,6 @@ __NR_ftruncate64, #ifdef __NR_bind __NR_bind, /* bind can affect fs object only in one way... */ #endif +#ifdef __NR_fallocate +__NR_fallocate, +#endif diff --git a/include/asm-generic/bitops.h b/include/asm-generic/bitops.h index dcdcacf2fd2b..bfc96bf6606e 100644 --- a/include/asm-generic/bitops.h +++ b/include/asm-generic/bitops.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_BITOPS_H #define __ASM_GENERIC_BITOPS_H diff --git a/include/asm-generic/bitops/__ffs.h b/include/asm-generic/bitops/__ffs.h index 937d7c435575..39e56e1c7203 100644 --- a/include/asm-generic/bitops/__ffs.h +++ b/include/asm-generic/bitops/__ffs.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_BITOPS___FFS_H_ #define _ASM_GENERIC_BITOPS___FFS_H_ diff --git a/include/asm-generic/bitops/__fls.h b/include/asm-generic/bitops/__fls.h index a60a7ccb6782..03f721a8a2b1 100644 --- a/include/asm-generic/bitops/__fls.h +++ b/include/asm-generic/bitops/__fls.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_BITOPS___FLS_H_ #define _ASM_GENERIC_BITOPS___FLS_H_ diff --git a/include/asm-generic/bitops/arch_hweight.h b/include/asm-generic/bitops/arch_hweight.h index 6a211f40665c..c2705e1d220d 100644 --- a/include/asm-generic/bitops/arch_hweight.h +++ b/include/asm-generic/bitops/arch_hweight.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_BITOPS_ARCH_HWEIGHT_H_ #define _ASM_GENERIC_BITOPS_ARCH_HWEIGHT_H_ diff --git a/include/asm-generic/bitops/atomic.h b/include/asm-generic/bitops/atomic.h index 49673510b484..04deffaf5f7d 100644 --- a/include/asm-generic/bitops/atomic.h +++ b/include/asm-generic/bitops/atomic.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_BITOPS_ATOMIC_H_ #define _ASM_GENERIC_BITOPS_ATOMIC_H_ diff --git a/include/asm-generic/bitops/builtin-__ffs.h b/include/asm-generic/bitops/builtin-__ffs.h index 90041e3a41f0..87024da44d10 100644 --- a/include/asm-generic/bitops/builtin-__ffs.h +++ b/include/asm-generic/bitops/builtin-__ffs.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_BITOPS_BUILTIN___FFS_H_ #define _ASM_GENERIC_BITOPS_BUILTIN___FFS_H_ diff --git a/include/asm-generic/bitops/builtin-__fls.h b/include/asm-generic/bitops/builtin-__fls.h index 0248f386635f..43a5aa9afbdb 100644 --- a/include/asm-generic/bitops/builtin-__fls.h +++ b/include/asm-generic/bitops/builtin-__fls.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_BITOPS_BUILTIN___FLS_H_ #define _ASM_GENERIC_BITOPS_BUILTIN___FLS_H_ diff --git a/include/asm-generic/bitops/builtin-ffs.h b/include/asm-generic/bitops/builtin-ffs.h index 064825829e1c..458c85ebcd15 100644 --- a/include/asm-generic/bitops/builtin-ffs.h +++ b/include/asm-generic/bitops/builtin-ffs.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_BITOPS_BUILTIN_FFS_H_ #define _ASM_GENERIC_BITOPS_BUILTIN_FFS_H_ diff --git a/include/asm-generic/bitops/builtin-fls.h b/include/asm-generic/bitops/builtin-fls.h index eda652d0ac7f..62daf940989d 100644 --- a/include/asm-generic/bitops/builtin-fls.h +++ b/include/asm-generic/bitops/builtin-fls.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_BITOPS_BUILTIN_FLS_H_ #define _ASM_GENERIC_BITOPS_BUILTIN_FLS_H_ diff --git a/include/asm-generic/bitops/const_hweight.h b/include/asm-generic/bitops/const_hweight.h index 0a7e06623470..149faeeeeaf2 100644 --- a/include/asm-generic/bitops/const_hweight.h +++ b/include/asm-generic/bitops/const_hweight.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_BITOPS_CONST_HWEIGHT_H_ #define _ASM_GENERIC_BITOPS_CONST_HWEIGHT_H_ diff --git a/include/asm-generic/bitops/ext2-atomic-setbit.h b/include/asm-generic/bitops/ext2-atomic-setbit.h index 5a0997857b34..b041cbf0d899 100644 --- a/include/asm-generic/bitops/ext2-atomic-setbit.h +++ b/include/asm-generic/bitops/ext2-atomic-setbit.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_BITOPS_EXT2_ATOMIC_SETBIT_H_ #define _ASM_GENERIC_BITOPS_EXT2_ATOMIC_SETBIT_H_ diff --git a/include/asm-generic/bitops/ext2-atomic.h b/include/asm-generic/bitops/ext2-atomic.h index 87f0f109d7f1..0cfc3180b074 100644 --- a/include/asm-generic/bitops/ext2-atomic.h +++ b/include/asm-generic/bitops/ext2-atomic.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_ #define _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_ diff --git a/include/asm-generic/bitops/ffs.h b/include/asm-generic/bitops/ffs.h index fbbb43af7dc0..e81868b2c0f0 100644 --- a/include/asm-generic/bitops/ffs.h +++ b/include/asm-generic/bitops/ffs.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_BITOPS_FFS_H_ #define _ASM_GENERIC_BITOPS_FFS_H_ diff --git a/include/asm-generic/bitops/ffz.h b/include/asm-generic/bitops/ffz.h index 6744bd4cdf46..0d010085fdec 100644 --- a/include/asm-generic/bitops/ffz.h +++ b/include/asm-generic/bitops/ffz.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_BITOPS_FFZ_H_ #define _ASM_GENERIC_BITOPS_FFZ_H_ diff --git a/include/asm-generic/bitops/find.h b/include/asm-generic/bitops/find.h index 998d4d544f18..1ba611e16fa0 100644 --- a/include/asm-generic/bitops/find.h +++ b/include/asm-generic/bitops/find.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_BITOPS_FIND_H_ #define _ASM_GENERIC_BITOPS_FIND_H_ diff --git a/include/asm-generic/bitops/fls.h b/include/asm-generic/bitops/fls.h index 0576d1f42f43..753aecaab641 100644 --- a/include/asm-generic/bitops/fls.h +++ b/include/asm-generic/bitops/fls.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_BITOPS_FLS_H_ #define _ASM_GENERIC_BITOPS_FLS_H_ diff --git a/include/asm-generic/bitops/fls64.h b/include/asm-generic/bitops/fls64.h index b097cf8444e3..866f2b2304ff 100644 --- a/include/asm-generic/bitops/fls64.h +++ b/include/asm-generic/bitops/fls64.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_BITOPS_FLS64_H_ #define _ASM_GENERIC_BITOPS_FLS64_H_ diff --git a/include/asm-generic/bitops/hweight.h b/include/asm-generic/bitops/hweight.h index a94d6519c7ed..6bf1bba83589 100644 --- a/include/asm-generic/bitops/hweight.h +++ b/include/asm-generic/bitops/hweight.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_BITOPS_HWEIGHT_H_ #define _ASM_GENERIC_BITOPS_HWEIGHT_H_ diff --git a/include/asm-generic/bitops/le.h b/include/asm-generic/bitops/le.h index 61731543c00e..188d3eba3ace 100644 --- a/include/asm-generic/bitops/le.h +++ b/include/asm-generic/bitops/le.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_BITOPS_LE_H_ #define _ASM_GENERIC_BITOPS_LE_H_ diff --git a/include/asm-generic/bitops/lock.h b/include/asm-generic/bitops/lock.h index 8ef0ccbf8167..bc397573c43a 100644 --- a/include/asm-generic/bitops/lock.h +++ b/include/asm-generic/bitops/lock.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_BITOPS_LOCK_H_ #define _ASM_GENERIC_BITOPS_LOCK_H_ diff --git a/include/asm-generic/bitops/non-atomic.h b/include/asm-generic/bitops/non-atomic.h index 697cc2b7e0f0..7e10c4b50c5d 100644 --- a/include/asm-generic/bitops/non-atomic.h +++ b/include/asm-generic/bitops/non-atomic.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_BITOPS_NON_ATOMIC_H_ #define _ASM_GENERIC_BITOPS_NON_ATOMIC_H_ diff --git a/include/asm-generic/bitops/sched.h b/include/asm-generic/bitops/sched.h index 604fab7031a6..86470cfcef60 100644 --- a/include/asm-generic/bitops/sched.h +++ b/include/asm-generic/bitops/sched.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_BITOPS_SCHED_H_ #define _ASM_GENERIC_BITOPS_SCHED_H_ diff --git a/include/asm-generic/bitsperlong.h b/include/asm-generic/bitsperlong.h index d1d70aa19021..3905c1c93dc2 100644 --- a/include/asm-generic/bitsperlong.h +++ b/include/asm-generic/bitsperlong.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_BITS_PER_LONG #define __ASM_GENERIC_BITS_PER_LONG diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index 87191357d303..af2cc94a61bf 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_BUG_H #define _ASM_GENERIC_BUG_H diff --git a/include/asm-generic/bugs.h b/include/asm-generic/bugs.h index 6c4f62ea714d..69021830f078 100644 --- a/include/asm-generic/bugs.h +++ b/include/asm-generic/bugs.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_BUGS_H #define __ASM_GENERIC_BUGS_H /* diff --git a/include/asm-generic/cache.h b/include/asm-generic/cache.h index 1bfcfe5c2237..60386e164246 100644 --- a/include/asm-generic/cache.h +++ b/include/asm-generic/cache.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_CACHE_H #define __ASM_GENERIC_CACHE_H /* diff --git a/include/asm-generic/cacheflush.h b/include/asm-generic/cacheflush.h index 87bc536ccde3..0dd47a6db2cf 100644 --- a/include/asm-generic/cacheflush.h +++ b/include/asm-generic/cacheflush.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_CACHEFLUSH_H #define __ASM_CACHEFLUSH_H diff --git a/include/asm-generic/checksum.h b/include/asm-generic/checksum.h index 3150cbd8eb21..34785c0f57b0 100644 --- a/include/asm-generic/checksum.h +++ b/include/asm-generic/checksum.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_CHECKSUM_H #define __ASM_GENERIC_CHECKSUM_H diff --git a/include/asm-generic/cmpxchg-local.h b/include/asm-generic/cmpxchg-local.h index 70bef78912b7..f17f14f84d09 100644 --- a/include/asm-generic/cmpxchg-local.h +++ b/include/asm-generic/cmpxchg-local.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_CMPXCHG_LOCAL_H #define __ASM_GENERIC_CMPXCHG_LOCAL_H diff --git a/include/asm-generic/cmpxchg.h b/include/asm-generic/cmpxchg.h index e5f9080e8e86..9a24510cd8c1 100644 --- a/include/asm-generic/cmpxchg.h +++ b/include/asm-generic/cmpxchg.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * Generic UP xchg and cmpxchg using interrupt disablement. Does not * support SMP. diff --git a/include/asm-generic/current.h b/include/asm-generic/current.h index 5e86f6ae7cab..3a2e224b9fa0 100644 --- a/include/asm-generic/current.h +++ b/include/asm-generic/current.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_CURRENT_H #define __ASM_GENERIC_CURRENT_H diff --git a/include/asm-generic/delay.h b/include/asm-generic/delay.h index 0f79054ce7cd..e448ac61430c 100644 --- a/include/asm-generic/delay.h +++ b/include/asm-generic/delay.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_DELAY_H #define __ASM_GENERIC_DELAY_H diff --git a/include/asm-generic/div64.h b/include/asm-generic/div64.h index 163f77999ea4..dc9726fdac8f 100644 --- a/include/asm-generic/div64.h +++ b/include/asm-generic/div64.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_DIV64_H #define _ASM_GENERIC_DIV64_H /* @@ -25,6 +26,20 @@ #if BITS_PER_LONG == 64 +/** + * do_div - returns 2 values: calculate remainder and update new dividend + * @n: pointer to uint64_t dividend (will be updated) + * @base: uint32_t divisor + * + * Summary: + * ``uint32_t remainder = *n % base;`` + * ``*n = *n / base;`` + * + * Return: (uint32_t)remainder + * + * NOTE: macro parameter @n is evaluated multiple times, + * beware of side effects! + */ # define do_div(n,base) ({ \ uint32_t __base = (base); \ uint32_t __rem; \ diff --git a/include/asm-generic/dma-contiguous.h b/include/asm-generic/dma-contiguous.h index 292c571750f0..f24b0f9a4f05 100644 --- a/include/asm-generic/dma-contiguous.h +++ b/include/asm-generic/dma-contiguous.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_DMA_CONTIGUOUS_H #define _ASM_GENERIC_DMA_CONTIGUOUS_H diff --git a/include/asm-generic/dma.h b/include/asm-generic/dma.h index 9dfc3a7f36d2..43d0c8af8058 100644 --- a/include/asm-generic/dma.h +++ b/include/asm-generic/dma.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_DMA_H #define __ASM_GENERIC_DMA_H /* diff --git a/include/asm-generic/early_ioremap.h b/include/asm-generic/early_ioremap.h index 2edef8d7fa6b..9def22e6e2b3 100644 --- a/include/asm-generic/early_ioremap.h +++ b/include/asm-generic/early_ioremap.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_EARLY_IOREMAP_H_ #define _ASM_EARLY_IOREMAP_H_ diff --git a/include/asm-generic/emergency-restart.h b/include/asm-generic/emergency-restart.h index 0d68a1eae985..445de38b795e 100644 --- a/include/asm-generic/emergency-restart.h +++ b/include/asm-generic/emergency-restart.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_EMERGENCY_RESTART_H #define _ASM_GENERIC_EMERGENCY_RESTART_H diff --git a/include/asm-generic/extable.h b/include/asm-generic/extable.h index ca14c6664027..f9618bd0723a 100644 --- a/include/asm-generic/extable.h +++ b/include/asm-generic/extable.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_EXTABLE_H #define __ASM_GENERIC_EXTABLE_H diff --git a/include/asm-generic/fb.h b/include/asm-generic/fb.h index fe8ca7fcea00..f9f18101ed36 100644 --- a/include/asm-generic/fb.h +++ b/include/asm-generic/fb.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_FB_H_ #define __ASM_GENERIC_FB_H_ #include <linux/fb.h> diff --git a/include/asm-generic/futex.h b/include/asm-generic/futex.h index f0d8b1c51343..fcb61b4659b3 100644 --- a/include/asm-generic/futex.h +++ b/include/asm-generic/futex.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_FUTEX_H #define _ASM_GENERIC_FUTEX_H diff --git a/include/asm-generic/getorder.h b/include/asm-generic/getorder.h index 65e4468ac53d..c64bea7a52be 100644 --- a/include/asm-generic/getorder.h +++ b/include/asm-generic/getorder.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_GETORDER_H #define __ASM_GENERIC_GETORDER_H diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index 8ca627dcea11..19eadac415c4 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_GPIO_H #define _ASM_GENERIC_GPIO_H diff --git a/include/asm-generic/hardirq.h b/include/asm-generic/hardirq.h index 04d0a977cd43..d14214dfc10b 100644 --- a/include/asm-generic/hardirq.h +++ b/include/asm-generic/hardirq.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_HARDIRQ_H #define __ASM_GENERIC_HARDIRQ_H diff --git a/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h index 540354f94f83..9d0cde8ab716 100644 --- a/include/asm-generic/hugetlb.h +++ b/include/asm-generic/hugetlb.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_HUGETLB_H #define _ASM_GENERIC_HUGETLB_H diff --git a/include/asm-generic/ide_iops.h b/include/asm-generic/ide_iops.h index 1b91d0681914..81dfa3ee5e06 100644 --- a/include/asm-generic/ide_iops.h +++ b/include/asm-generic/ide_iops.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* Generic I/O and MEMIO string operations. */ #define __ide_insw insw diff --git a/include/asm-generic/int-ll64.h b/include/asm-generic/int-ll64.h index 4cd84855cb46..ffb68d67be5f 100644 --- a/include/asm-generic/int-ll64.h +++ b/include/asm-generic/int-ll64.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * asm-generic/int-ll64.h * diff --git a/include/asm-generic/ioctl.h b/include/asm-generic/ioctl.h index 297fb0d7cd6c..9fda9ed000cd 100644 --- a/include/asm-generic/ioctl.h +++ b/include/asm-generic/ioctl.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_IOCTL_H #define _ASM_GENERIC_IOCTL_H diff --git a/include/asm-generic/iomap.h b/include/asm-generic/iomap.h index 650fede33c25..5b63b94ef6b5 100644 --- a/include/asm-generic/iomap.h +++ b/include/asm-generic/iomap.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __GENERIC_IO_H #define __GENERIC_IO_H diff --git a/include/asm-generic/irq.h b/include/asm-generic/irq.h index b90ec0bc485f..da21de991e84 100644 --- a/include/asm-generic/irq.h +++ b/include/asm-generic/irq.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_IRQ_H #define __ASM_GENERIC_IRQ_H diff --git a/include/asm-generic/irq_work.h b/include/asm-generic/irq_work.h index a44f452c6590..d5dce06f74b8 100644 --- a/include/asm-generic/irq_work.h +++ b/include/asm-generic/irq_work.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_IRQ_WORK_H #define __ASM_IRQ_WORK_H diff --git a/include/asm-generic/irqflags.h b/include/asm-generic/irqflags.h index 1f40d0024cf3..19ccbf483a24 100644 --- a/include/asm-generic/irqflags.h +++ b/include/asm-generic/irqflags.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_IRQFLAGS_H #define __ASM_GENERIC_IRQFLAGS_H diff --git a/include/asm-generic/kdebug.h b/include/asm-generic/kdebug.h index d1814497bcdb..2b10b31b02d0 100644 --- a/include/asm-generic/kdebug.h +++ b/include/asm-generic/kdebug.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_KDEBUG_H #define _ASM_GENERIC_KDEBUG_H diff --git a/include/asm-generic/kmap_types.h b/include/asm-generic/kmap_types.h index 90f99c74dd38..9f95b7b63d19 100644 --- a/include/asm-generic/kmap_types.h +++ b/include/asm-generic/kmap_types.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_KMAP_TYPES_H #define _ASM_GENERIC_KMAP_TYPES_H diff --git a/include/asm-generic/kprobes.h b/include/asm-generic/kprobes.h index 57af9f21d148..4a982089c95c 100644 --- a/include/asm-generic/kprobes.h +++ b/include/asm-generic/kprobes.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_KPROBES_H #define _ASM_GENERIC_KPROBES_H diff --git a/include/asm-generic/kvm_para.h b/include/asm-generic/kvm_para.h index fa25becbdcaf..18c6abe81fbd 100644 --- a/include/asm-generic/kvm_para.h +++ b/include/asm-generic/kvm_para.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_KVM_PARA_H #define _ASM_GENERIC_KVM_PARA_H diff --git a/include/asm-generic/local.h b/include/asm-generic/local.h index 9ceb03b4f466..fca7f1d84818 100644 --- a/include/asm-generic/local.h +++ b/include/asm-generic/local.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_LOCAL_H #define _ASM_GENERIC_LOCAL_H diff --git a/include/asm-generic/local64.h b/include/asm-generic/local64.h index 5980002b8b7b..765be0b7d883 100644 --- a/include/asm-generic/local64.h +++ b/include/asm-generic/local64.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_LOCAL64_H #define _ASM_GENERIC_LOCAL64_H diff --git a/include/asm-generic/memory_model.h b/include/asm-generic/memory_model.h index 5148150cc80b..7637fb46ba4f 100644 --- a/include/asm-generic/memory_model.h +++ b/include/asm-generic/memory_model.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_MEMORY_MODEL_H #define __ASM_MEMORY_MODEL_H diff --git a/include/asm-generic/mm_hooks.h b/include/asm-generic/mm_hooks.h index 41e5b6784b97..ea189d88a3cc 100644 --- a/include/asm-generic/mm_hooks.h +++ b/include/asm-generic/mm_hooks.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * Define generic no-op hooks for arch_dup_mmap, arch_exit_mmap * and arch_unmap to be included in asm-FOO/mmu_context.h for any diff --git a/include/asm-generic/mmu.h b/include/asm-generic/mmu.h index 0ed3f1cfb854..061838037542 100644 --- a/include/asm-generic/mmu.h +++ b/include/asm-generic/mmu.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_MMU_H #define __ASM_GENERIC_MMU_H diff --git a/include/asm-generic/mmu_context.h b/include/asm-generic/mmu_context.h index a7eec910ba6c..6be9106fb6fb 100644 --- a/include/asm-generic/mmu_context.h +++ b/include/asm-generic/mmu_context.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_MMU_CONTEXT_H #define __ASM_GENERIC_MMU_CONTEXT_H diff --git a/include/asm-generic/module.h b/include/asm-generic/module.h index 14dc41d185a7..98e1541b72b7 100644 --- a/include/asm-generic/module.h +++ b/include/asm-generic/module.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_MODULE_H #define __ASM_GENERIC_MODULE_H diff --git a/include/asm-generic/msi.h b/include/asm-generic/msi.h index 61c58d8878ce..e6795f088bdd 100644 --- a/include/asm-generic/msi.h +++ b/include/asm-generic/msi.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_MSI_H #define __ASM_GENERIC_MSI_H diff --git a/include/asm-generic/page.h b/include/asm-generic/page.h index 67cfb7dbc284..27bf3377b0cb 100644 --- a/include/asm-generic/page.h +++ b/include/asm-generic/page.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_PAGE_H #define __ASM_GENERIC_PAGE_H /* diff --git a/include/asm-generic/param.h b/include/asm-generic/param.h index 04e715bccceb..8d3009dd28ff 100644 --- a/include/asm-generic/param.h +++ b/include/asm-generic/param.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_PARAM_H #define __ASM_GENERIC_PARAM_H diff --git a/include/asm-generic/parport.h b/include/asm-generic/parport.h index 2c9f9d4336ca..483991d619a7 100644 --- a/include/asm-generic/parport.h +++ b/include/asm-generic/parport.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_PARPORT_H #define __ASM_GENERIC_PARPORT_H diff --git a/include/asm-generic/pci.h b/include/asm-generic/pci.h index f24bc519bf31..830d7659289b 100644 --- a/include/asm-generic/pci.h +++ b/include/asm-generic/pci.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * linux/include/asm-generic/pci.h * diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h index 976f8ac26665..1817a8415a5e 100644 --- a/include/asm-generic/percpu.h +++ b/include/asm-generic/percpu.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_PERCPU_H_ #define _ASM_GENERIC_PERCPU_H_ diff --git a/include/asm-generic/pgalloc.h b/include/asm-generic/pgalloc.h index 9e429d08b1f8..948714c1535a 100644 --- a/include/asm-generic/pgalloc.h +++ b/include/asm-generic/pgalloc.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_PGALLOC_H #define __ASM_GENERIC_PGALLOC_H /* diff --git a/include/asm-generic/pgtable-nop4d-hack.h b/include/asm-generic/pgtable-nop4d-hack.h index 752fb7511750..0c34215263b8 100644 --- a/include/asm-generic/pgtable-nop4d-hack.h +++ b/include/asm-generic/pgtable-nop4d-hack.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _PGTABLE_NOP4D_HACK_H #define _PGTABLE_NOP4D_HACK_H diff --git a/include/asm-generic/pgtable-nop4d.h b/include/asm-generic/pgtable-nop4d.h index de364ecb8df6..8f22f55de17a 100644 --- a/include/asm-generic/pgtable-nop4d.h +++ b/include/asm-generic/pgtable-nop4d.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _PGTABLE_NOP4D_H #define _PGTABLE_NOP4D_H diff --git a/include/asm-generic/pgtable-nopmd.h b/include/asm-generic/pgtable-nopmd.h index 725612b793ce..f35f6e8149e4 100644 --- a/include/asm-generic/pgtable-nopmd.h +++ b/include/asm-generic/pgtable-nopmd.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _PGTABLE_NOPMD_H #define _PGTABLE_NOPMD_H diff --git a/include/asm-generic/pgtable-nopud.h b/include/asm-generic/pgtable-nopud.h index c2b9b96d6268..e950b9c50f34 100644 --- a/include/asm-generic/pgtable-nopud.h +++ b/include/asm-generic/pgtable-nopud.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _PGTABLE_NOPUD_H #define _PGTABLE_NOPUD_H diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 8e0243036564..757dc6ffc7ba 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_PGTABLE_H #define _ASM_GENERIC_PGTABLE_H diff --git a/include/asm-generic/preempt.h b/include/asm-generic/preempt.h index c1cde3577551..c3046c920063 100644 --- a/include/asm-generic/preempt.h +++ b/include/asm-generic/preempt.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_PREEMPT_H #define __ASM_PREEMPT_H diff --git a/include/asm-generic/qrwlock.h b/include/asm-generic/qrwlock.h index 7d026bf27713..0f7062bd55e5 100644 --- a/include/asm-generic/qrwlock.h +++ b/include/asm-generic/qrwlock.h @@ -26,51 +26,20 @@ /* * Writer states & reader shift and bias. - * - * | +0 | +1 | +2 | +3 | - * ----+----+----+----+----+ - * LE | 78 | 56 | 34 | 12 | 0x12345678 - * ----+----+----+----+----+ - * | wr | rd | - * +----+----+----+----+ - * - * ----+----+----+----+----+ - * BE | 12 | 34 | 56 | 78 | 0x12345678 - * ----+----+----+----+----+ - * | rd | wr | - * +----+----+----+----+ */ -#define _QW_WAITING 1 /* A writer is waiting */ -#define _QW_LOCKED 0xff /* A writer holds the lock */ -#define _QW_WMASK 0xff /* Writer mask */ -#define _QR_SHIFT 8 /* Reader count shift */ +#define _QW_WAITING 0x100 /* A writer is waiting */ +#define _QW_LOCKED 0x0ff /* A writer holds the lock */ +#define _QW_WMASK 0x1ff /* Writer mask */ +#define _QR_SHIFT 9 /* Reader count shift */ #define _QR_BIAS (1U << _QR_SHIFT) /* * External function declarations */ -extern void queued_read_lock_slowpath(struct qrwlock *lock, u32 cnts); +extern void queued_read_lock_slowpath(struct qrwlock *lock); extern void queued_write_lock_slowpath(struct qrwlock *lock); /** - * queued_read_can_lock- would read_trylock() succeed? - * @lock: Pointer to queue rwlock structure - */ -static inline int queued_read_can_lock(struct qrwlock *lock) -{ - return !(atomic_read(&lock->cnts) & _QW_WMASK); -} - -/** - * queued_write_can_lock- would write_trylock() succeed? - * @lock: Pointer to queue rwlock structure - */ -static inline int queued_write_can_lock(struct qrwlock *lock) -{ - return !atomic_read(&lock->cnts); -} - -/** * queued_read_trylock - try to acquire read lock of a queue rwlock * @lock : Pointer to queue rwlock structure * Return: 1 if lock acquired, 0 if failed @@ -118,7 +87,7 @@ static inline void queued_read_lock(struct qrwlock *lock) return; /* The slowpath will decrement the reader count, if necessary. */ - queued_read_lock_slowpath(lock, cnts); + queued_read_lock_slowpath(lock); } /** @@ -147,30 +116,18 @@ static inline void queued_read_unlock(struct qrwlock *lock) } /** - * __qrwlock_write_byte - retrieve the write byte address of a queue rwlock - * @lock : Pointer to queue rwlock structure - * Return: the write byte address of a queue rwlock - */ -static inline u8 *__qrwlock_write_byte(struct qrwlock *lock) -{ - return (u8 *)lock + 3 * IS_BUILTIN(CONFIG_CPU_BIG_ENDIAN); -} - -/** * queued_write_unlock - release write lock of a queue rwlock * @lock : Pointer to queue rwlock structure */ static inline void queued_write_unlock(struct qrwlock *lock) { - smp_store_release(__qrwlock_write_byte(lock), 0); + smp_store_release(&lock->wlocked, 0); } /* * Remapping rwlock architecture specific functions to the corresponding * queue rwlock functions. */ -#define arch_read_can_lock(l) queued_read_can_lock(l) -#define arch_write_can_lock(l) queued_write_can_lock(l) #define arch_read_lock(l) queued_read_lock(l) #define arch_write_lock(l) queued_write_lock(l) #define arch_read_trylock(l) queued_read_trylock(l) diff --git a/include/asm-generic/qrwlock_types.h b/include/asm-generic/qrwlock_types.h index 0abc6b6062fb..137ecdd16daa 100644 --- a/include/asm-generic/qrwlock_types.h +++ b/include/asm-generic/qrwlock_types.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_QRWLOCK_TYPES_H #define __ASM_GENERIC_QRWLOCK_TYPES_H @@ -9,12 +10,23 @@ */ typedef struct qrwlock { - atomic_t cnts; + union { + atomic_t cnts; + struct { +#ifdef __LITTLE_ENDIAN + u8 wlocked; /* Locked for write? */ + u8 __lstate[3]; +#else + u8 __lstate[3]; + u8 wlocked; /* Locked for write? */ +#endif + }; + }; arch_spinlock_t wait_lock; } arch_rwlock_t; #define __ARCH_RW_LOCK_UNLOCKED { \ - .cnts = ATOMIC_INIT(0), \ + { .cnts = ATOMIC_INIT(0), }, \ .wait_lock = __ARCH_SPIN_LOCK_UNLOCKED, \ } diff --git a/include/asm-generic/qspinlock.h b/include/asm-generic/qspinlock.h index 66260777d644..b37b4ad7eb94 100644 --- a/include/asm-generic/qspinlock.h +++ b/include/asm-generic/qspinlock.h @@ -121,6 +121,5 @@ static __always_inline bool virt_spin_lock(struct qspinlock *lock) #define arch_spin_lock(l) queued_spin_lock(l) #define arch_spin_trylock(l) queued_spin_trylock(l) #define arch_spin_unlock(l) queued_spin_unlock(l) -#define arch_spin_lock_flags(l, f) queued_spin_lock(l) #endif /* __ASM_GENERIC_QSPINLOCK_H */ diff --git a/include/asm-generic/resource.h b/include/asm-generic/resource.h index 5e752b959054..8874f681b056 100644 --- a/include/asm-generic/resource.h +++ b/include/asm-generic/resource.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_RESOURCE_H #define _ASM_GENERIC_RESOURCE_H diff --git a/include/asm-generic/rwsem.h b/include/asm-generic/rwsem.h index 6c6a2141f271..93e67a055a4d 100644 --- a/include/asm-generic/rwsem.h +++ b/include/asm-generic/rwsem.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_RWSEM_H #define _ASM_GENERIC_RWSEM_H @@ -37,6 +38,16 @@ static inline void __down_read(struct rw_semaphore *sem) rwsem_down_read_failed(sem); } +static inline int __down_read_killable(struct rw_semaphore *sem) +{ + if (unlikely(atomic_long_inc_return_acquire(&sem->count) <= 0)) { + if (IS_ERR(rwsem_down_read_failed_killable(sem))) + return -EINTR; + } + + return 0; +} + static inline int __down_read_trylock(struct rw_semaphore *sem) { long tmp; diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h index e5da44eddd2f..6d9576931084 100644 --- a/include/asm-generic/sections.h +++ b/include/asm-generic/sections.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_SECTIONS_H_ #define _ASM_GENERIC_SECTIONS_H_ diff --git a/include/asm-generic/serial.h b/include/asm-generic/serial.h index 5e291090fe04..ca9f7b6be3f0 100644 --- a/include/asm-generic/serial.h +++ b/include/asm-generic/serial.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_SERIAL_H #define __ASM_GENERIC_SERIAL_H diff --git a/include/asm-generic/set_memory.h b/include/asm-generic/set_memory.h index 83e81f8996b2..c86abf6bc7ba 100644 --- a/include/asm-generic/set_memory.h +++ b/include/asm-generic/set_memory.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_SET_MEMORY_H #define __ASM_SET_MEMORY_H diff --git a/include/asm-generic/signal.h b/include/asm-generic/signal.h index d840c90a157a..c53984fa9761 100644 --- a/include/asm-generic/signal.h +++ b/include/asm-generic/signal.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_SIGNAL_H #define __ASM_GENERIC_SIGNAL_H diff --git a/include/asm-generic/simd.h b/include/asm-generic/simd.h index f57eb7b5c23b..d0343d58a74a 100644 --- a/include/asm-generic/simd.h +++ b/include/asm-generic/simd.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #include <linux/hardirq.h> diff --git a/include/asm-generic/spinlock.h b/include/asm-generic/spinlock.h index 1547a03ac50f..adaf6acab172 100644 --- a/include/asm-generic/spinlock.h +++ b/include/asm-generic/spinlock.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_SPINLOCK_H #define __ASM_GENERIC_SPINLOCK_H /* diff --git a/include/asm-generic/statfs.h b/include/asm-generic/statfs.h index 4b934e9ec970..f88dcd8ed9dd 100644 --- a/include/asm-generic/statfs.h +++ b/include/asm-generic/statfs.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _GENERIC_STATFS_H #define _GENERIC_STATFS_H diff --git a/include/asm-generic/syscalls.h b/include/asm-generic/syscalls.h index 1f74be5113b2..933ca6581aba 100644 --- a/include/asm-generic/syscalls.h +++ b/include/asm-generic/syscalls.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_SYSCALLS_H #define __ASM_GENERIC_SYSCALLS_H diff --git a/include/asm-generic/termios-base.h b/include/asm-generic/termios-base.h index 157bbf6f4510..59c5a3bd4a6e 100644 --- a/include/asm-generic/termios-base.h +++ b/include/asm-generic/termios-base.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* termios.h: generic termios/termio user copying/translation */ diff --git a/include/asm-generic/termios.h b/include/asm-generic/termios.h index 8c13a16b074e..b1398d0d4a1d 100644 --- a/include/asm-generic/termios.h +++ b/include/asm-generic/termios.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_TERMIOS_H #define _ASM_GENERIC_TERMIOS_H diff --git a/include/asm-generic/timex.h b/include/asm-generic/timex.h index b2243cb8d6f6..50ba9b5ce983 100644 --- a/include/asm-generic/timex.h +++ b/include/asm-generic/timex.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_TIMEX_H #define __ASM_GENERIC_TIMEX_H diff --git a/include/asm-generic/tlbflush.h b/include/asm-generic/tlbflush.h index d6d0a88430fe..dc2669289faf 100644 --- a/include/asm-generic/tlbflush.h +++ b/include/asm-generic/tlbflush.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_TLBFLUSH_H #define __ASM_GENERIC_TLBFLUSH_H /* diff --git a/include/asm-generic/trace_clock.h b/include/asm-generic/trace_clock.h index 6726f1bafb5e..cbbca295931a 100644 --- a/include/asm-generic/trace_clock.h +++ b/include/asm-generic/trace_clock.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_TRACE_CLOCK_H #define _ASM_GENERIC_TRACE_CLOCK_H /* diff --git a/include/asm-generic/uaccess.h b/include/asm-generic/uaccess.h index 2e51f6e7b3c2..6b2e63df2739 100644 --- a/include/asm-generic/uaccess.h +++ b/include/asm-generic/uaccess.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_UACCESS_H #define __ASM_GENERIC_UACCESS_H diff --git a/include/asm-generic/unaligned.h b/include/asm-generic/unaligned.h index 1ac097279db1..374c940e9be1 100644 --- a/include/asm-generic/unaligned.h +++ b/include/asm-generic/unaligned.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_GENERIC_UNALIGNED_H #define __ASM_GENERIC_UNALIGNED_H diff --git a/include/asm-generic/unistd.h b/include/asm-generic/unistd.h index cccc86ecfeaa..cdf904265caf 100644 --- a/include/asm-generic/unistd.h +++ b/include/asm-generic/unistd.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #include <uapi/asm-generic/unistd.h> #include <linux/export.h> diff --git a/include/asm-generic/vga.h b/include/asm-generic/vga.h index 36c8ff52016b..adf91a783b5c 100644 --- a/include/asm-generic/vga.h +++ b/include/asm-generic/vga.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * Access to VGA videoram * diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 8acfc1e099e1..bdcd1caae092 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -459,6 +459,7 @@ #define TEXT_TEXT \ ALIGN_FUNCTION(); \ *(.text.hot TEXT_MAIN .text.fixup .text.unlikely) \ + *(.text..refcount) \ *(.ref.text) \ MEM_KEEP(init.text) \ MEM_KEEP(exit.text) \ @@ -687,7 +688,7 @@ #define BUG_TABLE #endif -#ifdef CONFIG_ORC_UNWINDER +#ifdef CONFIG_UNWINDER_ORC #define ORC_UNWIND_TABLE \ . = ALIGN(4); \ .orc_unwind_ip : AT(ADDR(.orc_unwind_ip) - LOAD_OFFSET) { \ @@ -778,6 +779,24 @@ #endif /* + * Memory encryption operates on a page basis. Since we need to clear + * the memory encryption mask for this section, it needs to be aligned + * on a page boundary and be a page-size multiple in length. + * + * Note: We use a separate section so that only this section gets + * decrypted to avoid exposing more than we wish. + */ +#ifdef CONFIG_AMD_MEM_ENCRYPT +#define PERCPU_DECRYPTED_SECTION \ + . = ALIGN(PAGE_SIZE); \ + *(.data..percpu..decrypted) \ + . = ALIGN(PAGE_SIZE); +#else +#define PERCPU_DECRYPTED_SECTION +#endif + + +/* * Default discarded sections. * * Some archs want to discard exit text/data at runtime rather than @@ -815,6 +834,7 @@ . = ALIGN(cacheline); \ *(.data..percpu) \ *(.data..percpu..shared_aligned) \ + PERCPU_DECRYPTED_SECTION \ VMLINUX_SYMBOL(__per_cpu_end) = .; /** diff --git a/include/asm-generic/word-at-a-time.h b/include/asm-generic/word-at-a-time.h index 011dde083f23..20c93f08c993 100644 --- a/include/asm-generic/word-at-a-time.h +++ b/include/asm-generic/word-at-a-time.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_WORD_AT_A_TIME_H #define _ASM_WORD_AT_A_TIME_H |