Skip to contentSkip to conversation

x86: Add trace points to (nearly) all vectors

PATCH Superseded Andi Kleen 4 participants 7 messages Oct 30, 2019 – Nov 7, 2019

Subsystems (4)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

PATCH v3 1/1 x86: Add trace points to (nearly) all vectors

From: Andi Kleen <[email protected]>

In some scenarios it can be useful to count or trace every kernel entry. Most entry paths are covered by trace points already, but some of the more obscure entry points do not have trace points.

The most common uncovered one was KVM async page fault.

This patch kit adds trace points to all the other vectors, except UV (anyone uses?), Xen (generic code), reboot (pointless)

To avoid creating a lot of new trace points this just lumps them all together into a "other_vector" trace point, because they're all fairly obscure and uncommon, and can be figured out from the number when needed, or filtered using the filter expression. This makes the needed perf command line much shorter.

The exception is the KVM async page fault which is fairly common inside KVM guests, so is worth breaking out.

--

v2: Fix build errors found by 0day for some configurations.
v3: Finally use correct CONFIG symbol to check for KVM guest. Thanks 0day.

---
 arch/x86/hyperv/hv_init.c                |  3 ++
 arch/x86/include/asm/trace/irq_vectors.h |  9 ++++++
 arch/x86/kernel/apic/vector.c            |  3 ++
 arch/x86/kernel/cpu/mce/core.c           |  3 ++
 arch/x86/kernel/irq.c                    |  6 ++++
 arch/x86/kernel/kvm.c                    |  5 +++
 arch/x86/kernel/traps.c                  | 40 +++++++++++++++++++-----
 7 files changed, 61 insertions(+), 8 deletions(-)
arch/x86/hyperv/hv_init.c +3 -0
index 2db3972c0e0f..d97e570e37b6 100644
@@ -21,6 +21,7 @@
 #include <linux/slab.h>
 #include <linux/cpuhotplug.h>
 #include <clocksource/hyperv_timer.h>
+#include <asm/trace/irq_vectors.h>
 
 void *hv_hypercall_pg;
 EXPORT_SYMBOL_GPL(hv_hypercall_pg);
@@ -144,8 +145,10 @@ __visible void __irq_entry hyperv_reenlightenment_intr(struct pt_regs *regs)
 
 	inc_irq_stat(irq_hv_reenlightenment_count);
 
+	trace_other_vector_entry(HYPERV_REENLIGHTENMENT_VECTOR);
 	schedule_delayed_work(&hv_reenlightenment_work, HZ/10);
 
+	trace_other_vector_exit(HYPERV_REENLIGHTENMENT_VECTOR);
 	exiting_irq();
 }
 
arch/x86/include/asm/trace/irq_vectors.h +9 -0
index 33b9d0f0aafe..58f1a8432a8e 100644
@@ -71,6 +71,11 @@ DEFINE_IRQ_VECTOR_EVENT(error_apic);
  */
 DEFINE_IRQ_VECTOR_EVENT(x86_platform_ipi);
 
+/*
+ * Handle all other vectors.
+ */
+DEFINE_IRQ_VECTOR_EVENT(other_vector);
+
 #ifdef CONFIG_IRQ_WORK
 /*
  * irq_work - called when entering/exiting a irq work interrupt
@@ -138,6 +143,10 @@ DEFINE_IRQ_VECTOR_EVENT(deferred_error_apic);
 DEFINE_IRQ_VECTOR_EVENT(thermal_apic);
 #endif
 
+#ifdef CONFIG_KVM_GUEST
+DEFINE_IRQ_VECTOR_EVENT(async_page_fault);
+#endif
+
 TRACE_EVENT(vector_config,
 
 	TP_PROTO(unsigned int irq, unsigned int vector,
arch/x86/kernel/apic/vector.c +3 -0
index 2c5676b0a6e7..2e883f38b895 100644
@@ -860,6 +860,7 @@ asmlinkage __visible void __irq_entry smp_irq_move_cleanup_interrupt(void)
 	struct hlist_node *tmp;
 
 	entering_ack_irq();
+	trace_other_vector_entry(IRQ_MOVE_CLEANUP_VECTOR);
 	/* Prevent vectors vanishing under us */
 	raw_spin_lock(&vector_lock);
 
