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

2018-10-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 Signed-off-by: Rasmus Villemoes --- include/linux/acpi.h | 3 --- 1 file

[PATCH v2 14/23] btrfs: implement btrfs_debug* in terms of helper macro

2018-10-09 Thread Rasmus Villemoes
the new _dynamic_func_call_no_desc helper macro from dynamic_debug.h takes care of both of these. Cc: linux-bt...@vger.kernel.org Acked-by: David Sterba Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes --- fs/btrfs/ctree.h | 34 ++ 1 file changed, 10

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

2018-10-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 Signed-off-by: Rasmus Villemoes --- include/linux/acpi.h | 3 --- 1 file

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

2018-10-09 Thread Rasmus Villemoes
, there is a 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 | 44

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

2018-10-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 Signed-off-by: Rasmus Villemoes --- include/linux/acpi.h | 2 +- 1 file

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

2018-10-09 Thread Rasmus Villemoes
, there is a 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 | 44

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

2018-10-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 Signed-off-by: Rasmus Villemoes --- include/linux/acpi.h | 2 +- 1 file

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

2018-10-09 Thread Rasmus Villemoes
descriptor object is the right thing to do; that is also what happens when it is the compiler that defines a static object inside an inline(d) function. Cc: x...@kernel.org Reviewed-by: Ingo Molnar Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes --- arch/x86/Kconfig | 1

[PATCH v2 21/23] x86: jump_label: introduce ASM_STATIC_KEY_INIT_{TRUE,FALSE}

2018-10-09 Thread Rasmus Villemoes
These will be useful when defining the contents of (a struct containing) a static key in inline assembly. Cc: x...@kernel.org Reviewed-by: Ingo Molnar Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes --- arch/x86/include/asm/jump_label.h | 18 ++ include/linux

[PATCH v2 20/23] dynamic_debug: introduce CONFIG_DYNAMIC_DEBUG_RELATIVE_POINTERS

2018-10-09 Thread Rasmus Villemoes
a 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 v2 22/23] x86_64: use relative pointers with dynamic debug

2018-10-09 Thread Rasmus Villemoes
descriptor object is the right thing to do; that is also what happens when it is the compiler that defines a static object inside an inline(d) function. Cc: x...@kernel.org Reviewed-by: Ingo Molnar Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes --- arch/x86/Kconfig | 1

[PATCH v2 21/23] x86: jump_label: introduce ASM_STATIC_KEY_INIT_{TRUE,FALSE}

2018-10-09 Thread Rasmus Villemoes
These will be useful when defining the contents of (a struct containing) a static key in inline assembly. Cc: x...@kernel.org Reviewed-by: Ingo Molnar Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes --- arch/x86/include/asm/jump_label.h | 18 ++ include/linux

[PATCH v2 20/23] dynamic_debug: introduce CONFIG_DYNAMIC_DEBUG_RELATIVE_POINTERS

2018-10-09 Thread Rasmus Villemoes
a 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 v2 00/23] various dynamic_debug patches

2018-10-09 Thread Rasmus Villemoes
and that the dynamic_debug control file has the expected contents. 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

[PATCH v2 23/23] x86: dynamic_debug: protect against dynamic debug identifier reuse

2018-10-09 Thread Rasmus Villemoes
descriptor, "bla") - even with a helpful error message saying that '"descriptor" used as _ddebug identifer more than once'. Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes --- arch/x86/include/asm/dynamic_debug.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-)

[PATCH v2 00/23] various dynamic_debug patches

2018-10-09 Thread Rasmus Villemoes
and that the dynamic_debug control file has the expected contents. 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

[PATCH v2 23/23] x86: dynamic_debug: protect against dynamic debug identifier reuse

2018-10-09 Thread Rasmus Villemoes
descriptor, "bla") - even with a helpful error message saying that '"descriptor" used as _ddebug identifer more than once'. Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes --- arch/x86/include/asm/dynamic_debug.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-)

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

2018-10-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 v2 12/23] dynamic_debug: add static inline stub for ddebug_add_module

2018-10-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 v2 11/23] dynamic_debug: move pr_err from module.c to ddebug_add_module

2018-10-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 6746c85511fe..381f9bf282fe 100644 --- a/kernel/module.c +++ b/kernel

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

