All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: module: Add ".ref.text" to arm unwind tables
@ 2015-05-13 15:20 ` Vignesh Radhakrishnan
  0 siblings, 0 replies; 12+ messages in thread
From: Vignesh Radhakrishnan @ 2015-05-13 15:20 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel; +Cc: Vignesh Radhakrishnan

Functions inside kernel modules that use __ref
will end up being placed in .ARM.exidx.ref.text
section by gcc.

Currently we don't consider adding these functions
to arm unwind tables.

Hence, if we turn slub debug on by default we end up
with the messages of this sort:

	unwind: Index not found bf0011e0

This is because slub debug saves stack trace of
allocation's and free's. Therefore, we end up seeing
a flood of these messages in dmesg since its not
able to locate these functions.

Fix this by adding .ref.text section to arm unwind tables.

Signed-off-by: Vignesh Radhakrishnan <vigneshr@codeaurora.org>
---
 arch/arm/include/asm/module.h | 1 +
 arch/arm/kernel/module.c      | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/arch/arm/include/asm/module.h b/arch/arm/include/asm/module.h
index ed690c4..17640c9 100644
--- a/arch/arm/include/asm/module.h
+++ b/arch/arm/include/asm/module.h
@@ -14,6 +14,7 @@ enum {
 	ARM_SEC_DEVEXIT,
 	ARM_SEC_HOT,
 	ARM_SEC_UNLIKELY,
+	ARM_SEC_REF,
 	ARM_SEC_MAX,
 };
 
diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
index 2e11961..846b888 100644
--- a/arch/arm/kernel/module.c
+++ b/arch/arm/kernel/module.c
@@ -308,6 +308,8 @@ int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
 			maps[ARM_SEC_UNLIKELY].unw_sec = s;
 		else if (strcmp(".ARM.exidx.text.hot", secname) == 0)
 			maps[ARM_SEC_HOT].unw_sec = s;
+		else if (strcmp(".ARM.exidx.ref.text", secname) == 0)
+			maps[ARM_SEC_REF].unw_sec = s;
 		else if (strcmp(".init.text", secname) == 0)
 			maps[ARM_SEC_INIT].txt_sec = s;
 		else if (strcmp(".text", secname) == 0)
@@ -318,6 +320,8 @@ int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
 			maps[ARM_SEC_UNLIKELY].txt_sec = s;
 		else if (strcmp(".text.hot", secname) == 0)
 			maps[ARM_SEC_HOT].txt_sec = s;
+		else if (strcmp(".ref.text", secname) == 0)
+			maps[ARM_SEC_REF].txt_sec = s;
 	}
 
 	for (i = 0; i < ARM_SEC_MAX; i++)
-- 
1.8.2.1

-- 
Thanks and regards,
Vignesh Radhakrishnan

QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a
member of the Code Aurora Forum, hosted by The Linux Foundation.

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH] ARM: module: Add ".ref.text" to arm unwind tables
@ 2015-05-13 15:20 ` Vignesh Radhakrishnan
  0 siblings, 0 replies; 12+ messages in thread
From: Vignesh Radhakrishnan @ 2015-05-13 15:20 UTC (permalink / raw)
  To: linux-arm-kernel

Functions inside kernel modules that use __ref
will end up being placed in .ARM.exidx.ref.text
section by gcc.

Currently we don't consider adding these functions
to arm unwind tables.

Hence, if we turn slub debug on by default we end up
with the messages of this sort:

	unwind: Index not found bf0011e0

This is because slub debug saves stack trace of
allocation's and free's. Therefore, we end up seeing
a flood of these messages in dmesg since its not
able to locate these functions.

Fix this by adding .ref.text section to arm unwind tables.

Signed-off-by: Vignesh Radhakrishnan <vigneshr@codeaurora.org>
---
 arch/arm/include/asm/module.h | 1 +
 arch/arm/kernel/module.c      | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/arch/arm/include/asm/module.h b/arch/arm/include/asm/module.h
index ed690c4..17640c9 100644
--- a/arch/arm/include/asm/module.h
+++ b/arch/arm/include/asm/module.h
@@ -14,6 +14,7 @@ enum {
 	ARM_SEC_DEVEXIT,
 	ARM_SEC_HOT,
 	ARM_SEC_UNLIKELY,
+	ARM_SEC_REF,
 	ARM_SEC_MAX,
 };
 
diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
index 2e11961..846b888 100644
--- a/arch/arm/kernel/module.c
+++ b/arch/arm/kernel/module.c
@@ -308,6 +308,8 @@ int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
 			maps[ARM_SEC_UNLIKELY].unw_sec = s;
 		else if (strcmp(".ARM.exidx.text.hot", secname) == 0)
 			maps[ARM_SEC_HOT].unw_sec = s;
+		else if (strcmp(".ARM.exidx.ref.text", secname) == 0)
+			maps[ARM_SEC_REF].unw_sec = s;
 		else if (strcmp(".init.text", secname) == 0)
 			maps[ARM_SEC_INIT].txt_sec = s;
 		else if (strcmp(".text", secname) == 0)
@@ -318,6 +320,8 @@ int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
 			maps[ARM_SEC_UNLIKELY].txt_sec = s;
 		else if (strcmp(".text.hot", secname) == 0)
 			maps[ARM_SEC_HOT].txt_sec = s;
+		else if (strcmp(".ref.text", secname) == 0)
+			maps[ARM_SEC_REF].txt_sec = s;
 	}
 
 	for (i = 0; i < ARM_SEC_MAX; i++)
-- 
1.8.2.1

-- 
Thanks and regards,
Vignesh Radhakrishnan

QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a
member of the Code Aurora Forum, hosted by The Linux Foundation.

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] ARM: module: Add ".ref.text" to arm unwind tables
  2015-05-13 15:20 ` Vignesh Radhakrishnan
@ 2015-05-14 21:23   ` Laura Abbott
  -1 siblings, 0 replies; 12+ messages in thread
From: Laura Abbott @ 2015-05-14 21:23 UTC (permalink / raw)
  To: Vignesh Radhakrishnan, linux-arm-kernel, linux-kernel

On 05/13/2015 08:20 AM, Vignesh Radhakrishnan wrote:
> Functions inside kernel modules that use __ref
> will end up being placed in .ARM.exidx.ref.text
> section by gcc.
>
> Currently we don't consider adding these functions
> to arm unwind tables.
>
> Hence, if we turn slub debug on by default we end up
> with the messages of this sort:
>
> 	unwind: Index not found bf0011e0
>
> This is because slub debug saves stack trace of
> allocation's and free's. Therefore, we end up seeing
> a flood of these messages in dmesg since its not
> able to locate these functions.
>
> Fix this by adding .ref.text section to arm unwind tables.
>

With this patch, I go from

  ------------[ cut here ]------------
WARNING: CPU: 0 PID: 63 at drivers/misc/test.c:12 that_function+0x10/0x2c [test]()
Modules linked in: test(P+)
CPU: 0 PID: 63 Comm: insmod Tainted: P                4.1.0-rc2+ #28
Hardware name: ARM-Versatile PB
[<c001a590>] (unwind_backtrace) from [<c0017b84>] (show_stack+0x10/0x14)
[<c0017b84>] (show_stack) from [<c0022370>] (warn_slowpath_common+0x78/0xb0)
[<c0022370>] (warn_slowpath_common) from [<c0022444>] (warn_slowpath_null+0x1c/0x24)
[<c0022444>] (warn_slowpath_null) from [<bf000048>] (that_function+0x10/0x2c [test])
unwind: Index not found bf000048
---[ end trace 3e24f8edd90f3b27 ]---

to

