This reverts commit
5cb917aa1f1e03df9a4c29b363e3900d73508fa8 which is commit
be95a845cc4402272994ce290e3ad928aff06cb9 upstream. This commit heavily
modifies the bpf_map structure to split it on two cachelines and prevent
sharing reference counter with other, read-only fields in order to mitigate
Spectre attacks. This modification changes the ABI, so revert the mitigation
for now since the infrastructure is not yet complete for Spectre mitigation
anyway.
Gbp-Pq: Topic debian
Gbp-Pq: Name revert-bpf-avoid-false-sharing-of-map-refcount-with-.patch
};
struct bpf_map {
- /* 1st cacheline with read-mostly members of which some
- * are also accessed in fast-path (e.g. ops, max_entries).
- */
- const struct bpf_map_ops *ops ____cacheline_aligned;
+ atomic_t refcnt;
enum bpf_map_type map_type;
u32 key_size;
u32 value_size;
u32 map_flags;
u32 pages;
bool unpriv_array;
- /* 7 bytes hole */
-
- /* 2nd cacheline with misc members to avoid false sharing
- * particularly with refcounting.
- */
- struct user_struct *user ____cacheline_aligned;
- atomic_t refcnt;
- atomic_t usercnt;
+ struct user_struct *user;
+ const struct bpf_map_ops *ops;
struct work_struct work;
+ atomic_t usercnt;
};
struct bpf_map_type_list {