@@ -884,6 +885,8 @@ asmlinkage __visible void __irq_entry smp_irq_move_cleanup_interrupt(void)
 	}
 
 	raw_spin_unlock(&vector_lock);
+	trace_other_vector_exit(IRQ_MOVE_CLEANUP_VECTOR);
+	/* Prevent vectors vanishing under us */
 	exiting_irq();
 }
 
arch/x86/kernel/cpu/mce/core.c +3 -0
index 743370ee4983..f593bd6b0ed7 100644
@@ -61,6 +61,9 @@ static DEFINE_MUTEX(mce_sysfs_mutex);
 #define CREATE_TRACE_POINTS
 #include <trace/events/mce.h>
 
+#undef CREATE_TRACE_POINTS
+#include <asm/trace/irq_vectors.h>
+
 #define SPINUNIT		100	/* 100ns */
 
 DEFINE_PER_CPU(unsigned, mce_exception_count);
arch/x86/kernel/irq.c +6 -0
index 21efee32e2b1..f57c148dc578 100644
@@ -308,8 +308,10 @@ __visible void smp_kvm_posted_intr_ipi(struct pt_regs *regs)
 	struct pt_regs *old_regs = set_irq_regs(regs);
 
 	entering_ack_irq();
+	trace_other_vector_entry(POSTED_INTR_VECTOR);
 	inc_irq_stat(kvm_posted_intr_ipis);
 	exiting_irq();
+	trace_other_vector_exit(POSTED_INTR_VECTOR);
 	set_irq_regs(old_regs);
 }
 
@@ -321,8 +323,10 @@ __visible void smp_kvm_posted_intr_wakeup_ipi(struct pt_regs *regs)
 	struct pt_regs *old_regs = set_irq_regs(regs);
 
 	entering_ack_irq();
+	trace_other_vector_entry(POSTED_INTR_WAKEUP_VECTOR);
 	inc_irq_stat(kvm_posted_intr_wakeup_ipis);
 	kvm_posted_intr_wakeup_handler();
+	trace_other_vector_exit(POSTED_INTR_WAKEUP_VECTOR);
 	exiting_irq();
 	set_irq_regs(old_regs);
 }
@@ -335,7 +339,9 @@ __visible void smp_kvm_posted_intr_nested_ipi(struct pt_regs *regs)
 	struct pt_regs *old_regs = set_irq_regs(regs);
 
 	entering_ack_irq();
+	trace_other_vector_entry(POSTED_INTR_NESTED_VECTOR);
 	inc_irq_stat(kvm_posted_intr_nested_ipis);
+	trace_other_vector_exit(POSTED_INTR_NESTED_VECTOR);
 	exiting_irq();
 	set_irq_regs(old_regs);
 }
arch/x86/kernel/kvm.c +5 -0
index e820568ed4d5..8d915b559617 100644
@@ -33,6 +33,7 @@
 #include <asm/apicdef.h>
 #include <asm/hypervisor.h>
 #include <asm/tlb.h>
+#include <asm/trace/irq_vectors.h>
 
 static int kvmapf = 1;
 
@@ -246,6 +247,8 @@ do_async_page_fault(struct pt_regs *regs, unsigned long error_code, unsigned lon
 {
 	enum ctx_state prev_state;
 
+	trace_async_page_fault_entry(0);
+
 	switch (kvm_read_and_reset_pf_reason()) {
 	default:
 		do_page_fault(regs, error_code, address);
@@ -262,6 +265,8 @@ do_async_page_fault(struct pt_regs *regs, unsigned long error_code, unsigned lon
 		rcu_irq_exit();
 		break;
 	}
+
+	trace_async_page_fault_exit(0);
 }
 NOKPROBE_SYMBOL(do_async_page_fault);
 
arch/x86/kernel/traps.c +32 -8
index 4bb0f8447112..6ccc01d74747 100644
@@ -62,6 +62,8 @@
 #include <asm/vm86.h>
 #include <asm/umip.h>
 
+#include <asm/trace/irq_vectors.h>
+
 #ifdef CONFIG_X86_64
 #include <asm/x86_init.h>
 #include <asm/pgalloc.h>
@@ -264,19 +266,22 @@ static void do_error_trap(struct pt_regs *regs, long error_code, char *str,
 	unsigned long trapnr, int signr, int sicode, void __user *addr)
 {
 	RCU_LOCKDEP_WARN(!rcu_is_watching(), "entry code didn't wake RCU");
+	trace_other_vector_entry(trapnr);
 
 	/*
 	 * WARN*()s end up here; fix them up before we call the
 	 * notifier chain.
 	 */
 	if (!user_mode(regs) && fixup_bug(regs, trapnr))
-		return;
+		goto out;
 
 	if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) !=
 			NOTIFY_STOP) {
 		cond_local_irq_enable(regs);
 		do_trap(trapnr, signr, str, regs, error_code, sicode, addr);
 	}
+out:
+	trace_other_vector_exit(trapnr);
 }
 
 #define IP ((void __user *)uprobe_get_trap_addr(regs))