------------[ cut here ]------------
WARNING: CPU: 0 PID: 63 at drivers/misc/test.c:12 that_function+0x10/0x2c [test]()
Modules linked in: test(P+)
CPU: 0 PID: 63 Comm: insmod Tainted: P                4.1.0-rc2+ #30
Hardware name: ARM-Versatile PB
[<c001a5d0>] (unwind_backtrace) from [<c0017b84>] (show_stack+0x10/0x14)
[<c0017b84>] (show_stack) from [<c0022770>] (warn_slowpath_common+0x78/0xb0)
[<c0022770>] (warn_slowpath_common) from [<c0022844>] (warn_slowpath_null+0x1c/0x24)
[<c0022844>] (warn_slowpath_null) from [<bf000048>] (that_function+0x10/0x2c [test])
[<bf000048>] (that_function [test]) from [<bf002010>] (awesome_module+0x10/0x1c [test])
[<bf002010>] (awesome_module [test]) from [<c0009710>] (do_one_initcall+0x80/0x1dc)
[<c0009710>] (do_one_initcall) from [<c02d14e0>] (do_init_module+0x58/0x1a8)
[<c02d14e0>] (do_init_module) from [<c0063940>] (load_module+0x170c/0x1c38)
[<c0063940>] (load_module) from [<c0063f38>] (SyS_init_module+0xcc/0x124)
[<c0063f38>] (SyS_init_module) from [<c0014900>] (ret_fast_syscall+0x0/0x30)
---[ end trace 554c9ff461eb2505 ]---

Tested-by: Laura Abbott <labbott@redhat.com>

> Signed-off-by: Vignesh Radhakrishnan <vigneshr@codeaurora.org>
> ---
>   arch/arm/include/asm/module.h | 1 +
>   arch/arm/kernel/module.c      | 4 ++++
>   2 files changed, 5 insertions(+)
>
> diff --git a/arch/arm/include/asm/module.h b/arch/arm/include/asm/module.h
> index ed690c4..17640c9 100644
> --- a/arch/arm/include/asm/module.h
> +++ b/arch/arm/include/asm/module.h
> @@ -14,6 +14,7 @@ enum {
>   	ARM_SEC_DEVEXIT,
>   	ARM_SEC_HOT,
>   	ARM_SEC_UNLIKELY,
> +	ARM_SEC_REF,
>   	ARM_SEC_MAX,
>   };
>
> diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
> index 2e11961..846b888 100644
> --- a/arch/arm/kernel/module.c
> +++ b/arch/arm/kernel/module.c
> @@ -308,6 +308,8 @@ int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
>   			maps[ARM_SEC_UNLIKELY].unw_sec = s;
>   		else if (strcmp(".ARM.exidx.text.hot", secname) == 0)
>   			maps[ARM_SEC_HOT].unw_sec = s;
> +		else if (strcmp(".ARM.exidx.ref.text", secname) == 0)
> +			maps[ARM_SEC_REF].unw_sec = s;
>   		else if (strcmp(".init.text", secname) == 0)
>   			maps[ARM_SEC_INIT].txt_sec = s;
>   		else if (strcmp(".text", secname) == 0)
> @@ -318,6 +320,8 @@ int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
>   			maps[ARM_SEC_UNLIKELY].txt_sec = s;
>   		else if (strcmp(".text.hot", secname) == 0)
>   			maps[ARM_SEC_HOT].txt_sec = s;
> +		else if (strcmp(".ref.text", secname) == 0)
> +			maps[ARM_SEC_REF].txt_sec = s;
>   	}
>
>   	for (i = 0; i < ARM_SEC_MAX; i++)
>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH] ARM: module: Add ".ref.text" to arm unwind tables
@ 2015-05-14 21:23   ` Laura Abbott
  0 siblings, 0 replies; 12+ messages in thread
From: Laura Abbott @ 2015-05-14 21:23 UTC (permalink / raw)
  To: linux-arm-kernel

On 05/13/2015 08:20 AM, Vignesh Radhakrishnan wrote:
> Functions inside kernel modules that use __ref
> will end up being placed in .ARM.exidx.ref.text
> section by gcc.
>
> Currently we don't consider adding these functions
> to arm unwind tables.
>
> Hence, if we turn slub debug on by default we end up
> with the messages of this sort:
>
> 	unwind: Index not found bf0011e0
>
> This is because slub debug saves stack trace of
> allocation's and free's. Therefore, we end up seeing
> a flood of these messages in dmesg since its not
> able to locate these functions.
>
> Fix this by adding .ref.text section to arm unwind tables.
>

With this patch, I go from

  ------------[ cut here ]------------
WARNING: CPU: 0 PID: 63 at drivers/misc/test.c:12 that_function+0x10/0x2c [test]()
Modules linked in: test(P+)
CPU: 0 PID: 63 Comm: insmod Tainted: P                4.1.0-rc2+ #28
Hardware name: ARM-Versatile PB
[<c001a590>] (unwind_backtrace) from [<c0017b84>] (show_stack+0x10/0x14)
[<c0017b84>] (show_stack) from [<c0022370>] (warn_slowpath_common+0x78/0xb0)
[<c0022370>] (warn_slowpath_common) from [<c0022444>] (warn_slowpath_null+0x1c/0x24)
[<c0022444>] (warn_slowpath_null) from [<bf000048>] (that_function+0x10/0x2c [test])
unwind: Index not found bf000048
---[ end trace 3e24f8edd90f3b27 ]---

to

------------[ cut here ]------------
WARNING: CPU: 0 PID: 63 at drivers/misc/test.c:12 that_function+0x10/0x2c [test]()
Modules linked in: test(P+)
CPU: 0 PID: 63 Comm: insmod Tainted: P                4.1.0-rc2+ #30
Hardware name: ARM-Versatile PB
[<c001a5d0>] (unwind_backtrace) from [<c0017b84>] (show_stack+0x10/0x14)
[<c0017b84>] (show_stack) from [<c0022770>] (warn_slowpath_common+0x78/0xb0)
[<c0022770>] (warn_slowpath_common) from [<c0022844>] (warn_slowpath_null+0x1c/0x24)
[<c0022844>] (warn_slowpath_null) from [<bf000048>] (that_function+0x10/0x2c [test])
[<bf000048>] (that_function [test]) from [<bf002010>] (awesome_module+0x10/0x1c [test])
[<bf002010>] (awesome_module [test]) from [<c0009710>] (do_one_initcall+0x80/0x1dc)
[<c0009710>] (do_one_initcall) from [<c02d14e0>] (do_init_module+0x58/0x1a8)
[<c02d14e0>] (do_init_module) from [<c0063940>] (load_module+0x170c/0x1c38)
[<c0063940>] (load_module) from [<c0063f38>] (SyS_init_module+0xcc/0x124)
[<c0063f38>] (SyS_init_module) from [<c0014900>] (ret_fast_syscall+0x0/0x30)
---[ end trace 554c9ff461eb2505 ]---

Tested-by: Laura Abbott <labbott@redhat.com>

> Signed-off-by: Vignesh Radhakrishnan <vigneshr@codeaurora.org>
> ---
>   arch/arm/include/asm/module.h | 1 +
>   arch/arm/kernel/module.c      | 4 ++++
>   2 files changed, 5 insertions(+)
>
> diff --git a/arch/arm/include/asm/module.h b/arch/arm/include/asm/module.h
> index ed690c4..17640c9 100644
> --- a/arch/arm/include/asm/module.h
> +++ b/arch/arm/include/asm/module.h
> @@ -14,6 +14,7 @@ enum {
>   	ARM_SEC_DEVEXIT,
>   	ARM_SEC_HOT,
>   	ARM_SEC_UNLIKELY,
> +	ARM_SEC_REF,
>   	ARM_SEC_MAX,
>   };
>
> diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
> index 2e11961..846b888 100644
> --- a/arch/arm/kernel/module.c
> +++ b/arch/arm/kernel/module.c
> @@ -308,6 +308,8 @@ int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
>   			maps[ARM_SEC_UNLIKELY].unw_sec = s;
>   		else if (strcmp(".ARM.exidx.text.hot", secname) == 0)
>   			maps[ARM_SEC_HOT].unw_sec = s;
> +		else if (strcmp(".ARM.exidx.ref.text", secname) == 0)
> +			maps[ARM_SEC_REF].unw_sec = s;
>   		else if (strcmp(".init.text", secname) == 0)
>   			maps[ARM_SEC_INIT].txt_sec = s;
>   		else if (strcmp(".text", secname) == 0)
> @@ -318,6 +320,8 @@ int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
>   			maps[ARM_SEC_UNLIKELY].txt_sec = s;
>   		else if (strcmp(".text.hot", secname) == 0)
>   			maps[ARM_SEC_HOT].txt_sec = s;
> +		else if (strcmp(".ref.text", secname) == 0)
> +			maps[ARM_SEC_REF].txt_sec = s;
>   	}
>
>   	for (i = 0; i < ARM_SEC_MAX; i++)
>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] ARM: module: Add ".ref.text" to arm unwind tables
  2015-05-14 21:23   ` Laura Abbott
