Skip to contentSkip to conversation

arm: Drop support for 32-bit kvmtool

PATCH Superseded Oliver Upton 2 participants 11 messages Mar 25, 2025 – Mar 27, 2025

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover arm: Drop support for 32-bit kvmtool

The last stable kernel to support 32-bit KVM/arm is 5.4, which is on track for EOL at the end of this year. Considering this, and the fact that 32-bit KVM never saw much usage in the first place, it is probably time to toss out the coprolite.

Of course, this has no effect on the support for 32-bit guests on 64-bit KVM.

RFC: https://lore.kernel.org/kvmarm/[email protected]/

RFC -> v1:
- Collected Marc's Acks
- Cleaned up some forgotten references to CONFIG_ARM (Alex)
- Minor nits on includes, defines (Alex)

Oliver Upton (9):
Drop support for 32-bit arm
arm64: Move arm64-only features into main directory
arm64: Combine kvm.c
arm64: Merge kvm-cpu.c
arm64: Combine kvm-config-arch.h
arm64: Move remaining kvm/* headers
arm64: Move asm headers
arm64: Rename top-level directory
arm64: Get rid of the 'arm-common' include directory

 INSTALL                                       |   9 +-
 Makefile                                      |  40 +--
 arm/aarch32/arm-cpu.c                         |  50 ---
 arm/aarch32/include/asm/kernel.h              |   8 -
 arm/aarch32/include/asm/kvm.h                 | 311 ------------------
 arm/aarch32/include/kvm/barrier.h             |  10 -
 arm/aarch32/include/kvm/fdt-arch.h            |   6 -
 arm/aarch32/include/kvm/kvm-arch.h            |  18 -
 arm/aarch32/include/kvm/kvm-config-arch.h     |   8 -
 arm/aarch32/include/kvm/kvm-cpu-arch.h        |  24 --
 arm/aarch32/kvm-cpu.c                         | 132 --------
 arm/aarch32/kvm.c                             |  14 -
 arm/aarch64/include/kvm/fdt-arch.h            |   6 -
 arm/aarch64/include/kvm/kvm-arch.h            |  22 --
 arm/aarch64/include/kvm/kvm-config-arch.h     |  29 --
 arm/aarch64/include/kvm/kvm-cpu-arch.h        |  19 --
 arm/aarch64/kvm.c                             | 212 ------------
 arm/kvm-cpu.c                                 | 153 ---------
 {arm/aarch64 => arm64}/arm-cpu.c              |   4 +-
 {arm => arm64}/fdt.c                          |   4 +-
 {arm => arm64}/gic.c                          |   2 +-
 {arm => arm64}/gicv2m.c                       |   2 +-
 {arm/aarch64 => arm64}/include/asm/image.h    |   0
 {arm/aarch64 => arm64}/include/asm/kernel.h   |   0
 {arm/aarch64 => arm64}/include/asm/kvm.h      |   0
 {arm/aarch64 => arm64}/include/asm/pmu.h      |   0
 .../include/asm/sve_context.h                 |   0
 .../arm-common => arm64/include}/gic.h        |   0
 {arm/aarch64 => arm64}/include/kvm/barrier.h  |   0
 .../include/kvm}/fdt-arch.h                   |   0
 .../include/kvm}/kvm-arch.h                   |   8 +-
 .../include/kvm}/kvm-config-arch.h            |  24 +-
 .../include/kvm}/kvm-cpu-arch.h               |  10 +-
 .../arm-common => arm64/include}/pci.h        |   0
 .../arm-common => arm64/include}/timer.h      |   0
 {arm => arm64}/ioport.c                       |   0
 {arm/aarch64 => arm64}/kvm-cpu.c              | 289 ++++++++++++----
 {arm => arm64}/kvm.c                          | 209 +++++++++++-
 {arm => arm64}/pci.c                          |   4 +-
 {arm/aarch64 => arm64}/pmu.c                  |   2 +-
 {arm/aarch64 => arm64}/pvtime.c               |   0
 {arm => arm64}/timer.c                        |   4 +-
 builtin-run.c                                 |   2 +-
 hw/cfi_flash.c                                |   2 +-
 hw/rtc.c                                      |   2 +-
 hw/serial.c                                   |   2 +-
 virtio/core.c                                 |   2 +-
 47 files changed, 498 insertions(+), 1145 deletions(-)
 delete mode 100644 arm/aarch32/arm-cpu.c
 delete mode 100644 arm/aarch32/include/asm/kernel.h
 delete mode 100644 arm/aarch32/include/asm/kvm.h
 delete mode 100644 arm/aarch32/include/kvm/barrier.h
 delete mode 100644 arm/aarch32/include/kvm/fdt-arch.h
 delete mode 100644 arm/aarch32/include/kvm/kvm-arch.h
 delete mode 100644 arm/aarch32/include/kvm/kvm-config-arch.h
 delete mode 100644 arm/aarch32/include/kvm/kvm-cpu-arch.h
 delete mode 100644 arm/aarch32/kvm-cpu.c
 delete mode 100644 arm/aarch32/kvm.c
 delete mode 100644 arm/aarch64/include/kvm/fdt-arch.h
 delete mode 100644 arm/aarch64/include/kvm/kvm-arch.h
 delete mode 100644 arm/aarch64/include/kvm/kvm-config-arch.h
 delete mode 100644 arm/aarch64/include/kvm/kvm-cpu-arch.h
 delete mode 100644 arm/aarch64/kvm.c
 delete mode 100644 arm/kvm-cpu.c
 rename {arm/aarch64 => arm64}/arm-cpu.c (96%)
 rename {arm => arm64}/fdt.c (99%)
 rename {arm => arm64}/gic.c (99%)
 rename {arm => arm64}/gicv2m.c (99%)
 rename {arm/aarch64 => arm64}/include/asm/image.h (100%)
 rename {arm/aarch64 => arm64}/include/asm/kernel.h (100%)
 rename {arm/aarch64 => arm64}/include/asm/kvm.h (100%)
 rename {arm/aarch64 => arm64}/include/asm/pmu.h (100%)
 rename {arm/aarch64 => arm64}/include/asm/sve_context.h (100%)
 rename {arm/include/arm-common => arm64/include}/gic.h (100%)
 rename {arm/aarch64 => arm64}/include/kvm/barrier.h (100%)
 rename {arm/include/arm-common => arm64/include/kvm}/fdt-arch.h (100%)
 rename {arm/include/arm-common => arm64/include/kvm}/kvm-arch.h (96%)
 rename {arm/include/arm-common => arm64/include/kvm}/kvm-config-arch.h (54%)
 rename {arm/include/arm-common => arm64/include/kvm}/kvm-cpu-arch.h (82%)
 rename {arm/include/arm-common => arm64/include}/pci.h (100%)
 rename {arm/include/arm-common => arm64/include}/timer.h (100%)
 rename {arm => arm64}/ioport.c (100%)
 rename {arm/aarch64 => arm64}/kvm-cpu.c (70%)
 rename {arm => arm64}/kvm.c (59%)
 rename {arm => arm64}/pci.c (98%)
 rename {arm/aarch64 => arm64}/pmu.c (99%)
 rename {arm/aarch64 => arm64}/pvtime.c (100%)
 rename {arm => arm64}/timer.c (95%)

base-commit: e48563f5c4a48fe6a6bc2a98a9a7c84a10f043be

Signature · 1 line
2.39.5
#1 lore raw

PATCH 1/9 Drop support for 32-bit arm

Linux dropped support for KVM in 32-bit arm kernels almost 5 years ago in the 5.7 kernel release. In addition to that KVM/arm64 never had 32-bit compat support, so it is a safe assumption that usage of 32-bit kvmtool is pretty much dead at this point.

Do not despair -- 32-bit guests are still supported with a 64-bit userspace.

---
 INSTALL                                   |   9 +-
 Makefile                                  |  31 +--
 arm/aarch32/arm-cpu.c                     |  50 ----
 arm/aarch32/include/asm/kernel.h          |   8 -
 arm/aarch32/include/asm/kvm.h             | 311 ----------------------
 arm/aarch32/include/kvm/barrier.h         |  10 -
 arm/aarch32/include/kvm/fdt-arch.h        |   6 -
 arm/aarch32/include/kvm/kvm-arch.h        |  18 --
 arm/aarch32/include/kvm/kvm-config-arch.h |   8 -
 arm/aarch32/include/kvm/kvm-cpu-arch.h    |  24 --
 arm/aarch32/kvm-cpu.c                     | 132 ---------
 arm/aarch32/kvm.c                         |  14 -
 builtin-run.c                             |   2 +-
 hw/cfi_flash.c                            |   2 +-
 hw/rtc.c                                  |   2 +-
 hw/serial.c                               |   2 +-
 virtio/core.c                             |   2 +-
 17 files changed, 19 insertions(+), 612 deletions(-)
 delete mode 100644 arm/aarch32/arm-cpu.c
 delete mode 100644 arm/aarch32/include/asm/kernel.h
 delete mode 100644 arm/aarch32/include/asm/kvm.h
 delete mode 100644 arm/aarch32/include/kvm/barrier.h
 delete mode 100644 arm/aarch32/include/kvm/fdt-arch.h
 delete mode 100644 arm/aarch32/include/kvm/kvm-arch.h
 delete mode 100644 arm/aarch32/include/kvm/kvm-config-arch.h
 delete mode 100644 arm/aarch32/include/kvm/kvm-cpu-arch.h
 delete mode 100644 arm/aarch32/kvm-cpu.c
 delete mode 100644 arm/aarch32/kvm.c
INSTALL +4 -5
index 2a65735..0e1e63e 100644
@@ -26,7 +26,7 @@ For Fedora based systems:
 For OpenSUSE based systems:
 	# zypper install glibc-devel-static
 
-Architectures which require device tree (PowerPC, ARM, ARM64, RISC-V) also
+Architectures which require device tree (PowerPC, ARM64, RISC-V) also
 require libfdt.
 	deb: $ sudo apt-get install libfdt-dev
 	Fedora: # yum install libfdt-devel
@@ -61,16 +61,15 @@ to the Linux name of the architecture. Architectures supported:
 - i386
 - x86_64
 - powerpc
-- arm
 - arm64
 - mips
 - riscv
 If ARCH is not provided, the target architecture will be automatically
 determined by running "uname -m" on your host, resulting in a native build.
 
-To cross-compile to ARM for instance, install a cross-compiler, put the
+To cross-compile to arm64 for instance, install a cross-compiler, put the
 required libraries in the cross-compiler's SYSROOT and type:
-$ make CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm
+$ make CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64
 
 Missing libraries when cross-compiling
 ---------------------------------------
@@ -82,7 +81,7 @@ On multiarch system you should be able to install those be appending
 the architecture name after the package (example for ARM64):
 $ sudo apt-get install libfdt-dev:arm64
 
-PowerPC, ARM/ARM64 and RISC-V require libfdt to be installed. If you cannot use
+PowerPC, ARM64 and RISC-V require libfdt to be installed. If you cannot use
 precompiled mulitarch packages, you could either copy the required header and
 library files from an installed target system into the SYSROOT (you will need
 /usr/include/*fdt*.h and /usr/lib64/libfdt-v.v.v.so and its symlinks), or you
Makefile +10 -21
index d84dc8e..462659b 100644
@@ -166,35 +166,24 @@ ifeq ($(ARCH), powerpc)
 	ARCH_WANT_LIBFDT := y
 endif
 
-# ARM
-OBJS_ARM_COMMON		:= arm/fdt.o arm/gic.o arm/gicv2m.o arm/ioport.o \
-			   arm/kvm.o arm/kvm-cpu.o arm/pci.o arm/timer.o \
-			   hw/serial.o
-HDRS_ARM_COMMON		:= arm/include
-ifeq ($(ARCH), arm)
-	DEFINES		+= -DCONFIG_ARM
-	OBJS		+= $(OBJS_ARM_COMMON)
-	OBJS		+= arm/aarch32/arm-cpu.o
-	OBJS		+= arm/aarch32/kvm-cpu.o
-	OBJS		+= arm/aarch32/kvm.o
-	ARCH_INCLUDE	:= $(HDRS_ARM_COMMON)
-	ARCH_INCLUDE	+= -Iarm/aarch32/include
-	CFLAGS		+= -march=armv7-a
-
-	ARCH_WANT_LIBFDT := y
-	ARCH_HAS_FLASH_MEM := y
-endif
-
 # ARM64
 ifeq ($(ARCH), arm64)
 	DEFINES		+= -DCONFIG_ARM64
-	OBJS		+= $(OBJS_ARM_COMMON)
+	OBJS		+= arm/fdt.o
+	OBJS		+= arm/gic.o
+	OBJS		+= arm/gicv2m.o
+	OBJS		+= arm/ioport.o
+	OBJS		+= arm/kvm.o
+	OBJS		+= arm/kvm-cpu.o
+	OBJS		+= arm/pci.o
+	OBJS		+= arm/timer.o
+	OBJS		+= hw/serial.o
 	OBJS		+= arm/aarch64/arm-cpu.o
 	OBJS		+= arm/aarch64/kvm-cpu.o
 	OBJS		+= arm/aarch64/kvm.o
 	OBJS		+= arm/aarch64/pvtime.o
 	OBJS		+= arm/aarch64/pmu.o
-	ARCH_INCLUDE	:= $(HDRS_ARM_COMMON)
+	ARCH_INCLUDE	:= arm/include
 	ARCH_INCLUDE	+= -Iarm/aarch64/include
 
 	ARCH_WANT_LIBFDT := y
arm/aarch32/arm-cpu.c deleted +0 -50

50 lines not on this page · raw message

arm/aarch32/include/asm/kernel.h deleted +0 -8
deleted file mode 100644
index 6129609..0000000
@@ -1,8 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-
-#ifndef __ASM_KERNEL_H
-#define __ASM_KERNEL_H
-
-#define NR_CPUS	32
-
-#endif /* __ASM_KERNEL_H */
arm/aarch32/include/asm/kvm.h deleted +0 -311

