diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index f61daeeecee69..62cca2cd4dd65 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -356,11 +357,6 @@ struct dm_target { */ bool discards_supported:1; - /* - * Set if this target requires stable data during writeback. - */ - bool needs_stable_writes:1; - /* * Set if this target requires that discards be split on * 'max_discard_sectors' boundaries. @@ -401,6 +397,9 @@ struct dm_target { * bio_set_dev(). NOTE: ideally a target should _not_ need this. */ bool needs_bio_set_dev:1; + + /* Set if this target requires stable data during writeback. */ + DEEPIN_KABI_EXTEND(bool needs_stable_writes:1) }; void *dm_per_bio_data(struct bio *bio, size_t data_size); diff --git a/include/linux/io_uring_types.h b/include/linux/io_uring_types.h index d05ed8c7ae1ee..363c265cef21f 100644 --- a/include/linux/io_uring_types.h +++ b/include/linux/io_uring_types.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -362,9 +363,6 @@ struct io_ring_ctx { bool iowq_limits_set; struct callback_head poll_wq_task_work; - /* deferred ->poll_wq wake up for local task_work */ - struct rcu_head poll_wq_rcu; - atomic_t poll_wq_rcu_pending; struct list_head defer_list; unsigned sq_thread_idle; /* protected by ->completion_lock */ @@ -378,6 +376,9 @@ struct io_ring_ctx { unsigned short n_sqe_pages; struct page **ring_pages; struct page **sqe_pages; + /* deferred ->poll_wq wake up for local task_work */ + DEEPIN_KABI_EXTEND(struct rcu_head poll_wq_rcu) + DEEPIN_KABI_EXTEND(atomic_t poll_wq_rcu_pending) }; struct io_tw_state { @@ -579,7 +580,8 @@ struct io_kiocb { __poll_t apoll_events; }; atomic_t refs; - bool cancel_seq_set; + DEEPIN_KABI_REPLACE(atomic_t poll_refs, + bool cancel_seq_set) struct io_task_work io_task_work; unsigned nr_tw; /* for polled requests, i.e. IORING_OP_POLL_ADD and async armed poll */ @@ -589,7 +591,6 @@ struct io_kiocb { /* opcode allocated if it needs to store data for async defer */ void *async_data; /* linked requests, IFF REQ_F_HARDLINK or REQ_F_LINK are set */ - atomic_t poll_refs; struct io_kiocb *link; /* custom credentials, valid IFF REQ_F_CREDS is set */ const struct cred *creds; @@ -599,6 +600,7 @@ struct io_kiocb { u64 extra1; u64 extra2; } big_cqe; + DEEPIN_KABI_EXTEND(atomic_t poll_refs) }; struct io_overflow_cqe { diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 454ffc8e62f60..dc47c64c64f64 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -923,10 +923,6 @@ struct mm_struct { */ int mm_lock_seq; #endif -#ifdef CONFIG_FUTEX - atomic64_t futex_unique_id; -#endif - unsigned long hiwater_rss; /* High-watermark of RSS usage */ unsigned long hiwater_vm; /* High-water virtual memory usage */ @@ -1061,8 +1057,26 @@ struct mm_struct { #endif /* CONFIG_LRU_GEN */ } __randomize_layout; +#ifdef CONFIG_FUTEX +#ifdef CONFIG_64BIT + DEEPIN_KABI_USE(1, atomic64_t futex_unique_id) + DEEPIN_KABI_RESERVE(2) +#else + /* + * 32-bit reserve words are four bytes each and only four-byte + * aligned, which cannot host the alignment atomic64_t needs (eight + * bytes on ARM EABI), so keep two u32 words and cast at the use + * sites. The anonymous struct above holds atomic64_t pinned_vm, + * so its size is a multiple of eight and this storage in fact sits + * at an eight-byte-aligned offset, keeping the casts safe and + * cpu_bitmap at its baseline offset on every layout. + */ + DEEPIN_KABI_USE(1, 2, u32 futex_unique_id[2]) +#endif +#else DEEPIN_KABI_RESERVE(1) DEEPIN_KABI_RESERVE(2) +#endif DEEPIN_KABI_RESERVE(3) DEEPIN_KABI_RESERVE(4) DEEPIN_KABI_RESERVE(5) diff --git a/include/linux/sched/user.h b/include/linux/sched/user.h index ec262b605437c..bcd7e961b669f 100644 --- a/include/linux/sched/user.h +++ b/include/linux/sched/user.h @@ -7,6 +7,7 @@ #include #include #include +#include /* * Some day this will be a full-fledged user tracking system.. @@ -28,15 +29,15 @@ struct user_struct { defined(CONFIG_SECRETMEM) atomic_long_t locked_vm; /* pinned pages charged to RLIMIT_MEMLOCK */ #endif -#ifdef CONFIG_PERF_EVENTS - atomic_long_t perf_mlock; /* perf buffer pages within perf_event_mlock_kb */ -#endif #ifdef CONFIG_WATCH_QUEUE atomic_t nr_watches; /* The number of watches this user currently has */ #endif /* Miscellaneous per-user rate limit */ struct ratelimit_state ratelimit; +#ifdef CONFIG_PERF_EVENTS + DEEPIN_KABI_EXTEND(atomic_long_t perf_mlock) /* perf buffer pages */ +#endif }; extern int uids_sysfs_init(void); diff --git a/include/linux/unicode.h b/include/linux/unicode.h index f5ee53dc4dff7..7fe1486bcb72f 100644 --- a/include/linux/unicode.h +++ b/include/linux/unicode.h @@ -4,6 +4,7 @@ #include #include +#include struct utf8data; struct utf8data_table; @@ -51,7 +52,7 @@ struct unicode_map { unsigned int version; const struct utf8data *ntab[UTF8_NMAX]; const struct utf8data_table *tables; - struct rcu_head rcu; + DEEPIN_KABI_EXTEND(struct rcu_head rcu) }; int utf8_validate(const struct unicode_map *um, const struct qstr *str); diff --git a/kernel/fork.c b/kernel/fork.c index 294653c6f8b36..83b53293f0244 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1347,7 +1347,7 @@ static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p, mm_init_uprobes_state(mm); hugetlb_count_init(mm); #ifdef CONFIG_FUTEX - atomic64_set(&mm->futex_unique_id, 0); + atomic64_set((atomic64_t *)&mm->futex_unique_id, 0); #endif if (current->mm) { diff --git a/kernel/futex/core.c b/kernel/futex/core.c index 71372f2dd6af3..c432029c4191f 100644 --- a/kernel/futex/core.c +++ b/kernel/futex/core.c @@ -348,7 +348,8 @@ int get_futex_key(u32 __user *uaddr, bool fshared, union futex_key *key, } key->both.offset |= FUT_OFF_MMSHARED; - key->private.mm_seq = get_object_id(&mm->futex_unique_id); + key->private.mm_seq = + get_object_id((atomic64_t *)&mm->futex_unique_id); key->private.address = address; } else {