* [PATCH v1] x86, kasan, ftrace: Put APIC interrupt handlers into .irqentry.text
@ 2016-07-14 17:04 Alexander Potapenko
2016-07-15 9:19 ` kbuild test robot
0 siblings, 1 reply; 5+ messages in thread
From: Alexander Potapenko @ 2016-07-14 17:04 UTC (permalink / raw)
To: dvyukov, kcc, aryabinin, x86, rostedt, mingo; +Cc: kasan-dev, linux-kernel
When building with CONFIG_FUNCTION_GRAPH_TRACER or CONFIG_KASAN, put the
APIC interrupt handlers into the .irqentry.text section. This is needed
because both KASAN and function graph tracer use __irqentry_text_start and
__irqentry_text_end to determine whether a function is an IRQ entry point.
Dmitry Vyukov has reported unexpected KASAN stackdepot growth
(https://github.com/google/kasan/issues/36), which had been caused by
the APIC handlers not being present in .irqentry.text.
Signed-off-by: Alexander Potapenko <glider@google.com>
Reported-by: Dmitry Vyukov <dvyukov@google.com>
---
arch/x86/entry/entry_64.S | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index 9ee0da1..966b1a8 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -601,9 +601,20 @@ apicinterrupt3 \num trace(\sym) smp_trace(\sym)
.endm
#endif
+/* Make sure APIC interrupt handlers end up in the irqentry section. */
+#ifdef defined(CONFIG_FUNCTION_GRAPH_TRACER) || defined(CONFIG_KASAN)
+#define PUSH_SECTION_IRQENTRY .pushsection .irqentry.text, "ax"
+#define POP_SECTION_IRQENTRY .popsection
+#else
+#define PUSH_SECTION_IRQENTRY
+#define POP_SECTION_IRQENTRY
+#endif
+
.macro apicinterrupt num sym do_sym
+PUSH_SECTION_IRQENTRY
apicinterrupt3 \num \sym \do_sym
trace_apicinterrupt \num \sym
+POP_SECTION_IRQENTRY
.endm
#ifdef CONFIG_SMP
--
2.8.0.rc3.226.g39d4020
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v1] x86, kasan, ftrace: Put APIC interrupt handlers into .irqentry.text
2016-07-14 17:04 [PATCH v1] x86, kasan, ftrace: Put APIC interrupt handlers into .irqentry.text Alexander Potapenko
@ 2016-07-15 9:19 ` kbuild test robot
2016-07-27 12:45 ` Steven Rostedt
0 siblings, 1 reply; 5+ messages in thread
From: kbuild test robot @ 2016-07-15 9:19 UTC (permalink / raw)
To: Alexander Potapenko
Cc: kbuild-all, dvyukov, kcc, aryabinin, x86, rostedt, mingo,
kasan-dev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1749 bytes --]
Hi,
[auto build test WARNING on tip/x86/core]
[also build test WARNING on v4.7-rc7 next-20160714]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Alexander-Potapenko/x86-kasan-ftrace-Put-APIC-interrupt-handlers-into-irqentry-text/20160715-152601
config: x86_64-acpi-redef (attached as .config)
compiler: gcc-6 (Debian 6.1.1-1) 6.1.1 20160430
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All warnings (new ones prefixed by >>):
>> arch/x86/entry/entry_64.S:674:15: warning: extra tokens at end of #ifdef directive
#ifdef defined(CONFIG_FUNCTION_GRAPH_TRACER) || defined(CONFIG_KASAN)
^
vim +674 arch/x86/entry/entry_64.S
658 END(\sym)
659 .endm
660
661 #ifdef CONFIG_TRACING
662 #define trace(sym) trace_##sym
663 #define smp_trace(sym) smp_trace_##sym
664
665 .macro trace_apicinterrupt num sym
666 apicinterrupt3 \num trace(\sym) smp_trace(\sym)
667 .endm
668 #else
669 .macro trace_apicinterrupt num sym do_sym
670 .endm
671 #endif
672
673 /* Make sure APIC interrupt handlers end up in the irqentry section. */
> 674 #ifdef defined(CONFIG_FUNCTION_GRAPH_TRACER) || defined(CONFIG_KASAN)
675 #define PUSH_SECTION_IRQENTRY .pushsection .irqentry.text, "ax"
676 #define POP_SECTION_IRQENTRY .popsection
677 #else
678 #define PUSH_SECTION_IRQENTRY
679 #define POP_SECTION_IRQENTRY
680 #endif
681
682 .macro apicinterrupt num sym do_sym
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 27963 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1] x86, kasan, ftrace: Put APIC interrupt handlers into .irqentry.text
2016-07-15 9:19 ` kbuild test robot
@ 2016-07-27 12:45 ` Steven Rostedt
2016-07-27 12:52 ` Andrey Ryabinin
0 siblings, 1 reply; 5+ messages in thread
From: Steven Rostedt @ 2016-07-27 12:45 UTC (permalink / raw)
To: kbuild test robot
Cc: Alexander Potapenko, kbuild-all, dvyukov, kcc, aryabinin, x86,
mingo, kasan-dev, linux-kernel
On Fri, 15 Jul 2016 17:19:46 +0800
kbuild test robot <lkp@intel.com> wrote:
> Hi,
>
> [auto build test WARNING on tip/x86/core]
> [also build test WARNING on v4.7-rc7 next-20160714]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>
> url: https://github.com/0day-ci/linux/commits/Alexander-Potapenko/x86-kasan-ftrace-Put-APIC-interrupt-handlers-into-irqentry-text/20160715-152601
> config: x86_64-acpi-redef (attached as .config)
> compiler: gcc-6 (Debian 6.1.1-1) 6.1.1 20160430
> reproduce:
> # save the attached .config to linux build tree
> make ARCH=x86_64
>
> All warnings (new ones prefixed by >>):
>
> >> arch/x86/entry/entry_64.S:674:15: warning: extra tokens at end of #ifdef directive
> #ifdef defined(CONFIG_FUNCTION_GRAPH_TRACER) || defined(CONFIG_KASAN)
Alexander,
Can you send a v2 with this fixed?
-- Steve
> ^
>
> vim +674 arch/x86/entry/entry_64.S
>
> 658 END(\sym)
> 659 .endm
> 660
> 661 #ifdef CONFIG_TRACING
> 662 #define trace(sym) trace_##sym
> 663 #define smp_trace(sym) smp_trace_##sym
> 664
> 665 .macro trace_apicinterrupt num sym
> 666 apicinterrupt3 \num trace(\sym) smp_trace(\sym)
> 667 .endm
> 668 #else
> 669 .macro trace_apicinterrupt num sym do_sym
> 670 .endm
> 671 #endif
> 672
> 673 /* Make sure APIC interrupt handlers end up in the irqentry section. */
> > 674 #ifdef defined(CONFIG_FUNCTION_GRAPH_TRACER) || defined(CONFIG_KASAN)
> 675 #define PUSH_SECTION_IRQENTRY .pushsection .irqentry.text, "ax"
> 676 #define POP_SECTION_IRQENTRY .popsection
> 677 #else
> 678 #define PUSH_SECTION_IRQENTRY
> 679 #define POP_SECTION_IRQENTRY
> 680 #endif
> 681
> 682 .macro apicinterrupt num sym do_sym
>
> ---
> 0-DAY kernel test infrastructure Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all Intel Corporation
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1] x86, kasan, ftrace: Put APIC interrupt handlers into .irqentry.text
2016-07-27 12:45 ` Steven Rostedt
@ 2016-07-27 12:52 ` Andrey Ryabinin
2016-07-27 13:01 ` Steven Rostedt
0 siblings, 1 reply; 5+ messages in thread
From: Andrey Ryabinin @ 2016-07-27 12:52 UTC (permalink / raw)
To: Steven Rostedt, kbuild test robot
Cc: Alexander Potapenko, kbuild-all, dvyukov, kcc, x86, mingo,
kasan-dev, linux-kernel
On 07/27/2016 03:45 PM, Steven Rostedt wrote:
> On Fri, 15 Jul 2016 17:19:46 +0800
> kbuild test robot <lkp@intel.com> wrote:
>
>> Hi,
>>
>> [auto build test WARNING on tip/x86/core]
>> [also build test WARNING on v4.7-rc7 next-20160714]
>> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>>
>> url: https://github.com/0day-ci/linux/commits/Alexander-Potapenko/x86-kasan-ftrace-Put-APIC-interrupt-handlers-into-irqentry-text/20160715-152601
>> config: x86_64-acpi-redef (attached as .config)
>> compiler: gcc-6 (Debian 6.1.1-1) 6.1.1 20160430
>> reproduce:
>> # save the attached .config to linux build tree
>> make ARCH=x86_64
>>
>> All warnings (new ones prefixed by >>):
>>
>>>> arch/x86/entry/entry_64.S:674:15: warning: extra tokens at end of #ifdef directive
>> #ifdef defined(CONFIG_FUNCTION_GRAPH_TRACER) || defined(CONFIG_KASAN)
>
> Alexander,
>
> Can you send a v2 with this fixed?
>
He did - http://lkml.kernel.org/g/<1468575763-144889-1-git-send-email-glider@google.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1] x86, kasan, ftrace: Put APIC interrupt handlers into .irqentry.text
2016-07-27 12:52 ` Andrey Ryabinin
@ 2016-07-27 13:01 ` Steven Rostedt
0 siblings, 0 replies; 5+ messages in thread
From: Steven Rostedt @ 2016-07-27 13:01 UTC (permalink / raw)
To: Andrey Ryabinin
Cc: kbuild test robot, Alexander Potapenko, kbuild-all, dvyukov, kcc,
x86, mingo, kasan-dev, linux-kernel
On Wed, 27 Jul 2016 15:52:08 +0300
Andrey Ryabinin <aryabinin@virtuozzo.com> wrote:
> > Alexander,
> >
> > Can you send a v2 with this fixed?
> >
>
> He did - http://lkml.kernel.org/g/<1468575763-144889-1-git-send-email-glider@google.com>
>
Bah, you're right. I never marked that patch as "todo" and was
searching for a v2 with my "todo" filter on, so I missed it.
Sorry for the noise.
-- Steve
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-07-27 15:23 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-14 17:04 [PATCH v1] x86, kasan, ftrace: Put APIC interrupt handlers into .irqentry.text Alexander Potapenko
2016-07-15 9:19 ` kbuild test robot
2016-07-27 12:45 ` Steven Rostedt
2016-07-27 12:52 ` Andrey Ryabinin
2016-07-27 13:01 ` Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).