311 lines not on this page · raw message

arm/aarch32/include/kvm/barrier.h deleted +0 -10
deleted file mode 100644
index 94913a9..0000000
@@ -1,10 +0,0 @@
-#ifndef KVM__KVM_BARRIER_H
-#define KVM__KVM_BARRIER_H
-
-#define dmb()	asm volatile ("dmb" : : : "memory")
-
-#define mb()	dmb()
-#define rmb()	dmb()
-#define wmb()	dmb()
-
-#endif /* KVM__KVM_BARRIER_H */
arm/aarch32/include/kvm/fdt-arch.h deleted +0 -6
deleted file mode 100644
index e448bf1..0000000
@@ -1,6 +0,0 @@
-#ifndef KVM__KVM_FDT_H
-#define KVM__KVM_FDT_H
-
-#include "arm-common/fdt-arch.h"
-
-#endif /* KVM__KVM_FDT_H */
arm/aarch32/include/kvm/kvm-arch.h deleted +0 -18
deleted file mode 100644
index 0333cf4..0000000
@@ -1,18 +0,0 @@
-#ifndef KVM__KVM_ARCH_H
-#define KVM__KVM_ARCH_H
-
-#include <linux/sizes.h>
-
-#define kvm__arch_get_kern_offset(...)		0x8000
-#define kvm__arch_get_kernel_size(...)		0
-#define kvm__arch_get_payload_region_size(...)	SZ_256M
-
-struct kvm;
-static inline void kvm__arch_read_kernel_header(struct kvm *kvm, int fd) {}
-static inline void kvm__arch_enable_mte(struct kvm *kvm) {}
-
-#define MAX_PAGE_SIZE	SZ_4K
-
-#include "arm-common/kvm-arch.h"
-
-#endif /* KVM__KVM_ARCH_H */
arm/aarch32/include/kvm/kvm-config-arch.h deleted +0 -8
deleted file mode 100644
index acf0d23..0000000
@@ -1,8 +0,0 @@
-#ifndef KVM__KVM_CONFIG_ARCH_H
-#define KVM__KVM_CONFIG_ARCH_H
-
-#define ARM_OPT_ARCH_RUN(...)
-
-#include "arm-common/kvm-config-arch.h"
-
-#endif /* KVM__KVM_CONFIG_ARCH_H */
arm/aarch32/include/kvm/kvm-cpu-arch.h deleted +0 -24
deleted file mode 100644
index fd0b387..0000000
@@ -1,24 +0,0 @@
-#ifndef KVM__KVM_CPU_ARCH_H
-#define KVM__KVM_CPU_ARCH_H
-
-#include "kvm/kvm.h"
-
-#include "arm-common/kvm-cpu-arch.h"
-
-#define ARM_MPIDR_HWID_BITMASK	0xFFFFFF
-#define ARM_CPU_ID		0, 0, 0
-#define ARM_CPU_ID_MPIDR	5
-
-static inline void kvm_cpu__select_features(struct kvm *kvm,
-					    struct kvm_vcpu_init *init) { }
-static inline int kvm_cpu__configure_features(struct kvm_cpu *vcpu)
-{
-	return 0;
-}
-
-static inline int kvm_cpu__teardown_pvtime(struct kvm *kvm)
-{
-	return 0;
-}
-
-#endif /* KVM__KVM_CPU_ARCH_H */
arm/aarch32/kvm-cpu.c deleted +0 -132