2018-10-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 v2 11/23] dynamic_debug: move pr_err from module.c to ddebug_add_module

2018-10-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 6746c85511fe..381f9bf282fe 100644 --- a/kernel/module.c +++ b/kernel

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

2018-10-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 v2 17/23] ACPI: implement acpi_handle_debug in terms of _dynamic_func_call

2018-10-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 v2 05/23] linux/printk.h: use DYNAMIC_DEBUG_BRANCH in pr_debug_ratelimited

2018-10-09 Thread Rasmus Villemoes
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 +466,7

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

2018-10-09 Thread Rasmus Villemoes
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 c7c96bc7654a

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

2018-10-09 Thread Rasmus Villemoes
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 +466,7

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

2018-10-09 Thread Rasmus Villemoes
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 c7c96bc7654a

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

2018-10-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

Re: [PATCH v9 04/10] x86: refcount: prevent gcc distortions

2018-10-05 Thread Rasmus Villemoes
On 2018-10-04 21:33, H. Peter Anvin wrote: > Here is the horrible code I mentioned yesterday. This is about > implementing the immediate-patching framework that Linus and others have > discussed (it helps both performance and kernel hardening): Heh, I did a POC in userspace some years ago for

Re: [PATCH v9 04/10] x86: refcount: prevent gcc distortions

2018-10-05 Thread Rasmus Villemoes
On 2018-10-04 21:33, H. Peter Anvin wrote: > Here is the horrible code I mentioned yesterday. This is about > implementing the immediate-patching framework that Linus and others have > discussed (it helps both performance and kernel hardening): Heh, I did a POC in userspace some years ago for

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

2018-10-05 Thread Rasmus Villemoes
"Append to the list and do a merge sort" is not really an insertion sort. While a few more lines of code, we can keep the list sorted doing at most n comparisons by iterating until we find the first element strictly greater than gb. Signed-off-by: Rasmus Villemoes --- I ha

[PATCH 3/3] staging: greybus: loopback.c: simplify prototype of gb_loopback_bus_id_compare

2018-10-05 Thread Rasmus Villemoes
gb_loopback_bus_id_compare only has a single caller, and it no longer needs to have a prototype compatible with being a callback for list_sort. Signed-off-by: Rasmus Villemoes --- drivers/staging/greybus/loopback.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git

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

2018-10-05 Thread Rasmus Villemoes
"Append to the list and do a merge sort" is not really an insertion sort. While a few more lines of code, we can keep the list sorted doing at most n comparisons by iterating until we find the first element strictly greater than gb. Signed-off-by: Rasmus Villemoes --- I ha

[PATCH 3/3] staging: greybus: loopback.c: simplify prototype of gb_loopback_bus_id_compare

2018-10-05 Thread Rasmus Villemoes
gb_loopback_bus_id_compare only has a single caller, and it no longer needs to have a prototype compatible with being a callback for list_sort. Signed-off-by: Rasmus Villemoes --- drivers/staging/greybus/loopback.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git

[PATCH 1/3] staging: greybus: loopback.c: remove unused gb_loopback::lbid

2018-10-05 Thread Rasmus Villemoes
the lbid field is entirely unused outside of this function, so it seems we can just drop it entirely. Signed-off-by: Rasmus Villemoes --- Since lbid isn't mentioned anywhere else in greybus/, it's hard to figure out how it was meant to be used. It does seem like entirely dead (write-only) code.

[PATCH 1/3] staging: greybus: loopback.c: remove unused gb_loopback::lbid

2018-10-05 Thread Rasmus Villemoes
the lbid field is entirely unused outside of this function, so it seems we can just drop it entirely. Signed-off-by: Rasmus Villemoes --- Since lbid isn't mentioned anywhere else in greybus/, it's hard to figure out how it was meant to be used. It does seem like entirely dead (write-only) code.

Re: [PATCH 22/22] x86_64: use relative pointers with dynamic debug