@@ -433,9 +438,10 @@ dotraplinkage void do_bounds(struct pt_regs *regs, long error_code)
 	const struct mpx_bndcsr *bndcsr;
 
 	RCU_LOCKDEP_WARN(!rcu_is_watching(), "entry code didn't wake RCU");
+	trace_other_vector_entry(X86_TRAP_BR);
 	if (notify_die(DIE_TRAP, "bounds", regs, error_code,
 			X86_TRAP_BR, SIGSEGV) == NOTIFY_STOP)
-		return;
+		goto exit;
 	cond_local_irq_enable(regs);
 
 	if (!user_mode(regs))
@@ -501,6 +507,8 @@ dotraplinkage void do_bounds(struct pt_regs *regs, long error_code)
 		die("bounds", regs, error_code);
 	}
 
+exit:
+	trace_other_vector_exit(X86_TRAP_BR);
 	return;
 
 exit_trap:
@@ -512,6 +520,7 @@ dotraplinkage void do_bounds(struct pt_regs *regs, long error_code)
 	 * time..
 	 */
 	do_trap(X86_TRAP_BR, SIGSEGV, "bounds", regs, error_code, 0, NULL);
+	goto exit;
 }
 
 dotraplinkage void
@@ -522,22 +531,23 @@ do_general_protection(struct pt_regs *regs, long error_code)
 
 	RCU_LOCKDEP_WARN(!rcu_is_watching(), "entry code didn't wake RCU");
 	cond_local_irq_enable(regs);
+	trace_other_vector_entry(X86_TRAP_GP);
 
 	if (static_cpu_has(X86_FEATURE_UMIP)) {
 		if (user_mode(regs) && fixup_umip_exception(regs))
-			return;
+			goto out;
 	}
 
 	if (v8086_mode(regs)) {
 		local_irq_enable();
 		handle_vm86_fault((struct kernel_vm86_regs *) regs, error_code);
-		return;
+		goto out;
 	}
 
 	tsk = current;
 	if (!user_mode(regs)) {
 		if (fixup_exception(regs, X86_TRAP_GP, error_code, 0))
-			return;
+			goto out;
 
 		tsk->thread.error_code = error_code;
 		tsk->thread.trap_nr = X86_TRAP_GP;
@@ -549,12 +559,12 @@ do_general_protection(struct pt_regs *regs, long error_code)
 		 */
 		if (!preemptible() && kprobe_running() &&
 		    kprobe_fault_handler(regs, X86_TRAP_GP))
-			return;
+			goto out;
 
 		if (notify_die(DIE_GPF, desc, regs, error_code,
 			       X86_TRAP_GP, SIGSEGV) != NOTIFY_STOP)
 			die(desc, regs, error_code);
-		return;
+		goto out;
 	}
 
 	tsk->thread.error_code = error_code;
@@ -563,6 +573,9 @@ do_general_protection(struct pt_regs *regs, long error_code)
 	show_signal(tsk, SIGSEGV, "", desc, regs, error_code);
 
 	force_sig(SIGSEGV);
+
+out:
+	trace_other_vector_exit(X86_TRAP_GP);
 }
 NOKPROBE_SYMBOL(do_general_protection);
 
@@ -588,6 +601,7 @@ dotraplinkage void notrace do_int3(struct pt_regs *regs, long error_code)
 	 * This means that we can't schedule.  That's okay.
 	 */
 	ist_enter(regs);