@ 2015-05-25 10:56     ` vigneshr at codeaurora.org
  -1 siblings, 0 replies; 12+ messages in thread
From: vigneshr @ 2015-05-25 10:56 UTC (permalink / raw)
  To: linux, a.ryabinin, akpm, adech.fo
  Cc: Laura Abbott, linux-arm-kernel, linux-kernel

Forgot to add Maintainers. Adding them now.

> On 05/13/2015 08:20 AM, Vignesh Radhakrishnan wrote:
>> Functions inside kernel modules that use __ref
>> will end up being placed in .ARM.exidx.ref.text
>> section by gcc.
>>
>> Currently we don't consider adding these functions
>> to arm unwind tables.
>>
>> Hence, if we turn slub debug on by default we end up
>> with the messages of this sort:
>>
>> 	unwind: Index not found bf0011e0
>>
>> This is because slub debug saves stack trace of
>> allocation's and free's. Therefore, we end up seeing
>> a flood of these messages in dmesg since its not
>> able to locate these functions.
>>
>> Fix this by adding .ref.text section to arm unwind tables.
>>
>
> With this patch, I go from
>
>   ------------[ cut here ]------------
> WARNING: CPU: 0 PID: 63 at drivers/misc/test.c:12 that_function+0x10/0x2c
> [test]()
> Modules linked in: test(P+)
> CPU: 0 PID: 63 Comm: insmod Tainted: P                4.1.0-rc2+ #28
> Hardware name: ARM-Versatile PB
> [<c001a590>] (unwind_backtrace) from [<c0017b84>] (show_stack+0x10/0x14)
> [<c0017b84>] (show_stack) from [<c0022370>]
> (warn_slowpath_common+0x78/0xb0)
> [<c0022370>] (warn_slowpath_common) from [<c0022444>]
> (warn_slowpath_null+0x1c/0x24)
> [<c0022444>] (warn_slowpath_null) from [<bf000048>]
> (that_function+0x10/0x2c [test])
> unwind: Index not found bf000048
> ---[ end trace 3e24f8edd90f3b27 ]---
>
> to
>
> ------------[ cut here ]------------
> WARNING: CPU: 0 PID: 63 at drivers/misc/test.c:12 that_function+0x10/0x2c
> [test]()
> Modules linked in: test(P+)
> CPU: 0 PID: 63 Comm: insmod Tainted: P                4.1.0-rc2+ #30
> Hardware name: ARM-Versatile PB
> [<c001a5d0>] (unwind_backtrace) from [<c0017b84>] (show_stack+0x10/0x14)
> [<c0017b84>] (show_stack) from [<c0022770>]
> (warn_slowpath_common+0x78/0xb0)
> [<c0022770>] (warn_slowpath_common) from [<c0022844>]
> (warn_slowpath_null+0x1c/0x24)
> [<c0022844>] (warn_slowpath_null) from [<bf000048>]
> (that_function+0x10/0x2c [test])
> [<bf000048>] (that_function [test]) from [<bf002010>]
> (awesome_module+0x10/0x1c [test])
> [<bf002010>] (awesome_module [test]) from [<c0009710>]
> (do_one_initcall+0x80/0x1dc)
> [<c0009710>] (do_one_initcall) from [<c02d14e0>]
> (do_init_module+0x58/0x1a8)
> [<c02d14e0>] (do_init_module) from [<c0063940>]
> (load_module+0x170c/0x1c38)
> [<c0063940>] (load_module) from [<c0063f38>] (SyS_init_module+0xcc/0x124)
> [<c0063f38>] (SyS_init_module) from [<c0014900>]
> (ret_fast_syscall+0x0/0x30)
> ---[ end trace 554c9ff461eb2505 ]---
>
> Tested-by: Laura Abbott <labbott@redhat.com>
>
>> Signed-off-by: Vignesh Radhakrishnan <vigneshr@codeaurora.org>
>> ---
>>   arch/arm/include/asm/module.h | 1 +
>>   arch/arm/kernel/module.c      | 4 ++++
>>   2 files changed, 5 insertions(+)
>>
>> diff --git a/arch/arm/include/asm/module.h
>> b/arch/arm/include/asm/module.h
>> index ed690c4..17640c9 100644
>> --- a/arch/arm/include/asm/module.h
>> +++ b/arch/arm/include/asm/module.h
>> @@ -14,6 +14,7 @@ enum {
>>   	ARM_SEC_DEVEXIT,
>>   	ARM_SEC_HOT,
>>   	ARM_SEC_UNLIKELY,
>> +	ARM_SEC_REF,
>>   	ARM_SEC_MAX,
>>   };
>>
>> diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
>> index 2e11961..846b888 100644
>> --- a/arch/arm/kernel/module.c
>> +++ b/arch/arm/kernel/module.c
>> @@ -308,6 +308,8 @@ int module_finalize(const Elf32_Ehdr *hdr, const
>> Elf_Shdr *sechdrs,
>>   			maps[ARM_SEC_UNLIKELY].unw_sec = s;
>>   		else if (strcmp(".ARM.exidx.text.hot", secname) == 0)
>>   			maps[ARM_SEC_HOT].unw_sec = s;
>> +		else if (strcmp(".ARM.exidx.ref.text", secname) == 0)
>> +			maps[ARM_SEC_REF].unw_sec = s;
>>   		else if (strcmp(".init.text", secname) == 0)
>>   			maps[ARM_SEC_INIT].txt_sec = s;
>>   		else if (strcmp(".text", secname) == 0)
>> @@ -318,6 +320,8 @@ int module_finalize(const Elf32_Ehdr *hdr, const
>> Elf_Shdr *sechdrs,
>>   			maps[ARM_SEC_UNLIKELY].txt_sec = s;
>>   		else if (strcmp(".text.hot", secname) == 0)
>>   			maps[ARM_SEC_HOT].txt_sec = s;
>> +		else if (strcmp(".ref.text", secname) == 0)
>> +			maps[ARM_SEC_REF].txt_sec = s;
>>   	}
>>
>>   	for (i = 0; i < ARM_SEC_MAX; i++)
>>
>
>

QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of the Code Aurora Forum, hosted by The Linux Foundation.
again



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH] ARM: module: Add ".ref.text" to arm unwind tables
@ 2015-05-25 10:56     ` vigneshr at codeaurora.org
  0 siblings, 0 replies; 12+ messages in thread
From: vigneshr at codeaurora.org @ 2015-05-25 10:56 UTC (permalink / raw)
  To: linux-arm-kernel

Forgot to add Maintainers. Adding them now.

> On 05/13/2015 08:20 AM, Vignesh Radhakrishnan wrote:
>> Functions inside kernel modules that use __ref
>> will end up being placed in .ARM.exidx.ref.text
>> section by gcc.
>>
>> Currently we don't consider adding these functions
>> to arm unwind tables.
>>
>> Hence, if we turn slub debug on by default we end up
>> with the messages of this sort:
>>
>> 	unwind: Index not found bf0011e0
>>
>> This is because slub debug saves stack trace of
>> allocation's and free's. Therefore, we end up seeing
>> a flood of these messages in dmesg since its not
>> able to locate these functions.
>>
>> Fix this by adding .ref.text section to arm unwind tables.
>>
>
> With this patch, I go from
>
>   ------------[ cut here ]------------
> WARNING: CPU: 0 PID: 63 at drivers/misc/test.c:12 that_function+0x10/0x2c
> [test]()
> Modules linked in: test(P+)
> CPU: 0 PID: 63 Comm: insmod Tainted: P                4.1.0-rc2+ #28
> Hardware name: ARM-Versatile PB
> [<c001a590>] (unwind_backtrace) from [<c0017b84>] (show_stack+0x10/0x14)
> [<c0017b84>] (show_stack) from [<c0022370>]
> (warn_slowpath_common+0x78/0xb0)
> [<c0022370>] (warn_slowpath_common) from [<c0022444>]
> (warn_slowpath_null+0x1c/0x24)
> [<c0022444>] (warn_slowpath_null) from [<bf000048>]
> (that_function+0x10/0x2c [test])
> unwind: Index not found bf000048
> ---[ end trace 3e24f8edd90f3b27 ]---
>
> to
>
> ------------[ cut here ]------------
> WARNING: CPU: 0 PID: 63 at drivers/misc/test.c:12 that_function+0x10/0x2c
> [test]()
> Modules linked in: test(P+)
> CPU: 0 PID: 63 Comm: insmod Tainted: P                4.1.0-rc2+ #30
> Hardware name: ARM-Versatile PB
> [<c001a5d0>] (unwind_backtrace) from [<c0017b84>] (show_stack+0x10/0x14)
> [<c0017b84>] (show_stack) from [<c0022770>]
> (warn_slowpath_common+0x78/0xb0)
> [<c0022770>] (warn_slowpath_common) from [<c0022844>]
> (warn_slowpath_null+0x1c/0x24)
> [<c0022844>] (warn_slowpath_null) from [<bf000048>]
> (that_function+0x10/0x2c [test])
> [<bf000048>] (that_function [test]) from [<bf002010>]
> (awesome_module+0x10/0x1c [test])
> [<bf002010>] (awesome_module [test]) from [<c0009710>]
> (do_one_initcall+0x80/0x1dc)
> [<c0009710>] (do_one_initcall) from [<c02d14e0>]
> (do_init_module+0x58/0x1a8)
> [<c02d14e0>] (do_init_module) from [<c0063940>]
> (load_module+0x170c/0x1c38)
> [<c0063940>] (load_module) from [<c0063f38>] (SyS_init_module+0xcc/0x124)
> [<c0063f38>] (SyS_init_module) from [<c0014900>]
> (ret_fast_syscall+0x0/0x30)
> ---[ end trace 554c9ff461eb2505 ]---
>
> Tested-by: Laura Abbott <labbott@redhat.com>
>
>> Signed-off-by: Vignesh Radhakrishnan <vigneshr@codeaurora.org>
>> ---
>>   arch/arm/include/asm/module.h | 1 +
>>   arch/arm/kernel/module.c      | 4 ++++
>>   2 files changed, 5 insertions(+)
>>
>> diff --git a/arch/arm/include/asm/module.h
>> b/arch/arm/include/asm/module.h
>> index ed690c4..17640c9 100644
>> --- a/arch/arm/include/asm/module.h
>> +++ b/arch/arm/include/asm/module.h
>> @@ -14,6 +14,7 @@ enum {
>>   	ARM_SEC_DEVEXIT,
>>   	ARM_SEC_HOT,
>>   	ARM_SEC_UNLIKELY,
>> +	ARM_SEC_REF,
>>   	ARM_SEC_MAX,
>>   };
>>
>> diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
>> index 2e11961..846b888 100644
>> --- a/arch/arm/kernel/module.c
>> +++ b/arch/arm/kernel/module.c
>> @@ -308,6 +308,8 @@ int module_finalize(const Elf32_Ehdr *hdr, const
>> Elf_Shdr *sechdrs,
>>   			maps[ARM_SEC_UNLIKELY].unw_sec = s;
>>   		else if (strcmp(".ARM.exidx.text.hot", secname) == 0)
>>   			maps[ARM_SEC_HOT].unw_sec = s;
>> +		else if (strcmp(".ARM.exidx.ref.text", secname) == 0)
>> +			maps[ARM_SEC_REF].unw_sec = s;
>>   		else if (strcmp(".init.text", secname) == 0)
>>   			maps[ARM_SEC_INIT].txt_sec = s;
>>   		else if (strcmp(".text", secname) == 0)
>> @@ -318,6 +320,8 @@ int module_finalize(const Elf32_Ehdr *hdr, const
>> Elf_Shdr *sechdrs,
>>   			maps[ARM_SEC_UNLIKELY].txt_sec = s;
>>   		else if (strcmp(".text.hot", secname) == 0)
>>   			maps[ARM_SEC_HOT].txt_sec = s;
>> +		else if (strcmp(".ref.text", secname) == 0)
>> +			maps[ARM_SEC_REF].txt_sec = s;
>>   	}
>>
>>   	for (i = 0; i < ARM_SEC_MAX; i++)
>>
>
>

QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of the Code Aurora Forum, hosted by The Linux Foundation.
again

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] ARM: module: Add ".ref.text" to arm unwind tables
  2015-05-25 10:56     ` vigneshr at codeaurora.org
@ 2015-06-10 12:25       ` vigneshr at codeaurora.org
  -1 siblings, 0 replies; 12+ messages in thread
From: vigneshr @ 2015-06-10 12:25 UTC (permalink / raw)
  To: linux, a.ryabinin, akpm, adech.fo, Laura Abbott
  Cc: linux-kernel, linux-arm-kernel

Gentle reminder for review comments.