132 lines not on this page · raw message

arm/aarch32/kvm.c deleted +0 -14
deleted file mode 100644
index 768a56b..0000000
@@ -1,14 +0,0 @@
-#include "kvm/kvm.h"
-
-void kvm__arch_validate_cfg(struct kvm *kvm)
-{
-	if (kvm->cfg.ram_size > ARM_LOMAP_MAX_MEMORY) {
-		die("RAM size 0x%llx exceeds maximum allowed 0x%llx",
-		    kvm->cfg.ram_size, ARM_LOMAP_MAX_MEMORY);
-	}
-}
-
-u64 kvm__arch_default_ram_address(void)
-{
-	return ARM_MEMORY_AREA;
-}
builtin-run.c +1 -1
index 4b9a391..81f255f 100644
@@ -182,7 +182,7 @@ static int loglevel_parser(const struct option *opt, const char *arg, int unset)
 	" in megabytes (M)"
 #endif
 
-#if defined(CONFIG_ARM) || defined(CONFIG_ARM64) || defined(CONFIG_RISCV)
+#if defined(CONFIG_ARM64) || defined(CONFIG_RISCV)
 #define VIRTIO_TRANS_OPT_HELP_SHORT    "[pci|pci-legacy|mmio|mmio-legacy]"
 #else
 #define VIRTIO_TRANS_OPT_HELP_SHORT    "[pci|pci-legacy]"
