Hello community,

here is the log from the commit of package dwarves for openSUSE:Factory checked 
in at 2020-09-05 23:58:07
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/dwarves (Old)
 and      /work/SRC/openSUSE:Factory/.dwarves.new.3399 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "dwarves"

Sat Sep  5 23:58:07 2020 rev:21 rq:831414 version:1.17

Changes:
--------
--- /work/SRC/openSUSE:Factory/dwarves/dwarves.changes  2020-05-19 
14:51:11.160429579 +0200
+++ /work/SRC/openSUSE:Factory/.dwarves.new.3399/dwarves.changes        
2020-09-05 23:58:29.831136505 +0200
@@ -1,0 +2,5 @@
+Wed Sep  2 08:39:24 UTC 2020 - Jiri Slaby <jsl...@suse.com>
+
+- add libbpf-Fix-libbpf-hashmap-on-I-LP32-architectures.patch
+
+-------------------------------------------------------------------

New:
----
  libbpf-Fix-libbpf-hashmap-on-I-LP32-architectures.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ dwarves.spec ++++++
--- /var/tmp/diff_new_pack.P1xMZy/_old  2020-09-05 23:58:33.891138538 +0200
+++ /var/tmp/diff_new_pack.P1xMZy/_new  2020-09-05 23:58:33.895138540 +0200
@@ -28,6 +28,7 @@
 Source:         https://fedorapeople.org/~acme/dwarves/dwarves-%version.tar.xz
 Source2:        
https://fedorapeople.org/~acme/dwarves/dwarves-%version.tar.sign
 Source9:        baselibs.conf
+Patch0:         libbpf-Fix-libbpf-hashmap-on-I-LP32-architectures.patch
 BuildRequires:  cmake
 BuildRequires:  libdw-devel >= 0.170
 %if 0%{?suse_version} < 1550


++++++ libbpf-Fix-libbpf-hashmap-on-I-LP32-architectures.patch ++++++
From: Jakub Bogusz <qbo...@pld-linux.org>
Date: Thu, 9 Jul 2020 15:57:23 -0700
Subject: libbpf: Fix libbpf hashmap on (I)LP32 architectures
Git-commit: b2f9f1535bb93ee5fa2ea30ac1c26fa0d676154c
Patch-mainline: 5.8-rc5
References: x86_32 crashes fix

On ILP32, 64-bit result was shifted by value calculated for 32-bit long type
and returned value was much outside hashmap capacity.
As advised by Andrii Nakryiko, this patch uses different hashing variant for
architectures with size_t shorter than long long.

Fixes: e3b924224028 ("libbpf: add resizable non-thread safe internal hashmap")
Signed-off-by: Jakub Bogusz <qbo...@pld-linux.org>
Signed-off-by: Andrii Nakryiko <andr...@fb.com>
Signed-off-by: Alexei Starovoitov <a...@kernel.org>
Link: https://lore.kernel.org/bpf/20200709225723.1069937-1-andr...@fb.com
Signed-off-by: Jiri Slaby <jsl...@suse.cz>
---
 lib/bpf/src/hashmap.h |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

--- a/lib/bpf/src/hashmap.h
+++ b/lib/bpf/src/hashmap.h
@@ -16,11 +16,19 @@
 #include <bits/reg.h>
 #endif
 #include "libbpf_internal.h"
+#include <limits.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);
+#if (__SIZEOF_SIZE_T__ == __SIZEOF_LONG_LONG__)
+       /* LP64 case */
+       return (h * 11400714819323198485llu) >> (__SIZEOF_LONG_LONG__ * 8 - 
bits);
+#elif (__SIZEOF_SIZE_T__ <= __SIZEOF_LONG__)
+       return (h * 2654435769lu) >> (__SIZEOF_LONG__ * 8 - bits);
+#else
+#      error "Unsupported size_t size"
+#endif
 }
 
 typedef size_t (*hashmap_hash_fn)(const void *key, void *ctx);

Reply via email to