> Forgot to add Maintainers. Adding them now.
>
>> On 05/13/2015 08:20 AM, Vignesh Radhakrishnan wrote:
>>> Functions inside kernel modules that use __ref
>>> will end up being placed in .ARM.exidx.ref.text
>>> section by gcc.
>>>
>>> Currently we don't consider adding these functions
>>> to arm unwind tables.
>>>
>>> Hence, if we turn slub debug on by default we end up
>>> with the messages of this sort:
>>>
>>> 	unwind: Index not found bf0011e0
>>>
>>> This is because slub debug saves stack trace of
>>> allocation's and free's. Therefore, we end up seeing
>>> a flood of these messages in dmesg since its not
>>> able to locate these functions.
>>>
>>> Fix this by adding .ref.text section to arm unwind tables.
>>>
>>
>> With this patch, I go from
>>
>>   ------------[ cut here ]------------
>> WARNING: CPU: 0 PID: 63 at drivers/misc/test.c:12
>> that_function+0x10/0x2c
>> [test]()
>> Modules linked in: test(P+)
>> CPU: 0 PID: 63 Comm: insmod Tainted: P                4.1.0-rc2+ #28
>> Hardware name: ARM-Versatile PB
>> [<c001a590>] (unwind_backtrace) from [<c0017b84>] (show_stack+0x10/0x14)
>> [<c0017b84>] (show_stack) from [<c0022370>]
>> (warn_slowpath_common+0x78/0xb0)
>> [<c0022370>] (warn_slowpath_common) from [<c0022444>]
>> (warn_slowpath_null+0x1c/0x24)
>> [<c0022444>] (warn_slowpath_null) from [<bf000048>]
>> (that_function+0x10/0x2c [test])
>> unwind: Index not found bf000048
>> ---[ end trace 3e24f8edd90f3b27 ]---
>>
>> to
>>
>> ------------[ cut here ]------------
>> WARNING: CPU: 0 PID: 63 at drivers/misc/test.c:12
>> that_function+0x10/0x2c
>> [test]()
>> Modules linked in: test(P+)
>> CPU: 0 PID: 63 Comm: insmod Tainted: P                4.1.0-rc2+ #30
>> Hardware name: ARM-Versatile PB
>> [<c001a5d0>] (unwind_backtrace) from [<c0017b84>] (show_stack+0x10/0x14)
>> [<c0017b84>] (show_stack) from [<c0022770>]
>> (warn_slowpath_common+0x78/0xb0)
>> [<c0022770>] (warn_slowpath_common) from [<c0022844>]
>> (warn_slowpath_null+0x1c/0x24)
>> [<c0022844>] (warn_slowpath_null) from [<bf000048>]
>> (that_function+0x10/0x2c [test])
>> [<bf000048>] (that_function [test]) from [<bf002010>]
>> (awesome_module+0x10/0x1c [test])
>> [<bf002010>] (awesome_module [test]) from [<c0009710>]
>> (do_one_initcall+0x80/0x1dc)
>> [<c0009710>] (do_one_initcall) from [<c02d14e0>]
>> (do_init_module+0x58/0x1a8)
>> [<c02d14e0>] (do_init_module) from [<c0063940>]
>> (load_module+0x170c/0x1c38)
>> [<c0063940>] (load_module) from [<c0063f38>]
>> (SyS_init_module+0xcc/0x124)
>> [<c0063f38>] (SyS_init_module) from [<c0014900>]
>> (ret_fast_syscall+0x0/0x30)
>> ---[ end trace 554c9ff461eb2505 ]---
>>
>> Tested-by: Laura Abbott <labbott@redhat.com>
>>
>>> Signed-off-by: Vignesh Radhakrishnan <vigneshr@codeaurora.org>
>>> ---
>>>   arch/arm/include/asm/module.h | 1 +
>>>   arch/arm/kernel/module.c      | 4 ++++
>>>   2 files changed, 5 insertions(+)
>>>
>>> diff --git a/arch/arm/include/asm/module.h
>>> b/arch/arm/include/asm/module.h
>>> index ed690c4..17640c9 100644
>>> --- a/arch/arm/include/asm/module.h
>>> +++ b/arch/arm/include/asm/module.h
>>> @@ -14,6 +14,7 @@ enum {
>>>   	ARM_SEC_DEVEXIT,
>>>   	ARM_SEC_HOT,
>>>   	ARM_SEC_UNLIKELY,
>>> +	ARM_SEC_REF,
>>>   	ARM_SEC_MAX,
>>>   };
>>>
>>> diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
>>> index 2e11961..846b888 100644
>>> --- a/arch/arm/kernel/module.c
>>> +++ b/arch/arm/kernel/module.c
>>> @@ -308,6 +308,8 @@ int module_finalize(const Elf32_Ehdr *hdr, const
>>> Elf_Shdr *sechdrs,
>>>   			maps[ARM_SEC_UNLIKELY].unw_sec = s;
>>>   		else if (strcmp(".ARM.exidx.text.hot", secname) == 0)
>>>   			maps[ARM_SEC_HOT].unw_sec = s;
>>> +		else if (strcmp(".ARM.exidx.ref.text", secname) == 0)
>>> +			maps[ARM_SEC_REF].unw_sec = s;
>>>   		else if (strcmp(".init.text", secname) == 0)
>>>   			maps[ARM_SEC_INIT].txt_sec = s;
>>>   		else if (strcmp(".text", secname) == 0)
>>> @@ -318,6 +320,8 @@ int module_finalize(const Elf32_Ehdr *hdr, const
>>> Elf_Shdr *sechdrs,
>>>   			maps[ARM_SEC_UNLIKELY].txt_sec = s;
>>>   		else if (strcmp(".text.hot", secname) == 0)
>>>   			maps[ARM_SEC_HOT].txt_sec = s;
>>> +		else if (strcmp(".ref.text", secname) == 0)
>>> +			maps[ARM_SEC_REF].txt_sec = s;
>>>   	}
>>>
>>>   	for (i = 0; i < ARM_SEC_MAX; i++)
>>>
>>
>>
>
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> of the Code Aurora Forum, hosted by The Linux Foundation.
> again
>
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH] ARM: module: Add ".ref.text" to arm unwind tables
@ 2015-06-10 12:25       ` vigneshr at codeaurora.org
  0 siblings, 0 replies; 12+ messages in thread
From: vigneshr at codeaurora.org @ 2015-06-10 12:25 UTC (permalink / raw)
  To: linux-arm-kernel

Gentle reminder for review comments.

> Forgot to add Maintainers. Adding them now.
>
>> On 05/13/2015 08:20 AM, Vignesh Radhakrishnan wrote:
>>> Functions inside kernel modules that use __ref
>>> will end up being placed in .ARM.exidx.ref.text
>>> section by gcc.
>>>
>>> Currently we don't consider adding these functions
>>> to arm unwind tables.
>>>
>>> Hence, if we turn slub debug on by default we end up
>>> with the messages of this sort:
>>>
>>> 	unwind: Index not found bf0011e0
>>>
>>> This is because slub debug saves stack trace of
>>> allocation's and free's. Therefore, we end up seeing
>>> a flood of these messages in dmesg since its not
>>> able to locate these functions.
>>>
>>> Fix this by adding .ref.text section to arm unwind tables.
>>>
>>
>> With this patch, I go from
>>
>>   ------------[ cut here ]------------
>> WARNING: CPU: 0 PID: 63 at drivers/misc/test.c:12
>> that_function+0x10/0x2c
>> [test]()
>> Modules linked in: test(P+)
>> CPU: 0 PID: 63 Comm: insmod Tainted: P                4.1.0-rc2+ #28
>> Hardware name: ARM-Versatile PB
>> [<c001a590>] (unwind_backtrace) from [<c0017b84>] (show_stack+0x10/0x14)
>> [<c0017b84>] (show_stack) from [<c0022370>]
>> (warn_slowpath_common+0x78/0xb0)
>> [<c0022370>] (warn_slowpath_common) from [<c0022444>]
>> (warn_slowpath_null+0x1c/0x24)
>> [<c0022444>] (warn_slowpath_null) from [<bf000048>]
>> (that_function+0x10/0x2c [test])
>> unwind: Index not found bf000048
>> ---[ end trace 3e24f8edd90f3b27 ]---
>>
>> to
>>
>> ------------[ cut here ]------------
>> WARNING: CPU: 0 PID: 63 at drivers/misc/test.c:12
>> that_function+0x10/0x2c
>> [test]()
>> Modules linked in: test(P+)
>> CPU: 0 PID: 63 Comm: insmod Tainted: P                4.1.0-rc2+ #30
>> Hardware name: ARM-Versatile PB
>> [<c001a5d0>] (unwind_backtrace) from [<c0017b84>] (show_stack+0x10/0x14)
>> [<c0017b84>] (show_stack) from [<c0022770>]
>> (warn_slowpath_common+0x78/0xb0)
>> [<c0022770>] (warn_slowpath_common) from [<c0022844>]
>> (warn_slowpath_null+0x1c/0x24)
>> [<c0022844>] (warn_slowpath_null) from [<bf000048>]
>> (that_function+0x10/0x2c [test])
>> [<bf000048>] (that_function [test]) from [<bf002010>]
>> (awesome_module+0x10/0x1c [test])
>> [<bf002010>] (awesome_module [test]) from [<c0009710>]
>> (do_one_initcall+0x80/0x1dc)
>> [<c0009710>] (do_one_initcall) from [<c02d14e0>]
>> (do_init_module+0x58/0x1a8)
>> [<c02d14e0>] (do_init_module) from [<c0063940>]
>> (load_module+0x170c/0x1c38)
>> [<c0063940>] (load_module) from [<c0063f38>]
>> (SyS_init_module+0xcc/0x124)
>> [<c0063f38>] (SyS_init_module) from [<c0014900>]
>> (ret_fast_syscall+0x0/0x30)
>> ---[ end trace 554c9ff461eb2505 ]---
>>
>> Tested-by: Laura Abbott <labbott@redhat.com>
>>
>>> Signed-off-by: Vignesh Radhakrishnan <vigneshr@codeaurora.org>
>>> ---
>>>   arch/arm/include/asm/module.h | 1 +
>>>   arch/arm/kernel/module.c      | 4 ++++
>>>   2 files changed, 5 insertions(+)
>>>
>>> diff --git a/arch/arm/include/asm/module.h
>>> b/arch/arm/include/asm/module.h
>>> index ed690c4..17640c9 100644
>>> --- a/arch/arm/include/asm/module.h
>>> +++ b/arch/arm/include/asm/module.h
>>> @@ -14,6 +14,7 @@ enum {
>>>   	ARM_SEC_DEVEXIT,
>>>   	ARM_SEC_HOT,
>>>   	ARM_SEC_UNLIKELY,
>>> +	ARM_SEC_REF,
>>>   	ARM_SEC_MAX,
>>>   };
>>>
>>> diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
>>> index 2e11961..846b888 100644
>>> --- a/arch/arm/kernel/module.c
>>> +++ b/arch/arm/kernel/module.c
>>> @@ -308,6 +308,8 @@ int module_finalize(const Elf32_Ehdr *hdr, const
>>> Elf_Shdr *sechdrs,
>>>   			maps[ARM_SEC_UNLIKELY].unw_sec = s;
>>>   		else if (strcmp(".ARM.exidx.text.hot", secname) == 0)
>>>   			maps[ARM_SEC_HOT].unw_sec = s;
>>> +		else if (strcmp(".ARM.exidx.ref.text", secname) == 0)
>>> +			maps[ARM_SEC_REF].unw_sec = s;
>>>   		else if (strcmp(".init.text", secname) == 0)
>>>   			maps[ARM_SEC_INIT].txt_sec = s;
>>>   		else if (strcmp(".text", secname) == 0)
>>> @@ -318,6 +320,8 @@ int module_finalize(const Elf32_Ehdr *hdr, const
>>> Elf_Shdr *sechdrs,
>>>   			maps[ARM_SEC_UNLIKELY].txt_sec = s;
>>>   		else if (strcmp(".text.hot", secname) == 0)
>>>   			maps[ARM_SEC_HOT].txt_sec = s;
>>> +		else if (strcmp(".ref.text", secname) == 0)
>>> +			maps[ARM_SEC_REF].txt_sec = s;
>>>   	}
>>>
>>>   	for (i = 0; i < ARM_SEC_MAX; i++)
>>>
>>
>>
>
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> of the Code Aurora Forum, hosted by The Linux Foundation.
> again
>
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] ARM: module: Add ".ref.text" to arm unwind tables
  2015-06-10 12:25       ` vigneshr at codeaurora.org