hw/cfi_flash.c +1 -1
index 7faecdf..b68d9e0 100644
@@ -443,7 +443,7 @@ static void cfi_flash_write(struct cfi_flash_device *sfdev, u16 command,
  * If we are in ARRAY_READ mode, we can map the flash array directly
  * into the guest, just as read-only. This greatly improves read
  * performance, and avoids problems with exits due to accesses from
- * load instructions without syndrome information (on ARM).
+ * load instructions without syndrome information (on arm64).
  * Also it could allow code to be executed XIP in there.
  */
 static int map_flash_memory(struct kvm *kvm, struct cfi_flash_device *sfdev)
hw/rtc.c +1 -1
index da696e1..e3523a1 100644
@@ -6,7 +6,7 @@
 
 #include <time.h>
 
-#if defined(CONFIG_ARM) || defined(CONFIG_ARM64)
+#if defined(CONFIG_ARM64)
 #define RTC_BUS_TYPE		DEVICE_BUS_MMIO
 #define RTC_BASE_ADDRESS	ARM_RTC_MMIO_BASE
 #elif defined(CONFIG_RISCV)
hw/serial.c +1 -1
index b6263a0..68e6186 100644
@@ -13,7 +13,7 @@
 
 #include <pthread.h>
 
-#if defined(CONFIG_ARM) || defined(CONFIG_ARM64)
+#if defined(CONFIG_ARM64)
 #define serial_iobase(nr)	(ARM_UART_MMIO_BASE + (nr) * 0x1000)
 #define serial_irq(nr)		(32 + (nr))
 #define SERIAL8250_BUS_TYPE	DEVICE_BUS_MMIO
virtio/core.c +1 -1
index b77e987..50c9ddd 100644
@@ -31,7 +31,7 @@ int virtio_transport_parser(const struct option *opt, const char *arg, int unset
 			*type = VIRTIO_PCI;
 		} else if (!strcmp(arg, "pci-legacy")) {
 			*type = VIRTIO_PCI_LEGACY;
-#if defined(CONFIG_ARM) || defined(CONFIG_ARM64) || defined(CONFIG_RISCV)
+#if defined(CONFIG_ARM64) || defined(CONFIG_RISCV)
 		} else if (!strcmp(arg, "mmio")) {
 			*type = VIRTIO_MMIO;
 		} else if (!strcmp(arg, "mmio-legacy")) {
Signature · 1 line
2.39.5
#2 lore raw

PATCH 2/9 arm64: Move arm64-only features into main directory

In reply to Oliver Upton

Start the backing out the 32/64-bit split by moving arm64-only features up a level into the main arch directory.

---
 Makefile                    | 6 +++---
 arm/{aarch64 => }/arm-cpu.c | 0
 arm/{aarch64 => }/pmu.c     | 0
 arm/{aarch64 => }/pvtime.c  | 0
 4 files changed, 3 insertions(+), 3 deletions(-)
 rename arm/{aarch64 => }/arm-cpu.c (100%)
 rename arm/{aarch64 => }/pmu.c (100%)
 rename arm/{aarch64 => }/pvtime.c (100%)
Makefile +3 -3
index 462659b..cf50cf7 100644
@@ -178,11 +178,11 @@ ifeq ($(ARCH), arm64)
 	OBJS		+= arm/pci.o
 	OBJS		+= arm/timer.o
 	OBJS		+= hw/serial.o
-	OBJS		+= arm/aarch64/arm-cpu.o
+	OBJS		+= arm/arm-cpu.o
 	OBJS		+= arm/aarch64/kvm-cpu.o
 	OBJS		+= arm/aarch64/kvm.o
-	OBJS		+= arm/aarch64/pvtime.o
-	OBJS		+= arm/aarch64/pmu.o
+	OBJS		+= arm/pvtime.o
+	OBJS		+= arm/pmu.o
 	ARCH_INCLUDE	:= arm/include
 	ARCH_INCLUDE	+= -Iarm/aarch64/include
 
arm/arm-cpu.c renamed from arm/aarch64/arm-cpu.c +0 -0
similarity index 100%
rename from arm/aarch64/arm-cpu.c
rename to arm/arm-cpu.c
arm/pmu.c renamed from arm/aarch64/pmu.c +0 -0
similarity index 100%
rename from arm/aarch64/pmu.c
rename to arm/pmu.c
arm/pvtime.c renamed from arm/aarch64/pvtime.c +0 -0
similarity index 100%
rename from arm/aarch64/pvtime.c
rename to arm/pvtime.c
Signature · 1 line
2.39.5
#3 lore raw

PATCH 3/9 arm64: Combine kvm.c

In reply to Oliver Upton

Glue together the ARM common and previously arm64-specific bits into one source file.

---
 Makefile                                   |   1 -
 arm/aarch64/include/kvm/kvm-arch.h         |  22 ---
 arm/aarch64/kvm.c                          | 212 ---------------------
 arm/include/{arm-common => kvm}/kvm-arch.h |   6 +-
 arm/kvm.c                                  | 207 ++++++++++++++++++++
 5 files changed, 212 insertions(+), 236 deletions(-)
 delete mode 100644 arm/aarch64/include/kvm/kvm-arch.h
 delete mode 100644 arm/aarch64/kvm.c
 rename arm/include/{arm-common => kvm}/kvm-arch.h (97%)
Makefile +0 -1
index cf50cf7..72027e0 100644
@@ -180,7 +180,6 @@ ifeq ($(ARCH), arm64)
 	OBJS		+= hw/serial.o
 	OBJS		+= arm/arm-cpu.o
 	OBJS		+= arm/aarch64/kvm-cpu.o
-	OBJS		+= arm/aarch64/kvm.o
 	OBJS		+= arm/pvtime.o
 	OBJS		+= arm/pmu.o
 	ARCH_INCLUDE	:= arm/include
arm/aarch64/include/kvm/kvm-arch.h deleted +0 -22
deleted file mode 100644
index 2d1a4ed..0000000
@@ -1,22 +0,0 @@
-#ifndef KVM__KVM_ARCH_H
-#define KVM__KVM_ARCH_H
-
-#include <linux/sizes.h>
-
-struct kvm;
-void kvm__arch_read_kernel_header(struct kvm *kvm, int fd);
-unsigned long long kvm__arch_get_kern_offset(struct kvm *kvm);
-u64 kvm__arch_get_kernel_size(struct kvm *kvm);
-
-u64 kvm__arch_get_payload_region_size(struct kvm *kvm);
-
-int kvm__arch_get_ipa_limit(struct kvm *kvm);
-void kvm__arch_enable_mte(struct kvm *kvm);
-
-#define MAX_PAGE_SIZE	SZ_64K
-
-#define ARCH_HAS_CFG_RAM_ADDRESS	1
-
-#include "arm-common/kvm-arch.h"
-
-#endif /* KVM__KVM_ARCH_H */
arm/aarch64/kvm.c deleted +0 -212

212 lines not on this page · raw message

arm/include/kvm/kvm-arch.h renamed from arm/include/arm-common/kvm-arch.h +5 -1
similarity index 97%
rename from arm/include/arm-common/kvm-arch.h
rename to arm/include/kvm/kvm-arch.h
index 60eec02..b097186 100644
@@ -82,7 +82,11 @@
 
 #define VIRTIO_RING_ENDIAN	(VIRTIO_ENDIAN_LE | VIRTIO_ENDIAN_BE)
 
-#define ARCH_HAS_PCI_EXP	1
+#define ARCH_HAS_PCI_EXP		1
+#define ARCH_HAS_CFG_RAM_ADDRESS	1
+
+#define MAX_PAGE_SIZE	SZ_64K
+
 
 static inline bool arm_addr_in_ioport_region(u64 phys_addr)
 {
arm/kvm.c +207 -0

232 lines not on this page · raw message

Signature · 1 line
2.39.5
#4 lore raw

PATCH 4/9 arm64: Merge kvm-cpu.c

In reply to Oliver Upton

As before, glue together the arm64 and ARM generic bits into one file.

---
 Makefile                                      |   1 -
 arm/aarch64/include/kvm/kvm-cpu-arch.h        |  19 -
 arm/aarch64/kvm-cpu.c                         | 330 ------------------
 .../{arm-common => kvm}/kvm-cpu-arch.h        |  10 +-
 arm/kvm-cpu.c                                 | 328 +++++++++++++++++
 5 files changed, 337 insertions(+), 351 deletions(-)
 delete mode 100644 arm/aarch64/include/kvm/kvm-cpu-arch.h
 delete mode 100644 arm/aarch64/kvm-cpu.c
 rename arm/include/{arm-common => kvm}/kvm-cpu-arch.h (82%)
Makefile +0 -1
index 72027e0..25ee9b0 100644
@@ -179,7 +179,6 @@ ifeq ($(ARCH), arm64)
 	OBJS		+= arm/timer.o
 	OBJS		+= hw/serial.o
 	OBJS		+= arm/arm-cpu.o
-	OBJS		+= arm/aarch64/kvm-cpu.o
 	OBJS		+= arm/pvtime.o
 	OBJS		+= arm/pmu.o
 	ARCH_INCLUDE	:= arm/include
arm/aarch64/include/kvm/kvm-cpu-arch.h deleted +0 -19
deleted file mode 100644
index aeae8c1..0000000
@@ -1,19 +0,0 @@
-#ifndef KVM__KVM_CPU_ARCH_H
-#define KVM__KVM_CPU_ARCH_H
-
-#include "kvm/kvm.h"
-
-#include "arm-common/kvm-cpu-arch.h"
-
-#define ARM_MPIDR_HWID_BITMASK	0xFF00FFFFFFUL
-#define ARM_CPU_ID		3, 0, 0, 0
-#define ARM_CPU_ID_MPIDR	5
-#define ARM_CPU_CTRL		3, 0, 1, 0
-#define ARM_CPU_CTRL_SCTLR_EL1	0
-
-void kvm_cpu__select_features(struct kvm *kvm, struct kvm_vcpu_init *init);
-int kvm_cpu__configure_features(struct kvm_cpu *vcpu);
-int kvm_cpu__setup_pvtime(struct kvm_cpu *vcpu);
-int kvm_cpu__teardown_pvtime(struct kvm *kvm);
-
-#endif /* KVM__KVM_CPU_ARCH_H */
arm/aarch64/kvm-cpu.c deleted +0 -330

330 lines not on this page · raw message

arm/include/kvm/kvm-cpu-arch.h renamed from arm/include/arm-common/kvm-cpu-arch.h +9 -1
similarity index 82%
rename from arm/include/arm-common/kvm-cpu-arch.h
rename to arm/include/kvm/kvm-cpu-arch.h
index 923d2c4..1af394a 100644
@@ -1,11 +1,17 @@
 #ifndef ARM_COMMON__KVM_CPU_ARCH_H
 #define ARM_COMMON__KVM_CPU_ARCH_H
 
+#include "kvm/kvm.h"
+
 #include <linux/kvm.h>
 #include <pthread.h>
 #include <stdbool.h>
 
-struct kvm;
+#define ARM_MPIDR_HWID_BITMASK	0xFF00FFFFFFUL
+#define ARM_CPU_ID		3, 0, 0, 0
+#define ARM_CPU_ID_MPIDR	5
+#define ARM_CPU_CTRL		3, 0, 1, 0
+#define ARM_CPU_CTRL_SCTLR_EL1	0
 
 struct kvm_cpu {
 	pthread_t	thread;
@@ -58,5 +64,7 @@ static inline bool kvm_cpu__emulate_mmio(struct kvm_cpu *vcpu, u64 phys_addr,
 }
 
 unsigned long kvm_cpu__get_vcpu_mpidr(struct kvm_cpu *vcpu);
+int kvm_cpu__setup_pvtime(struct kvm_cpu *vcpu);
+int kvm_cpu__teardown_pvtime(struct kvm *kvm);
 
 #endif /* ARM_COMMON__KVM_CPU_ARCH_H */
arm/kvm-cpu.c +328 -0

342 lines not on this page · raw message

Signature · 1 line
2.39.5
#5 lore raw

PATCH 5/9 arm64: Combine kvm-config-arch.h

In reply to Oliver Upton

You get the point...

---
 arm/aarch64/include/kvm/kvm-config-arch.h     | 29 -------------------
 .../{arm-common => kvm}/kvm-config-arch.h     | 24 +++++++++++++--
 2 files changed, 22 insertions(+), 31 deletions(-)
 delete mode 100644 arm/aarch64/include/kvm/kvm-config-arch.h
 rename arm/include/{arm-common => kvm}/kvm-config-arch.h (54%)
arm/aarch64/include/kvm/kvm-config-arch.h deleted +0 -29
deleted file mode 100644
index 642fe67..0000000
@@ -1,29 +0,0 @@
-#ifndef KVM__KVM_CONFIG_ARCH_H
-#define KVM__KVM_CONFIG_ARCH_H
-
-int vcpu_affinity_parser(const struct option *opt, const char *arg, int unset);
-int sve_vl_parser(const struct option *opt, const char *arg, int unset);
-
-#define ARM_OPT_ARCH_RUN(cfg)						\
-	OPT_BOOLEAN('\0', "aarch32", &(cfg)->aarch32_guest,		\
-			"Run AArch32 guest"),				\
-	OPT_BOOLEAN('\0', "pmu", &(cfg)->has_pmuv3,			\
-			"Create PMUv3 device. The emulated PMU will be" \
-			" set to the PMU associated with the"		\
-			" main thread, unless --vcpu-affinity is set"),	\
-	OPT_BOOLEAN('\0', "disable-mte", &(cfg)->mte_disabled,		\
-			"Disable Memory Tagging Extension"),		\
-	OPT_CALLBACK('\0', "vcpu-affinity", kvm, "cpulist",  		\
-			"Specify the CPU affinity that will apply to "	\
-			"all VCPUs", vcpu_affinity_parser, kvm),	\
-	OPT_U64('\0', "kaslr-seed", &(cfg)->kaslr_seed,			\
-			"Specify random seed for Kernel Address Space "	\
-			"Layout Randomization (KASLR)"),		\
-	OPT_BOOLEAN('\0', "no-pvtime", &(cfg)->no_pvtime, "Disable"	\
-			" stolen time"),				\
-	OPT_CALLBACK('\0', "sve-max-vl", NULL, "vector length",		\
-		     "Specify the max SVE vector length (in bits) for "	\
-		     "all vCPUs", sve_vl_parser, kvm),
-#include "arm-common/kvm-config-arch.h"
-
-#endif /* KVM__KVM_CONFIG_ARCH_H */
arm/include/kvm/kvm-config-arch.h renamed from arm/include/arm-common/kvm-config-arch.h +22 -2
similarity index 54%
rename from arm/include/arm-common/kvm-config-arch.h
rename to arm/include/kvm/kvm-config-arch.h
index 4722d8f..ee031f0 100644
@@ -18,17 +18,37 @@ struct kvm_config_arch {
 };
 
 int irqchip_parser(const struct option *opt, const char *arg, int unset);
+int vcpu_affinity_parser(const struct option *opt, const char *arg, int unset);
+int sve_vl_parser(const struct option *opt, const char *arg, int unset);
 
 #define OPT_ARCH_RUN(pfx, cfg)							\
 	pfx,									\
-	ARM_OPT_ARCH_RUN(cfg)							\
+	OPT_BOOLEAN('\0', "aarch32", &(cfg)->aarch32_guest,			\
+			"Run AArch32 guest"),					\
+	OPT_BOOLEAN('\0', "pmu", &(cfg)->has_pmuv3,				\
+			"Create PMUv3 device. The emulated PMU will be" 	\
+			" set to the PMU associated with the"			\
+			" main thread, unless --vcpu-affinity is set"),		\
+	OPT_BOOLEAN('\0', "disable-mte", &(cfg)->mte_disabled,			\
+			"Disable Memory Tagging Extension"),			\
+	OPT_CALLBACK('\0', "vcpu-affinity", kvm, "cpulist",  			\
+			"Specify the CPU affinity that will apply to "		\
+			"all VCPUs", vcpu_affinity_parser, kvm),		\
+	OPT_U64('\0', "kaslr-seed", &(cfg)->kaslr_seed,				\
+			"Specify random seed for Kernel Address Space "		\
+			"Layout Randomization (KASLR)"),			\
+	OPT_BOOLEAN('\0', "no-pvtime", &(cfg)->no_pvtime, "Disable"		\
+			" stolen time"),					\
+	OPT_CALLBACK('\0', "sve-max-vl", NULL, "vector length",			\
+		     "Specify the max SVE vector length (in bits) for "		\
+		     "all vCPUs", sve_vl_parser, kvm),				\
 	OPT_STRING('\0', "dump-dtb", &(cfg)->dump_dtb_filename,			\
 		   ".dtb file", "Dump generated .dtb to specified file"),	\
 	OPT_UINTEGER('\0', "override-bad-firmware-cntfrq", &(cfg)->force_cntfrq,\
 		     "Specify Generic Timer frequency in guest DT to "		\
 		     "work around buggy secure firmware *Firmware should be "	\
 		     "updated to program CNTFRQ correctly*"),			\
-	OPT_CALLBACK_NOOPT('\0', "force-pci", NULL, "",			\
+	OPT_CALLBACK_NOOPT('\0', "force-pci", NULL, "",				\
 			   "Force virtio devices to use PCI as their default "	\
 			   "transport (Deprecated: Use --virtio-transport "	\
 			   "option instead)", virtio_transport_parser, kvm),	\
Signature · 1 line
2.39.5
#6 lore raw

PATCH 6/9 arm64: Move remaining kvm/* headers

In reply to Oliver Upton

Move the remaining kvm/* headers into the top-level ARM include path.

---
 arm/aarch64/include/kvm/fdt-arch.h         | 6 ------
 arm/{aarch64 => }/include/kvm/barrier.h    | 0
 arm/include/{arm-common => kvm}/fdt-arch.h | 0
 3 files changed, 6 deletions(-)
 delete mode 100644 arm/aarch64/include/kvm/fdt-arch.h
 rename arm/{aarch64 => }/include/kvm/barrier.h (100%)
 rename arm/include/{arm-common => kvm}/fdt-arch.h (100%)
arm/aarch64/include/kvm/fdt-arch.h deleted +0 -6
deleted file mode 100644
index e448bf1..0000000
@@ -1,6 +0,0 @@
-#ifndef KVM__KVM_FDT_H
-#define KVM__KVM_FDT_H
-
-#include "arm-common/fdt-arch.h"
-
-#endif /* KVM__KVM_FDT_H */
arm/include/kvm/barrier.h renamed from arm/aarch64/include/kvm/barrier.h +0 -0
similarity index 100%
rename from arm/aarch64/include/kvm/barrier.h
rename to arm/include/kvm/barrier.h
arm/include/kvm/fdt-arch.h renamed from arm/include/arm-common/fdt-arch.h +0 -0
similarity index 100%
rename from arm/include/arm-common/fdt-arch.h
rename to arm/include/kvm/fdt-arch.h
Signature · 1 line
2.39.5
#7 lore raw

PATCH 7/9 arm64: Move asm headers

In reply to Oliver Upton
---
 Makefile                                    | 1 -
 arm/{aarch64 => }/include/asm/image.h       | 0
 arm/{aarch64 => }/include/asm/kernel.h      | 0
 arm/{aarch64 => }/include/asm/kvm.h         | 0
 arm/{aarch64 => }/include/asm/pmu.h         | 0
 arm/{aarch64 => }/include/asm/sve_context.h | 0
 6 files changed, 1 deletion(-)
 rename arm/{aarch64 => }/include/asm/image.h (100%)
 rename arm/{aarch64 => }/include/asm/kernel.h (100%)
 rename arm/{aarch64 => }/include/asm/kvm.h (100%)
 rename arm/{aarch64 => }/include/asm/pmu.h (100%)
 rename arm/{aarch64 => }/include/asm/sve_context.h (100%)
Makefile +0 -1
index 25ee9b0..3085609 100644
@@ -182,7 +182,6 @@ ifeq ($(ARCH), arm64)
 	OBJS		+= arm/pvtime.o
 	OBJS		+= arm/pmu.o
 	ARCH_INCLUDE	:= arm/include
-	ARCH_INCLUDE	+= -Iarm/aarch64/include
 
 	ARCH_WANT_LIBFDT := y
 	ARCH_HAS_FLASH_MEM := y
arm/include/asm/image.h renamed from arm/aarch64/include/asm/image.h +0 -0
similarity index 100%
rename from arm/aarch64/include/asm/image.h
rename to arm/include/asm/image.h
arm/include/asm/kernel.h renamed from arm/aarch64/include/asm/kernel.h +0 -0
similarity index 100%
rename from arm/aarch64/include/asm/kernel.h
rename to arm/include/asm/kernel.h
arm/include/asm/kvm.h renamed from arm/aarch64/include/asm/kvm.h +0 -0
similarity index 100%
rename from arm/aarch64/include/asm/kvm.h
rename to arm/include/asm/kvm.h
arm/include/asm/pmu.h renamed from arm/aarch64/include/asm/pmu.h +0 -0
similarity index 100%
rename from arm/aarch64/include/asm/pmu.h
rename to arm/include/asm/pmu.h
arm/include/asm/sve_context.h renamed from arm/aarch64/include/asm/sve_context.h +0 -0
similarity index 100%
rename from arm/aarch64/include/asm/sve_context.h
rename to arm/include/asm/sve_context.h
Signature · 1 line
2.39.5
#8 lore raw

PATCH 8/9 arm64: Rename top-level directory

In reply to Oliver Upton

As a finishing touch, align the top-level arch directory name with the kernel's naming scheme.

---
 Makefile                                     | 24 ++++++++++----------
 {arm => arm64}/arm-cpu.c                     |  0
 {arm => arm64}/fdt.c                         |  0
 {arm => arm64}/gic.c                         |  0
 {arm => arm64}/gicv2m.c                      |  0
 {arm => arm64}/include/arm-common/gic.h      |  0
 {arm => arm64}/include/arm-common/pci.h      |  0
 {arm => arm64}/include/arm-common/timer.h    |  0
 {arm => arm64}/include/asm/image.h           |  0
 {arm => arm64}/include/asm/kernel.h          |  0
 {arm => arm64}/include/asm/kvm.h             |  0
 {arm => arm64}/include/asm/pmu.h             |  0
 {arm => arm64}/include/asm/sve_context.h     |  0
 {arm => arm64}/include/kvm/barrier.h         |  0
 {arm => arm64}/include/kvm/fdt-arch.h        |  0
 {arm => arm64}/include/kvm/kvm-arch.h        |  0
 {arm => arm64}/include/kvm/kvm-config-arch.h |  0
 {arm => arm64}/include/kvm/kvm-cpu-arch.h    |  0
 {arm => arm64}/ioport.c                      |  0
 {arm => arm64}/kvm-cpu.c                     |  0
 {arm => arm64}/kvm.c                         |  0
 {arm => arm64}/pci.c                         |  0
 {arm => arm64}/pmu.c                         |  0
 {arm => arm64}/pvtime.c                      |  0
 {arm => arm64}/timer.c                       |  0
 25 files changed, 12 insertions(+), 12 deletions(-)
 rename {arm => arm64}/arm-cpu.c (100%)
 rename {arm => arm64}/fdt.c (100%)
 rename {arm => arm64}/gic.c (100%)
 rename {arm => arm64}/gicv2m.c (100%)
 rename {arm => arm64}/include/arm-common/gic.h (100%)
 rename {arm => arm64}/include/arm-common/pci.h (100%)
 rename {arm => arm64}/include/arm-common/timer.h (100%)
 rename {arm => arm64}/include/asm/image.h (100%)
 rename {arm => arm64}/include/asm/kernel.h (100%)
 rename {arm => arm64}/include/asm/kvm.h (100%)
 rename {arm => arm64}/include/asm/pmu.h (100%)
 rename {arm => arm64}/include/asm/sve_context.h (100%)
 rename {arm => arm64}/include/kvm/barrier.h (100%)
 rename {arm => arm64}/include/kvm/fdt-arch.h (100%)
 rename {arm => arm64}/include/kvm/kvm-arch.h (100%)
 rename {arm => arm64}/include/kvm/kvm-config-arch.h (100%)
 rename {arm => arm64}/include/kvm/kvm-cpu-arch.h (100%)
 rename {arm => arm64}/ioport.c (100%)
 rename {arm => arm64}/kvm-cpu.c (100%)
 rename {arm => arm64}/kvm.c (100%)
 rename {arm => arm64}/pci.c (100%)
 rename {arm => arm64}/pmu.c (100%)
 rename {arm => arm64}/pvtime.c (100%)
 rename {arm => arm64}/timer.c (100%)
Makefile +12 -12
index 3085609..60e551f 100644
@@ -169,19 +169,19 @@ endif
 # ARM64
 ifeq ($(ARCH), arm64)
 	DEFINES		+= -DCONFIG_ARM64
-	OBJS		+= arm/fdt.o
-	OBJS		+= arm/gic.o
-	OBJS		+= arm/gicv2m.o
-	OBJS		+= arm/ioport.o
-	OBJS		+= arm/kvm.o
-	OBJS		+= arm/kvm-cpu.o
-	OBJS		+= arm/pci.o
-	OBJS		+= arm/timer.o
+	OBJS		+= arm64/fdt.o
+	OBJS		+= arm64/gic.o
+	OBJS		+= arm64/gicv2m.o
+	OBJS		+= arm64/ioport.o
+	OBJS		+= arm64/kvm.o
+	OBJS		+= arm64/kvm-cpu.o
+	OBJS		+= arm64/pci.o
+	OBJS		+= arm64/timer.o
 	OBJS		+= hw/serial.o
-	OBJS		+= arm/arm-cpu.o
-	OBJS		+= arm/pvtime.o
-	OBJS		+= arm/pmu.o
-	ARCH_INCLUDE	:= arm/include
+	OBJS		+= arm64/arm-cpu.o
+	OBJS		+= arm64/pvtime.o
+	OBJS		+= arm64/pmu.o
+	ARCH_INCLUDE	:= arm64/include
 
 	ARCH_WANT_LIBFDT := y
 	ARCH_HAS_FLASH_MEM := y
arm64/arm-cpu.c renamed from arm/arm-cpu.c +0 -0
similarity index 100%
rename from arm/arm-cpu.c
rename to arm64/arm-cpu.c
arm64/fdt.c renamed from arm/fdt.c +0 -0
similarity index 100%
rename from arm/fdt.c
rename to arm64/fdt.c
arm64/gic.c renamed from arm/gic.c +0 -0
similarity index 100%
rename from arm/gic.c
rename to arm64/gic.c
arm64/gicv2m.c renamed from arm/gicv2m.c +0 -0
similarity index 100%
rename from arm/gicv2m.c
rename to arm64/gicv2m.c
arm64/include/arm-common/gic.h renamed from arm/include/arm-common/gic.h +0 -0
similarity index 100%
rename from arm/include/arm-common/gic.h
rename to arm64/include/arm-common/gic.h
arm64/include/arm-common/pci.h renamed from arm/include/arm-common/pci.h +0 -0
similarity index 100%
rename from arm/include/arm-common/pci.h
rename to arm64/include/arm-common/pci.h
arm64/include/arm-common/timer.h renamed from arm/include/arm-common/timer.h +0 -0
similarity index 100%
rename from arm/include/arm-common/timer.h
rename to arm64/include/arm-common/timer.h
arm64/include/asm/image.h renamed from arm/include/asm/image.h +0 -0
similarity index 100%
rename from arm/include/asm/image.h
rename to arm64/include/asm/image.h
arm64/include/asm/kernel.h renamed from arm/include/asm/kernel.h +0 -0
similarity index 100%
rename from arm/include/asm/kernel.h
rename to arm64/include/asm/kernel.h
arm64/include/asm/kvm.h renamed from arm/include/asm/kvm.h +0 -0
similarity index 100%
rename from arm/include/asm/kvm.h
rename to arm64/include/asm/kvm.h
arm64/include/asm/pmu.h renamed from arm/include/asm/pmu.h +0 -0
similarity index 100%
rename from arm/include/asm/pmu.h
rename to arm64/include/asm/pmu.h
arm64/include/asm/sve_context.h renamed from arm/include/asm/sve_context.h +0 -0
similarity index 100%
rename from arm/include/asm/sve_context.h
rename to arm64/include/asm/sve_context.h
arm64/include/kvm/barrier.h renamed from arm/include/kvm/barrier.h +0 -0
similarity index 100%
rename from arm/include/kvm/barrier.h
rename to arm64/include/kvm/barrier.h
arm64/include/kvm/fdt-arch.h renamed from arm/include/kvm/fdt-arch.h +0 -0
similarity index 100%
rename from arm/include/kvm/fdt-arch.h
rename to arm64/include/kvm/fdt-arch.h
arm64/include/kvm/kvm-arch.h renamed from arm/include/kvm/kvm-arch.h +0 -0
similarity index 100%
rename from arm/include/kvm/kvm-arch.h
rename to arm64/include/kvm/kvm-arch.h
arm64/include/kvm/kvm-config-arch.h renamed from arm/include/kvm/kvm-config-arch.h +0 -0
similarity index 100%
rename from arm/include/kvm/kvm-config-arch.h
rename to arm64/include/kvm/kvm-config-arch.h
arm64/include/kvm/kvm-cpu-arch.h renamed from arm/include/kvm/kvm-cpu-arch.h +0 -0
similarity index 100%
rename from arm/include/kvm/kvm-cpu-arch.h
rename to arm64/include/kvm/kvm-cpu-arch.h
arm64/ioport.c renamed from arm/ioport.c +0 -0
similarity index 100%
rename from arm/ioport.c
rename to arm64/ioport.c
arm64/kvm-cpu.c renamed from arm/kvm-cpu.c +0 -0
similarity index 100%
rename from arm/kvm-cpu.c
rename to arm64/kvm-cpu.c
arm64/kvm.c renamed from arm/kvm.c +0 -0
similarity index 100%
rename from arm/kvm.c
rename to arm64/kvm.c
arm64/pci.c renamed from arm/pci.c +0 -0
similarity index 100%
rename from arm/pci.c
rename to arm64/pci.c
arm64/pmu.c renamed from arm/pmu.c +0 -0
similarity index 100%
rename from arm/pmu.c
rename to arm64/pmu.c
arm64/pvtime.c renamed from arm/pvtime.c +0 -0
similarity index 100%
rename from arm/pvtime.c
rename to arm64/pvtime.c
arm64/timer.c renamed from arm/timer.c +0 -0
similarity index 100%
rename from arm/timer.c
rename to arm64/timer.c
Signature · 1 line
2.39.5
#9 lore raw

PATCH 9/9 arm64: Get rid of the 'arm-common' include directory

In reply to Oliver Upton
---
 arm64/arm-cpu.c                        | 4 ++--
 arm64/fdt.c                            | 4 ++--
 arm64/gic.c                            | 2 +-
 arm64/gicv2m.c                         | 2 +-
 arm64/include/{arm-common => }/gic.h   | 0
 arm64/include/kvm/kvm-arch.h           | 2 +-
 arm64/include/{arm-common => }/pci.h   | 0
 arm64/include/{arm-common => }/timer.h | 0
 arm64/kvm.c                            | 2 +-
 arm64/pci.c                            | 4 ++--
 arm64/pmu.c                            | 2 +-
 arm64/timer.c                          | 4 ++--
 12 files changed, 13 insertions(+), 13 deletions(-)
 rename arm64/include/{arm-common => }/gic.h (100%)
 rename arm64/include/{arm-common => }/pci.h (100%)
 rename arm64/include/{arm-common => }/timer.h (100%)
arm64/arm-cpu.c +2 -2
index f5c8e1e..b9ca814 100644
@@ -3,8 +3,8 @@
 #include "kvm/kvm-cpu.h"
 #include "kvm/util.h"
 
-#include "arm-common/gic.h"
-#include "arm-common/timer.h"
+#include "gic.h"
+#include "timer.h"
 
 #include "asm/pmu.h"
 
arm64/fdt.c +2 -2
index 286ccad..9d93551 100644
@@ -4,8 +4,8 @@
 #include "kvm/kvm-cpu.h"
 #include "kvm/virtio-mmio.h"
 
-#include "arm-common/gic.h"
-#include "arm-common/pci.h"
+#include "gic.h"
+#include "pci.h"
 
 #include <stdbool.h>
 
arm64/gic.c +1 -1
index 0795e95..d0d8543 100644
@@ -3,7 +3,7 @@
 #include "kvm/kvm.h"
 #include "kvm/virtio.h"
 
-#include "arm-common/gic.h"
+#include "gic.h"
 
 #include <linux/byteorder.h>
 #include <linux/kernel.h>
arm64/gicv2m.c +1 -1
index b47ada8..e4e7dc8 100644
@@ -5,7 +5,7 @@
 #include "kvm/kvm.h"
 #include "kvm/util.h"
 
-#include "arm-common/gic.h"
+#include "gic.h"
 
 #define GICV2M_MSI_TYPER	0x008
 #define GICV2M_MSI_SETSPI	0x040
arm64/include/gic.h renamed from arm64/include/arm-common/gic.h +0 -0
similarity index 100%
rename from arm64/include/arm-common/gic.h
rename to arm64/include/gic.h
arm64/include/kvm/kvm-arch.h +1 -1
index b097186..ef3a701 100644
@@ -10,7 +10,7 @@
 #include <linux/const.h>
 #include <linux/types.h>
 
-#include "arm-common/gic.h"
+#include "gic.h"
 
 /*
  * The memory map used for ARM guests (not to scale):
arm64/include/pci.h renamed from arm64/include/arm-common/pci.h +0 -0
similarity index 100%
rename from arm64/include/arm-common/pci.h
rename to arm64/include/pci.h
arm64/include/timer.h renamed from arm64/include/arm-common/timer.h +0 -0
similarity index 100%
rename from arm64/include/arm-common/timer.h
rename to arm64/include/timer.h
arm64/kvm.c +1 -1
index 11c7a16..7d49cb4 100644
@@ -5,7 +5,7 @@
 #include "kvm/virtio-console.h"
 #include "kvm/fdt.h"
 
-#include "arm-common/gic.h"
+#include "gic.h"
 
 #include <linux/byteorder.h>
 #include <linux/cpumask.h>
arm64/pci.c +2 -2
index 5bd82d4..99bf887 100644
@@ -5,8 +5,8 @@
 #include "kvm/pci.h"
 #include "kvm/util.h"
 
-#include "arm-common/pci.h"
-#include "arm-common/gic.h"
+#include "pci.h"
+#include "gic.h"
 
 /*
  * An entry in the interrupt-map table looks like:
arm64/pmu.c +1 -1
index 5ed4979..52f4256 100644
@@ -9,7 +9,7 @@
 #include "kvm/kvm-cpu.h"
 #include "kvm/util.h"
 
-#include "arm-common/gic.h"
+#include "gic.h"
 
 #include "asm/pmu.h"
 
arm64/timer.c +2 -2
index 6acc50e..b3164f8 100644
@@ -3,8 +3,8 @@
 #include "kvm/kvm-cpu.h"
 #include "kvm/util.h"
 
-#include "arm-common/gic.h"
-#include "arm-common/timer.h"
+#include "gic.h"
+#include "timer.h"
 
 void timer__generate_fdt_nodes(void *fdt, struct kvm *kvm, int *irqs)
 {
Signature · 1 line
2.39.5
Reviewed-by on the v1 series
#10 lore raw
In reply to Oliver Upton

Hi Oliver,

Quoted 8 lines · Oliver Upton

The last stable kernel to support 32-bit KVM/arm is 5.4, which is on track for EOL at the end of this year. Considering this, and the fact that 32-bit KVM never saw much usage in the first place, it is probably time to toss out the coprolite.

Of course, this has no effect on the support for 32-bit guests on 64-bit KVM.

Quoted 6 lines

RFC: https://lore.kernel.org/kvmarm/[email protected]/

RFC -> v1:
- Collected Marc's Acks
- Cleaned up some forgotten references to CONFIG_ARM (Alex)
- Minor nits on includes, defines (Alex)

I see that you've kept gic.h, pci.h and timer.h in arm64/include.

The series looks good to me:

I've also did some light testing by building kvmtool from each patch in the series and booting a Linux guest.

Thanks,
Alex

Quoted 106 lines

Oliver Upton (9):
Drop support for 32-bit arm
arm64: Move arm64-only features into main directory
arm64: Combine kvm.c
arm64: Merge kvm-cpu.c
arm64: Combine kvm-config-arch.h
arm64: Move remaining kvm/* headers
arm64: Move asm headers
arm64: Rename top-level directory
arm64: Get rid of the 'arm-common' include directory

 INSTALL                                       |   9 +-
 Makefile                                      |  40 +--
 arm/aarch32/arm-cpu.c                         |  50 ---
 arm/aarch32/include/asm/kernel.h              |   8 -
 arm/aarch32/include/asm/kvm.h                 | 311 ------------------
 arm/aarch32/include/kvm/barrier.h             |  10 -
 arm/aarch32/include/kvm/fdt-arch.h            |   6 -
 arm/aarch32/include/kvm/kvm-arch.h            |  18 -
 arm/aarch32/include/kvm/kvm-config-arch.h     |   8 -
 arm/aarch32/include/kvm/kvm-cpu-arch.h        |  24 --
 arm/aarch32/kvm-cpu.c                         | 132 --------
 arm/aarch32/kvm.c                             |  14 -
 arm/aarch64/include/kvm/fdt-arch.h            |   6 -
 arm/aarch64/include/kvm/kvm-arch.h            |  22 --
 arm/aarch64/include/kvm/kvm-config-arch.h     |  29 --
 arm/aarch64/include/kvm/kvm-cpu-arch.h        |  19 --
 arm/aarch64/kvm.c                             | 212 ------------
 arm/kvm-cpu.c                                 | 153 ---------
 {arm/aarch64 => arm64}/arm-cpu.c              |   4 +-
 {arm => arm64}/fdt.c                          |   4 +-
 {arm => arm64}/gic.c                          |   2 +-
 {arm => arm64}/gicv2m.c                       |   2 +-
 {arm/aarch64 => arm64}/include/asm/image.h    |   0
 {arm/aarch64 => arm64}/include/asm/kernel.h   |   0
 {arm/aarch64 => arm64}/include/asm/kvm.h      |   0
 {arm/aarch64 => arm64}/include/asm/pmu.h      |   0
 .../include/asm/sve_context.h                 |   0
 .../arm-common => arm64/include}/gic.h        |   0
 {arm/aarch64 => arm64}/include/kvm/barrier.h  |   0
 .../include/kvm}/fdt-arch.h                   |   0
 .../include/kvm}/kvm-arch.h                   |   8 +-
 .../include/kvm}/kvm-config-arch.h            |  24 +-
 .../include/kvm}/kvm-cpu-arch.h               |  10 +-
 .../arm-common => arm64/include}/pci.h        |   0
 .../arm-common => arm64/include}/timer.h      |   0
 {arm => arm64}/ioport.c                       |   0
 {arm/aarch64 => arm64}/kvm-cpu.c              | 289 ++++++++++++----
 {arm => arm64}/kvm.c                          | 209 +++++++++++-
 {arm => arm64}/pci.c                          |   4 +-
 {arm/aarch64 => arm64}/pmu.c                  |   2 +-
 {arm/aarch64 => arm64}/pvtime.c               |   0
 {arm => arm64}/timer.c                        |   4 +-
 builtin-run.c                                 |   2 +-
 hw/cfi_flash.c                                |   2 +-
 hw/rtc.c                                      |   2 +-
 hw/serial.c                                   |   2 +-
 virtio/core.c                                 |   2 +-
 47 files changed, 498 insertions(+), 1145 deletions(-)
 delete mode 100644 arm/aarch32/arm-cpu.c
 delete mode 100644 arm/aarch32/include/asm/kernel.h
 delete mode 100644 arm/aarch32/include/asm/kvm.h
 delete mode 100644 arm/aarch32/include/kvm/barrier.h
 delete mode 100644 arm/aarch32/include/kvm/fdt-arch.h
 delete mode 100644 arm/aarch32/include/kvm/kvm-arch.h
 delete mode 100644 arm/aarch32/include/kvm/kvm-config-arch.h
 delete mode 100644 arm/aarch32/include/kvm/kvm-cpu-arch.h
 delete mode 100644 arm/aarch32/kvm-cpu.c
 delete mode 100644 arm/aarch32/kvm.c
 delete mode 100644 arm/aarch64/include/kvm/fdt-arch.h
 delete mode 100644 arm/aarch64/include/kvm/kvm-arch.h
 delete mode 100644 arm/aarch64/include/kvm/kvm-config-arch.h
 delete mode 100644 arm/aarch64/include/kvm/kvm-cpu-arch.h
 delete mode 100644 arm/aarch64/kvm.c
 delete mode 100644 arm/kvm-cpu.c
 rename {arm/aarch64 => arm64}/arm-cpu.c (96%)
 rename {arm => arm64}/fdt.c (99%)
 rename {arm => arm64}/gic.c (99%)
 rename {arm => arm64}/gicv2m.c (99%)
 rename {arm/aarch64 => arm64}/include/asm/image.h (100%)
 rename {arm/aarch64 => arm64}/include/asm/kernel.h (100%)
 rename {arm/aarch64 => arm64}/include/asm/kvm.h (100%)
 rename {arm/aarch64 => arm64}/include/asm/pmu.h (100%)
 rename {arm/aarch64 => arm64}/include/asm/sve_context.h (100%)
 rename {arm/include/arm-common => arm64/include}/gic.h (100%)
 rename {arm/aarch64 => arm64}/include/kvm/barrier.h (100%)
 rename {arm/include/arm-common => arm64/include/kvm}/fdt-arch.h (100%)
 rename {arm/include/arm-common => arm64/include/kvm}/kvm-arch.h (96%)
 rename {arm/include/arm-common => arm64/include/kvm}/kvm-config-arch.h (54%)
 rename {arm/include/arm-common => arm64/include/kvm}/kvm-cpu-arch.h (82%)
 rename {arm/include/arm-common => arm64/include}/pci.h (100%)
 rename {arm/include/arm-common => arm64/include}/timer.h (100%)
 rename {arm => arm64}/ioport.c (100%)
 rename {arm/aarch64 => arm64}/kvm-cpu.c (70%)
 rename {arm => arm64}/kvm.c (59%)
 rename {arm => arm64}/pci.c (98%)
 rename {arm/aarch64 => arm64}/pmu.c (99%)
 rename {arm/aarch64 => arm64}/pvtime.c (100%)
 rename {arm => arm64}/timer.c (95%)

base-commit: e48563f5c4a48fe6a6bc2a98a9a7c84a10f043be

Signature · 1 line
2.39.5