+	trace_other_vector_entry(X86_TRAP_BP);
 	RCU_LOCKDEP_WARN(!rcu_is_watching(), "entry code didn't wake RCU");
 #ifdef CONFIG_KGDB_LOW_LEVEL_TRAP
 	if (kgdb_ll_trap(DIE_INT3, "int3", regs, error_code, X86_TRAP_BP,
@@ -609,6 +623,7 @@ dotraplinkage void notrace do_int3(struct pt_regs *regs, long error_code)
 	cond_local_irq_disable(regs);
 
 exit:
+	trace_other_vector_exit(X86_TRAP_BP);
 	ist_exit(regs);
 }
 NOKPROBE_SYMBOL(do_int3);
@@ -714,6 +729,7 @@ dotraplinkage void do_debug(struct pt_regs *regs, long error_code)
 	int si_code;
 
 	ist_enter(regs);
+	trace_other_vector_entry(X86_TRAP_DB);
 
 	get_debugreg(dr6, 6);
 	/*
@@ -806,6 +822,7 @@ dotraplinkage void do_debug(struct pt_regs *regs, long error_code)
 	debug_stack_usage_dec();
 
 exit:
+	trace_other_vector_exit(X86_TRAP_DB);
 	ist_exit(regs);
 }
 NOKPROBE_SYMBOL(do_debug);
@@ -858,14 +875,18 @@ static void math_error(struct pt_regs *regs, int error_code, int trapnr)
 dotraplinkage void do_coprocessor_error(struct pt_regs *regs, long error_code)
 {
 	RCU_LOCKDEP_WARN(!rcu_is_watching(), "entry code didn't wake RCU");
+	trace_other_vector_entry(X86_TRAP_MF);
 	math_error(regs, error_code, X86_TRAP_MF);
+	trace_other_vector_exit(X86_TRAP_MF);
 }
 
 dotraplinkage void
 do_simd_coprocessor_error(struct pt_regs *regs, long error_code)
 {
 	RCU_LOCKDEP_WARN(!rcu_is_watching(), "entry code didn't wake RCU");
+	trace_other_vector_entry(X86_TRAP_XF);
 	math_error(regs, error_code, X86_TRAP_XF);
+	trace_other_vector_exit(X86_TRAP_XF);
 }
 
 dotraplinkage void
@@ -881,6 +902,7 @@ do_device_not_available(struct pt_regs *regs, long error_code)
 
 	RCU_LOCKDEP_WARN(!rcu_is_watching(), "entry code didn't wake RCU");
 
+	trace_other_vector_entry(X86_TRAP_NM);
 #ifdef CONFIG_MATH_EMULATION
 	if (!boot_cpu_has(X86_FEATURE_FPU) && (cr0 & X86_CR0_EM)) {
 		struct math_emu_info info = { };
@@ -889,7 +911,7 @@ do_device_not_available(struct pt_regs *regs, long error_code)
 
 		info.regs = regs;
 		math_emulate(&info);
-		return;
+		goto out;
 	}
 #endif
 
@@ -905,6 +927,8 @@ do_device_not_available(struct pt_regs *regs, long error_code)
 		 */
 		die("unexpected #NM exception", regs, error_code);
 	}
+out: __maybe_unused;
+	trace_other_vector_exit(X86_TRAP_NM);
 }
 NOKPROBE_SYMBOL(do_device_not_available);
 
Signature · 1 line
2.21.0
#1 lore raw
Thank you for the patch! Yet something to improve:

Hi Andi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on tip/auto-latest]
[also build test ERROR on v5.4-rc5 next-20191031]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Andi-Kleen/x86-Add-trace-points-to-nearly-all-vectors/20191102-063457
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git a5b576bfb3ba85d3e356f9900dce1428d4760582
config: i386-tinyconfig (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

If you fix the issue, kindly add following tag

All errors (new ones prefixed by >>):

arch/x86/kernel/traps.c: In function 'do_error_trap':

>> arch/x86/kernel/traps.c:264:2: error: implicit declaration of function 'trace_other_vector_entry'; did you mean 'frame_vector_destroy'? [-Werror=implicit-function-declaration]
     trace_other_vector_entry(trapnr);
     ^~~~~~~~~~~~~~~~~~~~~~~~
     frame_vector_destroy
>> arch/x86/kernel/traps.c:279:2: error: implicit declaration of function 'trace_other_vector_exit'; did you mean 'trace_hardirq_exit'? [-Werror=implicit-function-declaration]
     trace_other_vector_exit(trapnr);
     ^~~~~~~~~~~~~~~~~~~~~~~
     trace_hardirq_exit
   cc1: some warnings being treated as errors
--
   arch/x86/kernel/irq.c: In function 'smp_kvm_posted_intr_ipi':
>> arch/x86/kernel/irq.c:311:2: error: implicit declaration of function 'trace_other_vector_entry'; did you mean 'frame_vector_destroy'? [-Werror=implicit-function-declaration]
     trace_other_vector_entry(POSTED_INTR_VECTOR);
     ^~~~~~~~~~~~~~~~~~~~~~~~
     frame_vector_destroy
>> arch/x86/kernel/irq.c:314:2: error: implicit declaration of function 'trace_other_vector_exit'; did you mean 'trace_hardirq_exit'? [-Werror=implicit-function-declaration]
     trace_other_vector_exit(POSTED_INTR_VECTOR);
     ^~~~~~~~~~~~~~~~~~~~~~~
     trace_hardirq_exit

cc1: some warnings being treated as errors

vim +264 arch/x86/kernel/traps.c

259
260 static void do_error_trap(struct pt_regs *regs, long error_code, char *str,
261 unsigned long trapnr, int signr, int sicode, void __user *addr)
262 {
263 RCU_LOCKDEP_WARN(!rcu_is_watching(), "entry code didn't wake RCU");

 > 264		trace_other_vector_entry(trapnr);
   265	
   266		/*
   267		 * WARN*()s end up here; fix them up before we call the
   268		 * notifier chain.
   269		 */
   270		if (!user_mode(regs) && fixup_bug(regs, trapnr))
   271			goto out;
   272	
   273		if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) !=
   274				NOTIFY_STOP) {
   275			cond_local_irq_enable(regs);
   276			do_trap(trapnr, signr, str, regs, error_code, sicode, addr);
   277		}
   278	out:
 > 279		trace_other_vector_exit(trapnr);

280 }
281

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#2 lore raw
Quoted 19 lines · kbuild test robot

Hi Andi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on tip/auto-latest]
[also build test ERROR on v5.4-rc5 next-20191031]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Andi-Kleen/x86-Add-trace-points-to-nearly-all-vectors/20191102-063457
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git a5b576bfb3ba85d3e356f9900dce1428d4760582
config: i386-tinyconfig (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

If you fix the issue, kindly add following tag

Quoted 8 lines

All errors (new ones prefixed by >>):

arch/x86/kernel/traps.c: In function 'do_error_trap':

Quoted 1 line
Quoted 1 line

arch/x86/kernel/traps.c:264:2: error: implicit declaration of function 'trace_other_vector_entry'; did you mean 'frame_vector_destroy'? [-Werror=implicit-function-declaration]

     trace_other_vector_entry(trapnr);
     ^~~~~~~~~~~~~~~~~~~~~~~~

Also cannot reproduce and the config file seems to be not matching the kernel.

The file has the correct include:

vi +60 arch/x86/kernel/traps.c

...
60 #include <asm/trace/irq_vectors.h>

-Andi

#3 lore raw
Quoted 29 lines · Andi Kleen
Quoted 19 lines · kbuild test robot

Hi Andi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on tip/auto-latest]
[also build test ERROR on v5.4-rc5 next-20191031]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Andi-Kleen/x86-Add-trace-points-to-nearly-all-vectors/20191102-063457
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git a5b576bfb3ba85d3e356f9900dce1428d4760582
config: i386-tinyconfig (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
         # save the attached .config to linux build tree
         make ARCH=i386

If you fix the issue, kindly add following tag

Quoted 8 lines

All errors (new ones prefixed by >>):

arch/x86/kernel/traps.c: In function 'do_error_trap':

Quoted 1 line
Quoted 1 line

arch/x86/kernel/traps.c:264:2: error: implicit declaration of function 'trace_other_vector_entry'; did you mean 'frame_vector_destroy'? [-Werror=implicit-function-declaration]

      trace_other_vector_entry(trapnr);
      ^~~~~~~~~~~~~~~~~~~~~~~~
Quoted 9 lines

Also cannot reproduce and the config file seems to be not matching the kernel.

The file has the correct include:

vi +60 arch/x86/kernel/traps.c

...
60 #include <asm/trace/irq_vectors.h>

Hi Andi,

I think it's a kconfig issue, CONFIG_X86_LOCAL_APIC  is necessary according to your patch,
but i386-tinyconfig doesn't contain it.

arch/x86/include/asm/trace/irq_vectors.h:

 11 #ifdef CONFIG_X86_LOCAL_APIC

Best Regards,
Rong Chen

#4 lore raw
In reply to Andi Kleen
Thank you for the patch! Yet something to improve:

Hi Andi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on tip/auto-latest]
[also build test ERROR on v5.4-rc5 next-20191031]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Andi-Kleen/x86-Add-trace-points-to-nearly-all-vectors/20191102-063457
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git a5b576bfb3ba85d3e356f9900dce1428d4760582
config: i386-randconfig-b001-201943 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

