[PATCH v4 06/14] dynamic_debug: use pointer comparison in ddebug_remove_module

2019-02-12 Thread Rasmus Villemoes
core.c (incidentally, there is an in-tree module whose name is core, but I just tested this with an out-of-tree trivial one). Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes --- lib/dynamic_debug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/dynamic_debug.c b/lib

[PATCH v4 11/14] btrfs: implement btrfs_debug* in terms of helper macro

2019-02-12 Thread Rasmus Villemoes
t use distinct identifiers. Using the new _dynamic_func_call_no_desc helper macro from dynamic_debug.h takes care of both of these. No functional change. Cc: linux-bt...@vger.kernel.org Acked-by: David Sterba Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes --- fs/btrfs/ctree.h

[PATCH v4 13/14] ACPI: remove unused __acpi_handle_debug macro

2019-02-12 Thread Rasmus Villemoes
If CONFIG_DYNAMIC_DEBUG is not set, acpi_handle_debug directly invokes acpi_handle_printk (if DEBUG) or does a no-printk (if !DEBUG). So this macro is never used. Cc: linux-a...@vger.kernel.org Acked-by: Jason Baron Acked-by: Rafael J. Wysocki Signed-off-by: Rasmus Villemoes --- include/linux

[PATCH v4 14/14] ACPI: implement acpi_handle_debug in terms of _dynamic_func_call

2019-02-12 Thread Rasmus Villemoes
With coming changes on x86-64, all dynamic debug descriptors in a translation unit must have distinct names. The macro _dynamic_func_call takes care of that. No functional change. Cc: linux-a...@vger.kernel.org Acked-by: Rafael J. Wysocki Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes

[PATCH v4 05/14] dynamic_debug: don't duplicate modname in ddebug_add_module

2019-02-12 Thread Rasmus Villemoes
as long as the struct ddebug_table, since free_module() calls ddebug_remove_module(). Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes --- lib/dynamic_debug.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index db

Re: [PATCH v6 5/9] vsprintf: Factor out %pV handler as va_format()

2019-02-12 Thread Rasmus Villemoes
On 12/02/2019 18.58, Joe Perches wrote: > On Tue, 2019-02-12 at 14:00 +0100, Petr Mladek wrote: >> On Fri 2019-02-08 09:11:17, Joe Perches wrote: >>> On Fri, 2019-02-08 at 16:23 +0100, Petr Mladek wrote: Move the code from the long pointer() function. We are going to improve error handlin

[PATCH v2 3/3] linux/fs.h: move member alignment check next to definition of struct filename

2019-02-08 Thread Rasmus Villemoes
Instead of doing this compile-time check in some slightly arbitrary user of struct filename, put it next to the definition. Signed-off-by: Rasmus Villemoes --- v2: added, mostly as an example of use of static_assert(), to check that the compiler actually groks it. Feel free to NAK it as useless

[PATCH v2 1/3] build_bug.h: add wrapper for _Static_assert

2019-02-08 Thread Rasmus Villemoes
tic_assert(expr, msg, ...) _Static_assert(expr, "" msg "") godbolt.org suggests that _Static_assert() has been support by clang since at least 3.0.0. Signed-off-by: Rasmus Villemoes --- v2: drop useless "" "" wrapping include/linux/build_bug.h | 19

[PATCH v2 2/3] lib/vsprintf.c: move sizeof(struct printf_spec) next to its definition

2019-02-08 Thread Rasmus Villemoes
. Also add the appropriate #include to avoid relying on build_bug.h being pulled in via some arbitrary chain of includes. Signed-off-by: Rasmus Villemoes --- v2: added, mostly as an example of use of static_assert(), to check that the compiler actually groks it. lib/vsprintf.c | 5 +++-- 1 file

Re: [PATCH 16/32] x86/vdso: Generate vdso{,32}-timens.lds

2019-02-07 Thread Rasmus Villemoes
On 06/02/2019 01.10, Dmitry Safonov wrote: > As it has been discussed on timens RFC, adding a new conditional branch > `if (inside_time_ns)` on VDSO for all processes is undesirable. > It will add a penalty for everybody as branch predictor may mispredict > the jump. Also there are instruction cach

Re: [PATCH] xfs: allow disabling xfs tracepoints via Kconfig

2019-02-05 Thread Rasmus Villemoes
On 05/02/2019 00.13, Dave Chinner wrote: > On Mon, Feb 04, 2019 at 11:12:57PM +0100, Rasmus Villemoes wrote: >> On 04/02/2019 22.53, Dave Chinner wrote: >>> On Mon, Feb 04, 2019 at 10:20:35PM +0100, Rasmus Villemoes wrote: >>>> linux/tracepoints.h allows individu

Re: [PATCH] build_bug.h: add wrapper for _Static_assert

2019-02-05 Thread Rasmus Villemoes
On 05/02/2019 00.12, Andrew Morton wrote: >> >> It would be (very) nice to actually use this macro in a few places so >> it gets its build testing while in -next. > > ie, just about every BUILD_BUG_ON in mm/ could use this. Let's switch > a few? > Perhaps, but some make sense where they are, e.

Re: [PATCH] build_bug.h: add wrapper for _Static_assert

2019-02-05 Thread Rasmus Villemoes
On 05/02/2019 09.05, Masahiro Yamada wrote: > On Mon, Feb 4, 2019 at 4:24 AM Rasmus Villemoes > wrote: >> >> BUILD_BUG_ON() is a little annoying, since it cannot be used outside >> function scope. So one cannot put assertions about the sizeof() a >> struct next to

