From patchwork Thu Nov 10 01:05:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver Upton X-Patchwork-Id: 13038192 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8D134C4332F for ; Thu, 10 Nov 2022 01:07:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=+MYuVF/CuhUoIzLlXbeIRipgKiyoOUOcoOLnUvTY6RY=; b=Z4Egplrb+EuFRW 9O20+sNOoabSi2ELf7e2plyWULOimE4iQlb0IPzyQjWnMmslhxSD7cXmcfAd7H2Iw5eSGGvBozD55 8FadgMpZOv8bwznDG6lzbtPcwTXTYbUXuXu5VXiAY8L3y86YHwO1dMfkBVDnLaWSg4HUznKQgQJ4/ jVSqfUfEtSliJyVDWonCrrcf3gFbSXysq+xuTLYRMGedsxlC/Zvu3Cd7fzVyyYVHd/6UUiXlfSf3Y eJsuGpR/7UIvQGDXuyM4A15O4RrGoSRgjW0kb5u28Hfsq8Yxxr8j6OPY4nPwbILeT8CEhMH6ss3pX 7VVZp1CeezYIh3HDhxaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1osw1N-001ewp-Gb; Thu, 10 Nov 2022 01:06:21 +0000 Received: from out2.migadu.com ([2001:41d0:2:aacc::]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1osw1I-001ew5-Qq for linux-arm-kernel@lists.infradead.org; Thu, 10 Nov 2022 01:06:19 +0000 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1668042371; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=eZILFSaz86K3PCTmubRu/Ja27ewYZKXSfl7+aUl2EoU=; b=qyhF2ZdqbbmUNk6arPBPQ485kemkFB/KXq0j/XGDaM23JdUw51d0aPnQG8LVMqmzlFGz9K naWFDEgXTw4gC36CQ3Qu9Cap8eXX0V776UyG0iQpRG25JG9jVWl4V5oCi1F8ygOx92Avnr TaanTuuMJBNyyVMk7o/jg3r9JiQfMLw= From: Oliver Upton To: Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , Oliver Upton , Catalin Marinas , Will Deacon Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu Subject: [RESEND PATCH] KVM: arm64: Move arch-specific headers out of include/kvm/ Date: Thu, 10 Nov 2022 01:05:59 +0000 Message-Id: <20221110010603.3382385-1-oliver.upton@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221109_170617_347245_D6081812 X-CRM114-Status: GOOD ( 15.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- The one time I forget to run checkpatch.pl I left the stupid Gerrit Change-Id in the commit message... 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 diff --git a/MAINTAINERS b/MAINTAINERS index 379945f82a64..f7742e89e7b5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -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/ diff --git a/include/kvm/arm_arch_timer.h b/arch/arm64/include/asm/kvm_arch_timer.h similarity index 96% rename from include/kvm/arm_arch_timer.h rename to arch/arm64/include/asm/kvm_arch_timer.h index cd6d8f260eab..8982845a59d8 100644 --- a/include/kvm/arm_arch_timer.h +++ b/arch/arm64/include/asm/kvm_arch_timer.h @@ -4,11 +4,12 @@ * Author: Marc Zyngier */ -#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 #include +#include enum kvm_arch_timers { TIMER_PTIMER, diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index 45e2136322ba..e33ed7c09a28 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -25,16 +25,15 @@ #include #include #include +#include #include +#include +#include #define __KVM_HAVE_ARCH_INTC_INITIALIZED #define KVM_HALT_POLL_NS_DEFAULT 500000 -#include -#include -#include - #define KVM_MAX_VCPUS VGIC_V3_MAX_CPUS #define KVM_VCPU_MAX_FEATURES 7 diff --git a/include/kvm/arm_hypercalls.h b/arch/arm64/include/asm/kvm_hypercalls.h similarity index 94% rename from include/kvm/arm_hypercalls.h rename to arch/arm64/include/asm/kvm_hypercalls.h index 1188f116cf4e..dfebe8dd8dcd 100644 --- a/include/kvm/arm_hypercalls.h +++ b/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 diff --git a/include/kvm/arm_pmu.h b/arch/arm64/include/asm/kvm_pmu.h similarity index 98% rename from include/kvm/arm_pmu.h rename to arch/arm64/include/asm/kvm_pmu.h index c0b868ce6a8f..04a1a1565d4a 100644 --- a/include/kvm/arm_pmu.h +++ b/arch/arm64/include/asm/kvm_pmu.h @@ -4,9 +4,10 @@ * Author: Shannon Zhao */ -#ifndef __ASM_ARM_KVM_PMU_H -#define __ASM_ARM_KVM_PMU_H +#ifndef __ARM64_KVM_PMU_H +#define __ARM64_KVM_PMU_H +#include #include #include diff --git a/include/kvm/arm_psci.h b/arch/arm64/include/asm/kvm_psci.h similarity index 91% rename from include/kvm/arm_psci.h rename to arch/arm64/include/asm/kvm_psci.h index 6e55b9283789..befec38c572a 100644 --- a/include/kvm/arm_psci.h +++ b/arch/arm64/include/asm/kvm_psci.h @@ -4,8 +4,8 @@ * Author: Marc Zyngier */ -#ifndef __KVM_ARM_PSCI_H__ -#define __KVM_ARM_PSCI_H__ +#ifndef __ARM64_KVM_PSCI_H__ +#define __ARM64_KVM_PSCI_H__ #include #include @@ -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__ */ diff --git a/include/kvm/arm_vgic.h b/arch/arm64/include/asm/kvm_vgic.h similarity index 99% rename from include/kvm/arm_vgic.h rename to arch/arm64/include/asm/kvm_vgic.h index 4df9e73a8bb5..2a261ca9f8ea 100644 --- a/include/kvm/arm_vgic.h +++ b/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 #include diff --git a/arch/arm64/kvm/arch_timer.c b/arch/arm64/kvm/arch_timer.c index bb24a76b4224..f99430a48e0e 100644 --- a/arch/arm64/kvm/arch_timer.c +++ b/arch/arm64/kvm/arch_timer.c @@ -14,11 +14,10 @@ #include #include +#include #include #include - -#include -#include +#include #include "trace.h" diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index 94d33e296e10..6f0b56e7f8c7 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -36,14 +36,13 @@ #include #include #include -#include #include +#include +#include +#include +#include #include -#include -#include -#include - static enum kvm_mode kvm_mode = KVM_MODE_DEFAULT; DEFINE_STATIC_KEY_FALSE(kvm_protected_mode_initialized); diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c index 2ff13a3f8479..f60d7886df03 100644 --- a/arch/arm64/kvm/guest.c +++ b/arch/arm64/kvm/guest.c @@ -18,12 +18,12 @@ #include #include #include -#include #include #include #include #include #include +#include #include #include "trace.h" diff --git a/arch/arm64/kvm/handle_exit.c b/arch/arm64/kvm/handle_exit.c index e778eefcf214..cdfd7aef385e 100644 --- a/arch/arm64/kvm/handle_exit.c +++ b/arch/arm64/kvm/handle_exit.c @@ -15,13 +15,12 @@ #include #include #include +#include #include #include #include #include -#include - #define CREATE_TRACE_POINTS #include "trace_handle_exit.h" diff --git a/arch/arm64/kvm/hyp/include/hyp/switch.h b/arch/arm64/kvm/hyp/include/hyp/switch.h index 6cbbb6c02f66..d033fc531ada 100644 --- a/arch/arm64/kvm/hyp/include/hyp/switch.h +++ b/arch/arm64/kvm/hyp/include/hyp/switch.h @@ -16,8 +16,6 @@ #include #include -#include - #include #include #include @@ -26,6 +24,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/arm64/kvm/hyp/nvhe/switch.c b/arch/arm64/kvm/hyp/nvhe/switch.c index 8e9d49a964be..02a4f5d10de5 100644 --- a/arch/arm64/kvm/hyp/nvhe/switch.c +++ b/arch/arm64/kvm/hyp/nvhe/switch.c @@ -13,8 +13,6 @@ #include #include -#include - #include #include #include @@ -22,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/arm64/kvm/hyp/vhe/switch.c b/arch/arm64/kvm/hyp/vhe/switch.c index 7acb87eaa092..fe3db6a1cbac 100644 --- a/arch/arm64/kvm/hyp/vhe/switch.c +++ b/arch/arm64/kvm/hyp/vhe/switch.c @@ -13,8 +13,6 @@ #include #include -#include - #include #include #include @@ -22,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/arm64/kvm/hypercalls.c b/arch/arm64/kvm/hypercalls.c index c9f401fa01a9..6804075ce57f 100644 --- a/arch/arm64/kvm/hypercalls.c +++ b/arch/arm64/kvm/hypercalls.c @@ -5,9 +5,8 @@ #include #include - -#include -#include +#include +#include #define KVM_ARM_SMCCC_STD_FEATURES \ GENMASK(KVM_REG_ARM_STD_BMAP_BIT_COUNT - 1, 0) diff --git a/arch/arm64/kvm/irq.h b/arch/arm64/kvm/irq.h index 0d257de42c10..e79301e48938 100644 --- a/arch/arm64/kvm/irq.h +++ b/arch/arm64/kvm/irq.h @@ -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 +#include #endif diff --git a/arch/arm64/kvm/pmu-emul.c b/arch/arm64/kvm/pmu-emul.c index 0003c7d37533..c370ffe41076 100644 --- a/arch/arm64/kvm/pmu-emul.c +++ b/arch/arm64/kvm/pmu-emul.c @@ -12,8 +12,8 @@ #include #include #include -#include -#include +#include +#include DEFINE_STATIC_KEY_FALSE(kvm_arm_pmu_available); diff --git a/arch/arm64/kvm/psci.c b/arch/arm64/kvm/psci.c index 7fbc4c1b9df0..809710808b25 100644 --- a/arch/arm64/kvm/psci.c +++ b/arch/arm64/kvm/psci.c @@ -12,9 +12,8 @@ #include #include - -#include -#include +#include +#include /* * This is an implementation of the Power State Coordination Interface diff --git a/arch/arm64/kvm/pvtime.c b/arch/arm64/kvm/pvtime.c index 78a09f7a6637..614b2e70b815 100644 --- a/arch/arm64/kvm/pvtime.c +++ b/arch/arm64/kvm/pvtime.c @@ -5,11 +5,10 @@ #include #include +#include #include #include -#include - void kvm_update_stolen_time(struct kvm_vcpu *vcpu) { struct kvm *kvm = vcpu->kvm; diff --git a/arch/arm64/kvm/reset.c b/arch/arm64/kvm/reset.c index 5ae18472205a..86321c968de7 100644 --- a/arch/arm64/kvm/reset.c +++ b/arch/arm64/kvm/reset.c @@ -17,12 +17,11 @@ #include #include -#include - #include #include #include #include +#include #include #include #include diff --git a/arch/arm64/kvm/trace_arm.h b/arch/arm64/kvm/trace_arm.h index 33e4e7dd2719..a4028b46f22f 100644 --- a/arch/arm64/kvm/trace_arm.h +++ b/arch/arm64/kvm/trace_arm.h @@ -2,7 +2,7 @@ #if !defined(_TRACE_ARM_ARM64_KVM_H) || defined(TRACE_HEADER_MULTI_READ) #define _TRACE_ARM_ARM64_KVM_H -#include +#include #include #undef TRACE_SYSTEM diff --git a/arch/arm64/kvm/trng.c b/arch/arm64/kvm/trng.c index 99bdd7103c9c..b257d4eace50 100644 --- a/arch/arm64/kvm/trng.c +++ b/arch/arm64/kvm/trng.c @@ -4,10 +4,9 @@ #include #include +#include #include -#include - #define ARM_SMCCC_TRNG_VERSION_1_0 0x10000UL /* Those values are deliberately separate from the generic SMCCC definitions. */ diff --git a/arch/arm64/kvm/vgic/vgic-debug.c b/arch/arm64/kvm/vgic/vgic-debug.c index 78cde687383c..a75d423b6c2e 100644 --- a/arch/arm64/kvm/vgic/vgic-debug.c +++ b/arch/arm64/kvm/vgic/vgic-debug.c @@ -9,8 +9,8 @@ #include #include #include -#include #include +#include #include "vgic.h" /* diff --git a/arch/arm64/kvm/vgic/vgic-init.c b/arch/arm64/kvm/vgic/vgic-init.c index f6d4f4052555..7adc0beae769 100644 --- a/arch/arm64/kvm/vgic/vgic-init.c +++ b/arch/arm64/kvm/vgic/vgic-init.c @@ -7,9 +7,9 @@ #include #include #include -#include #include #include +#include #include "vgic.h" /* diff --git a/arch/arm64/kvm/vgic/vgic-irqfd.c b/arch/arm64/kvm/vgic/vgic-irqfd.c index 475059bacedf..c2005f85a614 100644 --- a/arch/arm64/kvm/vgic/vgic-irqfd.c +++ b/arch/arm64/kvm/vgic/vgic-irqfd.c @@ -5,8 +5,8 @@ #include #include +#include #include -#include #include "vgic.h" /** diff --git a/arch/arm64/kvm/vgic/vgic-kvm-device.c b/arch/arm64/kvm/vgic/vgic-kvm-device.c index edeac2380591..3d628f4916f3 100644 --- a/arch/arm64/kvm/vgic/vgic-kvm-device.c +++ b/arch/arm64/kvm/vgic/vgic-kvm-device.c @@ -6,7 +6,7 @@ * Author: Marc Zyngier */ #include -#include +#include #include #include #include diff --git a/arch/arm64/kvm/vgic/vgic-mmio-v2.c b/arch/arm64/kvm/vgic/vgic-mmio-v2.c index e070cda86e12..682a5a86c512 100644 --- a/arch/arm64/kvm/vgic/vgic-mmio-v2.c +++ b/arch/arm64/kvm/vgic/vgic-mmio-v2.c @@ -7,9 +7,9 @@ #include #include #include +#include #include -#include #include "vgic.h" #include "vgic-mmio.h" diff --git a/arch/arm64/kvm/vgic/vgic-mmio-v3.c b/arch/arm64/kvm/vgic/vgic-mmio-v3.c index 91201f743033..96a2a3460c3f 100644 --- a/arch/arm64/kvm/vgic/vgic-mmio-v3.c +++ b/arch/arm64/kvm/vgic/vgic-mmio-v3.c @@ -8,8 +8,8 @@ #include #include #include +#include #include -#include #include #include diff --git a/arch/arm64/kvm/vgic/vgic-mmio.c b/arch/arm64/kvm/vgic/vgic-mmio.c index b32d434c1d4a..046a65485ce9 100644 --- a/arch/arm64/kvm/vgic/vgic-mmio.c +++ b/arch/arm64/kvm/vgic/vgic-mmio.c @@ -9,9 +9,9 @@ #include #include #include +#include +#include #include -#include -#include #include "vgic.h" #include "vgic-mmio.h" diff --git a/arch/arm64/kvm/vgic/vgic-v2.c b/arch/arm64/kvm/vgic/vgic-v2.c index 645648349c99..2a803be83b4b 100644 --- a/arch/arm64/kvm/vgic/vgic-v2.c +++ b/arch/arm64/kvm/vgic/vgic-v2.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include "vgic.h" diff --git a/arch/arm64/kvm/vgic/vgic-v3.c b/arch/arm64/kvm/vgic/vgic-v3.c index 826ff6f2a4e7..f904447fc740 100644 --- a/arch/arm64/kvm/vgic/vgic-v3.c +++ b/arch/arm64/kvm/vgic/vgic-v3.c @@ -5,10 +5,10 @@ #include #include #include -#include +#include #include #include -#include +#include #include "vgic.h"