Skip to contentSkip to conversation

arm64/kvm: Fix duplicate tracepoint definitions after KVM consolidation

PATCH In review Will Deacon 2 participants 3 messages Apr 21, 2020 – Apr 22, 2020

Subsystems (2)
lore
Share & tools
lore

Will Deacon

author maintainer
#0 lore raw

PATCH 1/1 arm64/kvm: Fix duplicate tracepoint definitions after KVM consolidation

Both kvm/{arm,handle_exit}.c include trace.h and attempt to instantiate the same tracepoints, resulting in failures at link-time:

  | aarch64-linux-gnu-ld: arch/arm64/kvm/handle_exit.o:(__tracepoints+0x30):
  |   multiple definition of `__tracepoint_kvm_wfx_arm64';
  |   arch/arm64/kvm/arm.o:(__tracepoints+0x510): first defined here
  | ...

Split trace.h into two files so that the tracepoints are only created in the C files that use them.

---

Applies against kvm-arm64/welcome-home. Probably worth just folding in to the only commit on that branch.

 arch/arm64/kvm/arm.c               |   2 +-
 arch/arm64/kvm/handle_exit.c       |   2 +-
 arch/arm64/kvm/trace.h             | 575 +----------------------------
 arch/arm64/kvm/trace_arm.h         | 378 +++++++++++++++++++
 arch/arm64/kvm/trace_handle_exit.h | 215 +++++++++++
 5 files changed, 599 insertions(+), 573 deletions(-)
 create mode 100644 arch/arm64/kvm/trace_arm.h
 create mode 100644 arch/arm64/kvm/trace_handle_exit.h
arch/arm64/kvm/arm.c +1 -1
index 48d0ec44ad77..c958bb37b769 100644
@@ -22,7 +22,7 @@
 #include <trace/events/kvm.h>
 
 #define CREATE_TRACE_POINTS
-#include "trace.h"
+#include "trace_arm.h"
 
 #include <linux/uaccess.h>
 #include <asm/ptrace.h>
arch/arm64/kvm/handle_exit.c +1 -1
index aacfc55de44c..eb194696ef62 100644
@@ -23,7 +23,7 @@
 #include <kvm/arm_hypercalls.h>
 
 #define CREATE_TRACE_POINTS
-#include "trace.h"
+#include "trace_handle_exit.h"
 
 typedef int (*exit_handle_fn)(struct kvm_vcpu *, struct kvm_run *);
 
arch/arm64/kvm/trace.h +4 -571

579 lines not on this page · raw message

arch/arm64/kvm/trace_arm.h new file +378 -0

378 lines not on this page · raw message

arch/arm64/kvm/trace_handle_exit.h new file +215 -0

215 lines not on this page · raw message

Signature · 6 lines
2.26.1.301.g55bc3eb7cb9-goog

_______________________________________________
kvmarm mailing list
[email protected]
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
author maintainer
#1 lore raw
Quoted 11 lines · Will Deacon

Both kvm/{arm,handle_exit}.c include trace.h and attempt to instantiate the same tracepoints, resulting in failures at link-time:

  | aarch64-linux-gnu-ld: arch/arm64/kvm/handle_exit.o:(__tracepoints+0x30):
  |   multiple definition of `__tracepoint_kvm_wfx_arm64';
  |   arch/arm64/kvm/arm.o:(__tracepoints+0x510): first defined here
  | ...

Split trace.h into two files so that the tracepoints are only created in the C files that use them.

Quoted 6 lines

---

Applies against kvm-arm64/welcome-home. Probably worth just folding in to the only commit on that branch.

I also just noticed that you forgot to update MAINTAINERS after the move, so you can fold in the diff below as well.

Will

--->8

MAINTAINERS +0 -1
index e64e5db31497..7bff7e94a930 100644
@@ -9299,7 +9299,6 @@ F:	arch/arm64/include/asm/kvm*
 F:	arch/arm64/include/uapi/asm/kvm*
 F:	arch/arm64/kvm/
 F:	include/kvm/arm_*
-F:	virt/kvm/arm/
 
 KERNEL VIRTUAL MACHINE FOR MIPS (KVM/mips)
 L:	[email protected]

_______________________________________________
kvmarm mailing list
[email protected]
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

maintainer
#2 lore raw
Quoted 17 lines · Will Deacon
Quoted 16 lines · Will Deacon

Both kvm/{arm,handle_exit}.c include trace.h and attempt to instantiate the same tracepoints, resulting in failures at link-time:

| aarch64-linux-gnu-ld:
arch/arm64/kvm/handle_exit.o:(__tracepoints+0x30):

  |   multiple definition of `__tracepoint_kvm_wfx_arm64';
  |   arch/arm64/kvm/arm.o:(__tracepoints+0x510): first defined here
  | ...

Split trace.h into two files so that the tracepoints are only created in the C files that use them.

---

Quoted 5 lines
Quoted 2 lines

Applies against kvm-arm64/welcome-home. Probably worth just folding in to the only commit on that branch.

I also just noticed that you forgot to update MAINTAINERS after the move, so you can fold in the diff below as well.

All applied, squashed and pushed out.

Thanks,

        M.
Signature · 6 lines
Jazz is not dead. It just smells funny...

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel