Replace fence instructions with Zalasr instructions during acquire or
release operations.
Signed-off-by: Xu Lu <luxu.kernel@bytedance.com>
---
arch/riscv/include/asm/barrier.h | 79 +++++++++++++++++++++++++++-----
1 file changed, 68 insertions(+), 11 deletions(-)
diff --git a/arch/riscv/include/asm/barrier.h b/arch/riscv/include/asm/barrier.h
index b8c5726d86acb..b1d2a9a85256d 100644
--- a/arch/riscv/include/asm/barrier.h
+++ b/arch/riscv/include/asm/barrier.h
@@ -51,19 +51,76 @@
*/
#define smp_mb__after_spinlock() RISCV_FENCE(iorw, iorw)
-#define __smp_store_release(p, v) \
-do { \
- compiletime_assert_atomic_type(*p); \
- RISCV_FENCE(rw, w); \
- WRITE_ONCE(*p, v); \
+extern void __bad_size_call_parameter(void);
+
+#define __smp_store_release(p, v) \
+do { \
+ compiletime_assert_atomic_type(*p); \
+ switch (sizeof(*p)) { \
+ case 1: \
+ asm volatile(ALTERNATIVE("fence rw, w;\t\nsb %0, 0(%1)\t\n", \
+ SB_RL(%0, %1) "\t\nnop\t\n", \
+ 0, RISCV_ISA_EXT_ZALASR, 1) \
+ : : "r" (v), "r" (p) : "memory"); \
+ break; \
+ case 2: \
+ asm volatile(ALTERNATIVE("fence rw, w;\t\nsh %0, 0(%1)\t\n", \
+ SH_RL(%0, %1) "\t\nnop\t\n", \
+ 0, RISCV_ISA_EXT_ZALASR, 1) \
+ : : "r" (v), "r" (p) : "memory"); \
+ break; \
+ case 4: \
+ asm volatile(ALTERNATIVE("fence rw, w;\t\nsw %0, 0(%1)\t\n", \
+ SW_RL(%0, %1) "\t\nnop\t\n", \
+ 0, RISCV_ISA_EXT_ZALASR, 1) \
+ : : "r" (v), "r" (p) : "memory"); \
+ break; \
+ case 8: \
+ asm volatile(ALTERNATIVE("fence rw, w;\t\nsd %0, 0(%1)\t\n", \
+ SD_RL(%0, %1) "\t\nnop\t\n", \
+ 0, RISCV_ISA_EXT_ZALASR, 1) \
+ : : "r" (v), "r" (p) : "memory"); \
+ break; \
+ default: \
+ __bad_size_call_parameter(); \
+ break; \
+ } \
} while (0)
-#define __smp_load_acquire(p) \
-({ \
- typeof(*p) ___p1 = READ_ONCE(*p); \
- compiletime_assert_atomic_type(*p); \
- RISCV_FENCE(r, rw); \
- ___p1; \
+#define __smp_load_acquire(p) \
+({ \
+ TYPEOF_UNQUAL(*p) val; \
+ compiletime_assert_atomic_type(*p); \
+ switch (sizeof(*p)) { \
+ case 1: \
+ asm volatile(ALTERNATIVE("lb %0, 0(%1)\t\nfence r, rw\t\n", \
+ LB_AQ(%0, %1) "\t\nnop\t\n", \
+ 0, RISCV_ISA_EXT_ZALASR, 1) \
+ : "=r" (val) : "r" (p) : "memory"); \
+ break; \
+ case 2: \
+ asm volatile(ALTERNATIVE("lh %0, 0(%1)\t\nfence r, rw\t\n", \
+ LH_AQ(%0, %1) "\t\nnop\t\n", \
+ 0, RISCV_ISA_EXT_ZALASR, 1) \
+ : "=r" (val) : "r" (p) : "memory"); \
+ break; \
+ case 4: \
+ asm volatile(ALTERNATIVE("lw %0, 0(%1)\t\nfence r, rw\t\n", \
+ LW_AQ(%0, %1) "\t\nnop\t\n", \
+ 0, RISCV_ISA_EXT_ZALASR, 1) \
+ : "=r" (val) : "r" (p) : "memory"); \
+ break; \
+ case 8: \
+ asm volatile(ALTERNATIVE("ld %0, 0(%1)\t\nfence r, rw\t\n", \
+ LD_AQ(%0, %1) "\t\nnop\t\n", \
+ 0, RISCV_ISA_EXT_ZALASR, 1) \
+ : "=r" (val) : "r" (p) : "memory"); \
+ break; \
+ default: \
+ __bad_size_call_parameter(); \
+ break; \
+ } \
+ val; \
})
#ifdef CONFIG_RISCV_ISA_ZAWRS
--
2.20.1
Hi Xu,
kernel test robot noticed the following build errors:
[auto build test ERROR on robh/for-next]
[also build test ERROR on linus/master v6.17-rc4 next-20250902]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Xu-Lu/riscv-add-ISA-extension-parsing-for-Zalasr/20250902-123357
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link: https://lore.kernel.org/r/20250902042432.78960-5-luxu.kernel%40bytedance.com
patch subject: [PATCH v2 4/4] riscv: Use Zalasr for smp_load_acquire/smp_store_release
config: riscv-randconfig-002-20250903 (https://download.01.org/0day-ci/archive/20250903/202509030832.0uHQ24ec-lkp@intel.com/config)
compiler: riscv64-linux-gcc (GCC) 9.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250903/202509030832.0uHQ24ec-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202509030832.0uHQ24ec-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from include/asm-generic/bitops/generic-non-atomic.h:7,
from include/linux/bitops.h:28,
from include/linux/thread_info.h:27,
from include/asm-generic/preempt.h:5,
from ./arch/riscv/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:79,
from include/linux/spinlock.h:56,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:7,
from include/linux/mm.h:7,
from arch/riscv/kernel/asm-offsets.c:8:
include/linux/list.h: In function 'list_empty_careful':
>> arch/riscv/include/asm/barrier.h:96:3: error: read-only variable 'val' used as 'asm' output
96 | asm volatile(ALTERNATIVE("lb %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/list.h:409:27: note: in expansion of macro 'smp_load_acquire'
409 | struct list_head *next = smp_load_acquire(&head->next);
| ^~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:102:3: error: read-only variable 'val' used as 'asm' output
102 | asm volatile(ALTERNATIVE("lh %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/list.h:409:27: note: in expansion of macro 'smp_load_acquire'
409 | struct list_head *next = smp_load_acquire(&head->next);
| ^~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:108:3: error: read-only variable 'val' used as 'asm' output
108 | asm volatile(ALTERNATIVE("lw %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/list.h:409:27: note: in expansion of macro 'smp_load_acquire'
409 | struct list_head *next = smp_load_acquire(&head->next);
| ^~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:114:3: error: read-only variable 'val' used as 'asm' output
114 | asm volatile(ALTERNATIVE("ld %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/list.h:409:27: note: in expansion of macro 'smp_load_acquire'
409 | struct list_head *next = smp_load_acquire(&head->next);
| ^~~~~~~~~~~~~~~~
In file included from include/asm-generic/bitops/generic-non-atomic.h:7,
from include/linux/bitops.h:28,
from include/linux/thread_info.h:27,
from include/asm-generic/preempt.h:5,
from ./arch/riscv/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:79,
from include/linux/spinlock.h:56,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:7,
from include/linux/mm.h:7,
from arch/riscv/kernel/asm-offsets.c:8:
include/linux/atomic/atomic-arch-fallback.h: In function 'raw_atomic_read_acquire':
>> arch/riscv/include/asm/barrier.h:96:3: error: read-only variable 'val' used as 'asm' output
96 | asm volatile(ALTERNATIVE("lb %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/atomic/atomic-arch-fallback.h:479:9: note: in expansion of macro 'smp_load_acquire'
479 | ret = smp_load_acquire(&(v)->counter);
| ^~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:102:3: error: read-only variable 'val' used as 'asm' output
102 | asm volatile(ALTERNATIVE("lh %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/atomic/atomic-arch-fallback.h:479:9: note: in expansion of macro 'smp_load_acquire'
479 | ret = smp_load_acquire(&(v)->counter);
| ^~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:108:3: error: read-only variable 'val' used as 'asm' output
108 | asm volatile(ALTERNATIVE("lw %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/atomic/atomic-arch-fallback.h:479:9: note: in expansion of macro 'smp_load_acquire'
479 | ret = smp_load_acquire(&(v)->counter);
| ^~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:114:3: error: read-only variable 'val' used as 'asm' output
114 | asm volatile(ALTERNATIVE("ld %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/atomic/atomic-arch-fallback.h:479:9: note: in expansion of macro 'smp_load_acquire'
479 | ret = smp_load_acquire(&(v)->counter);
| ^~~~~~~~~~~~~~~~
include/linux/atomic/atomic-arch-fallback.h: In function 'raw_atomic64_read_acquire':
>> arch/riscv/include/asm/barrier.h:96:3: error: read-only variable 'val' used as 'asm' output
96 | asm volatile(ALTERNATIVE("lb %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/atomic/atomic-arch-fallback.h:2605:9: note: in expansion of macro 'smp_load_acquire'
2605 | ret = smp_load_acquire(&(v)->counter);
| ^~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:102:3: error: read-only variable 'val' used as 'asm' output
102 | asm volatile(ALTERNATIVE("lh %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/atomic/atomic-arch-fallback.h:2605:9: note: in expansion of macro 'smp_load_acquire'
2605 | ret = smp_load_acquire(&(v)->counter);
| ^~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:108:3: error: read-only variable 'val' used as 'asm' output
108 | asm volatile(ALTERNATIVE("lw %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/atomic/atomic-arch-fallback.h:2605:9: note: in expansion of macro 'smp_load_acquire'
2605 | ret = smp_load_acquire(&(v)->counter);
| ^~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:114:3: error: read-only variable 'val' used as 'asm' output
114 | asm volatile(ALTERNATIVE("ld %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/atomic/atomic-arch-fallback.h:2605:9: note: in expansion of macro 'smp_load_acquire'
2605 | ret = smp_load_acquire(&(v)->counter);
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h: In function '__seqprop_sequence':
>> arch/riscv/include/asm/barrier.h:96:3: error: read-only variable 'val' used as 'asm' output
96 | asm volatile(ALTERNATIVE("lb %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:211:9: note: in expansion of macro 'smp_load_acquire'
211 | return smp_load_acquire(&s->sequence);
| ^~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:102:3: error: read-only variable 'val' used as 'asm' output
102 | asm volatile(ALTERNATIVE("lh %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:211:9: note: in expansion of macro 'smp_load_acquire'
211 | return smp_load_acquire(&s->sequence);
| ^~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:108:3: error: read-only variable 'val' used as 'asm' output
108 | asm volatile(ALTERNATIVE("lw %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:211:9: note: in expansion of macro 'smp_load_acquire'
211 | return smp_load_acquire(&s->sequence);
| ^~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:114:3: error: read-only variable 'val' used as 'asm' output
114 | asm volatile(ALTERNATIVE("ld %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:211:9: note: in expansion of macro 'smp_load_acquire'
211 | return smp_load_acquire(&s->sequence);
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h: In function '__seqprop_raw_spinlock_sequence':
>> arch/riscv/include/asm/barrier.h:96:3: error: read-only variable 'val' used as 'asm' output
96 | asm volatile(ALTERNATIVE("lb %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:160:17: note: in expansion of macro 'smp_load_acquire'
160 | unsigned seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:226:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
226 | SEQCOUNT_LOCKNAME(raw_spinlock, raw_spinlock_t, false, raw_spin)
| ^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:102:3: error: read-only variable 'val' used as 'asm' output
102 | asm volatile(ALTERNATIVE("lh %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:160:17: note: in expansion of macro 'smp_load_acquire'
160 | unsigned seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:226:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
226 | SEQCOUNT_LOCKNAME(raw_spinlock, raw_spinlock_t, false, raw_spin)
| ^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:108:3: error: read-only variable 'val' used as 'asm' output
108 | asm volatile(ALTERNATIVE("lw %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:160:17: note: in expansion of macro 'smp_load_acquire'
160 | unsigned seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:226:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
226 | SEQCOUNT_LOCKNAME(raw_spinlock, raw_spinlock_t, false, raw_spin)
| ^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:114:3: error: read-only variable 'val' used as 'asm' output
114 | asm volatile(ALTERNATIVE("ld %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:160:17: note: in expansion of macro 'smp_load_acquire'
160 | unsigned seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:226:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
226 | SEQCOUNT_LOCKNAME(raw_spinlock, raw_spinlock_t, false, raw_spin)
| ^~~~~~~~~~~~~~~~~
>> arch/riscv/include/asm/barrier.h:96:3: error: read-only variable 'val' used as 'asm' output
96 | asm volatile(ALTERNATIVE("lb %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:173:9: note: in expansion of macro 'smp_load_acquire'
173 | seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:226:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
226 | SEQCOUNT_LOCKNAME(raw_spinlock, raw_spinlock_t, false, raw_spin)
| ^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:102:3: error: read-only variable 'val' used as 'asm' output
102 | asm volatile(ALTERNATIVE("lh %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:173:9: note: in expansion of macro 'smp_load_acquire'
173 | seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:226:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
226 | SEQCOUNT_LOCKNAME(raw_spinlock, raw_spinlock_t, false, raw_spin)
| ^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:108:3: error: read-only variable 'val' used as 'asm' output
108 | asm volatile(ALTERNATIVE("lw %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:173:9: note: in expansion of macro 'smp_load_acquire'
173 | seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:226:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
226 | SEQCOUNT_LOCKNAME(raw_spinlock, raw_spinlock_t, false, raw_spin)
| ^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:114:3: error: read-only variable 'val' used as 'asm' output
114 | asm volatile(ALTERNATIVE("ld %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:173:9: note: in expansion of macro 'smp_load_acquire'
173 | seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:226:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
226 | SEQCOUNT_LOCKNAME(raw_spinlock, raw_spinlock_t, false, raw_spin)
| ^~~~~~~~~~~~~~~~~
include/linux/seqlock.h: In function '__seqprop_spinlock_sequence':
>> arch/riscv/include/asm/barrier.h:96:3: error: read-only variable 'val' used as 'asm' output
96 | asm volatile(ALTERNATIVE("lb %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:160:17: note: in expansion of macro 'smp_load_acquire'
160 | unsigned seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:227:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
227 | SEQCOUNT_LOCKNAME(spinlock, spinlock_t, __SEQ_RT, spin)
| ^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:102:3: error: read-only variable 'val' used as 'asm' output
102 | asm volatile(ALTERNATIVE("lh %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:160:17: note: in expansion of macro 'smp_load_acquire'
160 | unsigned seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:227:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
227 | SEQCOUNT_LOCKNAME(spinlock, spinlock_t, __SEQ_RT, spin)
| ^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:108:3: error: read-only variable 'val' used as 'asm' output
108 | asm volatile(ALTERNATIVE("lw %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:160:17: note: in expansion of macro 'smp_load_acquire'
160 | unsigned seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:227:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
227 | SEQCOUNT_LOCKNAME(spinlock, spinlock_t, __SEQ_RT, spin)
| ^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:114:3: error: read-only variable 'val' used as 'asm' output
114 | asm volatile(ALTERNATIVE("ld %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:160:17: note: in expansion of macro 'smp_load_acquire'
160 | unsigned seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:227:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
227 | SEQCOUNT_LOCKNAME(spinlock, spinlock_t, __SEQ_RT, spin)
| ^~~~~~~~~~~~~~~~~
>> arch/riscv/include/asm/barrier.h:96:3: error: read-only variable 'val' used as 'asm' output
96 | asm volatile(ALTERNATIVE("lb %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:173:9: note: in expansion of macro 'smp_load_acquire'
173 | seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:227:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
227 | SEQCOUNT_LOCKNAME(spinlock, spinlock_t, __SEQ_RT, spin)
| ^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:102:3: error: read-only variable 'val' used as 'asm' output
102 | asm volatile(ALTERNATIVE("lh %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:173:9: note: in expansion of macro 'smp_load_acquire'
173 | seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:227:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
227 | SEQCOUNT_LOCKNAME(spinlock, spinlock_t, __SEQ_RT, spin)
| ^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:108:3: error: read-only variable 'val' used as 'asm' output
108 | asm volatile(ALTERNATIVE("lw %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:173:9: note: in expansion of macro 'smp_load_acquire'
173 | seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:227:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
227 | SEQCOUNT_LOCKNAME(spinlock, spinlock_t, __SEQ_RT, spin)
| ^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:114:3: error: read-only variable 'val' used as 'asm' output
114 | asm volatile(ALTERNATIVE("ld %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:173:9: note: in expansion of macro 'smp_load_acquire'
173 | seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:227:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
227 | SEQCOUNT_LOCKNAME(spinlock, spinlock_t, __SEQ_RT, spin)
| ^~~~~~~~~~~~~~~~~
include/linux/seqlock.h: In function '__seqprop_rwlock_sequence':
>> arch/riscv/include/asm/barrier.h:96:3: error: read-only variable 'val' used as 'asm' output
96 | asm volatile(ALTERNATIVE("lb %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:160:17: note: in expansion of macro 'smp_load_acquire'
160 | unsigned seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:228:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
228 | SEQCOUNT_LOCKNAME(rwlock, rwlock_t, __SEQ_RT, read)
| ^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:102:3: error: read-only variable 'val' used as 'asm' output
102 | asm volatile(ALTERNATIVE("lh %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:160:17: note: in expansion of macro 'smp_load_acquire'
160 | unsigned seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:228:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
228 | SEQCOUNT_LOCKNAME(rwlock, rwlock_t, __SEQ_RT, read)
| ^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:108:3: error: read-only variable 'val' used as 'asm' output
108 | asm volatile(ALTERNATIVE("lw %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:160:17: note: in expansion of macro 'smp_load_acquire'
160 | unsigned seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:228:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
228 | SEQCOUNT_LOCKNAME(rwlock, rwlock_t, __SEQ_RT, read)
| ^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:114:3: error: read-only variable 'val' used as 'asm' output
114 | asm volatile(ALTERNATIVE("ld %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:160:17: note: in expansion of macro 'smp_load_acquire'
160 | unsigned seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:228:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
228 | SEQCOUNT_LOCKNAME(rwlock, rwlock_t, __SEQ_RT, read)
| ^~~~~~~~~~~~~~~~~
>> arch/riscv/include/asm/barrier.h:96:3: error: read-only variable 'val' used as 'asm' output
96 | asm volatile(ALTERNATIVE("lb %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:173:9: note: in expansion of macro 'smp_load_acquire'
173 | seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:228:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
228 | SEQCOUNT_LOCKNAME(rwlock, rwlock_t, __SEQ_RT, read)
| ^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:102:3: error: read-only variable 'val' used as 'asm' output
102 | asm volatile(ALTERNATIVE("lh %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:173:9: note: in expansion of macro 'smp_load_acquire'
173 | seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:228:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
228 | SEQCOUNT_LOCKNAME(rwlock, rwlock_t, __SEQ_RT, read)
| ^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:108:3: error: read-only variable 'val' used as 'asm' output
108 | asm volatile(ALTERNATIVE("lw %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:173:9: note: in expansion of macro 'smp_load_acquire'
173 | seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:228:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
228 | SEQCOUNT_LOCKNAME(rwlock, rwlock_t, __SEQ_RT, read)
| ^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:114:3: error: read-only variable 'val' used as 'asm' output
114 | asm volatile(ALTERNATIVE("ld %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:173:9: note: in expansion of macro 'smp_load_acquire'
173 | seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:228:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
228 | SEQCOUNT_LOCKNAME(rwlock, rwlock_t, __SEQ_RT, read)
| ^~~~~~~~~~~~~~~~~
include/linux/seqlock.h: In function '__seqprop_mutex_sequence':
>> arch/riscv/include/asm/barrier.h:96:3: error: read-only variable 'val' used as 'asm' output
96 | asm volatile(ALTERNATIVE("lb %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:160:17: note: in expansion of macro 'smp_load_acquire'
160 | unsigned seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:229:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
229 | SEQCOUNT_LOCKNAME(mutex, struct mutex, true, mutex)
| ^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:102:3: error: read-only variable 'val' used as 'asm' output
102 | asm volatile(ALTERNATIVE("lh %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:160:17: note: in expansion of macro 'smp_load_acquire'
160 | unsigned seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:229:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
229 | SEQCOUNT_LOCKNAME(mutex, struct mutex, true, mutex)
| ^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:108:3: error: read-only variable 'val' used as 'asm' output
108 | asm volatile(ALTERNATIVE("lw %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:160:17: note: in expansion of macro 'smp_load_acquire'
160 | unsigned seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:229:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
229 | SEQCOUNT_LOCKNAME(mutex, struct mutex, true, mutex)
| ^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:114:3: error: read-only variable 'val' used as 'asm' output
114 | asm volatile(ALTERNATIVE("ld %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:160:17: note: in expansion of macro 'smp_load_acquire'
160 | unsigned seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:229:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
229 | SEQCOUNT_LOCKNAME(mutex, struct mutex, true, mutex)
| ^~~~~~~~~~~~~~~~~
>> arch/riscv/include/asm/barrier.h:96:3: error: read-only variable 'val' used as 'asm' output
96 | asm volatile(ALTERNATIVE("lb %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:173:9: note: in expansion of macro 'smp_load_acquire'
173 | seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:229:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
229 | SEQCOUNT_LOCKNAME(mutex, struct mutex, true, mutex)
| ^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:102:3: error: read-only variable 'val' used as 'asm' output
102 | asm volatile(ALTERNATIVE("lh %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:173:9: note: in expansion of macro 'smp_load_acquire'
173 | seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:229:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
229 | SEQCOUNT_LOCKNAME(mutex, struct mutex, true, mutex)
| ^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:108:3: error: read-only variable 'val' used as 'asm' output
108 | asm volatile(ALTERNATIVE("lw %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:173:9: note: in expansion of macro 'smp_load_acquire'
173 | seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:229:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
229 | SEQCOUNT_LOCKNAME(mutex, struct mutex, true, mutex)
| ^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:114:3: error: read-only variable 'val' used as 'asm' output
114 | asm volatile(ALTERNATIVE("ld %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/seqlock.h:173:9: note: in expansion of macro 'smp_load_acquire'
173 | seq = smp_load_acquire(&s->seqcount.sequence); \
| ^~~~~~~~~~~~~~~~
include/linux/seqlock.h:229:1: note: in expansion of macro 'SEQCOUNT_LOCKNAME'
229 | SEQCOUNT_LOCKNAME(mutex, struct mutex, true, mutex)
| ^~~~~~~~~~~~~~~~~
In file included from include/asm-generic/bitops/generic-non-atomic.h:7,
from include/linux/bitops.h:28,
from include/linux/thread_info.h:27,
from include/asm-generic/preempt.h:5,
from ./arch/riscv/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:79,
from include/linux/spinlock.h:56,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:7,
from include/linux/mm.h:7,
from arch/riscv/kernel/asm-offsets.c:8:
include/linux/key.h: In function 'key_read_state':
>> arch/riscv/include/asm/barrier.h:96:3: error: read-only variable 'val' used as 'asm' output
96 | asm volatile(ALTERNATIVE("lb %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/key.h:459:9: note: in expansion of macro 'smp_load_acquire'
459 | return smp_load_acquire(&key->state);
| ^~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:102:3: error: read-only variable 'val' used as 'asm' output
102 | asm volatile(ALTERNATIVE("lh %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/key.h:459:9: note: in expansion of macro 'smp_load_acquire'
459 | return smp_load_acquire(&key->state);
| ^~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:108:3: error: read-only variable 'val' used as 'asm' output
108 | asm volatile(ALTERNATIVE("lw %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/key.h:459:9: note: in expansion of macro 'smp_load_acquire'
459 | return smp_load_acquire(&key->state);
| ^~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:114:3: error: read-only variable 'val' used as 'asm' output
114 | asm volatile(ALTERNATIVE("ld %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/key.h:459:9: note: in expansion of macro 'smp_load_acquire'
459 | return smp_load_acquire(&key->state);
| ^~~~~~~~~~~~~~~~
include/linux/fs.h: In function 'i_size_read':
>> arch/riscv/include/asm/barrier.h:96:3: error: read-only variable 'val' used as 'asm' output
96 | asm volatile(ALTERNATIVE("lb %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/fs.h:988:9: note: in expansion of macro 'smp_load_acquire'
988 | return smp_load_acquire(&inode->i_size);
| ^~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:102:3: error: read-only variable 'val' used as 'asm' output
102 | asm volatile(ALTERNATIVE("lh %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/fs.h:988:9: note: in expansion of macro 'smp_load_acquire'
988 | return smp_load_acquire(&inode->i_size);
| ^~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:108:3: error: read-only variable 'val' used as 'asm' output
108 | asm volatile(ALTERNATIVE("lw %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/fs.h:988:9: note: in expansion of macro 'smp_load_acquire'
988 | return smp_load_acquire(&inode->i_size);
| ^~~~~~~~~~~~~~~~
arch/riscv/include/asm/barrier.h:114:3: error: read-only variable 'val' used as 'asm' output
114 | asm volatile(ALTERNATIVE("ld %0, 0(%1)\t\nfence r, rw\t\n", \
| ^~~
include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^~~~~~~~~~~~~~~~~~
include/linux/fs.h:988:9: note: in expansion of macro 'smp_load_acquire'
988 | return smp_load_acquire(&inode->i_size);
| ^~~~~~~~~~~~~~~~
make[3]: *** [scripts/Makefile.build:182: arch/riscv/kernel/asm-offsets.s] Error 1 shuffle=1073380763
make[3]: Target 'prepare' not remade because of errors.
make[2]: *** [Makefile:1282: prepare0] Error 2 shuffle=1073380763
make[2]: Target 'prepare' not remade because of errors.
make[1]: *** [Makefile:248: __sub-make] Error 2 shuffle=1073380763
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:248: __sub-make] Error 2 shuffle=1073380763
make: Target 'prepare' not remade because of errors.
vim +96 arch/riscv/include/asm/barrier.h
89
90 #define __smp_load_acquire(p) \
91 ({ \
92 TYPEOF_UNQUAL(*p) val; \
93 compiletime_assert_atomic_type(*p); \
94 switch (sizeof(*p)) { \
95 case 1: \
> 96 asm volatile(ALTERNATIVE("lb %0, 0(%1)\t\nfence r, rw\t\n", \
97 LB_AQ(%0, %1) "\t\nnop\t\n", \
98 0, RISCV_ISA_EXT_ZALASR, 1) \
99 : "=r" (val) : "r" (p) : "memory"); \
100 break; \
101 case 2: \
102 asm volatile(ALTERNATIVE("lh %0, 0(%1)\t\nfence r, rw\t\n", \
103 LH_AQ(%0, %1) "\t\nnop\t\n", \
104 0, RISCV_ISA_EXT_ZALASR, 1) \
105 : "=r" (val) : "r" (p) : "memory"); \
106 break; \
107 case 4: \
108 asm volatile(ALTERNATIVE("lw %0, 0(%1)\t\nfence r, rw\t\n", \
109 LW_AQ(%0, %1) "\t\nnop\t\n", \
110 0, RISCV_ISA_EXT_ZALASR, 1) \
111 : "=r" (val) : "r" (p) : "memory"); \
112 break; \
113 case 8: \
114 asm volatile(ALTERNATIVE("ld %0, 0(%1)\t\nfence r, rw\t\n", \
115 LD_AQ(%0, %1) "\t\nnop\t\n", \
116 0, RISCV_ISA_EXT_ZALASR, 1) \
117 : "=r" (val) : "r" (p) : "memory"); \
118 break; \
119 default: \
120 __bad_size_call_parameter(); \
121 break; \
122 } \
123 val; \
124 })
125
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
© 2016 - 2026 Red Hat, Inc.