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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'locking-urgent-2021-03-14' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull locking fixes from Thomas Gleixner:
"A couple of locking fixes:

- A fix for the static_call mechanism so it handles unaligned
addresses correctly.

- Make u64_stats_init() a macro so every instance gets a seperate
lockdep key.

- Make seqcount_latch_init() a macro as well to preserve the static
variable which is used for the lockdep key"

* tag 'locking-urgent-2021-03-14' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
seqlock,lockdep: Fix seqcount_latch_init()
u64_stats,lockdep: Fix u64_stats_init() vs lockdep
static_call: Fix the module key fixup

+9 -10
+1 -4
include/linux/seqlock.h
··· 664 664 * seqcount_latch_init() - runtime initializer for seqcount_latch_t 665 665 * @s: Pointer to the seqcount_latch_t instance 666 666 */ 667 - static inline void seqcount_latch_init(seqcount_latch_t *s) 668 - { 669 - seqcount_init(&s->seqcount); 670 - } 667 + #define seqcount_latch_init(s) seqcount_init(&(s)->seqcount) 671 668 672 669 /** 673 670 * raw_read_seqcount_latch() - pick even/odd latch data copy
+4 -3
include/linux/u64_stats_sync.h
··· 115 115 } 116 116 #endif 117 117 118 + #if BITS_PER_LONG == 32 && defined(CONFIG_SMP) 119 + #define u64_stats_init(syncp) seqcount_init(&(syncp)->seq) 120 + #else 118 121 static inline void u64_stats_init(struct u64_stats_sync *syncp) 119 122 { 120 - #if BITS_PER_LONG == 32 && defined(CONFIG_SMP) 121 - seqcount_init(&syncp->seq); 122 - #endif 123 123 } 124 + #endif 124 125 125 126 static inline void u64_stats_update_begin(struct u64_stats_sync *syncp) 126 127 {
+4 -3
kernel/static_call.c
··· 349 349 struct static_call_site *site; 350 350 351 351 for (site = start; site != stop; site++) { 352 - unsigned long addr = (unsigned long)static_call_key(site); 352 + unsigned long s_key = (long)site->key + (long)&site->key; 353 + unsigned long addr = s_key & ~STATIC_CALL_SITE_FLAGS; 353 354 unsigned long key; 354 355 355 356 /* ··· 374 373 return -EINVAL; 375 374 } 376 375 377 - site->key = (key - (long)&site->key) | 378 - (site->key & STATIC_CALL_SITE_FLAGS); 376 + key |= s_key & STATIC_CALL_SITE_FLAGS; 377 + site->key = key - (long)&site->key; 379 378 } 380 379 381 380 return __static_call_init(mod, start, stop);