KVM: arm/arm64: Move shared files to virt/kvm/arm
Subsystems (4)
PATCH 1/1 KVM: arm/arm64: Move shared files to virt/kvm/arm
For some time now we have been having a lot of shared functionality between the arm and arm64 KVM support in arch/arm, which not only required a horrible inter-arch reference from the Makefile in arch/arm64/kvm, but also created confusion for newcomers to the code base, as was recently seen on the mailing list.
Further, it causes confusion for things like cscope, which needs special attention to index specific shared files for arm64 from the arm tree.
Move the shared files into virt/kvm/arm and move the trace points along with it. When moving the tracepoints we have to modify the way the vgic creates definitions of the trace points, so we take the chance to include the VGIC tracepoints in its very own special vgic trace.h file.
---
Hi Marc,
What do you think of this? If you like it, I think we should include it for this merge window.
Thanks,
-Christoffer
arch/arm/kvm/Makefile | 7 +-
arch/arm/kvm/trace.h | 247 ----------------------------------
arch/arm64/kvm/Makefile | 5 +-
{arch/arm/kvm => virt/kvm/arm}/arm.c | 0
{arch/arm/kvm => virt/kvm/arm}/mmio.c | 0
{arch/arm/kvm => virt/kvm/arm}/mmu.c | 0
{arch/arm/kvm => virt/kvm/arm}/perf.c | 0
{arch/arm/kvm => virt/kvm/arm}/psci.c | 0
virt/kvm/arm/trace.h | 246 +++++++++++++++++++++++++++++++--
virt/kvm/arm/vgic/trace.h | 37 +++++
virt/kvm/arm/vgic/vgic.c | 2 +-
11 files changed, 280 insertions(+), 264 deletions(-)
rename {arch/arm/kvm => virt/kvm/arm}/arm.c (100%)
rename {arch/arm/kvm => virt/kvm/arm}/mmio.c (100%)
rename {arch/arm/kvm => virt/kvm/arm}/mmu.c (100%)
rename {arch/arm/kvm => virt/kvm/arm}/perf.c (100%)
rename {arch/arm/kvm => virt/kvm/arm}/psci.c (100%)
create mode 100644 virt/kvm/arm/vgic/trace.harch/arm/kvm/Makefile +5 -2
@@ -18,9 +18,12 @@ KVM := ../../../virt/kvm kvm-arm-y = $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o $(KVM)/eventfd.o $(KVM)/vfio.o obj-$(CONFIG_KVM_ARM_HOST) += hyp/ + obj-y += kvm-arm.o init.o interrupts.o -obj-y += arm.o handle_exit.o guest.o mmu.o emulate.o reset.o -obj-y += coproc.o coproc_a15.o coproc_a7.o mmio.o psci.o perf.o vgic-v3-coproc.o +obj-y += handle_exit.o guest.o emulate.o reset.o +obj-y += coproc.o coproc_a15.o coproc_a7.o vgic-v3-coproc.o +obj-y += $(KVM)/arm/arm.o $(KVM)/arm/mmu.o $(KVM)/arm/mmio.o +obj-y += $(KVM)/arm/psci.o $(KVM)/arm/perf.o obj-y += $(KVM)/arm/aarch32.o obj-y += $(KVM)/arm/vgic/vgic.o
arch/arm/kvm/trace.h +0 -247
265 lines not on this page · raw message
arch/arm64/kvm/Makefile +2 -3
@@ -7,14 +7,13 @@ CFLAGS_arm.o := -I. CFLAGS_mmu.o := -I. KVM=../../../virt/kvm -ARM=../../../arch/arm/kvm obj-$(CONFIG_KVM_ARM_HOST) += kvm.o obj-$(CONFIG_KVM_ARM_HOST) += hyp/ kvm-$(CONFIG_KVM_ARM_HOST) += $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o $(KVM)/eventfd.o $(KVM)/vfio.o -kvm-$(CONFIG_KVM_ARM_HOST) += $(ARM)/arm.o $(ARM)/mmu.o $(ARM)/mmio.o -kvm-$(CONFIG_KVM_ARM_HOST) += $(ARM)/psci.o $(ARM)/perf.o +kvm-$(CONFIG_KVM_ARM_HOST) += $(KVM)/arm/arm.o $(KVM)/arm/mmu.o $(KVM)/arm/mmio.o +kvm-$(CONFIG_KVM_ARM_HOST) += $(KVM)/arm/psci.o $(KVM)/arm/perf.o kvm-$(CONFIG_KVM_ARM_HOST) += inject_fault.o regmap.o kvm-$(CONFIG_KVM_ARM_HOST) += hyp.o hyp-init.o handle_exit.o
virt/kvm/arm/arm.c renamed from arch/arm/kvm/arm.c +0 -0
virt/kvm/arm/mmio.c renamed from arch/arm/kvm/mmio.c +0 -0
virt/kvm/arm/mmu.c renamed from arch/arm/kvm/mmu.c +0 -0
virt/kvm/arm/perf.c renamed from arch/arm/kvm/perf.c +0 -0
virt/kvm/arm/psci.c renamed from arch/arm/kvm/psci.c +0 -0
virt/kvm/arm/trace.h +235 -11
261 lines not on this page · raw message
virt/kvm/arm/vgic/trace.h new file +37 -0
@@ -0,0 +1,37 @@ +#if !defined(_TRACE_VGIC_H) || defined(TRACE_HEADER_MULTI_READ ) +#define _TRACE_VGIC_H + +#include <linux/tracepoint.h> + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM kvm + +TRACE_EVENT (vgic_update_irq_pending, + TP_PROTO(unsigned long vcpu_id, __u32 irq, bool level), +TP_ARGS (vcpu_id, irq, level), + +TP_STRUCT__entry ( + __field( unsigned long, vcpu_id ) + __field( __u32, irq ) +__field ( bool, level ) + ), + +TP_fast_assign ( + __entry->vcpu_id = vcpu_id; + __entry->irq = irq; + __entry->level = level; + ), + +TP_printk ("VCPU: %ld, IRQ %d, level: %d" , + __entry->vcpu_id, __entry->irq, __entry->level) +); + +#endif /* _TRACE_VGIC_H */ + +#undef TRACE_INCLUDE_PATH +#define TRACE_INCLUDE_PATH ../../../virt/kvm/arm/vgic +#undef TRACE_INCLUDE_FILE +#define TRACE_INCLUDE_FILE trace + +/* This part must be outside protection */ +#include <trace/define_trace.h>
virt/kvm/arm/vgic/vgic.c +1 -1
@@ -21,7 +21,7 @@#include "vgic.h" #define CREATE_TRACE_POINTS -#include "../trace.h" +#include "trace.h" #ifdef CONFIG_DEBUG_SPINLOCK #define DEBUG_SPINLOCK_BUG_ON (p) BUG_ON(p)
Signature · 1 line
2.9.0
Quoted 14 lines · Christoffer Dall
For some time now we have been having a lot of shared functionality between the arm and arm64 KVM support in
arch/arm, which not only required a horrible inter-arch reference from theMakefileinarch/arm64/kvm, but also created confusion for newcomers to the code base, as was recently seen on the mailing list.Further, it causes confusion for things like cscope, which needs special attention to index specific shared files for arm64 from the arm tree.
Move the shared files into
virt/kvm/armand move the trace points along with it. When moving the tracepoints we have to modify the way the vgic creates definitions of the trace points, so we take the chance to include the VGIC tracepoints in its very own special vgictrace.hfile.
Quoted 6 lines
Signed-off-by Christoffer Dall <[email protected]>---
Hi Marc,What do you think of this? If you like it, I think we should include it for this merge window.
I think we should have done that a while ago!
M.
Signature · 1 line
Jazz is not dead. It just smells funny...
Quoted 8 lines · Christoffer Dall
For some time now we have been having a lot of shared functionality between the arm and arm64 KVM support in
arch/arm, which not only required a horrible inter-arch reference from theMakefileinarch/arm64/kvm, but also created confusion for newcomers to the code base, as was recently seen on the mailing list.Further, it causes confusion for things like cscope, which needs special attention to index specific shared files for arm64 from the arm tree.
I'll probably still want the same cscope alias[*] to ensure I don't miss ARM code when writing patches, but anyway, YAY to this patch!
[*] alias cs_arm64="make ALLSOURCE_ARCHS='arm64 arm' cscope"
Quoted 26 lines
Move the shared files into
virt/kvm/armand move the trace points along with it. When moving the tracepoints we have to modify the way the vgic creates definitions of the trace points, so we take the chance to include the VGIC tracepoints in its very own special vgictrace.hfile.Signed-off-by Christoffer Dall <[email protected]>---
Hi Marc,What do you think of this? If you like it, I think we should include it for this merge window.
Thanks,
-Christofferarch/arm/kvm/Makefile | 7 +- arch/arm/kvm/trace.h | 247 ---------------------------------- arch/arm64/kvm/Makefile | 5 +- {arch/arm/kvm => virt/kvm/arm}/arm.c | 0 {arch/arm/kvm => virt/kvm/arm}/mmio.c | 0 {arch/arm/kvm => virt/kvm/arm}/mmu.c | 0 {arch/arm/kvm => virt/kvm/arm}/perf.c | 0 {arch/arm/kvm => virt/kvm/arm}/psci.c | 0 virt/kvm/arm/trace.h | 246 +++++++++++++++++++++++++++++++-- virt/kvm/arm/vgic/trace.h | 37 +++++
Quoted 9 lines
virt/kvm/arm/vgic/vgic.c | 2 +-
11 files changed, 280 insertions(+), 264 deletions(-)
rename {arch/arm/kvm => virt/kvm/arm}/arm.c (100%)
rename {arch/arm/kvm => virt/kvm/arm}/mmio.c (100%)
rename {arch/arm/kvm => virt/kvm/arm}/mmu.c (100%)
rename {arch/arm/kvm => virt/kvm/arm}/perf.c (100%)
rename {arch/arm/kvm => virt/kvm/arm}/psci.c (100%)
create mode 100644 virt/kvm/arm/vgic/trace.hPaolo Bonzini
maintainerQuoted 14 lines · Christoffer Dall
For some time now we have been having a lot of shared functionality between the arm and arm64 KVM support in
arch/arm, which not only required a horrible inter-arch reference from theMakefileinarch/arm64/kvm, but also created confusion for newcomers to the code base, as was recently seen on the mailing list.Further, it causes confusion for things like cscope, which needs special attention to index specific shared files for arm64 from the arm tree.
Move the shared files into
virt/kvm/armand move the trace points along with it. When moving the tracepoints we have to modify the way the vgic creates definitions of the trace points, so we take the chance to include the VGIC tracepoints in its very own special vgictrace.hfile.
Quoted 6 lines
Signed-off-by Christoffer Dall <[email protected]>---
Hi Marc,What do you think of this? If you like it, I think we should include it for this merge window.
Certainly no objection from me, in fact this should not be a problem even after -rc1.
Paolo