Re: [PATCH] xfs: allow disabling xfs tracepoints via Kconfig

2019-02-04 Thread Rasmus Villemoes
On 04/02/2019 22.53, Dave Chinner wrote: > On Mon, Feb 04, 2019 at 10:20:35PM +0100, Rasmus Villemoes wrote: >> linux/tracepoints.h allows individual subsystems to disable their >> tracepoints. Add such a knob for xfs. Disabling XFS_TRACEPOINTS >> reduces the resident size

[PATCH] xfs: allow disabling xfs tracepoints via Kconfig

2019-02-04 Thread Rasmus Villemoes
632 676487 a5287 /tmp/xfs/a/xfs.ko 893192 166737 632 1060561 102ed1 /tmp/xfs/b/xfs.ko Signed-off-by: Rasmus Villemoes --- fs/xfs/Kconfig | 9 + fs/xfs/xfs_trace.h | 4 2 files changed, 13 insertions(+) diff --git a/fs/xfs/Kconfig b/fs/xfs/Kconfig index 457ac9f97377

[PATCH] build_bug.h: add wrapper for _Static_assert

2019-02-03 Thread Rasmus Villemoes
tic_assert(expr, msg, ...) _Static_assert(expr, "" msg "") godbolt.org suggests that _Static_assert() has been support by clang since at least 3.0.0. Signed-off-by: Rasmus Villemoes --- include/linux/build_bug.h | 19 +++ 1 file changed, 19 insertions(

Re: [PATCH v9 1/3] watchdog: introduce watchdog.open_timeout commandline parameter

2019-01-29 Thread Rasmus Villemoes
On 29/01/2019 21.35, Rasmus Villemoes wrote: > On 22/01/2019 18.29, Guenter Roeck wrote: >> On Mon, Jan 21, 2019 at 08:45:39PM +0000, Rasmus Villemoes wrote: >>> >>> static void watchdog_ping_work(struct kthread_work *work) >>> @@ -297,7 +317,7 @@ static int

Re: [PATCH v9 1/3] watchdog: introduce watchdog.open_timeout commandline parameter

2019-01-29 Thread Rasmus Villemoes
On 22/01/2019 18.29, Guenter Roeck wrote: > On Mon, Jan 21, 2019 at 08:45:39PM +0000, Rasmus Villemoes wrote: >> The watchdog framework takes care of feeding a hardware watchdog until >> userspace opens /dev/watchdogN. If that never happens for some reason >> (buggy init

Re: [PATCH] drm/msm: fix building with DEBUG_FS=n

2019-01-29 Thread Rasmus Villemoes
ping On 15/01/2019 16.46, Rasmus Villemoes wrote: > With CONFIG_DEV_COREDUMP=y and CONFIG_DEBUG_FS=n, building fails: > > drivers/gpu/drm/msm/adreno/a2xx_gpu.c:428:4: error: ‘struct msm_gpu_funcs’ > has no member named ‘show’ >.show = adreno_show, > ^~~~ > drive

[tip:perf/core] perf tools: Replace automatic const char[] variables by statics

2019-01-22 Thread tip-bot for Rasmus Villemoes
Commit-ID: 49b8e2beceda79ae25938faf68fad0ad62534852 Gitweb: https://git.kernel.org/tip/49b8e2beceda79ae25938faf68fad0ad62534852 Author: Rasmus Villemoes AuthorDate: Sat, 3 Nov 2018 00:06:23 +0100 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 21 Jan 2019 15:15:57 -0300 perf

[PATCH v9 2/3] watchdog: introduce CONFIG_WATCHDOG_OPEN_TIMEOUT

2019-01-21 Thread Rasmus Villemoes
, and is of course immensely useful for development purposes while one has console acccess, as well as usable in the cases where one can make a permanent update of the kernel command line. Signed-off-by: Rasmus Villemoes --- Documentation/watchdog/watchdog-parameters.txt | 8 drivers/wat

[PATCH v9 1/3] watchdog: introduce watchdog.open_timeout commandline parameter

2019-01-21 Thread Rasmus Villemoes
/watchdog; conversely, one can of course also have the current behaviour of allowing indefinite time until the first open, and then set that module parameter. Signed-off-by: Rasmus Villemoes --- .../watchdog/watchdog-parameters.txt | 8 + drivers/watchdog/watchdog_dev.c | 30

[PATCH v9 3/3] watchdog: make the device time out at open_deadline when open_timeout is used

2019-01-21 Thread Rasmus Villemoes
c' line with the timestamp of the 'U-Boot SPL ...' line (which appears just after reset). Suggested-by: Guenter Roeck Signed-off-by: Rasmus Villemoes --- drivers/watchdog/watchdog_dev.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/watchdo

[PATCH v9 0/3] watchdog: allow setting deadline for opening /dev/watchdogN

2019-01-21 Thread Rasmus Villemoes
y easy by the ktime_t conversion. v7 submission at <https://lore.kernel.org/lkml/1511865350-20665-1-git-send-email-rasmus.villem...@prevas.dk/> Rasmus Villemoes (3): watchdog: introduce watchdog.open_timeout commandline parameter watchdog: introduce CONFIG_WATCHDOG_OPEN_TIMEOUT watchdog: m

[PATCH v8 2/3] watchdog: introduce CONFIG_WATCHDOG_OPEN_TIMEOUT

2019-01-16 Thread Rasmus Villemoes
, and is of course immensely useful for development purposes while one has console acccess, as well as usable in the cases where one can make a permanent update of the kernel command line. Signed-off-by: Rasmus Villemoes --- Documentation/watchdog/watchdog-parameters.txt | 3 ++- drivers/wat

[PATCH v8 3/3] watchdog: make the device time out at open_deadline when open_timeout is used

2019-01-16 Thread Rasmus Villemoes
2-wdt 20bc000.wdog: timeout nnn sec' line with the timestamp of the 'U-Boot SPL ...' line (which appears just after reset). Suggested-by: Guenter Roeck Signed-off-by: Rasmus Villemoes --- drivers/watchdog/watchdog_dev.c | 11 ++- 1 file changed, 6 insertions(+), 5 dele

[PATCH v8 0/3] watchdog: allow setting deadline for opening /dev/watchdogN

2019-01-16 Thread Rasmus Villemoes
.kernel.org/lkml/1511865350-20665-1-git-send-email-rasmus.villem...@prevas.dk/> Rasmus Villemoes (3): watchdog: introduce watchdog.open_timeout commandline parameter watchdog: introduce CONFIG_WATCHDOG_OPEN_TIMEOUT watchdog: make the device time out at open_deadline when open_

[PATCH v8 1/3] watchdog: introduce watchdog.open_timeout commandline parameter

2019-01-16 Thread Rasmus Villemoes
initially, requiring a somewhat liberal open_timeout, but when (for whatever reason) the application might then want to re-exec itself, it can set a much smaller threshold. Signed-off-by: Rasmus Villemoes --- .../watchdog/watchdog-parameters.txt | 8 + drivers/watchdog/watchdog_dev.c

[PATCH] drm/msm: fix building with DEBUG_FS=n

2019-01-15 Thread Rasmus Villemoes
hang) Cc: sta...@vger.kernel.org # v4.19+ Signed-off-by: Rasmus Villemoes --- drivers/gpu/drm/msm/msm_gpu.h | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_gpu.h b/drivers/gpu/drm/msm/msm_gpu.h index efb49bb64191..4cb41db7f9e8 100644 --- a/drivers

[tip:x86/asm] x86/asm: Remove unused __constant_c_x_memset() macro and inlines

2019-01-12 Thread tip-bot for Rasmus Villemoes
Commit-ID: 2e905c7abdcd5ff09b9df33d25eb7148c85bed2a Gitweb: https://git.kernel.org/tip/2e905c7abdcd5ff09b9df33d25eb7148c85bed2a Author: Rasmus Villemoes AuthorDate: Fri, 11 Jan 2019 09:49:31 +0100 Committer: Borislav Petkov CommitDate: Sat, 12 Jan 2019 17:54:49 +0100 x86/asm: Remove

[tip:x86/asm] x86/asm: Remove dead __GNUC__ conditionals

2019-01-12 Thread tip-bot for Rasmus Villemoes
Commit-ID: 88ca66d8540ca26119b1428cddb96b37925bdf01 Gitweb: https://git.kernel.org/tip/88ca66d8540ca26119b1428cddb96b37925bdf01 Author: Rasmus Villemoes AuthorDate: Fri, 11 Jan 2019 09:49:30 +0100 Committer: Borislav Petkov CommitDate: Sat, 12 Jan 2019 17:50:48 +0100 x86/asm: Remove

Re: [PATCH v6 1/8] bitops: Introduce the for_each_set_clump8 macro

2019-01-11 Thread Rasmus Villemoes
On 19/12/2018 07.00, William Breathitt Gray wrote: > +/** > + * bitmap_set_value8 - set an 8-bit value within a memory region > + * @bitmap: address to the bitmap memory region > + * @value: the 8-bit value > + * @start: bit offset of the 8-bit value > + */ > +void bitmap_set_value8(unsigned long *

[PATCH 1/2] x86/include: remove dead __GNUC__ conditionals

2019-01-11 Thread Rasmus Villemoes
We require gcc >= 4.6, so these can be removed. Signed-off-by: Rasmus Villemoes --- arch/x86/include/asm/bitops.h| 6 -- arch/x86/include/asm/string_32.h | 20 arch/x86/include/asm/string_64.h | 15 --- 3 files changed, 41 deletions(-) diff --gi

[PATCH 2/2] x86: string_32.h: remove unused macro and inlines

2019-01-11 Thread Rasmus Villemoes
Nothing refers to the __constant_c_x_memset macro anymore, and when we remove that, the two referenced static inline functions become orphan. Signed-off-by: Rasmus Villemoes --- arch/x86/include/asm/string_32.h | 84 1 file changed, 84 deletions(-) diff --git a

Re: [PATCH] perf: replace automatic const char[] variables by statics

2019-01-10 Thread Rasmus Villemoes
ping On Sun, 4 Nov 2018 at 20:26, Jiri Olsa wrote: > > On Sat, Nov 03, 2018 at 12:06:23AM +0100, Rasmus Villemoes wrote: > > An automatic const char[] variable gets initialized at runtime, just > > like any other automatic variable. For long strings, that uses a lot of > &g

Re: [RFC] Use plan9 C extensions

2019-01-10 Thread Rasmus Villemoes
On 10/01/2019 00.55, Nick Desaulniers wrote: > I agree that something like builtin_types_compatible_p() in a macro > could help make these functions more "generic" in the sense of being > able to accept either a `struct xarray*` or `struct xarray_cyclic*`. An alternative to implementing all the g

Re: [for-next][PATCH 23/24] string.h: Add strncmp_prefix() helper macro

2018-12-23 Thread Rasmus Villemoes
On 23/12/2018 23.56, Steven Rostedt wrote: > On Sun, 23 Dec 2018 23:01:52 +0100 > Rasmus Villemoes wrote: > >> On 21/12/2018 23.20, Joe Perches wrote: >>> >>> Using >>> >>> static inline bool str_has_prefix(const char *str, const char prefix[]

Re: [for-next][PATCH 23/24] string.h: Add strncmp_prefix() helper macro

2018-12-23 Thread Rasmus Villemoes
On 21/12/2018 23.20, Joe Perches wrote: > On Fri, 2018-12-21 at 16:08 -0500, Steven Rostedt wrote: >> On Fri, 21 Dec 2018 21:58:32 +0100 >> Andreas Schwab wrote: >> >> Well, perhaps I can just remove the ending ones. I get paranoid with macro variables, and tend to over do it so that the

Re: linux-next: build failure after merge of the nfs-anna tree

2018-12-17 Thread Rasmus Villemoes
On 17/12/2018 00.16, Stephen Rothwell wrote: > Hi all, > > After merging the nfs-anna tree, today's linux-next build (arm > multi_v7_defconfig) failed like this: > > /home/sfr/next/next/fs/nfs/nfsroot.c: In function 'root_nfs_data': > /home/sfr/next/next/fs/nfs/nfsroot.c:264:5: error: implicit de

Re: [PATCH v2 4/4] x86/static_call: Add inline static call implementation for x86-64

2018-11-30 Thread Rasmus Villemoes
On 29/11/2018 20.22, Josh Poimboeuf wrote: > On Thu, Nov 29, 2018 at 02:16:48PM -0500, Steven Rostedt wrote: >>> and honestly, the way "static_call()" works now, can you guarantee >>> that the call-site doesn't end up doing that, and calling the >>> trampoline function for two different static call

Re: [PATCH 5/8] kbuild: change if_changed_rule to accept multi-line recipe

2018-11-15 Thread Rasmus Villemoes
On 15/11/2018 09.27, Masahiro Yamada wrote: > GNU Make supports 'define' ... 'endef' directive, which can describe > a recipe that consists of multiple lines. > > endef > > This does not actually exploit the benefits of 'define' ... 'endef' > form. All shell commands must be concatenated with '

Re: [PATCH] fork: Fix two -Wmissing-prototypes warnings

2018-11-13 Thread Rasmus Villemoes
On 13/11/2018 08.26, Yi Wang wrote: > We get two warning when building kernel with W=1: > kernel/fork.c:167:13: warning: no previous prototype for > ‘arch_release_thread_stack’ [-Wmissing-prototypes] > kernel/fork.c:779:13: warning: no previous prototype for ‘fork_init’ > [-Wmissing-prototypes]

[PATCH v3 06/23] linux/printk.h: use unique identifier for each struct _ddebug

2018-11-09 Thread Rasmus Villemoes
: Petr Mladek Acked-by: Jason Baron Cc: Steven Rostedt Signed-off-by: Rasmus Villemoes --- include/linux/printk.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/printk.h b/include/linux/printk.h index d3ba3245531d..70df2c578d40 100644 --- a/include/linux

[PATCH v3 05/23] linux/printk.h: use DYNAMIC_DEBUG_BRANCH in pr_debug_ratelimited

2018-11-09 Thread Rasmus Villemoes
teven Rostedt Signed-off-by: Rasmus Villemoes --- include/linux/printk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/printk.h b/include/linux/printk.h index cf3eccfe1543..d3ba3245531d 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -466,7 +

[PATCH v3 02/23] linux/device.h: use unique identifier for each struct _ddebug

2018-11-09 Thread Rasmus Villemoes
: Greg Kroah-Hartman Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes --- include/linux/device.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/device.h b/include/linux/device.h index 061cd83ac64c..6e0909db6dda 100644 --- a/include/linux/device.h +++ b

[PATCH v3 00/23] various dynamic_debug patches

2018-11-09 Thread Rasmus Villemoes
thout at least one arch opting in to use DYNAMIC_DEBUG_RELATIVE_POINTERS). Rasmus Villemoes (23): linux/device.h: use DYNAMIC_DEBUG_BRANCH in dev_dbg_ratelimited linux/device.h: use unique identifier for each struct _ddebug linux/net.h: use DYNAMIC_DEBUG_BRANCH in net_dbg_ratelimited linux/net.h: use u

[PATCH v3 01/23] linux/device.h: use DYNAMIC_DEBUG_BRANCH in dev_dbg_ratelimited

2018-11-09 Thread Rasmus Villemoes
Baron Signed-off-by: Rasmus Villemoes --- include/linux/device.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/device.h b/include/linux/device.h index 1b25c7a43f4c..061cd83ac64c 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -1538,7 +1538,7

[PATCH v3 07/23] dynamic_debug: consolidate DEFINE_DYNAMIC_DEBUG_METADATA definitions

2018-11-09 Thread Rasmus Villemoes
. Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes --- include/linux/dynamic_debug.h | 22 +++--- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 2fd8006153c3..0a643316597c 100644 --- a/include

[PATCH v3 13/23] dynamic_debug: refactor dynamic_pr_debug and friends

2018-11-09 Thread Rasmus Villemoes
_func_call - though the hex_dump case requires a slight variant, since print_hex_dump does not take the _ddebug descriptor. We'll also get to use that variant elsewhere (btrfs). Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes --- include/linux/dynamic_debug.h | 72 +---

[PATCH v3 15/23] ACPI: use proper DYNAMIC_DEBUG_BRANCH macro

2018-11-09 Thread Rasmus Villemoes
dynamic debug may be implemented via static keys, but ACPI is missing out on that runtime benefit since it open-codes one possible definition of DYNAMIC_DEBUG_BRANCH. Cc: linux-a...@vger.kernel.org Acked-by: Jason Baron Acked-by: Rafael J. Wysocki Signed-off-by: Rasmus Villemoes --- include

[PATCH v3 09/23] dynamic_debug: use pointer comparison in ddebug_remove_module

2018-11-09 Thread Rasmus Villemoes
core.c (incidentally, there is an in-tree module whose name is core, but I just tested this with an out-of-tree trivial one). Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes --- lib/dynamic_debug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/dynamic_debug.c b/lib

[PATCH v3 11/23] dynamic_debug: move pr_err from module.c to ddebug_add_module

2018-11-09 Thread Rasmus Villemoes
]. Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes --- kernel/module.c | 4 +--- lib/dynamic_debug.c | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/module.c b/kernel/module.c index 49a405891587..80ede55db25a 100644 --- a/kernel/module.c +++ b/kernel

[PATCH v3 18/23] dynamic_debug: introduce accessors for string members of struct _ddebug

2018-11-09 Thread Rasmus Villemoes
When we introduce compact versions of these pointers (a la CONFIG_GENERIC_BUG_RELATIVE_POINTERS), all access to these members must go via appropriate accessors. This just mass-converts dynamic_debug.c to use the new accessors. Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes --- lib

[PATCH v3 21/23] jump_label: move JUMP_TYPE_* constants to new asm-generic file

2018-11-09 Thread Rasmus Villemoes
I'm going to need to refer to the JUMP_TYPE_FALSE and JUMP_TYPE_TRUE constants from asm code. In order to do that, move them to an asm-generic header and define them using the UL() helper macro. Cc: Ingo Molnar Cc: Jason Baron Signed-off-by: Rasmus Villemoes --- include/asm-ge

[PATCH v3 17/23] ACPI: implement acpi_handle_debug in terms of _dynamic_func_call

2018-11-09 Thread Rasmus Villemoes
With coming changes on x86-64, all dynamic debug descriptors in a translation unit must have distinct names. The macro _dynamic_func_call takes care of that. No functional change. Cc: linux-a...@vger.kernel.org Acked-by: Rafael J. Wysocki Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes

[PATCH v3 19/23] dynamic_debug: drop use of bitfields in struct _ddebug

2018-11-09 Thread Rasmus Villemoes
four byte hole after these fields, so we could just give flags and lineno each their own u32. But I don't think that's worth the ifdeffery. Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes --- include/linux/dynamic_debug.h | 12 -- lib/dynamic_debug.c

[PATCH v3 23/23] x86_64: use relative pointers with dynamic debug

2018-11-09 Thread Rasmus Villemoes
ifier. To prevent such a problem from going unnoticed, we use a guard symbol in assembly whose value is unique per DEFINE_DYNAMIC_DEBUG_METADATA invocation. Cc: x...@kernel.org Cc: Ingo Molnar Cc: Jason Baron Signed-off-by: Rasmus Villemoes --- arch/x86/Kconfig | 1 + arc

[PATCH v3 20/23] dynamic_debug: introduce CONFIG_DYNAMIC_DEBUG_RELATIVE_POINTERS

2018-11-09 Thread Rasmus Villemoes
suitable DEFINE_DYNAMIC_DEBUG_METADATA macro in . Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes --- include/linux/dynamic_debug.h | 14 ++ lib/Kconfig.debug | 3 +++ lib/dynamic_debug.c | 20 3 files changed, 37 insertions(+) diff

[PATCH v3 12/23] dynamic_debug: add static inline stub for ddebug_add_module

2018-11-09 Thread Rasmus Villemoes
For symmetry with ddebug_remove_module, and to avoid a bit of ifdeffery in module.c, move the declaration of ddebug_add_module inside #if defined(CONFIG_DYNAMIC_DEBUG) and add a corresponding no-op stub in the #else branch. Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes --- include

[PATCH v3 22/23] x86: jump_label: introduce asm macros STATIC_KEY_INIT{,_TRUE,_FALSE}

2018-11-09 Thread Rasmus Villemoes
These will be useful when defining the contents of (a struct containing) a static key in assembly. Cc: x...@kernel.org Cc: Ingo Molnar Cc: Jason Baron Signed-off-by: Rasmus Villemoes --- arch/x86/include/asm/jump_label.h | 17 + 1 file changed, 17 insertions(+) diff --git a

[PATCH v3 10/23] dynamic_debug: remove unused EXPORT_SYMBOLs

2018-11-09 Thread Rasmus Villemoes
Baron Signed-off-by: Rasmus Villemoes --- lib/dynamic_debug.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index ab81155f928d..f1de45a100fa 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -868,7 +868,6 @@ int ddebug_add_module(struct

[PATCH v3 16/23] ACPI: remove unused __acpi_handle_debug macro

2018-11-09 Thread Rasmus Villemoes
If CONFIG_DYNAMIC_DEBUG is not set, acpi_handle_debug directly invokes acpi_handle_printk (if DEBUG) or does a no-printk (if !DEBUG). So this macro is never used. Cc: linux-a...@vger.kernel.org Acked-by: Jason Baron Acked-by: Rafael J. Wysocki Signed-off-by: Rasmus Villemoes --- include/linux

[PATCH v3 08/23] dynamic_debug: don't duplicate modname in ddebug_add_module

2018-11-09 Thread Rasmus Villemoes
as long as the struct ddebug_table, since free_module() calls ddebug_remove_module(). Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes --- lib/dynamic_debug.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index c7

Re: [PATCH RFC 0/3] Static calls

2018-11-09 Thread Rasmus Villemoes
On 09/11/2018 16.16, Andy Lutomirski wrote: > On Thu, Nov 8, 2018 at 11:28 PM Ingo Molnar wrote: >> >> >> All other usecases are bonus, but it would certainly be interesting to >> investigate the impact of using these APIs for tracing: that too is a >> feature enabled everywhere but utilized only

Re: [PATCH] slab.h: Avoid using & for logical and of booleans

2018-11-05 Thread Rasmus Villemoes
On 2018-11-05 22:48, Bart Van Assche wrote: > On Mon, 2018-11-05 at 13:13 -0800, Andrew Morton wrote: >> On Mon, 5 Nov 2018 12:40:00 -0800 Bart Van Assche >> wrote: >> >>> This patch suppresses the following sparse warning: >>> >>> ./include/linux/slab.h:332:43: warning: dubious: x & !y >>> >>>

kstrdup_quotable_cmdline and gfp flags

2018-11-05 Thread Rasmus Villemoes
kstrdup_quotable_cmdline takes gfp flags and passes those on to kstrdup_quotable, but before that it has done a kmalloc(PAGE_SIZE) with a hard-coded GFP_KERNEL. There is one caller of kstrdup_quotable_cmdline which passes GFP_ATOMIC, and the commit introducing that (65a3c2748e) conveniently has thi

Re: [RFC PATCH 0/7] runtime format string checking

2018-11-05 Thread Rasmus Villemoes
On 2018-11-01 23:57, Kees Cook wrote: >> Yes, gcc should be able to infer the constness of drv from the fact that >> it's never assigned to elsewhere in the function... I think I saw that >> on some gcc todo list at some point. > > If you find that bug, I'll add it to my gcc bug tracking list. :P

[PATCH] perf: replace automatic const char[] variables by statics

2018-11-02 Thread Rasmus Villemoes
20 20 movabs $0x20202e646e756f66,%rax Make them all static so that the compiler just references objects in .rodata. Signed-off-by: Rasmus Villemoes --- tools/perf/builtin-c2c.c| 4 ++-- tools/perf/builtin-kmem.c | 4 ++-- tools/perf/builtin-report.c | 6 +++--- tools/perf/bu

[PATCH] bloat-o-meter: ignore __addressable_ symbols

2018-11-02 Thread Rasmus Villemoes
ction old new delta trace_default_header 663 642 -21 tracing_mark_raw_write 406 355 -51 tracing_mark_write 624 557 -67 Total: Before=63721, After=63582, chg -0.22% Signed-off-by: Rasmus Vill

[PATCH] tracing: eliminate const char[] auto variables

2018-11-02 Thread Rasmus Villemoes
faulted variable used in tracing_mark_raw_write(). Finally, for the two runs of spaces, just use variables initialized with string literals; the linker (at least for x86) will reuse the tail of the longer for the shorter string. Signed-off-by: Rasmus Villemoes --- kernel/trace/ftrace.c | 2

Re: [RFC PATCH 0/7] runtime format string checking

2018-11-02 Thread Rasmus Villemoes
[trimming cc list] On 2018-11-01 23:57, Kees Cook wrote: > On Thu, Nov 1, 2018 at 3:06 PM, Rasmus Villemoes > wrote: >> referring to an anonymous object in .rodata; one gets code gen like >> >> +: 31 c0 xor%eax,%eax >> +:

[PATCH 2/3] drivers/char/random.c: remove unused stuct poolinfo::poolbits

2018-11-02 Thread Rasmus Villemoes
This field is never used, might as well remove it. Signed-off-by: Rasmus Villemoes --- drivers/char/random.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/char/random.c b/drivers/char/random.c index 320108df04c1..1b2e1580b4b5 100644 --- a/drivers/char

[PATCH 3/3] drivers/char/random.c: make primary_crng static

2018-11-02 Thread Rasmus Villemoes
Since the definition of struct crng_state is private to random.c, and primary_crng is neither declared or used elsewhere, there's no reason for that symbol to have external linkage. Signed-off-by: Rasmus Villemoes --- drivers/char/random.c | 2 +- 1 file changed, 1 insertion(+), 1 del

[PATCH 1/3] drivers/char/random.c: constify poolinfo_table

2018-11-02 Thread Rasmus Villemoes
Never modified, might as well be put in .rodata. Signed-off-by: Rasmus Villemoes --- drivers/char/random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/random.c b/drivers/char/random.c index 2eb70e76ed35..320108df04c1 100644 --- a/drivers/char/random.c +++ b

Re: [RFC PATCH 1/7] compiler_attributes.h: add __attribute__((format_arg)) shorthand

2018-11-02 Thread Rasmus Villemoes
On 2018-11-02 11:36, Miguel Ojeda wrote: > Hi Rasmus, > > On Sat, Oct 27, 2018 at 2:06 PM Miguel Ojeda > wrote: >> >> I did quick check and gcc >= 4.1, clang >= 3.0, icc >= 13 compilers >> seem to support it (or at least recognize it, even if they just ignore >> it), so we do not need to make it

Re: [PATCH] fs: proc: move linux_proc_banner to where it is used

2018-10-30 Thread Rasmus Villemoes
On 2018-10-27 21:47, Alexey Dobriyan wrote: > On Fri, Oct 26, 2018 at 11:20:34PM +0200, Rasmus Villemoes wrote: >> +#include > >> +#define linux_proc_banner \ >> +"%s version %s" \ >> +" (" LINUX_COMPILE_BY "@" LINUX_COMPILE_

[PATCH v2 1/3] tracing: merge seq_print_sym_short() and seq_print_sym_offset()

2018-10-29 Thread Rasmus Villemoes
These two functions are nearly identical, so we can avoid some code duplication by moving the conditional into a common implementation. Signed-off-by: Rasmus Villemoes --- kernel/trace/trace_output.c | 34 +++--- 1 file changed, 7 insertions(+), 27 deletions(-) diff

[PATCH v2 3/3] tracing: simplify printf'ing in seq_print_sym

2018-10-29 Thread Rasmus Villemoes
the declaration of the str buffer inside the CONFIG_KALLSYMS guard, which in turn will make gcc inline the function for !CONFIG_KALLSYMS (it only has a single caller, but the huge stack frame seems to make gcc not inline it for CONFIG_KALLSYMS). Signed-off-by: Rasmus Villemoes --- kernel/trace/tra

[PATCH v2 2/3] tracing: avoid -Wformat-nonliteral warning

2018-10-29 Thread Rasmus Villemoes
single caller which passes "%s" as fmt, so we might as well just use that directly. That also paves the way for further cleanups that will actually make that format string go away entirely. Signed-off-by: Rasmus Villemoes --- kernel/trace/trace_output.c | 9 - 1 file changed, 4

[PATCH v2 0/3] tracing: a few simplifying patches

2018-10-29 Thread Rasmus Villemoes
-> offset. Rasmus Villemoes (3): tracing: merge seq_print_sym_short() and seq_print_sym_offset() tracing: avoid -Wformat-nonliteral warning tracing: simplify printf'ing in seq_print_sym kernel/trace/trace_output.c | 38 - 1 file changed, 8 insertion

[tip:x86/urgent] x86/traps: Use format string with panic() call

2018-10-29 Thread tip-bot for Rasmus Villemoes
Commit-ID: 2022cceb4e30f1bb4c84d40ffa705aa8d8d68adb Gitweb: https://git.kernel.org/tip/2022cceb4e30f1bb4c84d40ffa705aa8d8d68adb Author: Rasmus Villemoes AuthorDate: Sat, 27 Oct 2018 00:20:04 +0200 Committer: Ingo Molnar CommitDate: Mon, 29 Oct 2018 07:19:26 +0100 x86/traps: Use format

Re: [RFC PATCH 1/7] compiler_attributes.h: add __attribute__((format_arg)) shorthand

2018-10-29 Thread Rasmus Villemoes
On 2018-10-27 14:06, Miguel Ojeda wrote: > Hi Rasmus, > > On Sat, Oct 27, 2018 at 1:24 AM Rasmus Villemoes > wrote: >> >> +/* >> + * Optional > > I did quick check and gcc >= 4.1, clang >= 3.0, icc >= 13 compilers > seem to support it (or at l

[RFC PATCH 5/7] kernel/kthread.c: do runtime check of format string in kthread_create_on_cpu()

2018-10-26 Thread Rasmus Villemoes
One is supposed to pass in a format string containing (at most) one %u instance. Use fmtcheck() to enforce that at runtime, WARNing and falling back to a harmless "kthread/%u" in case verification fails. Signed-off-by: Rasmus Villemoes --- kernel/kthread.c | 4 ++-- 1 file changed, 2

[RFC PATCH 2/7] lib/vsprintf.c: add fmtcheck utility

2018-10-26 Thread Rasmus Villemoes
ever appear in a hot path. The BSDs (and libbsd on linux) contain a fmtcheck() function; I took the name and return semantics from that. Signed-off-by: Rasmus Villemoes --- include/linux/kernel.h | 18 lib/Kconfig.debug | 9 ++ lib/vsprintf.c | 65 ++

[RFC PATCH 1/7] compiler_attributes.h: add __attribute__((format_arg)) shorthand

2018-10-26 Thread Rasmus Villemoes
mpiler cannot do any type checking. Even a static inline fmtcheck() that just returns its first argument would provide documentation for which specifiers what->ever is supposed to contain, but we'll implement an actual run-time check later. Signed-off-by: Rasmus Villemoes --- include/lin

[RFC PATCH 6/7] nfs: use fmtcheck() in root_nfs_data

2018-10-26 Thread Rasmus Villemoes
check of fmt to ensure it doesn't contain odd printf specifiers that would make snprintf go off into the weeds. The lack of the FMTCHECK_NO_EXTRA_ARGS flag (i.e., the last 0 argument) means we allow either no specifiers or precisely one occurrence of %s in tmp. Signed-off-by: Rasmus Vi

[RFC PATCH 4/7] lib/test_printf.c: add a few fmtcheck() test cases

2018-10-26 Thread Rasmus Villemoes
It should be trivial to add more test cases, once we figure out the exact rules for being compatible or not. Perhaps we'll have to extend the struct test with a flags element if we add flags that affect the return value. Signed-off-by: Rasmus Villemoes --- lib/test_printf.c

[RFC PATCH 3/7] kernel.h: implement fmtmatch() wrapper around fmtcheck()

2018-10-26 Thread Rasmus Villemoes
Some users may prefer to check a "user-supplied" string upfront and return EINVAL rather than using the the template as a fallback for printf'ing later. fmtmatch() is simply a shorthand for fmtcheck(a, b, c | FMTCHECK_SILENT) == a. Signed-off-by: Rasmus Villemoes --- include

[PATCH] x86: traps.c: use format string with panic() call

2018-10-26 Thread Rasmus Villemoes
with a string not containing format specifiers, but we might as well silence this warning using "%s" as format string. Signed-off-by: Rasmus Villemoes --- arch/x86/kernel/traps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/traps.c b/arch/x86/kern

[PATCH] fs: proc: move linux_proc_banner to where it is used

2018-10-26 Thread Rasmus Villemoes
complain in the unlikely case one of the LINUX_* strings ended up containing a %. This also avoids compiling it in for !CONFIG_PROC_FS. Signed-off-by: Rasmus Villemoes --- fs/proc/version.c | 6 ++ include/linux/printk.h | 1 - init/version.c | 5 - 3 files changed, 6 insertions

[PATCH 3/3] tracing: simplify printf'ing in seq_print_sym

2018-10-26 Thread Rasmus Villemoes
the declaration of the str buffer inside the CONFIG_KALLSYMS guard, which in turn will make gcc inline the function for !CONFIG_KALLSYMS (it only has a single caller, but the huge stack frame seems to make gcc not inline it for CONFIG_KALLSYMS). Signed-off-by: Rasmus Villemoes --- kernel/trace/tra

[PATCH 1/3] tracing: merge seq_print_sym_short() and seq_print_sym_offset()

2018-10-26 Thread Rasmus Villemoes
These two functions are nearly identical, so we can avoid some code duplication by moving the conditional into a common implementation. Signed-off-by: Rasmus Villemoes --- kernel/trace/trace_output.c | 34 +++--- 1 file changed, 7 insertions(+), 27 deletions(-) diff

[PATCH 2/3] tracing: avoid -Wformat-nonliteral warning

2018-10-26 Thread Rasmus Villemoes
single caller which passes "%s" as fmt, so we might as well just use that directly. That also paves the way for further cleanups that will actually make that format string go away entirely. Signed-off-by: Rasmus Villemoes --- kernel/trace/trace_output.c | 9 - 1 file changed, 4

Re: [PATCH AUTOSEL 3.18 15/98] usb: musb: Fix a few off-by-one lengths

2018-10-26 Thread Rasmus Villemoes
On 2018-10-25 16:17, Sasha Levin wrote: > From: Rasmus Villemoes > > [ Upstream commit e87c3f80ad0490d26ffe04754b7d094463b40f30 ] > > !strncmp(buf, "force host", 9) is true if and only if buf starts with > "force hos". This was obviously not what was intend

[PATCH] fs/file.c: make more use of cloexec bits not being cleared

2018-10-24 Thread Rasmus Villemoes
about the state of close_on_exec in the new bits when we expand the fdtable, we don't need to clear close_on_exec[i] in do_close_on_exec, and since we may have quite a few bits set in close_on_exec[i] without an actual open file, mask the set with open_fds[i]. Signed-off-by: Rasmus Villemoe

[PATCH v2] staging: greybus: loopback.c: remove unused lists

2018-10-24 Thread Rasmus Villemoes
orted. Reviewed-by: Bryan O'Donoghue Signed-off-by: Rasmus Villemoes --- Sending as a proper patch. Marked v2 since this replaces earlier 2/3 and 3/3 patches. Applies on top of b4fc4e8340784e30c5a59bf0791f9c3ce15e (staging: greybus: loopback.c: remove unused gb_loopback::lbid). drive

Re: [PATCH 2/3] staging: greybus: loopback.c: do insertion in O(n) instead of O(n lg n)

2018-10-23 Thread Rasmus Villemoes
On 2018-10-11 01:03, Bryan O'Donoghue wrote: > On 05/10/2018 15:28, Rasmus Villemoes wrote: >> Signed-off-by: Rasmus Villemoes >> --- >> I have no idea if the performance matters (it probably doesn't). Feel >> free to ignore this and the followup cleanup. >

[POC 01/12] Accessing __ro_after_init variables as immediates

2018-10-17 Thread Rasmus Villemoes
riable sufficiently rarely that it's no longer in L1, that extra cache miss is hardly noticable. Comments? Flames? Signed-off-by: Rasmus Villemoes --- include/linux/rai.h | 83 + 1 file changed, 83 insertions(+) create mode 100644 include/l

[POC 07/12] x86-64: rai: implement _rai_load

2018-10-17 Thread Rasmus Villemoes
eated "cat /proc/rai" continues to print "one: 1, two: 2, three: 3". Signed-off-by: Rasmus Villemoes --- arch/x86/include/asm/rai.S | 42 +- arch/x86/include/asm/rai.h | 30 ++- arch/x86/kernel/rai.c | 18 +++

[POC 09/12] fs/inode.c: access inode_cachep via rai_load

2018-10-17 Thread Rasmus Villemoes
This avoids a cacheline access to get the value of the inode_cachep pointer in the places that do a kmem_cache_*(inode_cachep, ...); Signed-off-by: Rasmus Villemoes --- fs/inode.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/inode.c b/fs/inode.c index

<    2   3   4   5   6   7   8   9   10   11   >