]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 May 2019 15:32:27 +0000 (17:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 May 2019 15:32:27 +0000 (17:32 +0200)
added patches:
perf-tools-no-need-to-include-bitops.h-in-util.h.patch
tools-include-adopt-linux-bits.h.patch

queue-4.9/perf-tools-no-need-to-include-bitops.h-in-util.h.patch [new file with mode: 0644]
queue-4.9/series
queue-4.9/tools-include-adopt-linux-bits.h.patch [new file with mode: 0644]

diff --git a/queue-4.9/perf-tools-no-need-to-include-bitops.h-in-util.h.patch b/queue-4.9/perf-tools-no-need-to-include-bitops.h-in-util.h.patch
new file mode 100644 (file)
index 0000000..66b6714
--- /dev/null
@@ -0,0 +1,38 @@
+From e992641539e32d53ff4d99e4e00adab86e03c05a Mon Sep 17 00:00:00 2001
+From: Arnaldo Carvalho de Melo <acme@redhat.com>
+Date: Tue, 18 Apr 2017 11:42:23 -0300
+Subject: perf tools: No need to include bitops.h in util.h
+
+From: Arnaldo Carvalho de Melo <acme@redhat.com>
+
+commit 6dcca6df4b73d409628c7b4464c63d4eb9d4d13a upstream.
+
+When we switched to the kernel's roundup_pow_of_two we forgot to remove
+this include from util.h, do it now.
+
+Cc: Adrian Hunter <adrian.hunter@intel.com>
+Cc: David Ahern <dsahern@gmail.com>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Namhyung Kim <namhyung@kernel.org>
+Cc: Wang Nan <wangnan0@huawei.com>
+Fixes: 91529834d1de ("perf evlist: Use roundup_pow_of_two")
+Link: http://lkml.kernel.org/n/tip-kfye5rxivib6155cltx0bw4h@git.kernel.org
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+[bwh: Backported to 4.9 as dependency of "tools include: Adopt linux/bits.h";
+ adjusted context]
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ tools/perf/util/util.h |    1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/tools/perf/util/util.h
++++ b/tools/perf/util/util.h
+@@ -74,7 +74,6 @@
+ #include <sys/ttydefaults.h>
+ #include <api/fs/tracing_path.h>
+ #include <termios.h>
+-#include <linux/bitops.h>
+ #include <termios.h>
+ #include "strlist.h"
index 79da6252dea270aacf8969dfd4e29465f8701ed6..f3c579f0805f15df692aef042abebcb44d6f0a5a 100644 (file)
@@ -17,3 +17,5 @@ media-cpia2-fix-use-after-free-in-cpia2_exit.patch
 media-vivid-use-vfree-instead-of-kfree-for-dev-bitmap_cap.patch
 ssb-fix-possible-null-pointer-dereference-in-ssb_host_pcmcia_exit.patch
 at76c50x-usb-don-t-register-led_trigger-if-usb_register_driver-failed.patch
+perf-tools-no-need-to-include-bitops.h-in-util.h.patch
+tools-include-adopt-linux-bits.h.patch
diff --git a/queue-4.9/tools-include-adopt-linux-bits.h.patch b/queue-4.9/tools-include-adopt-linux-bits.h.patch
new file mode 100644 (file)
index 0000000..caf1b0a
--- /dev/null
@@ -0,0 +1,101 @@
+From 9b5d783e9911dae542bef3e02b59e5205ce5ff01 Mon Sep 17 00:00:00 2001
+From: Arnaldo Carvalho de Melo <acme@redhat.com>
+Date: Tue, 25 Sep 2018 10:55:59 -0300
+Subject: tools include: Adopt linux/bits.h
+
+From: Arnaldo Carvalho de Melo <acme@redhat.com>
+
+commit ba4aa02b417f08a0bee5e7b8ed70cac788a7c854 upstream.
+
+So that we reduce the difference of tools/include/linux/bitops.h to the
+original kernel file, include/linux/bitops.h, trying to remove the need
+to define BITS_PER_LONG, to avoid clashes with asm/bitsperlong.h.
+
+And the things removed from tools/include/linux/bitops.h are really in
+linux/bits.h, so that we can have a copy and then
+tools/perf/check_headers.sh will tell us when new stuff gets added to
+linux/bits.h so that we can check if it is useful and if any adjustment
+needs to be done to the tools/{include,arch}/ copies.
+
+Cc: Adrian Hunter <adrian.hunter@intel.com>
+Cc: Alexander Sverdlin <alexander.sverdlin@nokia.com>
+Cc: David Ahern <dsahern@gmail.com>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Namhyung Kim <namhyung@kernel.org>
+Cc: Wang Nan <wangnan0@huawei.com>
+Link: https://lkml.kernel.org/n/tip-y1sqyydvfzo0bjjoj4zsl562@git.kernel.org
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+[bwh: Backported to 4.9 as dependency of "x86/msr-index: Cleanup bit defines";
+ adjusted context]
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ tools/include/linux/bitops.h |    7 ++-----
+ tools/include/linux/bits.h   |   26 ++++++++++++++++++++++++++
+ tools/perf/check-headers.sh  |    1 +
+ 3 files changed, 29 insertions(+), 5 deletions(-)
+ create mode 100644 tools/include/linux/bits.h
+
+--- a/tools/include/linux/bitops.h
++++ b/tools/include/linux/bitops.h
+@@ -3,8 +3,6 @@
+ #include <asm/types.h>
+ #include <linux/kernel.h>
+-#include <linux/compiler.h>
+-
+ #ifndef __WORDSIZE
+ #define __WORDSIZE (__SIZEOF_LONG__ * 8)
+ #endif
+@@ -12,10 +10,9 @@
+ #ifndef BITS_PER_LONG
+ # define BITS_PER_LONG __WORDSIZE
+ #endif
++#include <linux/bits.h>
++#include <linux/compiler.h>
+-#define BIT_MASK(nr)          (1UL << ((nr) % BITS_PER_LONG))
+-#define BIT_WORD(nr)          ((nr) / BITS_PER_LONG)
+-#define BITS_PER_BYTE         8
+ #define BITS_TO_LONGS(nr)     DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long))
+ #define BITS_TO_U64(nr)               DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(u64))
+ #define BITS_TO_U32(nr)               DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(u32))
+--- /dev/null
++++ b/tools/include/linux/bits.h
+@@ -0,0 +1,26 @@
++/* SPDX-License-Identifier: GPL-2.0 */
++#ifndef __LINUX_BITS_H
++#define __LINUX_BITS_H
++#include <asm/bitsperlong.h>
++
++#define BIT(nr)                       (1UL << (nr))
++#define BIT_ULL(nr)           (1ULL << (nr))
++#define BIT_MASK(nr)          (1UL << ((nr) % BITS_PER_LONG))
++#define BIT_WORD(nr)          ((nr) / BITS_PER_LONG)
++#define BIT_ULL_MASK(nr)      (1ULL << ((nr) % BITS_PER_LONG_LONG))
++#define BIT_ULL_WORD(nr)      ((nr) / BITS_PER_LONG_LONG)
++#define BITS_PER_BYTE         8
++
++/*
++ * Create a contiguous bitmask starting at bit position @l and ending at
++ * position @h. For example
++ * GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000.
++ */
++#define GENMASK(h, l) \
++      (((~0UL) - (1UL << (l)) + 1) & (~0UL >> (BITS_PER_LONG - 1 - (h))))
++
++#define GENMASK_ULL(h, l) \
++      (((~0ULL) - (1ULL << (l)) + 1) & \
++       (~0ULL >> (BITS_PER_LONG_LONG - 1 - (h))))
++
++#endif        /* __LINUX_BITS_H */
+--- a/tools/perf/check-headers.sh
++++ b/tools/perf/check-headers.sh
+@@ -4,6 +4,7 @@ HEADERS='
+ include/uapi/linux/fcntl.h
+ include/uapi/linux/perf_event.h
+ include/uapi/linux/stat.h
++include/linux/bits.h
+ include/linux/hash.h
+ include/uapi/linux/hw_breakpoint.h
+ arch/x86/include/asm/disabled-features.h