@ 2015-06-10 12:33         ` Russell King - ARM Linux
  -1 siblings, 0 replies; 12+ messages in thread
From: Russell King - ARM Linux @ 2015-06-10 12:33 UTC (permalink / raw)
  To: vigneshr
  Cc: a.ryabinin, akpm, adech.fo, Laura Abbott, linux-kernel, linux-arm-kernel

On Wed, Jun 10, 2015 at 12:25:54PM -0000, vigneshr@codeaurora.org wrote:
> Gentle reminder for review comments.

I don't see anything wrong with the patch... but it needs to find its
way into the patch system to be applied, so it doesn't get forgotten.
Please add it there along with Laura's attributation.  Thanks.

> > Forgot to add Maintainers. Adding them now.
> >
> >> On 05/13/2015 08:20 AM, Vignesh Radhakrishnan wrote:
> >>> Functions inside kernel modules that use __ref
> >>> will end up being placed in .ARM.exidx.ref.text
> >>> section by gcc.
> >>>
> >>> Currently we don't consider adding these functions
> >>> to arm unwind tables.
> >>>
> >>> Hence, if we turn slub debug on by default we end up
> >>> with the messages of this sort:
> >>>
> >>> 	unwind: Index not found bf0011e0
> >>>
> >>> This is because slub debug saves stack trace of
> >>> allocation's and free's. Therefore, we end up seeing
> >>> a flood of these messages in dmesg since its not
> >>> able to locate these functions.
> >>>
> >>> Fix this by adding .ref.text section to arm unwind tables.
> >>>
> >>
> >> With this patch, I go from
> >>
> >>   ------------[ cut here ]------------
> >> WARNING: CPU: 0 PID: 63 at drivers/misc/test.c:12
> >> that_function+0x10/0x2c
> >> [test]()
> >> Modules linked in: test(P+)
> >> CPU: 0 PID: 63 Comm: insmod Tainted: P                4.1.0-rc2+ #28
> >> Hardware name: ARM-Versatile PB
> >> [<c001a590>] (unwind_backtrace) from [<c0017b84>] (show_stack+0x10/0x14)
> >> [<c0017b84>] (show_stack) from [<c0022370>]
> >> (warn_slowpath_common+0x78/0xb0)
> >> [<c0022370>] (warn_slowpath_common) from [<c0022444>]
> >> (warn_slowpath_null+0x1c/0x24)
> >> [<c0022444>] (warn_slowpath_null) from [<bf000048>]
> >> (that_function+0x10/0x2c [test])
> >> unwind: Index not found bf000048
> >> ---[ end trace 3e24f8edd90f3b27 ]---
> >>
> >> to
> >>
> >> ------------[ cut here ]------------
> >> WARNING: CPU: 0 PID: 63 at drivers/misc/test.c:12
> >> that_function+0x10/0x2c
> >> [test]()
> >> Modules linked in: test(P+)
> >> CPU: 0 PID: 63 Comm: insmod Tainted: P                4.1.0-rc2+ #30
> >> Hardware name: ARM-Versatile PB
> >> [<c001a5d0>] (unwind_backtrace) from [<c0017b84>] (show_stack+0x10/0x14)
> >> [<c0017b84>] (show_stack) from [<c0022770>]
> >> (warn_slowpath_common+0x78/0xb0)
> >> [<c0022770>] (warn_slowpath_common) from [<c0022844>]
> >> (warn_slowpath_null+0x1c/0x24)
> >> [<c0022844>] (warn_slowpath_null) from [<bf000048>]
> >> (that_function+0x10/0x2c [test])
> >> [<bf000048>] (that_function [test]) from [<bf002010>]
> >> (awesome_module+0x10/0x1c [test])
> >> [<bf002010>] (awesome_module [test]) from [<c0009710>]
> >> (do_one_initcall+0x80/0x1dc)
> >> [<c0009710>] (do_one_initcall) from [<c02d14e0>]
> >> (do_init_module+0x58/0x1a8)
> >> [<c02d14e0>] (do_init_module) from [<c0063940>]
> >> (load_module+0x170c/0x1c38)
> >> [<c0063940>] (load_module) from [<c0063f38>]
> >> (SyS_init_module+0xcc/0x124)
> >> [<c0063f38>] (SyS_init_module) from [<c0014900>]
> >> (ret_fast_syscall+0x0/0x30)
> >> ---[ end trace 554c9ff461eb2505 ]---
> >>
> >> Tested-by: Laura Abbott <labbott@redhat.com>
> >>
> >>> Signed-off-by: Vignesh Radhakrishnan <vigneshr@codeaurora.org>
> >>> ---
> >>>   arch/arm/include/asm/module.h | 1 +
> >>>   arch/arm/kernel/module.c      | 4 ++++
> >>>   2 files changed, 5 insertions(+)
> >>>
> >>> diff --git a/arch/arm/include/asm/module.h
> >>> b/arch/arm/include/asm/module.h
> >>> index ed690c4..17640c9 100644
> >>> --- a/arch/arm/include/asm/module.h
> >>> +++ b/arch/arm/include/asm/module.h
> >>> @@ -14,6 +14,7 @@ enum {
> >>>   	ARM_SEC_DEVEXIT,
> >>>   	ARM_SEC_HOT,
> >>>   	ARM_SEC_UNLIKELY,
> >>> +	ARM_SEC_REF,
> >>>   	ARM_SEC_MAX,
> >>>   };
> >>>
> >>> diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
> >>> index 2e11961..846b888 100644
> >>> --- a/arch/arm/kernel/module.c
> >>> +++ b/arch/arm/kernel/module.c
> >>> @@ -308,6 +308,8 @@ int module_finalize(const Elf32_Ehdr *hdr, const
> >>> Elf_Shdr *sechdrs,
> >>>   			maps[ARM_SEC_UNLIKELY].unw_sec = s;
> >>>   		else if (strcmp(".ARM.exidx.text.hot", secname) == 0)
> >>>   			maps[ARM_SEC_HOT].unw_sec = s;
> >>> +		else if (strcmp(".ARM.exidx.ref.text", secname) == 0)
> >>> +			maps[ARM_SEC_REF].unw_sec = s;
> >>>   		else if (strcmp(".init.text", secname) == 0)
> >>>   			maps[ARM_SEC_INIT].txt_sec = s;
> >>>   		else if (strcmp(".text", secname) == 0)
> >>> @@ -318,6 +320,8 @@ int module_finalize(const Elf32_Ehdr *hdr, const
> >>> Elf_Shdr *sechdrs,
> >>>   			maps[ARM_SEC_UNLIKELY].txt_sec = s;
> >>>   		else if (strcmp(".text.hot", secname) == 0)
> >>>   			maps[ARM_SEC_HOT].txt_sec = s;
> >>> +		else if (strcmp(".ref.text", secname) == 0)
> >>> +			maps[ARM_SEC_REF].txt_sec = s;
> >>>   	}
> >>>
> >>>   	for (i = 0; i < ARM_SEC_MAX; i++)
> >>>
> >>
> >>
> >
> > QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> > of the Code Aurora Forum, hosted by The Linux Foundation.
> > again
> >
> >
> >
> > _______________________________________________
> > linux-arm-kernel mailing list
> > linux-arm-kernel@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> >
> 
> 

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH] ARM: module: Add ".ref.text" to arm unwind tables
@ 2015-06-10 12:33         ` Russell King - ARM Linux
  0 siblings, 0 replies; 12+ messages in thread
