@@ -11218,7 +11218,6 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git
F: arch/arm64/include/asm/kvm*
F: arch/arm64/include/uapi/asm/kvm*
F: arch/arm64/kvm/
-F: include/kvm/arm_*
F: tools/testing/selftests/kvm/*/aarch64/
F: tools/testing/selftests/kvm/aarch64/
similarity index 96%
rename from include/kvm/arm_arch_timer.h
rename to arch/arm64/include/asm/kvm_arch_timer.h
@@ -4,11 +4,12 @@
* Author: Marc Zyngier <marc.zyngier@arm.com>
*/
-#ifndef __ASM_ARM_KVM_ARCH_TIMER_H
-#define __ASM_ARM_KVM_ARCH_TIMER_H
+#ifndef __ARM64_KVM_ARCH_TIMER_H
+#define __ARM64_KVM_ARCH_TIMER_H
#include <linux/clocksource.h>
#include <linux/hrtimer.h>
+#include <linux/kvm.h>
enum kvm_arch_timers {
TIMER_PTIMER,
@@ -25,16 +25,15 @@
#include <asm/daifflags.h>
#include <asm/fpsimd.h>
#include <asm/kvm.h>
+#include <asm/kvm_arch_timer.h>
#include <asm/kvm_asm.h>
+#include <asm/kvm_pmu.h>
+#include <asm/kvm_vgic.h>
#define __KVM_HAVE_ARCH_INTC_INITIALIZED
#define KVM_HALT_POLL_NS_DEFAULT 500000
-#include <kvm/arm_vgic.h>
-#include <kvm/arm_arch_timer.h>
-#include <kvm/arm_pmu.h>
-
#define KVM_MAX_VCPUS VGIC_V3_MAX_CPUS
#define KVM_VCPU_MAX_FEATURES 7
similarity index 94%
rename from include/kvm/arm_hypercalls.h
rename to arch/arm64/include/asm/kvm_hypercalls.h
@@ -1,8 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (C) 2019 Arm Ltd. */
-#ifndef __KVM_ARM_HYPERCALLS_H
-#define __KVM_ARM_HYPERCALLS_H
+#ifndef __ARM64_KVM_HYPERCALLS_H
+#define __ARM64_KVM_HYPERCALLS_H
#include <asm/kvm_emulate.h>
similarity index 98%
rename from include/kvm/arm_pmu.h
rename to arch/arm64/include/asm/kvm_pmu.h
@@ -4,9 +4,10 @@
* Author: Shannon Zhao <shannon.zhao@linaro.org>
*/
-#ifndef __ASM_ARM_KVM_PMU_H
-#define __ASM_ARM_KVM_PMU_H
+#ifndef __ARM64_KVM_PMU_H
+#define __ARM64_KVM_PMU_H
+#include <linux/kvm.h>
#include <linux/perf_event.h>
#include <asm/perf_event.h>
similarity index 91%
rename from include/kvm/arm_psci.h
rename to arch/arm64/include/asm/kvm_psci.h
@@ -4,8 +4,8 @@
* Author: Marc Zyngier <marc.zyngier@arm.com>
*/
-#ifndef __KVM_ARM_PSCI_H__
-#define __KVM_ARM_PSCI_H__
+#ifndef __ARM64_KVM_PSCI_H__
+#define __ARM64_KVM_PSCI_H__
#include <linux/kvm_host.h>
#include <uapi/linux/psci.h>
@@ -39,4 +39,4 @@ static inline int kvm_psci_version(struct kvm_vcpu *vcpu)
int kvm_psci_call(struct kvm_vcpu *vcpu);
-#endif /* __KVM_ARM_PSCI_H__ */
+#endif /* __ARM64_KVM_PSCI_H__ */
similarity index 99%
rename from include/kvm/arm_vgic.h
rename to arch/arm64/include/asm/kvm_vgic.h
@@ -2,8 +2,8 @@
/*
* Copyright (C) 2015, 2016 ARM Ltd.
*/
-#ifndef __KVM_ARM_VGIC_H
-#define __KVM_ARM_VGIC_H
+#ifndef __ARM64_KVM_VGIC_H
+#define __ARM64_KVM_VGIC_H
#include <linux/bits.h>
#include <linux/kvm.h>
@@ -14,11 +14,10 @@
#include <clocksource/arm_arch_timer.h>
#include <asm/arch_timer.h>
+#include <asm/kvm_arch_timer.h>
#include <asm/kvm_emulate.h>
#include <asm/kvm_hyp.h>
-
-#include <kvm/arm_vgic.h>
-#include <kvm/arm_arch_timer.h>
+#include <asm/kvm_vgic.h>
#include "trace.h"
@@ -36,14 +36,13 @@
#include <asm/virt.h>
#include <asm/kvm_arm.h>
#include <asm/kvm_asm.h>
-#include <asm/kvm_mmu.h>
#include <asm/kvm_emulate.h>
+#include <asm/kvm_hypercalls.h>
+#include <asm/kvm_mmu.h>
+#include <asm/kvm_pmu.h>
+#include <asm/kvm_psci.h>
#include <asm/sections.h>
-#include <kvm/arm_hypercalls.h>
-#include <kvm/arm_pmu.h>
-#include <kvm/arm_psci.h>
-
static enum kvm_mode kvm_mode = KVM_MODE_DEFAULT;
DEFINE_STATIC_KEY_FALSE(kvm_protected_mode_initialized);
@@ -18,12 +18,12 @@
#include <linux/string.h>
#include <linux/vmalloc.h>
#include <linux/fs.h>
-#include <kvm/arm_hypercalls.h>
#include <asm/cputype.h>
#include <linux/uaccess.h>
#include <asm/fpsimd.h>
#include <asm/kvm.h>
#include <asm/kvm_emulate.h>
+#include <asm/kvm_hypercalls.h>
#include <asm/sigcontext.h>
#include "trace.h"
@@ -15,13 +15,12 @@
#include <asm/exception.h>
#include <asm/kvm_asm.h>
#include <asm/kvm_emulate.h>
+#include <asm/kvm_hypercalls.h>
#include <asm/kvm_mmu.h>
#include <asm/debug-monitors.h>
#include <asm/stacktrace/nvhe.h>
#include <asm/traps.h>
-#include <kvm/arm_hypercalls.h>
-
#define CREATE_TRACE_POINTS
#include "trace_handle_exit.h"
@@ -16,8 +16,6 @@
#include <linux/jump_label.h>
#include <uapi/linux/psci.h>
-#include <kvm/arm_psci.h>
-
#include <asm/barrier.h>
#include <asm/cpufeature.h>
#include <asm/extable.h>
@@ -26,6 +24,7 @@
#include <asm/kvm_emulate.h>
#include <asm/kvm_hyp.h>
#include <asm/kvm_mmu.h>
+#include <asm/kvm_psci.h>
#include <asm/fpsimd.h>
#include <asm/debug-monitors.h>
#include <asm/processor.h>
@@ -13,8 +13,6 @@
#include <linux/jump_label.h>
#include <uapi/linux/psci.h>
-#include <kvm/arm_psci.h>
-
#include <asm/barrier.h>
#include <asm/cpufeature.h>
#include <asm/kprobes.h>
@@ -22,6 +20,7 @@
#include <asm/kvm_emulate.h>
#include <asm/kvm_hyp.h>
#include <asm/kvm_mmu.h>
+#include <asm/kvm_psci.h>
#include <asm/fpsimd.h>
#include <asm/debug-monitors.h>
#include <asm/processor.h>
@@ -13,8 +13,6 @@
#include <linux/percpu.h>
#include <uapi/linux/psci.h>
-#include <kvm/arm_psci.h>
-
#include <asm/barrier.h>
#include <asm/cpufeature.h>
#include <asm/kprobes.h>
@@ -22,6 +20,7 @@
#include <asm/kvm_emulate.h>
#include <asm/kvm_hyp.h>
#include <asm/kvm_mmu.h>
+#include <asm/kvm_psci.h>
#include <asm/fpsimd.h>
#include <asm/debug-monitors.h>
#include <asm/processor.h>
@@ -5,9 +5,8 @@
#include <linux/kvm_host.h>
#include <asm/kvm_emulate.h>
-
-#include <kvm/arm_hypercalls.h>
-#include <kvm/arm_psci.h>
+#include <asm/kvm_hypercalls.h>
+#include <asm/kvm_psci.h>
#define KVM_ARM_SMCCC_STD_FEATURES \
GENMASK(KVM_REG_ARM_STD_BMAP_BIT_COUNT - 1, 0)
@@ -3,14 +3,13 @@
* irq.h: in kernel interrupt controller related definitions
* Copyright (c) 2016 Red Hat, Inc.
*
- * This header is included by irqchip.c. However, on ARM, interrupt
- * controller declarations are located in include/kvm/arm_vgic.h since
- * they are mostly shared between arm and arm64.
+ * This header is included by irqchip.c. However, on arm64, interrupt
+ * controller declarations are located in arch/arm64/include/asm/kvm_vgic.h
*/
#ifndef __IRQ_H
#define __IRQ_H
-#include <kvm/arm_vgic.h>
+#include <asm/kvm_vgic.h>
#endif
@@ -12,8 +12,8 @@
#include <linux/perf/arm_pmu.h>
#include <linux/uaccess.h>
#include <asm/kvm_emulate.h>
-#include <kvm/arm_pmu.h>
-#include <kvm/arm_vgic.h>
+#include <asm/kvm_pmu.h>
+#include <asm/kvm_vgic.h>
DEFINE_STATIC_KEY_FALSE(kvm_arm_pmu_available);
@@ -12,9 +12,8 @@
#include <asm/cputype.h>
#include <asm/kvm_emulate.h>
-
-#include <kvm/arm_psci.h>
-#include <kvm/arm_hypercalls.h>
+#include <asm/kvm_hypercalls.h>
+#include <asm/kvm_psci.h>
/*
* This is an implementation of the Power State Coordination Interface
@@ -5,11 +5,10 @@
#include <linux/kvm_host.h>
#include <linux/sched/stat.h>
+#include <asm/kvm_hypercalls.h>
#include <asm/kvm_mmu.h>
#include <asm/pvclock-abi.h>
-#include <kvm/arm_hypercalls.h>
-
void kvm_update_stolen_time(struct kvm_vcpu *vcpu)
{
struct kvm *kvm = vcpu->kvm;
@@ -17,12 +17,11 @@
#include <linux/string.h>
#include <linux/types.h>
-#include <kvm/arm_arch_timer.h>
-
#include <asm/cpufeature.h>
#include <asm/cputype.h>
#include <asm/fpsimd.h>
#include <asm/ptrace.h>
+#include <asm/kvm_arch_timer.h>
#include <asm/kvm_arm.h>
#include <asm/kvm_asm.h>
#include <asm/kvm_emulate.h>
@@ -2,7 +2,7 @@
#if !defined(_TRACE_ARM_ARM64_KVM_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_ARM_ARM64_KVM_H
-#include <kvm/arm_arch_timer.h>
+#include <asm/kvm_arch_timer.h>
#include <linux/tracepoint.h>
#undef TRACE_SYSTEM
@@ -4,10 +4,9 @@
#include <linux/arm-smccc.h>
#include <linux/kvm_host.h>
+#include <asm/kvm_hypercalls.h>
#include <asm/kvm_emulate.h>
-#include <kvm/arm_hypercalls.h>
-
#define ARM_SMCCC_TRNG_VERSION_1_0 0x10000UL
/* Those values are deliberately separate from the generic SMCCC definitions. */
@@ -9,8 +9,8 @@
#include <linux/interrupt.h>
#include <linux/kvm_host.h>
#include <linux/seq_file.h>
-#include <kvm/arm_vgic.h>
#include <asm/kvm_mmu.h>
+#include <asm/kvm_vgic.h>
#include "vgic.h"
/*
@@ -7,9 +7,9 @@
#include <linux/interrupt.h>
#include <linux/cpu.h>
#include <linux/kvm_host.h>
-#include <kvm/arm_vgic.h>
#include <asm/kvm_emulate.h>
#include <asm/kvm_mmu.h>
+#include <asm/kvm_vgic.h>
#include "vgic.h"
/*
@@ -5,8 +5,8 @@
#include <linux/kvm.h>
#include <linux/kvm_host.h>
+#include <asm/kvm_vgic.h>
#include <trace/events/kvm.h>
-#include <kvm/arm_vgic.h>
#include "vgic.h"
/**
@@ -6,7 +6,7 @@
* Author: Marc Zyngier <marc.zyngier@arm.com>
*/
#include <linux/kvm_host.h>
-#include <kvm/arm_vgic.h>
+#include <asm/kvm_vgic.h>
#include <linux/uaccess.h>
#include <asm/kvm_mmu.h>
#include <asm/cputype.h>
@@ -7,9 +7,9 @@
#include <linux/kvm.h>
#include <linux/kvm_host.h>
#include <linux/nospec.h>
+#include <asm/kvm_vgic.h>
#include <kvm/iodev.h>
-#include <kvm/arm_vgic.h>
#include "vgic.h"
#include "vgic-mmio.h"
@@ -8,8 +8,8 @@
#include <linux/kvm.h>
#include <linux/kvm_host.h>
#include <linux/interrupt.h>
+#include <asm/kvm_vgic.h>
#include <kvm/iodev.h>
-#include <kvm/arm_vgic.h>
#include <asm/kvm_emulate.h>
#include <asm/kvm_arm.h>
@@ -9,9 +9,9 @@
#include <linux/irq.h>
#include <linux/kvm.h>
#include <linux/kvm_host.h>
+#include <asm/kvm_arch_timer.h>
+#include <asm/kvm_vgic.h>
#include <kvm/iodev.h>
-#include <kvm/arm_arch_timer.h>
-#include <kvm/arm_vgic.h>
#include "vgic.h"
#include "vgic-mmio.h"
@@ -6,7 +6,7 @@
#include <linux/irqchip/arm-gic.h>
#include <linux/kvm.h>
#include <linux/kvm_host.h>
-#include <kvm/arm_vgic.h>
+#include <asm/kvm_vgic.h>
#include <asm/kvm_mmu.h>
#include "vgic.h"
@@ -5,10 +5,10 @@
#include <linux/irqdomain.h>
#include <linux/kvm.h>
#include <linux/kvm_host.h>
-#include <kvm/arm_vgic.h>
+#include <asm/kvm_asm.h>
#include <asm/kvm_hyp.h>
#include <asm/kvm_mmu.h>
-#include <asm/kvm_asm.h>
+#include <asm/kvm_vgic.h>
#include "vgic.h"
Long ago in a galaxy far, far away, KVM was supported on both 32 bit and 64 bit arm architectures. A considerable portion of the code was shared between these architectures, hence some headers needed to live in an arch-generic path. KVM/arm64 is the only supported arm KVM port now. Sweep some remaining residue into the arch-specific include path. No functional change intended. Signed-off-by: Oliver Upton <oliver.upton@linux.dev> Change-Id: Iec1caf5a426fba5003abff2dc7f814e0ba398e00 --- MAINTAINERS | 1 - .../arm64/include/asm/kvm_arch_timer.h | 5 +++-- arch/arm64/include/asm/kvm_host.h | 7 +++---- .../arm64/include/asm/kvm_hypercalls.h | 4 ++-- .../kvm/arm_pmu.h => arch/arm64/include/asm/kvm_pmu.h | 5 +++-- .../kvm/arm_psci.h => arch/arm64/include/asm/kvm_psci.h | 6 +++--- .../kvm/arm_vgic.h => arch/arm64/include/asm/kvm_vgic.h | 4 ++-- arch/arm64/kvm/arch_timer.c | 5 ++--- arch/arm64/kvm/arm.c | 9 ++++----- arch/arm64/kvm/guest.c | 2 +- arch/arm64/kvm/handle_exit.c | 3 +-- arch/arm64/kvm/hyp/include/hyp/switch.h | 3 +-- arch/arm64/kvm/hyp/nvhe/switch.c | 3 +-- arch/arm64/kvm/hyp/vhe/switch.c | 3 +-- arch/arm64/kvm/hypercalls.c | 5 ++--- arch/arm64/kvm/irq.h | 7 +++---- arch/arm64/kvm/pmu-emul.c | 4 ++-- arch/arm64/kvm/psci.c | 5 ++--- arch/arm64/kvm/pvtime.c | 3 +-- arch/arm64/kvm/reset.c | 3 +-- arch/arm64/kvm/trace_arm.h | 2 +- arch/arm64/kvm/trng.c | 3 +-- arch/arm64/kvm/vgic/vgic-debug.c | 2 +- arch/arm64/kvm/vgic/vgic-init.c | 2 +- arch/arm64/kvm/vgic/vgic-irqfd.c | 2 +- arch/arm64/kvm/vgic/vgic-kvm-device.c | 2 +- arch/arm64/kvm/vgic/vgic-mmio-v2.c | 2 +- arch/arm64/kvm/vgic/vgic-mmio-v3.c | 2 +- arch/arm64/kvm/vgic/vgic-mmio.c | 4 ++-- arch/arm64/kvm/vgic/vgic-v2.c | 2 +- arch/arm64/kvm/vgic/vgic-v3.c | 4 ++-- 31 files changed, 51 insertions(+), 63 deletions(-) rename include/kvm/arm_arch_timer.h => arch/arm64/include/asm/kvm_arch_timer.h (96%) rename include/kvm/arm_hypercalls.h => arch/arm64/include/asm/kvm_hypercalls.h (94%) rename include/kvm/arm_pmu.h => arch/arm64/include/asm/kvm_pmu.h (98%) rename include/kvm/arm_psci.h => arch/arm64/include/asm/kvm_psci.h (91%) rename include/kvm/arm_vgic.h => arch/arm64/include/asm/kvm_vgic.h (99%) base-commit: 30a0b95b1335e12efef89dd78518ed3e4a71a763