- updated to 5.7[.0]
authorJakub Bogusz <qboosh@pld-linux.org>
Sun, 21 Jun 2020 13:44:28 +0000 (15:44 +0200)
committerJakub Bogusz <qboosh@pld-linux.org>
Sun, 21 Jun 2020 13:44:28 +0000 (15:44 +0200)
- added bpf-hashmap patch (fix bpftool with size_t shorter than ULL)

kernel-tools-bpf-hashmap.patch [new file with mode: 0644]
kernel-tools.spec

diff --git a/kernel-tools-bpf-hashmap.patch b/kernel-tools-bpf-hashmap.patch
new file mode 100644 (file)
index 0000000..e5300b1
--- /dev/null
@@ -0,0 +1,24 @@
+Fix broken hashmap implementation to ensure that hash_bits returns value fitting in
+given bits (for bits > 0): multiplier is long long, so shift bits must be based on
+long long, not __WORDSIZE.
+--- linux-5.7/tools/lib/bpf/hashmap.h.orig     2020-06-01 01:49:15.000000000 +0200
++++ linux-5.7/tools/lib/bpf/hashmap.h  2020-06-21 15:22:07.298466419 +0200
+@@ -10,17 +10,12 @@
+ #include <stdbool.h>
+ #include <stddef.h>
+-#ifdef __GLIBC__
+-#include <bits/wordsize.h>
+-#else
+-#include <bits/reg.h>
+-#endif
+ #include "libbpf_internal.h"
+ static inline size_t hash_bits(size_t h, int bits)
+ {
+       /* shuffle bits and return requested number of upper bits */
+-      return (h * 11400714819323198485llu) >> (__WORDSIZE - bits);
++      return (h * 11400714819323198485llu) >> (__SIZEOF_LONG_LONG__ * 8 - bits);
+ }
+ typedef size_t (*hashmap_hash_fn)(const void *key, void *ctx);
index 5434d1bdc2f0e2f5912e5b2a6cd9abe2063e3ba4..8d8f95114c54ea8f30392bfea7c9c6fa594e978d 100644 (file)
@@ -19,8 +19,8 @@
 %undefine      with_multilib
 %endif
 
-%define                basever         5.6
-%define                postver         .5
+%define                basever         5.7
+%define                postver         .0
 Summary:       Assortment of tools for the Linux kernel
 Summary(pl.UTF-8):     Zestaw narzędzi dla jądra Linuksa
 Name:          kernel-tools
@@ -29,7 +29,7 @@ Release:      1
 License:       GPL v2
 Group:         Applications/System
 Source0:       https://www.kernel.org/pub/linux/kernel/v5.x/linux-%{basever}.tar.xz
-# Source0-md5: 7b9199ec5fa563ece9ed585ffb17798f
+# Source0-md5: f63ed18935914e1ee3e04c2a0ce1ba3b
 Source1:       cpupower.service
 Source2:       cpupower.config
 %if "%{postver}" != ".0"
@@ -40,6 +40,7 @@ Patch1:               x32.patch
 Patch2:                regex.patch
 Patch3:                %{name}-perf-update.patch
 Patch4:                %{name}-perf-gtk2.patch
+Patch5:                %{name}-bpf-hashmap.patch
 URL:           https://www.kernel.org/
 BuildRequires: bison
 BuildRequires: docutils
@@ -404,6 +405,7 @@ cd linux-%{basever}
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
 
 %{__sed} -i -e '/^CFLAGS = /s/ -g / $(OPTFLAGS) /' tools/hv/Makefile
 %{__sed} -i -e '/^CFLAGS+=/s/ -O1 / $(OPTFLAGS) /' tools/thermal/tmon/Makefile
This page took 0.064767 seconds and 4 git commands to generate.