From: Russell King - ARM Linux @ 2015-06-10 12:33 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jun 10, 2015 at 12:25:54PM -0000, vigneshr at codeaurora.org wrote:
> Gentle reminder for review comments.

I don't see anything wrong with the patch... but it needs to find its
way into the patch system to be applied, so it doesn't get forgotten.
Please add it there along with Laura's attributation.  Thanks.

> > Forgot to add Maintainers. Adding them now.
> >
> >> On 05/13/2015 08:20 AM, Vignesh Radhakrishnan wrote:
> >>> Functions inside kernel modules that use __ref
> >>> will end up being placed in .ARM.exidx.ref.text
> >>> section by gcc.
> >>>
> >>> Currently we don't consider adding these functions
> >>> to arm unwind tables.
> >>>
> >>> Hence, if we turn slub debug on by default we end up
> >>> with the messages of this sort:
> >>>
> >>> 	unwind: Index not found bf0011e0
> >>>
> >>> This is because slub debug saves stack trace of
> >>> allocation's and free's. Therefore, we end up seeing
> >>> a flood of these messages in dmesg since its not
> >>> able to locate these functions.
> >>>
> >>> Fix this by adding .ref.text section to arm unwind tables.
> >>>
> >>
> >> With this patch, I go from
> >>
> >>   ------------[ cut here ]------------
> >> WARNING: CPU: 0 PID: 63 at drivers/misc/test.c:12
> >> that_function+0x10/0x2c
> >> [test]()
> >> Modules linked in: test(P+)
> >> CPU: 0 PID: 63 Comm: insmod Tainted: P                4.1.0-rc2+ #28
> >> Hardware name: ARM-Versatile PB
> >> [<c001a590>] (unwind_backtrace) from [<c0017b84>] (show_stack+0x10/0x14)
> >> [<c0017b84>] (show_stack) from [<c0022370>]
> >> (warn_slowpath_common+0x78/0xb0)
> >> [<c0022370>] (warn_slowpath_common) from [<c0022444>]
> >> (warn_slowpath_null+0x1c/0x24)
> >> [<c0022444>] (warn_slowpath_null) from [<bf000048>]
> >> (that_function+0x10/0x2c [test])
> >> unwind: Index not found bf000048
> >> ---[ end trace 3e24f8edd90f3b27 ]---
> >>
> >> to
> >>
> >> ------------[ cut here ]------------
> >> WARNING: CPU: 0 PID: 63 at drivers/misc/test.c:12
> >> that_function+0x10/0x2c
> >> [test]()
> >> Modules linked in: test(P+)
> >> CPU: 0 PID: 63 Comm: insmod Tainted: P                4.1.0-rc2+ #30
> >> Hardware name: ARM-Versatile PB
> >> [<c001a5d0>] (unwind_backtrace) from [<c0017b84>] (show_stack+0x10/0x14)
> >> [<c0017b84>] (show_stack) from [<c0022770>]
> >> (warn_slowpath_common+0x78/0xb0)
> >> [<c0022770>] (warn_slowpath_common) from [<c0022844>]
> >> (warn_slowpath_null+0x1c/0x24)
> >> [<c0022844>] (warn_slowpath_null) from [<bf000048>]
> >> (that_function+0x10/0x2c [test])
> >> [<bf000048>] (that_function [test]) from [<bf002010>]
> >> (awesome_module+0x10/0x1c [test])
> >> [<bf002010>] (awesome_module [test]) from [<c0009710>]
> >> (do_one_initcall+0x80/0x1dc)
> >> [<c0009710>] (do_one_initcall) from [<c02d14e0>]
> >> (do_init_module+0x58/0x1a8)
> >> [<c02d14e0>] (do_init_module) from [<c0063940>]
> >> (load_module+0x170c/0x1c38)
> >> [<c0063940>] (load_module) from [<c0063f38>]
> >> (SyS_init_module+0xcc/0x124)
> >> [<c0063f38>] (SyS_init_module) from [<c0014900>]
> >> (ret_fast_syscall+0x0/0x30)
> >> ---[ end trace 554c9ff461eb2505 ]---
> >>
> >> Tested-by: Laura Abbott <labbott@redhat.com>
> >>
> >>> Signed-off-by: Vignesh Radhakrishnan <vigneshr@codeaurora.org>
> >>> ---
> >>>   arch/arm/include/asm/module.h | 1 +
> >>>   arch/arm/kernel/module.c      | 4 ++++
> >>>   2 files changed, 5 insertions(+)
> >>>
> >>> diff --git a/arch/arm/include/asm/module.h
> >>> b/arch/arm/include/asm/module.h
> >>> index ed690c4..17640c9 100644
> >>> --- a/arch/arm/include/asm/module.h
> >>> +++ b/arch/arm/include/asm/module.h
> >>> @@ -14,6 +14,7 @@ enum {
> >>>   	ARM_SEC_DEVEXIT,
> >>>   	ARM_SEC_HOT,
> >>>   	ARM_SEC_UNLIKELY,
> >>> +	ARM_SEC_REF,
> >>>   	ARM_SEC_MAX,
> >>>   };
> >>>
> >>> diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
> >>> index 2e11961..846b888 100644
> >>> --- a/arch/arm/kernel/module.c
> >>> +++ b/arch/arm/kernel/module.c
> >>> @@ -308,6 +308,8 @@ int module_finalize(const Elf32_Ehdr *hdr, const
> >>> Elf_Shdr *sechdrs,
> >>>   			maps[ARM_SEC_UNLIKELY].unw_sec = s;
> >>>   		else if (strcmp(".ARM.exidx.text.hot", secname) == 0)
> >>>   			maps[ARM_SEC_HOT].unw_sec = s;
> >>> +		else if (strcmp(".ARM.exidx.ref.text", secname) == 0)
> >>> +			maps[ARM_SEC_REF].unw_sec = s;
> >>>   		else if (strcmp(".init.text", secname) == 0)
> >>>   			maps[ARM_SEC_INIT].txt_sec = s;
> >>>   		else if (strcmp(".text", secname) == 0)
> >>> @@ -318,6 +320,8 @@ int module_finalize(const Elf32_Ehdr *hdr, const
> >>> Elf_Shdr *sechdrs,
> >>>   			maps[ARM_SEC_UNLIKELY].txt_sec = s;
> >>>   		else if (strcmp(".text.hot", secname) == 0)
> >>>   			maps[ARM_SEC_HOT].txt_sec = s;
> >>> +		else if (strcmp(".ref.text", secname) == 0)
> >>> +			maps[ARM_SEC_REF].txt_sec = s;
> >>>   	}
> >>>
> >>>   	for (i = 0; i < ARM_SEC_MAX; i++)
> >>>
> >>
> >>
> >
> > QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> > of the Code Aurora Forum, hosted by The Linux Foundation.
> > again
> >
> >
> >
> > _______________________________________________
> > linux-arm-kernel mailing list
> > linux-arm-kernel at lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> >
> 
> 

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH] ARM: module: Add ".ref.text" to arm unwind tables
  2015-06-10 12:33         ` Russell King - ARM Linux
@ 2015-06-19  9:35           ` Vignesh Radhakrishnan
  -1 siblings, 0 replies; 12+ messages in thread