2018-10-03 Thread Rasmus Villemoes
On 2018-10-02 11:50, Ingo Molnar wrote: > > * Rasmus Villemoes wrote: > >> Similar to how x86_64 uses bug_entry-relative pointers to reduce >> sizeof(struct bug_entry), the same thing can now be done for struct >> _ddebug, saving 16 bytes for each of those (i.e., ea

Re: [PATCH 22/22] x86_64: use relative pointers with dynamic debug

2018-10-03 Thread Rasmus Villemoes
On 2018-10-02 11:50, Ingo Molnar wrote: > > * Rasmus Villemoes wrote: > >> Similar to how x86_64 uses bug_entry-relative pointers to reduce >> sizeof(struct bug_entry), the same thing can now be done for struct >> _ddebug, saving 16 bytes for each of those (i.e., ea

Re: [PATCH 21/22] x86: jump_label: introduce ASM_STATIC_KEY_INIT_{TRUE,FALSE}

2018-10-02 Thread Rasmus Villemoes
On 2018-09-20 00:04, Rasmus Villemoes wrote: > These will be useful when defining the contents of (a struct containing) > a static key in inline assembly. May I politely ask someone in the x86 camp to comment on patches 21,22,23 in this series? If the memory savings is deemed not-worth-t

Re: [PATCH 21/22] x86: jump_label: introduce ASM_STATIC_KEY_INIT_{TRUE,FALSE}

2018-10-02 Thread Rasmus Villemoes
On 2018-09-20 00:04, Rasmus Villemoes wrote: > These will be useful when defining the contents of (a struct containing) > a static key in inline assembly. May I politely ask someone in the x86 camp to comment on patches 21,22,23 in this series? If the memory savings is deemed not-worth-t

Re: [RESEND PATCH v4 1/8] bitops: Introduce the for_each_set_clump macro

2018-10-02 Thread Rasmus Villemoes
On 2018-10-02 03:13, William Breathitt Gray wrote: > This macro iterates for each group of bits (clump) with set bits, within > a bitmap memory region. For each iteration, "clump" is set to the found > clump index, "index" is set to the word index of the bitmap containing > the found clump, and

Re: [RESEND PATCH v4 1/8] bitops: Introduce the for_each_set_clump macro

2018-10-02 Thread Rasmus Villemoes
On 2018-10-02 03:13, William Breathitt Gray wrote: > This macro iterates for each group of bits (clump) with set bits, within > a bitmap memory region. For each iteration, "clump" is set to the found > clump index, "index" is set to the word index of the bitmap containing > the found clump, and

Re: [RESEND PATCH v4 3/8] gpio: 104-dio-48e: Utilize for_each_set_clump macro

2018-10-02 Thread Rasmus Villemoes
On 2018-10-02 03:14, William Breathitt Gray wrote: > /* clear bits array to a clean slate */ > bitmap_zero(bits, chip->ngpio); > > - /* get bits are evaluated a gpio port register at a time */ > - for (i = 0; i < ARRAY_SIZE(ports); i++) { > - /* gpio offset in

Re: [RESEND PATCH v4 3/8] gpio: 104-dio-48e: Utilize for_each_set_clump macro

2018-10-02 Thread Rasmus Villemoes
On 2018-10-02 03:14, William Breathitt Gray wrote: > /* clear bits array to a clean slate */ > bitmap_zero(bits, chip->ngpio); > > - /* get bits are evaluated a gpio port register at a time */ > - for (i = 0; i < ARRAY_SIZE(ports); i++) { > - /* gpio offset in

Re: [PATCH 0/3] Kbuild: Some fixdep tweaks

2018-10-01 Thread Rasmus Villemoes
On 2018-09-28 04:21, Masahiro Yamada wrote: > Hi Rasmus, > > This patch set actually sits on the fence. > I tend to choose not-apply when I cannot make up my mind. > > If you have something more to convince me, please let me know. No, that's fine. I agree that the overall performance

Re: [PATCH 0/3] Kbuild: Some fixdep tweaks

2018-10-01 Thread Rasmus Villemoes
On 2018-09-28 04:21, Masahiro Yamada wrote: > Hi Rasmus, > > This patch set actually sits on the fence. > I tend to choose not-apply when I cannot make up my mind. > > If you have something more to convince me, please let me know. No, that's fine. I agree that the overall performance

Re: [PATCH v5 2/4] mm: move is_kernel_rodata() to asm-generic/sections.h

2018-09-28 Thread Rasmus Villemoes
On 2018-09-28 09:14, Bartosz Golaszewski wrote: > Export this routine so that we can use it later in devm_kstrdup_const() > and devm_kfree_const(). s/devm_kfree_const/devm_kfree/. Apart from that nit, feel free to add my ack to 1,2,3. Thanks, Rasmus

Re: [PATCH v5 2/4] mm: move is_kernel_rodata() to asm-generic/sections.h

2018-09-28 Thread Rasmus Villemoes
On 2018-09-28 09:14, Bartosz Golaszewski wrote: > Export this routine so that we can use it later in devm_kstrdup_const() > and devm_kfree_const(). s/devm_kfree_const/devm_kfree/. Apart from that nit, feel free to add my ack to 1,2,3. Thanks, Rasmus

Re: [PATCH v3 3/4] devres: provide devm_kstrdup_const()

2018-09-27 Thread Rasmus Villemoes
On 2018-09-27 13:01, Geert Uytterhoeven wrote: > Hi Rasmus, > > On Thu, Sep 27, 2018 at 12:55 PM Rasmus Villemoes > wrote: >> On 2018-09-27 01:13, Kees Cook wrote: >> >> Just drop devm_kfree_const and teach devm_kfree to ignore >> is_kernel_rodata(). That

Re: [PATCH v3 3/4] devres: provide devm_kstrdup_const()

2018-09-27 Thread Rasmus Villemoes
On 2018-09-27 13:01, Geert Uytterhoeven wrote: > Hi Rasmus, > > On Thu, Sep 27, 2018 at 12:55 PM Rasmus Villemoes > wrote: >> On 2018-09-27 01:13, Kees Cook wrote: >> >> Just drop devm_kfree_const and teach devm_kfree to ignore >> is_kernel_rodata(). That

Re: [PATCH v3 3/4] devres: provide devm_kstrdup_const()

2018-09-27 Thread Rasmus Villemoes
On 2018-09-27 01:13, Kees Cook wrote: > On Mon, Sep 24, 2018 at 3:11 AM, Bartosz Golaszewski wrote: >> Provide a resource managed version of kstrdup_const(). This variant >> internally calls devm_kstrdup() on pointers that are outside of >> .rodata section and returns the string as is otherwise.

Re: [PATCH v3 3/4] devres: provide devm_kstrdup_const()

2018-09-27 Thread Rasmus Villemoes
On 2018-09-27 01:13, Kees Cook wrote: > On Mon, Sep 24, 2018 at 3:11 AM, Bartosz Golaszewski wrote: >> Provide a resource managed version of kstrdup_const(). This variant >> internally calls devm_kstrdup() on pointers that are outside of >> .rodata section and returns the string as is otherwise.

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

2018-09-27 Thread Rasmus Villemoes
On 2018-09-27 10:22, Petr Mladek wrote: > On Thu 2018-09-20 00:04:28, Rasmus Villemoes wrote: >> Changes on x86-64 later in this series require that all struct _ddebug >> descriptors in a translation unit uses distinct identifiers. Realize >> that for pr_debug_rate

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

2018-09-27 Thread Rasmus Villemoes
On 2018-09-27 10:22, Petr Mladek wrote: > On Thu 2018-09-20 00:04:28, Rasmus Villemoes wrote: >> Changes on x86-64 later in this series require that all struct _ddebug >> descriptors in a translation unit uses distinct identifiers. Realize >> that for pr_debug_rate

Re: [PATCH v8 02/10] Makefile: Prepare for using macros for inline asm

2018-09-27 Thread Rasmus Villemoes
On 2018-09-26 19:56, Nadav Amit wrote: > at 1:58 AM, Rasmus Villemoes wrote: > >>> +ASM_MACRO_FLAGS = -Wa,arch/x86/kernel/macros.s >>> +export ASM_MACRO_FLAGS >>> +KBUILD_CFLAGS += $(ASM_MACRO_FLAGS) >> How does this affect what gets rebuilt when one of the

Re: [PATCH v8 02/10] Makefile: Prepare for using macros for inline asm

2018-09-27 Thread Rasmus Villemoes
On 2018-09-26 19:56, Nadav Amit wrote: > at 1:58 AM, Rasmus Villemoes wrote: > >>> +ASM_MACRO_FLAGS = -Wa,arch/x86/kernel/macros.s >>> +export ASM_MACRO_FLAGS >>> +KBUILD_CFLAGS += $(ASM_MACRO_FLAGS) >> How does this affect what gets rebuilt when one of the

Re: [PATCH 0/3] Kbuild: Some fixdep tweaks

2018-09-26 Thread Rasmus Villemoes
On 15 August 2018 at 16:27, Rasmus Villemoes wrote: > These patches eliminate two (albeit tiny and shortlived) processes > from the cmd_and_fixdep rule, i.e. from every TU being > compiled. Whether the diffstat below is worth it I'll leave to Kbuild > maintainers to decide. Ping.

Re: [PATCH 0/3] Kbuild: Some fixdep tweaks

2018-09-26 Thread Rasmus Villemoes
On 15 August 2018 at 16:27, Rasmus Villemoes wrote: > These patches eliminate two (albeit tiny and shortlived) processes > from the cmd_and_fixdep rule, i.e. from every TU being > compiled. Whether the diffstat below is worth it I'll leave to Kbuild > maintainers to decide. Ping.

Re: [PATCH v8 02/10] Makefile: Prepare for using macros for inline asm

2018-09-26 Thread Rasmus Villemoes
On 2018-09-18 23:28, Nadav Amit wrote: > diff --git a/arch/x86/Makefile b/arch/x86/Makefile > index 8f6e7eb8ae9f..944fa3bc9376 100644 > --- a/arch/x86/Makefile > +++ b/arch/x86/Makefile > @@ -214,8 +214,8 @@ ifdef CONFIG_X86_64 > KBUILD_LDFLAGS += $(call ld-option, -z max-page-size=0x20) >

Re: [PATCH v8 02/10] Makefile: Prepare for using macros for inline asm

2018-09-26 Thread Rasmus Villemoes
On 2018-09-18 23:28, Nadav Amit wrote: > diff --git a/arch/x86/Makefile b/arch/x86/Makefile > index 8f6e7eb8ae9f..944fa3bc9376 100644 > --- a/arch/x86/Makefile > +++ b/arch/x86/Makefile > @@ -214,8 +214,8 @@ ifdef CONFIG_X86_64 > KBUILD_LDFLAGS += $(call ld-option, -z max-page-size=0x20) >

Re: [PATCH 0/5] VFS: Introduce filesystem information query syscall [ver #12]

2018-09-21 Thread Rasmus Villemoes
On 2018-09-21 18:37, David Howells wrote: > > arch/x86/entry/syscalls/syscall_32.tbl |1 > arch/x86/entry/syscalls/syscall_64.tbl |1 > fs/afs/internal.h |1 > fs/afs/super.c | 168 + > fs/hugetlbfs/inode.c |

Re: [PATCH 0/5] VFS: Introduce filesystem information query syscall [ver #12]

2018-09-21 Thread Rasmus Villemoes
On 2018-09-21 18:37, David Howells wrote: > > arch/x86/entry/syscalls/syscall_32.tbl |1 > arch/x86/entry/syscalls/syscall_64.tbl |1 > fs/afs/internal.h |1 > fs/afs/super.c | 168 + > fs/hugetlbfs/inode.c |

[PATCH 23/22] x86: dynamic_debug: protect against dynamic debug identifier reuse

2018-09-20 Thread Rasmus Villemoes
descriptor, "bla") - even with a helpful error message saying that '"descriptor" used as _ddebug identifer more than once'. Cc: x...@kernel.org Signed-off-by: Rasmus Villemoes --- Just in case it wasn't already ugly enough ;) arch/x86/include/asm/dynamic_debug.h | 7 ++-

[PATCH 23/22] x86: dynamic_debug: protect against dynamic debug identifier reuse

2018-09-20 Thread Rasmus Villemoes
descriptor, "bla") - even with a helpful error message saying that '"descriptor" used as _ddebug identifer more than once'. Cc: x...@kernel.org Signed-off-by: Rasmus Villemoes --- Just in case it wasn't already ugly enough ;) arch/x86/include/asm/dynamic_debug.h | 7 ++-

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

2018-09-19 Thread Rasmus Villemoes
dev_dbg_ratelimited tests the dynamic debug descriptor the old-fashioned way, and doesn't utilize the static key/jump label implementation on architectures that HAVE_JUMP_LABEL. Use the DYNAMIC_DEBUG_BRANCH which is defined appropriately. Cc: Greg Kroah-Hartman Signed-off-by: Rasmus Villemoes

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

2018-09-19 Thread Rasmus Villemoes
dev_dbg_ratelimited tests the dynamic debug descriptor the old-fashioned way, and doesn't utilize the static key/jump label implementation on architectures that HAVE_JUMP_LABEL. Use the DYNAMIC_DEBUG_BRANCH which is defined appropriately. Cc: Greg Kroah-Hartman Signed-off-by: Rasmus Villemoes

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

2018-09-19 Thread Rasmus Villemoes
Mladek 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/printk.h +++ b/include/linux

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

2018-09-19 Thread Rasmus Villemoes
as the struct ddebug_table, since free_module() calls ddebug_remove_module(). 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 c7c96bc7654a..2155e0e23530 100644

[PATCH 07/22] dynamic_debug: consolidate DEFINE_DYNAMIC_DEBUG_METADATA definitions

2018-09-19 Thread Rasmus Villemoes
. 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/linux/dynamic_debug.h

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

2018-09-19 Thread Rasmus Villemoes
Mladek 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/printk.h +++ b/include/linux

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

2018-09-19 Thread Rasmus Villemoes
as the struct ddebug_table, since free_module() calls ddebug_remove_module(). 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 c7c96bc7654a..2155e0e23530 100644

[PATCH 07/22] dynamic_debug: consolidate DEFINE_DYNAMIC_DEBUG_METADATA definitions

2018-09-19 Thread Rasmus Villemoes
. 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/linux/dynamic_debug.h

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

2018-09-19 Thread Rasmus Villemoes
Kroah-Hartman 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 0d8ed2adfc73..81108db013e4 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -1497,7

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

2018-09-19 Thread Rasmus Villemoes
-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 +466,7 @@ do

[PATCH 04/22] linux/net.h: use unique identifier for each struct _ddebug

2018-09-19 Thread Rasmus Villemoes
...@vger.kernel.org Signed-off-by: Rasmus Villemoes --- include/linux/net.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/net.h b/include/linux/net.h index 651fca72286c..397243a25f56 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -260,7 +260,7 @@ do

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

2018-09-19 Thread Rasmus Villemoes
-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 +466,7 @@ do

[PATCH 04/22] linux/net.h: use unique identifier for each struct _ddebug

2018-09-19 Thread Rasmus Villemoes
...@vger.kernel.org Signed-off-by: Rasmus Villemoes --- include/linux/net.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/net.h b/include/linux/net.h index 651fca72286c..397243a25f56 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -260,7 +260,7 @@ do

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

2018-09-19 Thread Rasmus Villemoes
Kroah-Hartman 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 0d8ed2adfc73..81108db013e4 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -1497,7

[PATCH 10/22] dynamic_debug: remove unused EXPORT_SYMBOLs

2018-09-19 Thread Rasmus Villemoes
-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 _ddebug *tab, unsigned int

[PATCH 10/22] dynamic_debug: remove unused EXPORT_SYMBOLs

2018-09-19 Thread Rasmus Villemoes
-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 _ddebug *tab, unsigned int

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

2018-09-19 Thread Rasmus Villemoes
]. 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 6746c85511fe..381f9bf282fe 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -2716,9 +2716,7

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

2018-09-19 Thread Rasmus Villemoes
]. 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 6746c85511fe..381f9bf282fe 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -2716,9 +2716,7

[PATCH 21/22] x86: jump_label: introduce ASM_STATIC_KEY_INIT_{TRUE,FALSE}

2018-09-19 Thread Rasmus Villemoes
These will be useful when defining the contents of (a struct containing) a static key in inline assembly. Cc: x...@kernel.org Signed-off-by: Rasmus Villemoes --- arch/x86/include/asm/jump_label.h | 18 ++ include/linux/jump_label.h| 2 ++ 2 files changed, 20 insertions

[PATCH 21/22] x86: jump_label: introduce ASM_STATIC_KEY_INIT_{TRUE,FALSE}

2018-09-19 Thread Rasmus Villemoes
These will be useful when defining the contents of (a struct containing) a static key in inline assembly. Cc: x...@kernel.org Signed-off-by: Rasmus Villemoes --- arch/x86/include/asm/jump_label.h | 18 ++ include/linux/jump_label.h| 2 ++ 2 files changed, 20 insertions

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

2018-09-19 Thread Rasmus Villemoes
, there is a 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. Signed-off-by: Rasmus Villemoes --- include/linux/dynamic_debug.h | 12 +--- lib/dynamic_debug.c | 44

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

2018-09-19 Thread Rasmus Villemoes
descriptor object is the right thing to do; that is also what happens when it is the compiler that defines a static object inside an inline(d) function. Cc: x...@kernel.org Signed-off-by: Rasmus Villemoes --- arch/x86/Kconfig | 1 + arch/x86/include/asm/dynamic_debug.h | 35

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

2018-09-19 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. Signed-off-by: Rasmus Villemoes --- lib/dynamic_debug.c | 51

[PATCH 20/22] dynamic_debug: introduce CONFIG_DYNAMIC_DEBUG_RELATIVE_POINTERS

2018-09-19 Thread Rasmus Villemoes
a suitable DEFINE_DYNAMIC_DEBUG_METADATA macro in . 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 --git a/include/linux

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

2018-09-19 Thread Rasmus Villemoes
, there is a 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. Signed-off-by: Rasmus Villemoes --- include/linux/dynamic_debug.h | 12 +--- lib/dynamic_debug.c | 44

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

2018-09-19 Thread Rasmus Villemoes
descriptor object is the right thing to do; that is also what happens when it is the compiler that defines a static object inside an inline(d) function. Cc: x...@kernel.org Signed-off-by: Rasmus Villemoes --- arch/x86/Kconfig | 1 + arch/x86/include/asm/dynamic_debug.h | 35

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

2018-09-19 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. Signed-off-by: Rasmus Villemoes --- lib/dynamic_debug.c | 51

[PATCH 20/22] dynamic_debug: introduce CONFIG_DYNAMIC_DEBUG_RELATIVE_POINTERS

2018-09-19 Thread Rasmus Villemoes
a suitable DEFINE_DYNAMIC_DEBUG_METADATA macro in . 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 --git a/include/linux

[PATCH 16/22] ACPI: remove unused __acpi_handle_debug macro

2018-09-19 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 Signed-off-by: Rasmus Villemoes --- include/linux/acpi.h | 3 --- 1 file changed, 3 deletions

[PATCH 16/22] ACPI: remove unused __acpi_handle_debug macro

2018-09-19 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 Signed-off-by: Rasmus Villemoes --- include/linux/acpi.h | 3 --- 1 file changed, 3 deletions

[PATCH 15/22] ACPI: use proper DYNAMIC_DEBUG_BRANCH macro

2018-09-19 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 Signed-off-by: Rasmus Villemoes --- include/linux/acpi.h | 2 +- 1 file changed, 1 insertion

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

2018-09-19 Thread Rasmus Villemoes
the new _dynamic_func_call_no_desc helper macro from dynamic_debug.h takes care of both of these. Cc: linux-bt...@vger.kernel.org Signed-off-by: Rasmus Villemoes --- fs/btrfs/ctree.h | 34 ++ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/fs/btrfs

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

2018-09-19 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 Signed-off-by: Rasmus Villemoes --- include/linux/acpi.h | 8 ++-- 1 file

[PATCH 13/22] dynamic_debug: refactor dynamic_pr_debug and friends

2018-09-19 Thread Rasmus Villemoes
- 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). Signed-off-by: Rasmus Villemoes --- include/linux/dynamic_debug.h | 72 ++- 1 file changed, 43

[PATCH 15/22] ACPI: use proper DYNAMIC_DEBUG_BRANCH macro

2018-09-19 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 Signed-off-by: Rasmus Villemoes --- include/linux/acpi.h | 2 +- 1 file changed, 1 insertion

<    4   5   6   7   8   9   10   11   12   13   >