-
由 Andrii Nakryiko 提交于
mainline inclusion from mainline-5.14-rc1 commit 256eab48 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I5EUVD CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=256eab48e70c0eaf5b1b9af83c0588491986c7de ------------------------------------------------- In preparation of skipping emitting static variables in BPF skeletons, switch all current selftests uses of static variables to pass data between BPF and user-space to use global variables. All non-read-only `static volatile` variables become just plain global variables by dropping `static volatile` part. Read-only `static volatile const` variables, though, still require `volatile` modifier, otherwise compiler will ignore whatever values are set from user-space. Few static linker tests are using name-conflicting static variables to validate that static linker still properly handles static variables and doesn't trip up on name conflicts. Signed-off-by: NAndrii Nakryiko <andrii@kernel.org> Signed-off-by: NAlexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20210507054119.270888-4-andrii@kernel.org (cherry picked from commit 256eab48) Signed-off-by: NWang Yufen <wangyufen@huawei.com> Conflicts: tools/testing/selftests/bpf/progs/test_check_mtu.c tools/testing/selftests/bpf/progs/test_snprintf_single.c tools/testing/selftests/bpf/progs/test_sockmap_listen.c Signed-off-by: NWang Yufen <wangyufen@huawei.com>
d5073e2f