From: Vignesh Radhakrishnan @ 2015-06-19  9:35 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel
  Cc: Vignesh Radhakrishnan, Russell King, Andrew Morton, Laura Abbott,
	Andrey Ryabinin, Andrey Konovalov

Functions inside kernel modules that use __ref
will end up being placed in .ARM.exidx.ref.text
section by gcc.

Currently we don't consider adding these functions
to arm unwind tables.

Hence, if we turn slub debug on by default we end up
with the messages of this sort:

unwind: Index not found bf0011e0

This is because slub debug saves stack trace of
allocation's and free's. Therefore, we end up seeing
a flood of these messages in dmesg since its not
able to locate these functions.

Fix this by adding .ref.text section to arm unwind tables.

Tested-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Vignesh Radhakrishnan <vigneshr@codeaurora.org>
CC: Russell King <linux@arm.linux.org.uk>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Laura Abbott <labbott@redhat.com>
CC: Andrey Ryabinin <a.ryabinin@samsung.com>
CC: Andrey Konovalov <adech.fo@gmail.com>
---
 arch/arm/include/asm/module.h | 1 +
 arch/arm/kernel/module.c      | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/arch/arm/include/asm/module.h b/arch/arm/include/asm/module.h
index ed690c4..17640c9 100644
--- a/arch/arm/include/asm/module.h
+++ b/arch/arm/include/asm/module.h
@@ -14,6 +14,7 @@ enum {
 	ARM_SEC_DEVEXIT,
 	ARM_SEC_HOT,
 	ARM_SEC_UNLIKELY,
+	ARM_SEC_REF,
 	ARM_SEC_MAX,
 };
 
diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
index 2e11961..846b888 100644
--- a/arch/arm/kernel/module.c
+++ b/arch/arm/kernel/module.c
@@ -308,6 +308,8 @@ int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
 			maps[ARM_SEC_UNLIKELY].unw_sec = s;
 		else if (strcmp(".ARM.exidx.text.hot", secname) == 0)
 			maps[ARM_SEC_HOT].unw_sec = s;
+		else if (strcmp(".ARM.exidx.ref.text", secname) == 0)
+			maps[ARM_SEC_REF].unw_sec = s;
 		else if (strcmp(".init.text", secname) == 0)
 			maps[ARM_SEC_INIT].txt_sec = s;
 		else if (strcmp(".text", secname) == 0)
@@ -318,6 +320,8 @@ int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
 			maps[ARM_SEC_UNLIKELY].txt_sec = s;
 		else if (strcmp(".text.hot", secname) == 0)
 			maps[ARM_SEC_HOT].txt_sec = s;
+		else if (strcmp(".ref.text", secname) == 0)
+			maps[ARM_SEC_REF].txt_sec = s;
 	}
 
 	for (i = 0; i < ARM_SEC_MAX; i++)
-- 
1.8.2.1

-- 
Thanks and regards,
Vignesh Radhakrishnan

QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a
member of the Code Aurora Forum, hosted by The Linux Foundation.


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH] ARM: module: Add ".ref.text" to arm unwind tables
@ 2015-06-19  9:35           ` Vignesh Radhakrishnan
  0 siblings, 0 replies; 12+ messages in thread
From: Vignesh Radhakrishnan @ 2015-06-19  9:35 UTC (permalink / raw)
  To: linux-arm-kernel

Functions inside kernel modules that use __ref
will end up being placed in .ARM.exidx.ref.text
section by gcc.

Currently we don't consider adding these functions
to arm unwind tables.

Hence, if we turn slub debug on by default we end up
with the messages of this sort:

unwind: Index not found bf0011e0

This is because slub debug saves stack trace of
allocation's and free's. Therefore, we end up seeing
a flood of these messages in dmesg since its not
able to locate these functions.

Fix this by adding .ref.text section to arm unwind tables.

Tested-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Vignesh Radhakrishnan <vigneshr@codeaurora.org>
CC: Russell King <linux@arm.linux.org.uk>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Laura Abbott <labbott@redhat.com>
CC: Andrey Ryabinin <a.ryabinin@samsung.com>
CC: Andrey Konovalov <adech.fo@gmail.com>
---
 arch/arm/include/asm/module.h | 1 +
 arch/arm/kernel/module.c      | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/arch/arm/include/asm/module.h b/arch/arm/include/asm/module.h
index ed690c4..17640c9 100644
--- a/arch/arm/include/asm/module.h
+++ b/arch/arm/include/asm/module.h
@@ -14,6 +14,7 @@ enum {
 	ARM_SEC_DEVEXIT,
 	ARM_SEC_HOT,
 	ARM_SEC_UNLIKELY,
+	ARM_SEC_REF,
 	ARM_SEC_MAX,
 };
 
diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
index 2e11961..846b888 100644
--- a/arch/arm/kernel/module.c
+++ b/arch/arm/kernel/module.c
@@ -308,6 +308,8 @@ int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
 			maps[ARM_SEC_UNLIKELY].unw_sec = s;
 		else if (strcmp(".ARM.exidx.text.hot", secname) == 0)
 			maps[ARM_SEC_HOT].unw_sec = s;
+		else if (strcmp(".ARM.exidx.ref.text", secname) == 0)
+			maps[ARM_SEC_REF].unw_sec = s;
 		else if (strcmp(".init.text", secname) == 0)
 			maps[ARM_SEC_INIT].txt_sec = s;
 		else if (strcmp(".text", secname) == 0)
@@ -318,6 +320,8 @@ int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
 			maps[ARM_SEC_UNLIKELY].txt_sec = s;
 		else if (strcmp(".text.hot", secname) == 0)
 			maps[ARM_SEC_HOT].txt_sec = s;
+		else if (strcmp(".ref.text", secname) == 0)
+			maps[ARM_SEC_REF].txt_sec = s;
 	}
 
 	for (i = 0; i < ARM_SEC_MAX; i++)
-- 
1.8.2.1

-- 
Thanks and regards,
Vignesh Radhakrishnan

QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a
member of the Code Aurora Forum, hosted by The Linux Foundation.

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-06-19  9:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-13 15:20 [PATCH] ARM: module: Add ".ref.text" to arm unwind tables Vignesh Radhakrishnan
2015-05-13 15:20 ` Vignesh Radhakrishnan
2015-05-14 21:23 ` Laura Abbott
2015-05-14 21:23   ` Laura Abbott
2015-05-25 10:56   ` vigneshr
2015-05-25 10:56     ` vigneshr at codeaurora.org
2015-06-10 12:25     ` vigneshr
2015-06-10 12:25       ` vigneshr at codeaurora.org
2015-06-10 12:33       ` Russell King - ARM Linux
2015-06-10 12:33         ` Russell King - ARM Linux
2015-06-19  9:35         ` Vignesh Radhakrishnan
2015-06-19  9:35           ` Vignesh Radhakrishnan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.