If you fix the issue, kindly add following tag

All errors (new ones prefixed by >>):

arch/x86//kernel/kvm.c: In function 'do_async_page_fault':

>> arch/x86//kernel/kvm.c:250:2: error: implicit declaration of function 'trace_async_page_fault_entry'; did you mean 'do_async_page_fault'? [-Werror=implicit-function-declaration]
     trace_async_page_fault_entry(0);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
     do_async_page_fault
>> arch/x86//kernel/kvm.c:269:2: error: implicit declaration of function 'trace_async_page_fault_exit'; did you mean 'do_async_page_fault'? [-Werror=implicit-function-declaration]
     trace_async_page_fault_exit(0);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
     do_async_page_fault

cc1: some warnings being treated as errors

vim +250 arch/x86//kernel/kvm.c

244
245 dotraplinkage void
246 do_async_page_fault(struct pt_regs *regs, unsigned long error_code, unsigned long address)
247 {
248 enum ctx_state prev_state;
249

 > 250		trace_async_page_fault_entry(0);
   251	
   252		switch (kvm_read_and_reset_pf_reason()) {
   253		default:
   254			do_page_fault(regs, error_code, address);
   255			break;
   256		case KVM_PV_REASON_PAGE_NOT_PRESENT:
   257			/* page is swapped out by the host. */
   258			prev_state = exception_enter();
   259			kvm_async_pf_task_wait((u32)address, !user_mode(regs));
   260			exception_exit(prev_state);
   261			break;
   262		case KVM_PV_REASON_PAGE_READY:
   263			rcu_irq_enter();
   264			kvm_async_pf_task_wake((u32)address);
   265			rcu_irq_exit();
   266			break;
   267		}
   268	
 > 269		trace_async_page_fault_exit(0);

270 }
271 NOKPROBE_SYMBOL(do_async_page_fault);
272

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#5 lore raw
Quoted 3 lines · kbuild test robot

Hi Andi,

Thank you for the patch! Yet something to improve:

I cannot reproduce this.

And the file clearly has an include for the trace file, so I can't see what could be wrong.

Quoted 3 lines

[auto build test ERROR on tip/auto-latest]
[also build test ERROR on v5.4-rc5 next-20191031]

Also the config the bot sent doesn't even match next-20191031 nor tip/auto-latest

$ git log --oneline
5be9e3ebd480 (HEAD) x86: Add trace points to (nearly) all vectors
49afce6d47fe (tag: next-20191031, next/master) Add linux-next specific files for 20191031
$ zcat ~/submit/0day2.config.gz > .config
$ make oldconfig
  GEN     Makefile
scripts/kconfig/conf  --oldconfig Kconfig
*
* Restart config...
*
*
* CPU/Task time and stats accounting
*
Cputime accounting
Quoted 1 line

1. Simple tick based cputime accounting (TICK_CPU_ACCOUNTING)

2. Full dynticks CPU time accounting (VIRT_CPU_ACCOUNTING_GEN) (NEW)
choice[1-2?]:
...

and lots more of those.

If i press return it compiles fine.

Quoted 3 lines

[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

My patch was against Linus master, but it should work against all of those

-Andi

#6 lore raw
Quoted 7 lines · Andi Kleen
Quoted 3 lines · kbuild test robot

Hi Andi,

Thank you for the patch! Yet something to improve:

I cannot reproduce this.

Quoted 8 lines

And the file clearly has an include for the trace file, so I can't see what could be wrong.

Quoted 3 lines

[auto build test ERROR on tip/auto-latest]
[also build test ERROR on v5.4-rc5 next-20191031]

Also the config the bot sent doesn't even match next-20191031 nor tip/auto-latest

Never mind -- the config works with make ARCH=i386

Helps when you read the message completely :-)

-Andi