Skip to content

Commit 7275acd

Browse files
Marc ZyngierGleb Natapov
authored andcommitted
ARM: KVM: move GIC/timer code to a common location
As KVM/arm64 is looming on the horizon, it makes sense to move some of the common code to a single location in order to reduce duplication. The code could live anywhere. Actually, most of KVM is already built with a bunch of ugly ../../.. hacks in the various Makefiles, so we're not exactly talking about style here. But maybe it is time to start moving into a less ugly direction. The include files must be in a "public" location, as they are accessed from non-KVM files (arch/arm/kernel/asm-offsets.c). For this purpose, introduce two new locations: - virt/kvm/arm/ : x86 and ia64 already share the ioapic code in virt/kvm, so this could be seen as a (very ugly) precedent. - include/kvm/ : there is already an include/xen, and while the intent is slightly different, this seems as good a location as any Eventually, we should probably have independant Makefiles at every levels (just like everywhere else in the kernel), but this is just the first step. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Gleb Natapov <gleb@redhat.com>
1 parent 35af577 commit 7275acd

6 files changed

Lines changed: 8 additions & 7 deletions

File tree

‎arch/arm/include/asm/kvm_host.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <asm/kvm_asm.h>
2424
#include <asm/kvm_mmio.h>
2525
#include <asm/fpstate.h>
26-
#include <asm/kvm_arch_timer.h>
26+
#include <kvm/arm_arch_timer.h>
2727

2828
#define KVM_MAX_VCPUS CONFIG_KVM_ARM_MAX_VCPUS
2929
#define KVM_USER_MEM_SLOTS 32
@@ -38,7 +38,7 @@
3838
#define KVM_NR_PAGE_SIZES 1
3939
#define KVM_PAGES_PER_HPAGE(x) (1UL<<31)
4040

41-
#include <asm/kvm_vgic.h>
41+
#include <kvm/arm_vgic.h>
4242

4343
struct kvm_vcpu;
4444
u32 *kvm_vcpu_reg(struct kvm_vcpu *vcpu, u8 reg_num, u32 mode);

‎arch/arm/kvm/Makefile‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ CFLAGS_mmu.o := -I.
1414
AFLAGS_init.o := -Wa,-march=armv7-a$(plus_virt)
1515
AFLAGS_interrupts.o := -Wa,-march=armv7-a$(plus_virt)
1616

17-
kvm-arm-y = $(addprefix ../../../virt/kvm/, kvm_main.o coalesced_mmio.o)
17+
KVM := ../../../virt/kvm
18+
kvm-arm-y = $(addprefix $(KVM)/, kvm_main.o coalesced_mmio.o)
1819

1920
obj-y += kvm-arm.o init.o interrupts.o
2021
obj-y += arm.o handle_exit.o guest.o mmu.o emulate.o reset.o
2122
obj-y += coproc.o coproc_a15.o mmio.o psci.o perf.o
22-
obj-$(CONFIG_KVM_ARM_VGIC) += vgic.o
23-
obj-$(CONFIG_KVM_ARM_TIMER) += arch_timer.o
23+
obj-$(CONFIG_KVM_ARM_VGIC) += $(KVM)/arm/vgic.o
24+
obj-$(CONFIG_KVM_ARM_TIMER) += $(KVM)/arm/arch_timer.o
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
#include <clocksource/arm_arch_timer.h>
2626
#include <asm/arch_timer.h>
2727

28-
#include <asm/kvm_vgic.h>
29-
#include <asm/kvm_arch_timer.h>
28+
#include <kvm/arm_vgic.h>
29+
#include <kvm/arm_arch_timer.h>
3030

3131
static struct timecounter *timecounter;
3232
static struct workqueue_struct *wqueue;
File renamed without changes.

0 commit comments

Comments
 (0)