* [RFC kvmtool 1/9] Drop support for 32-bit arm
2025-03-14 22:25 [RFC kvmtool 0/9] arm: Drop support for 32-bit kvmtool Oliver Upton
@ 2025-03-14 22:25 ` Oliver Upton
2025-03-20 16:58 ` Alexandru Elisei
2025-03-14 22:25 ` [RFC kvmtool 2/9] arm64: Move arm64-only features into main directory Oliver Upton
` (9 subsequent siblings)
10 siblings, 1 reply; 20+ messages in thread
From: Oliver Upton @ 2025-03-14 22:25 UTC (permalink / raw)
To: kvmarm; +Cc: kvm, Will Deacon, Julien Thierry, Oliver Upton
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.
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
---
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 -
12 files changed, 14 insertions(+), 607 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
diff --git a/INSTALL b/INSTALL
index 2a65735..0e1e63e 100644
--- a/INSTALL
+++ b/INSTALL
@@ -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
diff --git a/Makefile b/Makefile
index d84dc8e..462659b 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/arm/aarch32/arm-cpu.c b/arm/aarch32/arm-cpu.c
deleted file mode 100644
index 16bba55..0000000
diff --git a/arm/aarch32/include/asm/kernel.h b/arm/aarch32/include/asm/kernel.h
deleted file mode 100644
index 6129609..0000000
diff --git a/arm/aarch32/include/asm/kvm.h b/arm/aarch32/include/asm/kvm.h
deleted file mode 100644
index a4217c1..0000000
diff --git a/arm/aarch32/include/kvm/barrier.h b/arm/aarch32/include/kvm/barrier.h
deleted file mode 100644
index 94913a9..0000000
diff --git a/arm/aarch32/include/kvm/fdt-arch.h b/arm/aarch32/include/kvm/fdt-arch.h
deleted file mode 100644
index e448bf1..0000000
diff --git a/arm/aarch32/include/kvm/kvm-arch.h b/arm/aarch32/include/kvm/kvm-arch.h
deleted file mode 100644
index 0333cf4..0000000
diff --git a/arm/aarch32/include/kvm/kvm-config-arch.h b/arm/aarch32/include/kvm/kvm-config-arch.h
deleted file mode 100644
index acf0d23..0000000
diff --git a/arm/aarch32/include/kvm/kvm-cpu-arch.h b/arm/aarch32/include/kvm/kvm-cpu-arch.h
deleted file mode 100644
index fd0b387..0000000
diff --git a/arm/aarch32/kvm-cpu.c b/arm/aarch32/kvm-cpu.c
deleted file mode 100644
index 95fb1da..0000000
diff --git a/arm/aarch32/kvm.c b/arm/aarch32/kvm.c
deleted file mode 100644
index 768a56b..0000000
--
2.39.5
^ permalink raw reply related [flat|nested] 20+ messages in thread* Re: [RFC kvmtool 1/9] Drop support for 32-bit arm
2025-03-14 22:25 ` [RFC kvmtool 1/9] Drop support for 32-bit arm Oliver Upton
@ 2025-03-20 16:58 ` Alexandru Elisei
2025-03-25 17:08 ` Oliver Upton
0 siblings, 1 reply; 20+ messages in thread
From: Alexandru Elisei @ 2025-03-20 16:58 UTC (permalink / raw)
To: Oliver Upton; +Cc: kvmarm, kvm, Will Deacon, Julien Thierry
Hi Oliver,
I tried to apply the patch on top of e48563f5c4a48fe6a6bc2a98a9a7c84a10f043be,
which is the base commit from the cover letter, and I got these errors:
Applying: Drop support for 32-bit arm
error: removal patch leaves file contents
error: arm/aarch32/arm-cpu.c: patch does not apply
error: removal patch leaves file contents
error: arm/aarch32/include/asm/kernel.h: patch does not apply
error: removal patch leaves file contents
error: arm/aarch32/include/asm/kvm.h: patch does not apply
error: removal patch leaves file contents
error: arm/aarch32/include/kvm/barrier.h: patch does not apply
error: removal patch leaves file contents
error: arm/aarch32/include/kvm/fdt-arch.h: patch does not apply
error: removal patch leaves file contents
error: arm/aarch32/include/kvm/kvm-arch.h: patch does not apply
error: removal patch leaves file contents
error: arm/aarch32/include/kvm/kvm-config-arch.h: patch does not apply
error: removal patch leaves file contents
error: arm/aarch32/include/kvm/kvm-cpu-arch.h: patch does not apply
error: removal patch leaves file contents
error: arm/aarch32/kvm-cpu.c: patch does not apply
error: removal patch leaves file contents
error: arm/aarch32/kvm.c: patch does not apply
When I delete the files manually, the resulting commit has diffs like this for
the deleted files:
diff --git a/arm/aarch32/arm-cpu.c b/arm/aarch32/arm-cpu.c
deleted file mode 100644
index 16bba5524caf..000000000000
--- a/arm/aarch32/arm-cpu.c
+++ /dev/null
@@ -1,50 +0,0 @@
-#include "kvm/kvm.h"
-#include "kvm/kvm-cpu.h"
-#include "kvm/util.h"
-
-#include "arm-common/gic.h"
-#include "arm-common/timer.h"
[..]
.. and so on.
Am I missing a knob for applying the patch? FYI, this happens for all the
patches in this series with files deleted.
One more comment below.
On Fri, Mar 14, 2025 at 03:25:08PM -0700, Oliver Upton wrote:
> 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.
>
> Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
> ---
> 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 -
> 12 files changed, 14 insertions(+), 607 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
>
> diff --git a/INSTALL b/INSTALL
> index 2a65735..0e1e63e 100644
> --- a/INSTALL
> +++ b/INSTALL
> @@ -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
> diff --git a/Makefile b/Makefile
> index d84dc8e..462659b 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -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
Found a couple of instances of CONFIG_ARM using grep.
There also one instance of the architecture name ARM in a comment in
hw/cfi_flash.c, I think that was a typo and it was meant to say ARM64.
Other than that, looks good.
Thanks,
Alex
> - 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
> diff --git a/arm/aarch32/arm-cpu.c b/arm/aarch32/arm-cpu.c
> deleted file mode 100644
> index 16bba55..0000000
> diff --git a/arm/aarch32/include/asm/kernel.h b/arm/aarch32/include/asm/kernel.h
> deleted file mode 100644
> index 6129609..0000000
> diff --git a/arm/aarch32/include/asm/kvm.h b/arm/aarch32/include/asm/kvm.h
> deleted file mode 100644
> index a4217c1..0000000
> diff --git a/arm/aarch32/include/kvm/barrier.h b/arm/aarch32/include/kvm/barrier.h
> deleted file mode 100644
> index 94913a9..0000000
> diff --git a/arm/aarch32/include/kvm/fdt-arch.h b/arm/aarch32/include/kvm/fdt-arch.h
> deleted file mode 100644
> index e448bf1..0000000
> diff --git a/arm/aarch32/include/kvm/kvm-arch.h b/arm/aarch32/include/kvm/kvm-arch.h
> deleted file mode 100644
> index 0333cf4..0000000
> diff --git a/arm/aarch32/include/kvm/kvm-config-arch.h b/arm/aarch32/include/kvm/kvm-config-arch.h
> deleted file mode 100644
> index acf0d23..0000000
> diff --git a/arm/aarch32/include/kvm/kvm-cpu-arch.h b/arm/aarch32/include/kvm/kvm-cpu-arch.h
> deleted file mode 100644
> index fd0b387..0000000
> diff --git a/arm/aarch32/kvm-cpu.c b/arm/aarch32/kvm-cpu.c
> deleted file mode 100644
> index 95fb1da..0000000
> diff --git a/arm/aarch32/kvm.c b/arm/aarch32/kvm.c
> deleted file mode 100644
> index 768a56b..0000000
> --
> 2.39.5
>
>
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [RFC kvmtool 1/9] Drop support for 32-bit arm
2025-03-20 16:58 ` Alexandru Elisei
@ 2025-03-25 17:08 ` Oliver Upton
0 siblings, 0 replies; 20+ messages in thread
From: Oliver Upton @ 2025-03-25 17:08 UTC (permalink / raw)
To: Alexandru Elisei; +Cc: kvmarm, kvm, Will Deacon, Julien Thierry
On Thu, Mar 20, 2025 at 04:58:53PM +0000, Alexandru Elisei wrote:
> Hi Oliver,
>
> I tried to apply the patch on top of e48563f5c4a48fe6a6bc2a98a9a7c84a10f043be,
> which is the base commit from the cover letter, and I got these errors:
>
> Applying: Drop support for 32-bit arm
> error: removal patch leaves file contents
> error: arm/aarch32/arm-cpu.c: patch does not apply
> error: removal patch leaves file contents
> error: arm/aarch32/include/asm/kernel.h: patch does not apply
> error: removal patch leaves file contents
> error: arm/aarch32/include/asm/kvm.h: patch does not apply
> error: removal patch leaves file contents
> error: arm/aarch32/include/kvm/barrier.h: patch does not apply
> error: removal patch leaves file contents
> error: arm/aarch32/include/kvm/fdt-arch.h: patch does not apply
> error: removal patch leaves file contents
> error: arm/aarch32/include/kvm/kvm-arch.h: patch does not apply
> error: removal patch leaves file contents
> error: arm/aarch32/include/kvm/kvm-config-arch.h: patch does not apply
> error: removal patch leaves file contents
> error: arm/aarch32/include/kvm/kvm-cpu-arch.h: patch does not apply
> error: removal patch leaves file contents
> error: arm/aarch32/kvm-cpu.c: patch does not apply
> error: removal patch leaves file contents
> error: arm/aarch32/kvm.c: patch does not apply
>
> When I delete the files manually, the resulting commit has diffs like this for
> the deleted files:
>
> diff --git a/arm/aarch32/arm-cpu.c b/arm/aarch32/arm-cpu.c
> deleted file mode 100644
> index 16bba5524caf..000000000000
> --- a/arm/aarch32/arm-cpu.c
> +++ /dev/null
> @@ -1,50 +0,0 @@
> -#include "kvm/kvm.h"
> -#include "kvm/kvm-cpu.h"
> -#include "kvm/util.h"
> -
> -#include "arm-common/gic.h"
> -#include "arm-common/timer.h"
> [..]
>
> .. and so on.
>
> Am I missing a knob for applying the patch? FYI, this happens for all the
> patches in this series with files deleted.
That's on me, I did 'git format-patch -D' to keep the diffs smaller for
an RFC. I'll post patches that actually apply for v1.
> One more comment below.
>
> On Fri, Mar 14, 2025 at 03:25:08PM -0700, Oliver Upton wrote:
> > 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.
> >
> > Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
> > ---
> > 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 -
> > 12 files changed, 14 insertions(+), 607 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
> >
> > diff --git a/INSTALL b/INSTALL
> > index 2a65735..0e1e63e 100644
> > --- a/INSTALL
> > +++ b/INSTALL
> > @@ -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
> > diff --git a/Makefile b/Makefile
> > index d84dc8e..462659b 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -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
>
> Found a couple of instances of CONFIG_ARM using grep.
>
> There also one instance of the architecture name ARM in a comment in
> hw/cfi_flash.c, I think that was a typo and it was meant to say ARM64.
>
> Other than that, looks good.
Thanks for spotting those, will fix.
Thanks,
Oliver
^ permalink raw reply [flat|nested] 20+ messages in thread
* [RFC kvmtool 2/9] arm64: Move arm64-only features into main directory
2025-03-14 22:25 [RFC kvmtool 0/9] arm: Drop support for 32-bit kvmtool Oliver Upton
2025-03-14 22:25 ` [RFC kvmtool 1/9] Drop support for 32-bit arm Oliver Upton
@ 2025-03-14 22:25 ` Oliver Upton
2025-03-14 22:25 ` [RFC kvmtool 3/9] arm64: Combine kvm.c Oliver Upton
` (8 subsequent siblings)
10 siblings, 0 replies; 20+ messages in thread
From: Oliver Upton @ 2025-03-14 22:25 UTC (permalink / raw)
To: kvmarm; +Cc: kvm, Will Deacon, Julien Thierry, Oliver Upton
Start the backing out the 32/64-bit split by moving arm64-only features
up a level into the main arch directory.
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
---
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%)
diff --git a/Makefile b/Makefile
index 462659b..cf50cf7 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/arm/aarch64/arm-cpu.c b/arm/arm-cpu.c
similarity index 100%
rename from arm/aarch64/arm-cpu.c
rename to arm/arm-cpu.c
diff --git a/arm/aarch64/pmu.c b/arm/pmu.c
similarity index 100%
rename from arm/aarch64/pmu.c
rename to arm/pmu.c
diff --git a/arm/aarch64/pvtime.c b/arm/pvtime.c
similarity index 100%
rename from arm/aarch64/pvtime.c
rename to arm/pvtime.c
--
2.39.5
^ permalink raw reply related [flat|nested] 20+ messages in thread* [RFC kvmtool 3/9] arm64: Combine kvm.c
2025-03-14 22:25 [RFC kvmtool 0/9] arm: Drop support for 32-bit kvmtool Oliver Upton
2025-03-14 22:25 ` [RFC kvmtool 1/9] Drop support for 32-bit arm Oliver Upton
2025-03-14 22:25 ` [RFC kvmtool 2/9] arm64: Move arm64-only features into main directory Oliver Upton
@ 2025-03-14 22:25 ` Oliver Upton
2025-03-20 16:59 ` Alexandru Elisei
2025-03-14 22:25 ` [RFC kvmtool 4/9] arm64: Merge kvm-cpu.c Oliver Upton
` (7 subsequent siblings)
10 siblings, 1 reply; 20+ messages in thread
From: Oliver Upton @ 2025-03-14 22:25 UTC (permalink / raw)
To: kvmarm; +Cc: kvm, Will Deacon, Julien Thierry, Oliver Upton
Glue together the ARM common and previously arm64-specific bits into one
source file.
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
---
Makefile | 1 -
arm/aarch64/include/kvm/kvm-arch.h | 22 ---
arm/aarch64/kvm.c | 212 ---------------------
arm/include/{arm-common => kvm}/kvm-arch.h | 4 +
arm/kvm.c | 210 ++++++++++++++++++++
5 files changed, 214 insertions(+), 235 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%)
diff --git a/Makefile b/Makefile
index cf50cf7..72027e0 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/arm/aarch64/include/kvm/kvm-arch.h b/arm/aarch64/include/kvm/kvm-arch.h
deleted file mode 100644
index 2d1a4ed..0000000
diff --git a/arm/aarch64/kvm.c b/arm/aarch64/kvm.c
deleted file mode 100644
index 98b2437..0000000
diff --git a/arm/include/arm-common/kvm-arch.h b/arm/include/kvm/kvm-arch.h
similarity index 97%
rename from arm/include/arm-common/kvm-arch.h
rename to arm/include/kvm/kvm-arch.h
index 60eec02..b55b3bf 100644
--- a/arm/include/arm-common/kvm-arch.h
+++ b/arm/include/kvm/kvm-arch.h
@@ -84,6 +84,10 @@
#define ARCH_HAS_PCI_EXP 1
+#define MAX_PAGE_SIZE SZ_64K
+
+#define ARCH_HAS_CFG_RAM_ADDRESS 1
+
static inline bool arm_addr_in_ioport_region(u64 phys_addr)
{
u64 limit = KVM_IOPORT_AREA + ARM_IOPORT_SIZE;
diff --git a/arm/kvm.c b/arm/kvm.c
index cc0cc4f..5e7fe77 100644
--- a/arm/kvm.c
+++ b/arm/kvm.c
@@ -7,10 +7,19 @@
#include "arm-common/gic.h"
+#include <linux/byteorder.h>
+#include <linux/cpumask.h>
#include <linux/kernel.h>
#include <linux/kvm.h>
#include <linux/sizes.h>
+#include <asm/image.h>
+
+#include <kvm/util.h>
+
+
+static struct arm64_image_header *kernel_header;
+
struct kvm_ext kvm_req_ext[] = {
{ DEFINE_KVM_EXT(KVM_CAP_IRQCHIP) },
{ DEFINE_KVM_EXT(KVM_CAP_ONE_REG) },
@@ -87,6 +96,33 @@ void kvm__arch_set_cmdline(char *cmdline, bool video)
{
}
+static void kvm__arch_enable_mte(struct kvm *kvm)
+{
+ struct kvm_enable_cap cap = {
+ .cap = KVM_CAP_ARM_MTE,
+ };
+
+ if (kvm->cfg.arch.aarch32_guest) {
+ pr_debug("MTE is incompatible with AArch32");
+ return;
+ }
+
+ if (kvm->cfg.arch.mte_disabled) {
+ pr_debug("MTE disabled by user");
+ return;
+ }
+
+ if (!kvm__supports_extension(kvm, KVM_CAP_ARM_MTE)) {
+ pr_debug("MTE capability not available");
+ return;
+ }
+
+ if (ioctl(kvm->vm_fd, KVM_ENABLE_CAP, &cap))
+ die_perror("KVM_ENABLE_CAP(KVM_CAP_ARM_MTE)");
+
+ pr_debug("MTE capability enabled");
+}
+
void kvm__arch_init(struct kvm *kvm)
{
/* Create the virtual GIC. */
@@ -96,6 +132,90 @@ void kvm__arch_init(struct kvm *kvm)
kvm__arch_enable_mte(kvm);
}
+static u64 kvm__arch_get_payload_region_size(struct kvm *kvm)
+{
+ if (kvm->cfg.arch.aarch32_guest)
+ return SZ_256M;
+
+ return SZ_512M;
+}
+
+/*
+ * Return the TEXT_OFFSET value that the guest kernel expects. Note
+ * that pre-3.17 kernels expose this value using the native endianness
+ * instead of Little-Endian. BE kernels of this vintage may fail to
+ * boot. See Documentation/arm64/booting.rst in your local kernel tree.
+ */
+static u64 kvm__arch_get_kern_offset(struct kvm *kvm)
+{
+ const char *debug_str;
+
+ /* the 32bit kernel offset is a well known value */
+ if (kvm->cfg.arch.aarch32_guest)
+ return 0x8000;
+
+ if (!kernel_header) {
+ debug_str = "Kernel header is missing";
+ goto default_offset;
+ }
+
+ if (!le64_to_cpu(kernel_header->image_size)) {
+ debug_str = "Image size is 0";
+ goto default_offset;
+ }
+
+ return le64_to_cpu(kernel_header->text_offset);
+
+default_offset:
+ pr_debug("%s, assuming TEXT_OFFSET to be 0x80000", debug_str);
+ return 0x80000;
+}
+
+static void kvm__arch_read_kernel_header(struct kvm *kvm, int fd)
+{
+ const char *debug_str;
+ off_t cur_offset;
+ ssize_t size;
+
+ if (kvm->cfg.arch.aarch32_guest)
+ return;
+
+ kernel_header = malloc(sizeof(*kernel_header));
+ if (!kernel_header)
+ return;
+
+ cur_offset = lseek(fd, 0, SEEK_CUR);
+ if (cur_offset == (off_t)-1 || lseek(fd, 0, SEEK_SET) == (off_t)-1) {
+ debug_str = "Failed to seek in kernel image file";
+ goto fail;
+ }
+
+ size = xread(fd, kernel_header, sizeof(*kernel_header));
+ if (size < 0 || (size_t)size < sizeof(*kernel_header))
+ die("Failed to read kernel image header");
+
+ lseek(fd, cur_offset, SEEK_SET);
+
+ if (memcmp(&kernel_header->magic, ARM64_IMAGE_MAGIC, sizeof(kernel_header->magic))) {
+ debug_str = "Kernel image magic not matching";
+ kernel_header = NULL;
+ goto fail;
+ }
+
+ return;
+
+fail:
+ pr_debug("%s, using defaults", debug_str);
+}
+
+static u64 kvm__arch_get_kernel_size(struct kvm *kvm)
+{
+ if (kvm->cfg.arch.aarch32_guest || !kernel_header)
+ return 0;
+
+ return le64_to_cpu(kernel_header->image_size);
+}
+
#define FDT_ALIGN SZ_2M
#define INITRD_ALIGN 4
bool kvm__arch_load_kernel_image(struct kvm *kvm, int fd_kernel, int fd_initrd,
@@ -264,3 +384,93 @@ int kvm__arch_setup_firmware(struct kvm *kvm)
{
return 0;
}
+
+int vcpu_affinity_parser(const struct option *opt, const char *arg, int unset)
+{
+ struct kvm *kvm = opt->ptr;
+ const char *cpulist = arg;
+ cpumask_t *cpumask;
+ int cpu, ret;
+
+ kvm->cfg.arch.vcpu_affinity = cpulist;
+
+ cpumask = calloc(1, cpumask_size());
+ if (!cpumask)
+ die_perror("calloc");
+
+ ret = cpulist_parse(cpulist, cpumask);
+ if (ret) {
+ free(cpumask);
+ return ret;
+ }
+
+ kvm->arch.vcpu_affinity_cpuset = CPU_ALLOC(NR_CPUS);
+ if (!kvm->arch.vcpu_affinity_cpuset)
+ die_perror("CPU_ALLOC");
+ CPU_ZERO_S(CPU_ALLOC_SIZE(NR_CPUS), kvm->arch.vcpu_affinity_cpuset);
+
+ for_each_cpu(cpu, cpumask)
+ CPU_SET(cpu, kvm->arch.vcpu_affinity_cpuset);
+
+ return 0;
+}
+
+void kvm__arch_validate_cfg(struct kvm *kvm)
+{
+
+ if (kvm->cfg.ram_addr < ARM_MEMORY_AREA) {
+ die("RAM address is below the I/O region ending at %luGB",
+ ARM_MEMORY_AREA >> 30);
+ }
+
+ if (kvm->cfg.arch.aarch32_guest &&
+ kvm->cfg.ram_addr + kvm->cfg.ram_size > SZ_4G) {
+ die("RAM extends above 4GB");
+ }
+}
+
+u64 kvm__arch_default_ram_address(void)
+{
+ return ARM_MEMORY_AREA;
+}
+
+static int kvm__arch_get_ipa_limit(struct kvm *kvm)
+{
+ int ret;
+
+ ret = ioctl(kvm->sys_fd, KVM_CHECK_EXTENSION, KVM_CAP_ARM_VM_IPA_SIZE);
+ if (ret <= 0)
+ ret = 0;
+
+ return ret;
+}
+
+int kvm__get_vm_type(struct kvm *kvm)
+{
+ unsigned int ipa_bits, max_ipa_bits;
+ unsigned long max_ipa;
+
+ /* If we're running on an old kernel, use 0 as the VM type */
+ max_ipa_bits = kvm__arch_get_ipa_limit(kvm);
+ if (!max_ipa_bits)
+ return 0;
+
+ /* Otherwise, compute the minimal required IPA size */
+ max_ipa = kvm->cfg.ram_addr + kvm->cfg.ram_size - 1;
+ ipa_bits = max(32, fls_long(max_ipa));
+ pr_debug("max_ipa %lx ipa_bits %d max_ipa_bits %d",
+ max_ipa, ipa_bits, max_ipa_bits);
+
+ if (ipa_bits > max_ipa_bits)
+ die("Memory too large for this system (needs %d bits, %d available)", ipa_bits, max_ipa_bits);
+
+ return KVM_VM_TYPE_ARM_IPA_SIZE(ipa_bits);
+}
+
+static int kvm__arch_free_kernel_header(struct kvm *kvm)
+{
+ free(kernel_header);
+
+ return 0;
+}
+late_exit(kvm__arch_free_kernel_header);
--
2.39.5
^ permalink raw reply related [flat|nested] 20+ messages in thread* Re: [RFC kvmtool 3/9] arm64: Combine kvm.c
2025-03-14 22:25 ` [RFC kvmtool 3/9] arm64: Combine kvm.c Oliver Upton
@ 2025-03-20 16:59 ` Alexandru Elisei
0 siblings, 0 replies; 20+ messages in thread
From: Alexandru Elisei @ 2025-03-20 16:59 UTC (permalink / raw)
To: Oliver Upton; +Cc: kvmarm, kvm, Will Deacon, Julien Thierry
Hi Oliver,
On Fri, Mar 14, 2025 at 03:25:10PM -0700, Oliver Upton wrote:
> Glue together the ARM common and previously arm64-specific bits into one
> source file.
>
> Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
> ---
> Makefile | 1 -
> arm/aarch64/include/kvm/kvm-arch.h | 22 ---
> arm/aarch64/kvm.c | 212 ---------------------
> arm/include/{arm-common => kvm}/kvm-arch.h | 4 +
> arm/kvm.c | 210 ++++++++++++++++++++
> 5 files changed, 214 insertions(+), 235 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%)
>
> diff --git a/Makefile b/Makefile
> index cf50cf7..72027e0 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -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
> diff --git a/arm/aarch64/include/kvm/kvm-arch.h b/arm/aarch64/include/kvm/kvm-arch.h
> deleted file mode 100644
> index 2d1a4ed..0000000
> diff --git a/arm/aarch64/kvm.c b/arm/aarch64/kvm.c
> deleted file mode 100644
> index 98b2437..0000000
> diff --git a/arm/include/arm-common/kvm-arch.h b/arm/include/kvm/kvm-arch.h
> similarity index 97%
> rename from arm/include/arm-common/kvm-arch.h
> rename to arm/include/kvm/kvm-arch.h
> index 60eec02..b55b3bf 100644
> --- a/arm/include/arm-common/kvm-arch.h
> +++ b/arm/include/kvm/kvm-arch.h
> @@ -84,6 +84,10 @@
>
> #define ARCH_HAS_PCI_EXP 1
>
> +#define MAX_PAGE_SIZE SZ_64K
> +
> +#define ARCH_HAS_CFG_RAM_ADDRESS 1
Would you mind grouping ARCH_HAS_* defines together?
> +
> static inline bool arm_addr_in_ioport_region(u64 phys_addr)
> {
> u64 limit = KVM_IOPORT_AREA + ARM_IOPORT_SIZE;
> diff --git a/arm/kvm.c b/arm/kvm.c
> index cc0cc4f..5e7fe77 100644
> --- a/arm/kvm.c
> +++ b/arm/kvm.c
> @@ -7,10 +7,19 @@
>
> #include "arm-common/gic.h"
>
> +#include <linux/byteorder.h>
> +#include <linux/cpumask.h>
> #include <linux/kernel.h>
> #include <linux/kvm.h>
> #include <linux/sizes.h>
>
> +#include <asm/image.h>
> +
> +#include <kvm/util.h>
kvm/util.h is already included at the top of the file. Otherwise looks good
to me.
Thanks,
Alex
> +
> +
> +static struct arm64_image_header *kernel_header;
> +
> struct kvm_ext kvm_req_ext[] = {
> { DEFINE_KVM_EXT(KVM_CAP_IRQCHIP) },
> { DEFINE_KVM_EXT(KVM_CAP_ONE_REG) },
> @@ -87,6 +96,33 @@ void kvm__arch_set_cmdline(char *cmdline, bool video)
> {
> }
>
> +static void kvm__arch_enable_mte(struct kvm *kvm)
> +{
> + struct kvm_enable_cap cap = {
> + .cap = KVM_CAP_ARM_MTE,
> + };
> +
> + if (kvm->cfg.arch.aarch32_guest) {
> + pr_debug("MTE is incompatible with AArch32");
> + return;
> + }
> +
> + if (kvm->cfg.arch.mte_disabled) {
> + pr_debug("MTE disabled by user");
> + return;
> + }
> +
> + if (!kvm__supports_extension(kvm, KVM_CAP_ARM_MTE)) {
> + pr_debug("MTE capability not available");
> + return;
> + }
> +
> + if (ioctl(kvm->vm_fd, KVM_ENABLE_CAP, &cap))
> + die_perror("KVM_ENABLE_CAP(KVM_CAP_ARM_MTE)");
> +
> + pr_debug("MTE capability enabled");
> +}
> +
> void kvm__arch_init(struct kvm *kvm)
> {
> /* Create the virtual GIC. */
> @@ -96,6 +132,90 @@ void kvm__arch_init(struct kvm *kvm)
> kvm__arch_enable_mte(kvm);
> }
>
> +static u64 kvm__arch_get_payload_region_size(struct kvm *kvm)
> +{
> + if (kvm->cfg.arch.aarch32_guest)
> + return SZ_256M;
> +
> + return SZ_512M;
> +}
> +
> +/*
> + * Return the TEXT_OFFSET value that the guest kernel expects. Note
> + * that pre-3.17 kernels expose this value using the native endianness
> + * instead of Little-Endian. BE kernels of this vintage may fail to
> + * boot. See Documentation/arm64/booting.rst in your local kernel tree.
> + */
> +static u64 kvm__arch_get_kern_offset(struct kvm *kvm)
> +{
> + const char *debug_str;
> +
> + /* the 32bit kernel offset is a well known value */
> + if (kvm->cfg.arch.aarch32_guest)
> + return 0x8000;
> +
> + if (!kernel_header) {
> + debug_str = "Kernel header is missing";
> + goto default_offset;
> + }
> +
> + if (!le64_to_cpu(kernel_header->image_size)) {
> + debug_str = "Image size is 0";
> + goto default_offset;
> + }
> +
> + return le64_to_cpu(kernel_header->text_offset);
> +
> +default_offset:
> + pr_debug("%s, assuming TEXT_OFFSET to be 0x80000", debug_str);
> + return 0x80000;
> +}
> +
> +static void kvm__arch_read_kernel_header(struct kvm *kvm, int fd)
> +{
> + const char *debug_str;
> + off_t cur_offset;
> + ssize_t size;
> +
> + if (kvm->cfg.arch.aarch32_guest)
> + return;
> +
> + kernel_header = malloc(sizeof(*kernel_header));
> + if (!kernel_header)
> + return;
> +
> + cur_offset = lseek(fd, 0, SEEK_CUR);
> + if (cur_offset == (off_t)-1 || lseek(fd, 0, SEEK_SET) == (off_t)-1) {
> + debug_str = "Failed to seek in kernel image file";
> + goto fail;
> + }
> +
> + size = xread(fd, kernel_header, sizeof(*kernel_header));
> + if (size < 0 || (size_t)size < sizeof(*kernel_header))
> + die("Failed to read kernel image header");
> +
> + lseek(fd, cur_offset, SEEK_SET);
> +
> + if (memcmp(&kernel_header->magic, ARM64_IMAGE_MAGIC, sizeof(kernel_header->magic))) {
> + debug_str = "Kernel image magic not matching";
> + kernel_header = NULL;
> + goto fail;
> + }
> +
> + return;
> +
> +fail:
> + pr_debug("%s, using defaults", debug_str);
> +}
> +
> +static u64 kvm__arch_get_kernel_size(struct kvm *kvm)
> +{
> + if (kvm->cfg.arch.aarch32_guest || !kernel_header)
> + return 0;
> +
> + return le64_to_cpu(kernel_header->image_size);
> +}
> +
> #define FDT_ALIGN SZ_2M
> #define INITRD_ALIGN 4
> bool kvm__arch_load_kernel_image(struct kvm *kvm, int fd_kernel, int fd_initrd,
> @@ -264,3 +384,93 @@ int kvm__arch_setup_firmware(struct kvm *kvm)
> {
> return 0;
> }
> +
> +int vcpu_affinity_parser(const struct option *opt, const char *arg, int unset)
> +{
> + struct kvm *kvm = opt->ptr;
> + const char *cpulist = arg;
> + cpumask_t *cpumask;
> + int cpu, ret;
> +
> + kvm->cfg.arch.vcpu_affinity = cpulist;
> +
> + cpumask = calloc(1, cpumask_size());
> + if (!cpumask)
> + die_perror("calloc");
> +
> + ret = cpulist_parse(cpulist, cpumask);
> + if (ret) {
> + free(cpumask);
> + return ret;
> + }
> +
> + kvm->arch.vcpu_affinity_cpuset = CPU_ALLOC(NR_CPUS);
> + if (!kvm->arch.vcpu_affinity_cpuset)
> + die_perror("CPU_ALLOC");
> + CPU_ZERO_S(CPU_ALLOC_SIZE(NR_CPUS), kvm->arch.vcpu_affinity_cpuset);
> +
> + for_each_cpu(cpu, cpumask)
> + CPU_SET(cpu, kvm->arch.vcpu_affinity_cpuset);
> +
> + return 0;
> +}
> +
> +void kvm__arch_validate_cfg(struct kvm *kvm)
> +{
> +
> + if (kvm->cfg.ram_addr < ARM_MEMORY_AREA) {
> + die("RAM address is below the I/O region ending at %luGB",
> + ARM_MEMORY_AREA >> 30);
> + }
> +
> + if (kvm->cfg.arch.aarch32_guest &&
> + kvm->cfg.ram_addr + kvm->cfg.ram_size > SZ_4G) {
> + die("RAM extends above 4GB");
> + }
> +}
> +
> +u64 kvm__arch_default_ram_address(void)
> +{
> + return ARM_MEMORY_AREA;
> +}
> +
> +static int kvm__arch_get_ipa_limit(struct kvm *kvm)
> +{
> + int ret;
> +
> + ret = ioctl(kvm->sys_fd, KVM_CHECK_EXTENSION, KVM_CAP_ARM_VM_IPA_SIZE);
> + if (ret <= 0)
> + ret = 0;
> +
> + return ret;
> +}
> +
> +int kvm__get_vm_type(struct kvm *kvm)
> +{
> + unsigned int ipa_bits, max_ipa_bits;
> + unsigned long max_ipa;
> +
> + /* If we're running on an old kernel, use 0 as the VM type */
> + max_ipa_bits = kvm__arch_get_ipa_limit(kvm);
> + if (!max_ipa_bits)
> + return 0;
> +
> + /* Otherwise, compute the minimal required IPA size */
> + max_ipa = kvm->cfg.ram_addr + kvm->cfg.ram_size - 1;
> + ipa_bits = max(32, fls_long(max_ipa));
> + pr_debug("max_ipa %lx ipa_bits %d max_ipa_bits %d",
> + max_ipa, ipa_bits, max_ipa_bits);
> +
> + if (ipa_bits > max_ipa_bits)
> + die("Memory too large for this system (needs %d bits, %d available)", ipa_bits, max_ipa_bits);
> +
> + return KVM_VM_TYPE_ARM_IPA_SIZE(ipa_bits);
> +}
> +
> +static int kvm__arch_free_kernel_header(struct kvm *kvm)
> +{
> + free(kernel_header);
> +
> + return 0;
> +}
> +late_exit(kvm__arch_free_kernel_header);
> --
> 2.39.5
>
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* [RFC kvmtool 4/9] arm64: Merge kvm-cpu.c
2025-03-14 22:25 [RFC kvmtool 0/9] arm: Drop support for 32-bit kvmtool Oliver Upton
` (2 preceding siblings ...)
2025-03-14 22:25 ` [RFC kvmtool 3/9] arm64: Combine kvm.c Oliver Upton
@ 2025-03-14 22:25 ` Oliver Upton
2025-03-14 22:25 ` [RFC kvmtool 5/9] arm64: Combine kvm-config-arch.h Oliver Upton
` (6 subsequent siblings)
10 siblings, 0 replies; 20+ messages in thread
From: Oliver Upton @ 2025-03-14 22:25 UTC (permalink / raw)
To: kvmarm; +Cc: kvm, Will Deacon, Julien Thierry, Oliver Upton
As before, glue together the arm64 and ARM generic bits into one file.
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
---
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%)
diff --git a/Makefile b/Makefile
index 72027e0..25ee9b0 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/arm/aarch64/include/kvm/kvm-cpu-arch.h b/arm/aarch64/include/kvm/kvm-cpu-arch.h
deleted file mode 100644
index aeae8c1..0000000
diff --git a/arm/aarch64/kvm-cpu.c b/arm/aarch64/kvm-cpu.c
deleted file mode 100644
index 7b6061a..0000000
diff --git a/arm/include/arm-common/kvm-cpu-arch.h b/arm/include/kvm/kvm-cpu-arch.h
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
--- a/arm/include/arm-common/kvm-cpu-arch.h
+++ b/arm/include/kvm/kvm-cpu-arch.h
@@ -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 */
diff --git a/arm/kvm-cpu.c b/arm/kvm-cpu.c
index a43eb90..94c08a4 100644
--- a/arm/kvm-cpu.c
+++ b/arm/kvm-cpu.c
@@ -1,5 +1,17 @@
#include "kvm/kvm.h"
#include "kvm/kvm-cpu.h"
+#include "kvm/virtio.h"
+
+#include <asm/ptrace.h>
+#include <linux/bitops.h>
+
+#define COMPAT_PSR_F_BIT 0x00000040
+#define COMPAT_PSR_I_BIT 0x00000080
+#define COMPAT_PSR_E_BIT 0x00000200
+#define COMPAT_PSR_MODE_SVC 0x00000013
+
+#define SCTLR_EL1_E0E_MASK (1 << 24)
+#define SCTLR_EL1_EE_MASK (1 << 25)
static int debug_fd;
@@ -35,6 +47,74 @@ int kvm_cpu__register_kvm_arm_target(struct kvm_arm_target *target)
return -ENOSPC;
}
+static void kvm_cpu__select_features(struct kvm *kvm, struct kvm_vcpu_init *init)
+{
+ if (kvm->cfg.arch.aarch32_guest) {
+ if (!kvm__supports_extension(kvm, KVM_CAP_ARM_EL1_32BIT))
+ die("32bit guests are not supported\n");
+ init->features[0] |= 1UL << KVM_ARM_VCPU_EL1_32BIT;
+ }
+
+ if (kvm->cfg.arch.has_pmuv3) {
+ if (!kvm__supports_extension(kvm, KVM_CAP_ARM_PMU_V3))
+ die("PMUv3 is not supported");
+ init->features[0] |= 1UL << KVM_ARM_VCPU_PMU_V3;
+ }
+
+ /* Enable pointer authentication if available */
+ if (kvm__supports_extension(kvm, KVM_CAP_ARM_PTRAUTH_ADDRESS) &&
+ kvm__supports_extension(kvm, KVM_CAP_ARM_PTRAUTH_GENERIC)) {
+ init->features[0] |= 1UL << KVM_ARM_VCPU_PTRAUTH_ADDRESS;
+ init->features[0] |= 1UL << KVM_ARM_VCPU_PTRAUTH_GENERIC;
+ }
+
+ /* Enable SVE if available */
+ if (kvm__supports_extension(kvm, KVM_CAP_ARM_SVE))
+ init->features[0] |= 1UL << KVM_ARM_VCPU_SVE;
+}
+
+static int vcpu_configure_sve(struct kvm_cpu *vcpu)
+{
+ unsigned int max_vq = vcpu->kvm->cfg.arch.sve_max_vq;
+ int feature = KVM_ARM_VCPU_SVE;
+
+ if (max_vq) {
+ unsigned long vls[KVM_ARM64_SVE_VLS_WORDS];
+ struct kvm_one_reg reg = {
+ .id = KVM_REG_ARM64_SVE_VLS,
+ .addr = (u64)&vls,
+ };
+ unsigned int vq;
+
+ if (ioctl(vcpu->vcpu_fd, KVM_GET_ONE_REG, ®))
+ die_perror("KVM_GET_ONE_REG failed (KVM_ARM64_SVE_VLS)");
+
+ if (!test_bit(max_vq - KVM_ARM64_SVE_VQ_MIN, vls))
+ die("SVE vector length (%u) not supported", max_vq * 128);
+
+ for (vq = KVM_ARM64_SVE_VQ_MAX; vq > max_vq; vq--)
+ clear_bit(vq - KVM_ARM64_SVE_VQ_MIN, vls);
+
+ if (ioctl(vcpu->vcpu_fd, KVM_SET_ONE_REG, ®))
+ die_perror("KVM_SET_ONE_REG failed (KVM_ARM64_SVE_VLS)");
+ }
+
+ if (ioctl(vcpu->vcpu_fd, KVM_ARM_VCPU_FINALIZE, &feature)) {
+ pr_err("KVM_ARM_VCPU_FINALIZE: %s", strerror(errno));
+ return -1;
+ }
+
+ return 0;
+}
+
+static int kvm_cpu__configure_features(struct kvm_cpu *vcpu)
+{
+ if (kvm__supports_extension(vcpu->kvm, KVM_CAP_ARM_SVE))
+ return vcpu_configure_sve(vcpu);
+
+ return 0;
+}
+
struct kvm_cpu *kvm_cpu__arch_init(struct kvm *kvm, unsigned long cpu_id)
{
struct kvm_arm_target *target = NULL;
@@ -151,3 +231,251 @@ bool kvm_cpu__handle_exit(struct kvm_cpu *vcpu)
void kvm_cpu__show_page_tables(struct kvm_cpu *vcpu)
{
}
+
+static __u64 __core_reg_id(__u64 offset)
+{
+ __u64 id = KVM_REG_ARM64 | KVM_REG_ARM_CORE | offset;
+
+ if (offset < KVM_REG_ARM_CORE_REG(fp_regs))
+ id |= KVM_REG_SIZE_U64;
+ else if (offset < KVM_REG_ARM_CORE_REG(fp_regs.fpsr))
+ id |= KVM_REG_SIZE_U128;
+ else
+ id |= KVM_REG_SIZE_U32;
+
+ return id;
+}
+
+#define ARM64_CORE_REG(x) __core_reg_id(KVM_REG_ARM_CORE_REG(x))
+
+unsigned long kvm_cpu__get_vcpu_mpidr(struct kvm_cpu *vcpu)
+{
+ struct kvm_one_reg reg;
+ u64 mpidr;
+
+ reg.id = ARM64_SYS_REG(ARM_CPU_ID, ARM_CPU_ID_MPIDR);
+ reg.addr = (u64)&mpidr;
+ if (ioctl(vcpu->vcpu_fd, KVM_GET_ONE_REG, ®) < 0)
+ die("KVM_GET_ONE_REG failed (get_mpidr vcpu%ld", vcpu->cpu_id);
+
+ return mpidr;
+}
+
+static void reset_vcpu_aarch32(struct kvm_cpu *vcpu)
+{
+ struct kvm *kvm = vcpu->kvm;
+ struct kvm_one_reg reg;
+ u64 data;
+
+ reg.addr = (u64)&data;
+
+ /* pstate = all interrupts masked */
+ data = COMPAT_PSR_I_BIT | COMPAT_PSR_F_BIT | COMPAT_PSR_MODE_SVC;
+ reg.id = ARM64_CORE_REG(regs.pstate);
+ if (ioctl(vcpu->vcpu_fd, KVM_SET_ONE_REG, ®) < 0)
+ die_perror("KVM_SET_ONE_REG failed (spsr[EL1])");
+
+ /* Secondary cores are stopped awaiting PSCI wakeup */
+ if (vcpu->cpu_id != 0)
+ return;
+
+ /* r0 = 0 */
+ data = 0;
+ reg.id = ARM64_CORE_REG(regs.regs[0]);
+ if (ioctl(vcpu->vcpu_fd, KVM_SET_ONE_REG, ®) < 0)
+ die_perror("KVM_SET_ONE_REG failed (r0)");
+
+ /* r1 = machine type (-1) */
+ data = -1;
+ reg.id = ARM64_CORE_REG(regs.regs[1]);
+ if (ioctl(vcpu->vcpu_fd, KVM_SET_ONE_REG, ®) < 0)
+ die_perror("KVM_SET_ONE_REG failed (r1)");
+
+ /* r2 = physical address of the device tree blob */
+ data = kvm->arch.dtb_guest_start;
+ reg.id = ARM64_CORE_REG(regs.regs[2]);
+ if (ioctl(vcpu->vcpu_fd, KVM_SET_ONE_REG, ®) < 0)
+ die_perror("KVM_SET_ONE_REG failed (r2)");
+
+ /* pc = start of kernel image */
+ data = kvm->arch.kern_guest_start;
+ reg.id = ARM64_CORE_REG(regs.pc);
+ if (ioctl(vcpu->vcpu_fd, KVM_SET_ONE_REG, ®) < 0)
+ die_perror("KVM_SET_ONE_REG failed (pc)");
+}
+
+static void reset_vcpu_aarch64(struct kvm_cpu *vcpu)
+{
+ struct kvm *kvm = vcpu->kvm;
+ struct kvm_one_reg reg;
+ u64 data;
+
+ reg.addr = (u64)&data;
+
+ /* pstate = all interrupts masked */
+ data = PSR_D_BIT | PSR_A_BIT | PSR_I_BIT | PSR_F_BIT | PSR_MODE_EL1h;
+ reg.id = ARM64_CORE_REG(regs.pstate);
+ if (ioctl(vcpu->vcpu_fd, KVM_SET_ONE_REG, ®) < 0)
+ die_perror("KVM_SET_ONE_REG failed (spsr[EL1])");
+
+ /* x1...x3 = 0 */
+ data = 0;
+ reg.id = ARM64_CORE_REG(regs.regs[1]);
+ if (ioctl(vcpu->vcpu_fd, KVM_SET_ONE_REG, ®) < 0)
+ die_perror("KVM_SET_ONE_REG failed (x1)");
+
+ reg.id = ARM64_CORE_REG(regs.regs[2]);
+ if (ioctl(vcpu->vcpu_fd, KVM_SET_ONE_REG, ®) < 0)
+ die_perror("KVM_SET_ONE_REG failed (x2)");
+
+ reg.id = ARM64_CORE_REG(regs.regs[3]);
+ if (ioctl(vcpu->vcpu_fd, KVM_SET_ONE_REG, ®) < 0)
+ die_perror("KVM_SET_ONE_REG failed (x3)");
+
+ /* Secondary cores are stopped awaiting PSCI wakeup */
+ if (vcpu->cpu_id == 0) {
+ /* x0 = physical address of the device tree blob */
+ data = kvm->arch.dtb_guest_start;
+ reg.id = ARM64_CORE_REG(regs.regs[0]);
+ if (ioctl(vcpu->vcpu_fd, KVM_SET_ONE_REG, ®) < 0)
+ die_perror("KVM_SET_ONE_REG failed (x0)");
+
+ /* pc = start of kernel image */
+ data = kvm->arch.kern_guest_start;
+ reg.id = ARM64_CORE_REG(regs.pc);
+ if (ioctl(vcpu->vcpu_fd, KVM_SET_ONE_REG, ®) < 0)
+ die_perror("KVM_SET_ONE_REG failed (pc)");
+ }
+}
+
+int sve_vl_parser(const struct option *opt, const char *arg, int unset)
+{
+ struct kvm *kvm = opt->ptr;
+ unsigned long val;
+ unsigned int vq;
+
+ errno = 0;
+ val = strtoull(arg, NULL, 10);
+ if (errno == ERANGE)
+ die("SVE vector length too large: %s", arg);
+
+ if (!val || (val & (val - 1)))
+ die("SVE vector length isn't power of 2: %s", arg);
+
+ vq = val / 128;
+ if (vq > KVM_ARM64_SVE_VQ_MAX || vq < KVM_ARM64_SVE_VQ_MIN)
+ die("SVE vector length out of range: %s", arg);
+
+ kvm->cfg.arch.sve_max_vq = vq;
+ return 0;
+}
+
+void kvm_cpu__reset_vcpu(struct kvm_cpu *vcpu)
+{
+ struct kvm *kvm = vcpu->kvm;
+ cpu_set_t *affinity;
+ int ret;
+
+ affinity = kvm->arch.vcpu_affinity_cpuset;
+ if (affinity) {
+ ret = sched_setaffinity(0, sizeof(cpu_set_t), affinity);
+ if (ret == -1)
+ die_perror("sched_setaffinity");
+ }
+
+ if (kvm->cfg.arch.aarch32_guest)
+ return reset_vcpu_aarch32(vcpu);
+ else
+ return reset_vcpu_aarch64(vcpu);
+}
+
+int kvm_cpu__get_endianness(struct kvm_cpu *vcpu)
+{
+ struct kvm_one_reg reg;
+ u64 psr;
+ u64 sctlr;
+
+ /*
+ * Quoting the definition given by Peter Maydell:
+ *
+ * "Endianness of the CPU which does the virtio reset at the
+ * point when it does that reset"
+ *
+ * We first check for an AArch32 guest: its endianness can
+ * change when using SETEND, which affects the CPSR.E bit.
+ *
+ * If we're AArch64, use SCTLR_EL1.E0E if access comes from
+ * EL0, and SCTLR_EL1.EE if access comes from EL1.
+ */
+ reg.id = ARM64_CORE_REG(regs.pstate);
+ reg.addr = (u64)&psr;
+ if (ioctl(vcpu->vcpu_fd, KVM_GET_ONE_REG, ®) < 0)
+ die("KVM_GET_ONE_REG failed (spsr[EL1])");
+
+ if (psr & PSR_MODE32_BIT)
+ return (psr & COMPAT_PSR_E_BIT) ? VIRTIO_ENDIAN_BE : VIRTIO_ENDIAN_LE;
+
+ reg.id = ARM64_SYS_REG(ARM_CPU_CTRL, ARM_CPU_CTRL_SCTLR_EL1);
+ reg.addr = (u64)&sctlr;
+ if (ioctl(vcpu->vcpu_fd, KVM_GET_ONE_REG, ®) < 0)
+ die("KVM_GET_ONE_REG failed (SCTLR_EL1)");
+
+ if ((psr & PSR_MODE_MASK) == PSR_MODE_EL0t)
+ sctlr &= SCTLR_EL1_E0E_MASK;
+ else
+ sctlr &= SCTLR_EL1_EE_MASK;
+ return sctlr ? VIRTIO_ENDIAN_BE : VIRTIO_ENDIAN_LE;
+}
+
+void kvm_cpu__show_code(struct kvm_cpu *vcpu)
+{
+ struct kvm_one_reg reg;
+ unsigned long data;
+ int debug_fd = kvm_cpu__get_debug_fd();
+
+ reg.addr = (u64)&data;
+
+ dprintf(debug_fd, "\n*pc:\n");
+ reg.id = ARM64_CORE_REG(regs.pc);
+ if (ioctl(vcpu->vcpu_fd, KVM_GET_ONE_REG, ®) < 0)
+ die("KVM_GET_ONE_REG failed (show_code @ PC)");
+
+ kvm__dump_mem(vcpu->kvm, data, 32, debug_fd);
+
+ dprintf(debug_fd, "\n*lr:\n");
+ reg.id = ARM64_CORE_REG(regs.regs[30]);
+ if (ioctl(vcpu->vcpu_fd, KVM_GET_ONE_REG, ®) < 0)
+ die("KVM_GET_ONE_REG failed (show_code @ LR)");
+
+ kvm__dump_mem(vcpu->kvm, data, 32, debug_fd);
+}
+
+void kvm_cpu__show_registers(struct kvm_cpu *vcpu)
+{
+ struct kvm_one_reg reg;
+ unsigned long data;
+ int debug_fd = kvm_cpu__get_debug_fd();
+
+ reg.addr = (u64)&data;
+ dprintf(debug_fd, "\n Registers:\n");
+
+ reg.id = ARM64_CORE_REG(regs.pc);
+ if (ioctl(vcpu->vcpu_fd, KVM_GET_ONE_REG, ®) < 0)
+ die("KVM_GET_ONE_REG failed (pc)");
+ dprintf(debug_fd, " PC: 0x%lx\n", data);
+
+ reg.id = ARM64_CORE_REG(regs.pstate);
+ if (ioctl(vcpu->vcpu_fd, KVM_GET_ONE_REG, ®) < 0)
+ die("KVM_GET_ONE_REG failed (pstate)");
+ dprintf(debug_fd, " PSTATE: 0x%lx\n", data);
+
+ reg.id = ARM64_CORE_REG(sp_el1);
+ if (ioctl(vcpu->vcpu_fd, KVM_GET_ONE_REG, ®) < 0)
+ die("KVM_GET_ONE_REG failed (sp_el1)");
+ dprintf(debug_fd, " SP_EL1: 0x%lx\n", data);
+
+ reg.id = ARM64_CORE_REG(regs.regs[30]);
+ if (ioctl(vcpu->vcpu_fd, KVM_GET_ONE_REG, ®) < 0)
+ die("KVM_GET_ONE_REG failed (lr)");
+ dprintf(debug_fd, " LR: 0x%lx\n", data);
+}
--
2.39.5
^ permalink raw reply related [flat|nested] 20+ messages in thread* [RFC kvmtool 5/9] arm64: Combine kvm-config-arch.h
2025-03-14 22:25 [RFC kvmtool 0/9] arm: Drop support for 32-bit kvmtool Oliver Upton
` (3 preceding siblings ...)
2025-03-14 22:25 ` [RFC kvmtool 4/9] arm64: Merge kvm-cpu.c Oliver Upton
@ 2025-03-14 22:25 ` Oliver Upton
2025-03-14 22:25 ` [RFC kvmtool 6/9] arm64: Move remaining kvm/* headers Oliver Upton
` (5 subsequent siblings)
10 siblings, 0 replies; 20+ messages in thread
From: Oliver Upton @ 2025-03-14 22:25 UTC (permalink / raw)
To: kvmarm; +Cc: kvm, Will Deacon, Julien Thierry, Oliver Upton
You get the point...
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
---
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%)
diff --git a/arm/aarch64/include/kvm/kvm-config-arch.h b/arm/aarch64/include/kvm/kvm-config-arch.h
deleted file mode 100644
index 642fe67..0000000
diff --git a/arm/include/arm-common/kvm-config-arch.h b/arm/include/kvm/kvm-config-arch.h
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
--- a/arm/include/arm-common/kvm-config-arch.h
+++ b/arm/include/kvm/kvm-config-arch.h
@@ -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), \
--
2.39.5
^ permalink raw reply related [flat|nested] 20+ messages in thread* [RFC kvmtool 6/9] arm64: Move remaining kvm/* headers
2025-03-14 22:25 [RFC kvmtool 0/9] arm: Drop support for 32-bit kvmtool Oliver Upton
` (4 preceding siblings ...)
2025-03-14 22:25 ` [RFC kvmtool 5/9] arm64: Combine kvm-config-arch.h Oliver Upton
@ 2025-03-14 22:25 ` Oliver Upton
2025-03-14 22:25 ` [RFC kvmtool 7/9] arm64: Move asm headers Oliver Upton
` (4 subsequent siblings)
10 siblings, 0 replies; 20+ messages in thread
From: Oliver Upton @ 2025-03-14 22:25 UTC (permalink / raw)
To: kvmarm; +Cc: kvm, Will Deacon, Julien Thierry, Oliver Upton
Move the remaining kvm/* headers into the top-level ARM include path.
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
---
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%)
diff --git a/arm/aarch64/include/kvm/fdt-arch.h b/arm/aarch64/include/kvm/fdt-arch.h
deleted file mode 100644
index e448bf1..0000000
diff --git a/arm/aarch64/include/kvm/barrier.h b/arm/include/kvm/barrier.h
similarity index 100%
rename from arm/aarch64/include/kvm/barrier.h
rename to arm/include/kvm/barrier.h
diff --git a/arm/include/arm-common/fdt-arch.h b/arm/include/kvm/fdt-arch.h
similarity index 100%
rename from arm/include/arm-common/fdt-arch.h
rename to arm/include/kvm/fdt-arch.h
--
2.39.5
^ permalink raw reply [flat|nested] 20+ messages in thread* [RFC kvmtool 7/9] arm64: Move asm headers
2025-03-14 22:25 [RFC kvmtool 0/9] arm: Drop support for 32-bit kvmtool Oliver Upton
` (5 preceding siblings ...)
2025-03-14 22:25 ` [RFC kvmtool 6/9] arm64: Move remaining kvm/* headers Oliver Upton
@ 2025-03-14 22:25 ` Oliver Upton
2025-03-14 22:25 ` [RFC kvmtool 8/9] arm64: Rename top-level directory Oliver Upton
` (3 subsequent siblings)
10 siblings, 0 replies; 20+ messages in thread
From: Oliver Upton @ 2025-03-14 22:25 UTC (permalink / raw)
To: kvmarm; +Cc: kvm, Will Deacon, Julien Thierry, Oliver Upton
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
---
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%)
diff --git a/Makefile b/Makefile
index 25ee9b0..3085609 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/arm/aarch64/include/asm/image.h b/arm/include/asm/image.h
similarity index 100%
rename from arm/aarch64/include/asm/image.h
rename to arm/include/asm/image.h
diff --git a/arm/aarch64/include/asm/kernel.h b/arm/include/asm/kernel.h
similarity index 100%
rename from arm/aarch64/include/asm/kernel.h
rename to arm/include/asm/kernel.h
diff --git a/arm/aarch64/include/asm/kvm.h b/arm/include/asm/kvm.h
similarity index 100%
rename from arm/aarch64/include/asm/kvm.h
rename to arm/include/asm/kvm.h
diff --git a/arm/aarch64/include/asm/pmu.h b/arm/include/asm/pmu.h
similarity index 100%
rename from arm/aarch64/include/asm/pmu.h
rename to arm/include/asm/pmu.h
diff --git a/arm/aarch64/include/asm/sve_context.h b/arm/include/asm/sve_context.h
similarity index 100%
rename from arm/aarch64/include/asm/sve_context.h
rename to arm/include/asm/sve_context.h
--
2.39.5
^ permalink raw reply related [flat|nested] 20+ messages in thread* [RFC kvmtool 8/9] arm64: Rename top-level directory
2025-03-14 22:25 [RFC kvmtool 0/9] arm: Drop support for 32-bit kvmtool Oliver Upton
` (6 preceding siblings ...)
2025-03-14 22:25 ` [RFC kvmtool 7/9] arm64: Move asm headers Oliver Upton
@ 2025-03-14 22:25 ` Oliver Upton
2025-03-14 22:25 ` [RFC kvmtool 9/9] arm64: Get rid of the 'arm-common' include directory Oliver Upton
` (2 subsequent siblings)
10 siblings, 0 replies; 20+ messages in thread
From: Oliver Upton @ 2025-03-14 22:25 UTC (permalink / raw)
To: kvmarm; +Cc: kvm, Will Deacon, Julien Thierry, Oliver Upton
As a finishing touch, align the top-level arch directory name with the
kernel's naming scheme.
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
---
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%)
diff --git a/Makefile b/Makefile
index 3085609..60e551f 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/arm/arm-cpu.c b/arm64/arm-cpu.c
similarity index 100%
rename from arm/arm-cpu.c
rename to arm64/arm-cpu.c
diff --git a/arm/fdt.c b/arm64/fdt.c
similarity index 100%
rename from arm/fdt.c
rename to arm64/fdt.c
diff --git a/arm/gic.c b/arm64/gic.c
similarity index 100%
rename from arm/gic.c
rename to arm64/gic.c
diff --git a/arm/gicv2m.c b/arm64/gicv2m.c
similarity index 100%
rename from arm/gicv2m.c
rename to arm64/gicv2m.c
diff --git a/arm/include/arm-common/gic.h b/arm64/include/arm-common/gic.h
similarity index 100%
rename from arm/include/arm-common/gic.h
rename to arm64/include/arm-common/gic.h
diff --git a/arm/include/arm-common/pci.h b/arm64/include/arm-common/pci.h
similarity index 100%
rename from arm/include/arm-common/pci.h
rename to arm64/include/arm-common/pci.h
diff --git a/arm/include/arm-common/timer.h b/arm64/include/arm-common/timer.h
similarity index 100%
rename from arm/include/arm-common/timer.h
rename to arm64/include/arm-common/timer.h
diff --git a/arm/include/asm/image.h b/arm64/include/asm/image.h
similarity index 100%
rename from arm/include/asm/image.h
rename to arm64/include/asm/image.h
diff --git a/arm/include/asm/kernel.h b/arm64/include/asm/kernel.h
similarity index 100%
rename from arm/include/asm/kernel.h
rename to arm64/include/asm/kernel.h
diff --git a/arm/include/asm/kvm.h b/arm64/include/asm/kvm.h
similarity index 100%
rename from arm/include/asm/kvm.h
rename to arm64/include/asm/kvm.h
diff --git a/arm/include/asm/pmu.h b/arm64/include/asm/pmu.h
similarity index 100%
rename from arm/include/asm/pmu.h
rename to arm64/include/asm/pmu.h
diff --git a/arm/include/asm/sve_context.h b/arm64/include/asm/sve_context.h
similarity index 100%
rename from arm/include/asm/sve_context.h
rename to arm64/include/asm/sve_context.h
diff --git a/arm/include/kvm/barrier.h b/arm64/include/kvm/barrier.h
similarity index 100%
rename from arm/include/kvm/barrier.h
rename to arm64/include/kvm/barrier.h
diff --git a/arm/include/kvm/fdt-arch.h b/arm64/include/kvm/fdt-arch.h
similarity index 100%
rename from arm/include/kvm/fdt-arch.h
rename to arm64/include/kvm/fdt-arch.h
diff --git a/arm/include/kvm/kvm-arch.h b/arm64/include/kvm/kvm-arch.h
similarity index 100%
rename from arm/include/kvm/kvm-arch.h
rename to arm64/include/kvm/kvm-arch.h
diff --git a/arm/include/kvm/kvm-config-arch.h b/arm64/include/kvm/kvm-config-arch.h
similarity index 100%
rename from arm/include/kvm/kvm-config-arch.h
rename to arm64/include/kvm/kvm-config-arch.h
diff --git a/arm/include/kvm/kvm-cpu-arch.h b/arm64/include/kvm/kvm-cpu-arch.h
similarity index 100%
rename from arm/include/kvm/kvm-cpu-arch.h
rename to arm64/include/kvm/kvm-cpu-arch.h
diff --git a/arm/ioport.c b/arm64/ioport.c
similarity index 100%
rename from arm/ioport.c
rename to arm64/ioport.c
diff --git a/arm/kvm-cpu.c b/arm64/kvm-cpu.c
similarity index 100%
rename from arm/kvm-cpu.c
rename to arm64/kvm-cpu.c
diff --git a/arm/kvm.c b/arm64/kvm.c
similarity index 100%
rename from arm/kvm.c
rename to arm64/kvm.c
diff --git a/arm/pci.c b/arm64/pci.c
similarity index 100%
rename from arm/pci.c
rename to arm64/pci.c
diff --git a/arm/pmu.c b/arm64/pmu.c
similarity index 100%
rename from arm/pmu.c
rename to arm64/pmu.c
diff --git a/arm/pvtime.c b/arm64/pvtime.c
similarity index 100%
rename from arm/pvtime.c
rename to arm64/pvtime.c
diff --git a/arm/timer.c b/arm64/timer.c
similarity index 100%
rename from arm/timer.c
rename to arm64/timer.c
--
2.39.5
^ permalink raw reply related [flat|nested] 20+ messages in thread* [RFC kvmtool 9/9] arm64: Get rid of the 'arm-common' include directory
2025-03-14 22:25 [RFC kvmtool 0/9] arm: Drop support for 32-bit kvmtool Oliver Upton
` (7 preceding siblings ...)
2025-03-14 22:25 ` [RFC kvmtool 8/9] arm64: Rename top-level directory Oliver Upton
@ 2025-03-14 22:25 ` Oliver Upton
2025-03-20 17:01 ` Alexandru Elisei
2025-03-17 10:39 ` [RFC kvmtool 0/9] arm: Drop support for 32-bit kvmtool Alexandru Elisei
2025-03-17 11:14 ` Marc Zyngier
10 siblings, 1 reply; 20+ messages in thread
From: Oliver Upton @ 2025-03-14 22:25 UTC (permalink / raw)
To: kvmarm; +Cc: kvm, Will Deacon, Julien Thierry, Oliver Upton
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
---
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%)
diff --git a/arm64/arm-cpu.c b/arm64/arm-cpu.c
index f5c8e1e..b9ca814 100644
--- a/arm64/arm-cpu.c
+++ b/arm64/arm-cpu.c
@@ -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"
diff --git a/arm64/fdt.c b/arm64/fdt.c
index 286ccad..9d93551 100644
--- a/arm64/fdt.c
+++ b/arm64/fdt.c
@@ -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>
diff --git a/arm64/gic.c b/arm64/gic.c
index 0795e95..d0d8543 100644
--- a/arm64/gic.c
+++ b/arm64/gic.c
@@ -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>
diff --git a/arm64/gicv2m.c b/arm64/gicv2m.c
index b47ada8..e4e7dc8 100644
--- a/arm64/gicv2m.c
+++ b/arm64/gicv2m.c
@@ -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
diff --git a/arm64/include/arm-common/gic.h b/arm64/include/gic.h
similarity index 100%
rename from arm64/include/arm-common/gic.h
rename to arm64/include/gic.h
diff --git a/arm64/include/kvm/kvm-arch.h b/arm64/include/kvm/kvm-arch.h
index b55b3bf..a9872a8 100644
--- a/arm64/include/kvm/kvm-arch.h
+++ b/arm64/include/kvm/kvm-arch.h
@@ -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):
diff --git a/arm64/include/arm-common/pci.h b/arm64/include/pci.h
similarity index 100%
rename from arm64/include/arm-common/pci.h
rename to arm64/include/pci.h
diff --git a/arm64/include/arm-common/timer.h b/arm64/include/timer.h
similarity index 100%
rename from arm64/include/arm-common/timer.h
rename to arm64/include/timer.h
diff --git a/arm64/kvm.c b/arm64/kvm.c
index 5e7fe77..6ee4c1d 100644
--- a/arm64/kvm.c
+++ b/arm64/kvm.c
@@ -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>
diff --git a/arm64/pci.c b/arm64/pci.c
index 5bd82d4..99bf887 100644
--- a/arm64/pci.c
+++ b/arm64/pci.c
@@ -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:
diff --git a/arm64/pmu.c b/arm64/pmu.c
index 5ed4979..52f4256 100644
--- a/arm64/pmu.c
+++ b/arm64/pmu.c
@@ -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"
diff --git a/arm64/timer.c b/arm64/timer.c
index 6acc50e..b3164f8 100644
--- a/arm64/timer.c
+++ b/arm64/timer.c
@@ -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)
{
--
2.39.5
^ permalink raw reply related [flat|nested] 20+ messages in thread* Re: [RFC kvmtool 9/9] arm64: Get rid of the 'arm-common' include directory
2025-03-14 22:25 ` [RFC kvmtool 9/9] arm64: Get rid of the 'arm-common' include directory Oliver Upton
@ 2025-03-20 17:01 ` Alexandru Elisei
2025-03-25 17:02 ` Oliver Upton
0 siblings, 1 reply; 20+ messages in thread
From: Alexandru Elisei @ 2025-03-20 17:01 UTC (permalink / raw)
To: Oliver Upton; +Cc: kvmarm, kvm, Will Deacon, Julien Thierry
Hi Oliver,
On Fri, Mar 14, 2025 at 03:25:16PM -0700, Oliver Upton wrote:
> Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
> ---
> 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
Looking at x86 and riscv, the pattern is to have the header files in
<arch>/include/kvm, even if they're only used by the arch code.
Do we care about following this pattern?
Thanks,
Alex
> 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%)
>
> diff --git a/arm64/arm-cpu.c b/arm64/arm-cpu.c
> index f5c8e1e..b9ca814 100644
> --- a/arm64/arm-cpu.c
> +++ b/arm64/arm-cpu.c
> @@ -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"
>
> diff --git a/arm64/fdt.c b/arm64/fdt.c
> index 286ccad..9d93551 100644
> --- a/arm64/fdt.c
> +++ b/arm64/fdt.c
> @@ -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>
>
> diff --git a/arm64/gic.c b/arm64/gic.c
> index 0795e95..d0d8543 100644
> --- a/arm64/gic.c
> +++ b/arm64/gic.c
> @@ -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>
> diff --git a/arm64/gicv2m.c b/arm64/gicv2m.c
> index b47ada8..e4e7dc8 100644
> --- a/arm64/gicv2m.c
> +++ b/arm64/gicv2m.c
> @@ -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
> diff --git a/arm64/include/arm-common/gic.h b/arm64/include/gic.h
> similarity index 100%
> rename from arm64/include/arm-common/gic.h
> rename to arm64/include/gic.h
> diff --git a/arm64/include/kvm/kvm-arch.h b/arm64/include/kvm/kvm-arch.h
> index b55b3bf..a9872a8 100644
> --- a/arm64/include/kvm/kvm-arch.h
> +++ b/arm64/include/kvm/kvm-arch.h
> @@ -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):
> diff --git a/arm64/include/arm-common/pci.h b/arm64/include/pci.h
> similarity index 100%
> rename from arm64/include/arm-common/pci.h
> rename to arm64/include/pci.h
> diff --git a/arm64/include/arm-common/timer.h b/arm64/include/timer.h
> similarity index 100%
> rename from arm64/include/arm-common/timer.h
> rename to arm64/include/timer.h
> diff --git a/arm64/kvm.c b/arm64/kvm.c
> index 5e7fe77..6ee4c1d 100644
> --- a/arm64/kvm.c
> +++ b/arm64/kvm.c
> @@ -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>
> diff --git a/arm64/pci.c b/arm64/pci.c
> index 5bd82d4..99bf887 100644
> --- a/arm64/pci.c
> +++ b/arm64/pci.c
> @@ -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:
> diff --git a/arm64/pmu.c b/arm64/pmu.c
> index 5ed4979..52f4256 100644
> --- a/arm64/pmu.c
> +++ b/arm64/pmu.c
> @@ -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"
>
> diff --git a/arm64/timer.c b/arm64/timer.c
> index 6acc50e..b3164f8 100644
> --- a/arm64/timer.c
> +++ b/arm64/timer.c
> @@ -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)
> {
> --
> 2.39.5
>
>
^ permalink raw reply [flat|nested] 20+ messages in thread* Re: [RFC kvmtool 9/9] arm64: Get rid of the 'arm-common' include directory
2025-03-20 17:01 ` Alexandru Elisei
@ 2025-03-25 17:02 ` Oliver Upton
0 siblings, 0 replies; 20+ messages in thread
From: Oliver Upton @ 2025-03-25 17:02 UTC (permalink / raw)
To: Alexandru Elisei; +Cc: kvmarm, kvm, Will Deacon, Julien Thierry
Hi Alex,
On Thu, Mar 20, 2025 at 05:01:11PM +0000, Alexandru Elisei wrote:
> Hi Oliver,
>
> On Fri, Mar 14, 2025 at 03:25:16PM -0700, Oliver Upton wrote:
> > Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
> > ---
> > 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
>
> Looking at x86 and riscv, the pattern is to have the header files in
> <arch>/include/kvm, even if they're only used by the arch code.
>
> Do we care about following this pattern?
I have no strong preference in either direction, I just did the laziest
thing here.
Thanks,
Oliver
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [RFC kvmtool 0/9] arm: Drop support for 32-bit kvmtool
2025-03-14 22:25 [RFC kvmtool 0/9] arm: Drop support for 32-bit kvmtool Oliver Upton
` (8 preceding siblings ...)
2025-03-14 22:25 ` [RFC kvmtool 9/9] arm64: Get rid of the 'arm-common' include directory Oliver Upton
@ 2025-03-17 10:39 ` Alexandru Elisei
2025-03-17 10:51 ` Marc Zyngier
2025-03-19 14:18 ` Andre Przywara
2025-03-17 11:14 ` Marc Zyngier
10 siblings, 2 replies; 20+ messages in thread
From: Alexandru Elisei @ 2025-03-17 10:39 UTC (permalink / raw)
To: Oliver Upton
Cc: kvmarm, kvm, Will Deacon, Julien Thierry, andre.przywara, maz,
jean-philippe
Hi Oliver,
I'm CC'ing Marc and Andre (Andre is the only person that I know for a fact
that ran 32 bit kvmtool).
Haven't looked at the patches in detail, but as someone who ocassionally
contributes to kvmtool, I have to say it's always nice to have fewer things
to worry about. I, for one, never used 32 bit kvmtool, I just compiled for
32 bit arm to make sure it doesn't break.
If nobody objects to dropping support for 32 bit kvmtool, I'm planning to
review the patches.
Thanks,
Alex
On Fri, Mar 14, 2025 at 03:25:07PM -0700, Oliver Upton wrote:
> 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.
>
> 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 | 6 +-
> .../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 | 212 +++++++++++-
> {arm => arm64}/pci.c | 4 +-
> {arm/aarch64 => arm64}/pmu.c | 2 +-
> {arm/aarch64 => arm64}/pvtime.c | 0
> {arm => arm64}/timer.c | 4 +-
> 42 files changed, 495 insertions(+), 1139 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 (97%)
> 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
> --
> 2.39.5
>
>
^ permalink raw reply [flat|nested] 20+ messages in thread* Re: [RFC kvmtool 0/9] arm: Drop support for 32-bit kvmtool
2025-03-17 10:39 ` [RFC kvmtool 0/9] arm: Drop support for 32-bit kvmtool Alexandru Elisei
@ 2025-03-17 10:51 ` Marc Zyngier
2025-03-18 1:10 ` Oliver Upton
2025-03-19 14:18 ` Andre Przywara
1 sibling, 1 reply; 20+ messages in thread
From: Marc Zyngier @ 2025-03-17 10:51 UTC (permalink / raw)
To: Alexandru Elisei
Cc: Oliver Upton, kvmarm, kvm, Will Deacon, Julien Thierry,
andre.przywara, jean-philippe
On Mon, 17 Mar 2025 10:39:44 +0000,
Alexandru Elisei <alexandru.elisei@arm.com> wrote:
>
> Hi Oliver,
>
> I'm CC'ing Marc and Andre (Andre is the only person that I know for a fact
> that ran 32 bit kvmtool).
>
> Haven't looked at the patches in detail, but as someone who ocassionally
> contributes to kvmtool, I have to say it's always nice to have fewer things
> to worry about. I, for one, never used 32 bit kvmtool, I just compiled for
> 32 bit arm to make sure it doesn't break.
>
> If nobody objects to dropping support for 32 bit kvmtool, I'm planning to
> review the patches.
Frankly, the removal of 32bit support is long overdue. Every time I
hack something in kvmtool (at least once a month), I have to wonder
how to fit that in the 32bit code that I *know* to be dead code.
We kept it ticking around when the kernel code was removed back in
5.6, and in the interval I have ran it *once*. These days, I don't
even have a working 32bit setup.
In all honesty, someone using 32bit KVM can also use an older build of
kvmtool (this piece of SW is *done*), and we can happily move on.
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [RFC kvmtool 0/9] arm: Drop support for 32-bit kvmtool
2025-03-17 10:51 ` Marc Zyngier
@ 2025-03-18 1:10 ` Oliver Upton
0 siblings, 0 replies; 20+ messages in thread
From: Oliver Upton @ 2025-03-18 1:10 UTC (permalink / raw)
To: Marc Zyngier
Cc: Alexandru Elisei, kvmarm, kvm, Will Deacon, Julien Thierry,
andre.przywara, jean-philippe
On Mon, Mar 17, 2025 at 10:51:18AM +0000, Marc Zyngier wrote:
> On Mon, 17 Mar 2025 10:39:44 +0000,
> Alexandru Elisei <alexandru.elisei@arm.com> wrote:
> >
> > Hi Oliver,
> >
> > I'm CC'ing Marc and Andre (Andre is the only person that I know for a fact
> > that ran 32 bit kvmtool).
Thanks Alex, forgot some folks :)
> > Haven't looked at the patches in detail, but as someone who ocassionally
> > contributes to kvmtool, I have to say it's always nice to have fewer things
> > to worry about. I, for one, never used 32 bit kvmtool, I just compiled for
> > 32 bit arm to make sure it doesn't break.
> >
> > If nobody objects to dropping support for 32 bit kvmtool, I'm planning to
> > review the patches.
>
> Frankly, the removal of 32bit support is long overdue. Every time I
> hack something in kvmtool (at least once a month), I have to wonder
> how to fit that in the 32bit code that I *know* to be dead code.
That's pretty much how I arrived at these patches, hacking on something
for arm64 and getting annoyed with the 32-bit stuff.
Thanks,
Oliver
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [RFC kvmtool 0/9] arm: Drop support for 32-bit kvmtool
2025-03-17 10:39 ` [RFC kvmtool 0/9] arm: Drop support for 32-bit kvmtool Alexandru Elisei
2025-03-17 10:51 ` Marc Zyngier
@ 2025-03-19 14:18 ` Andre Przywara
1 sibling, 0 replies; 20+ messages in thread
From: Andre Przywara @ 2025-03-19 14:18 UTC (permalink / raw)
To: Alexandru Elisei
Cc: Oliver Upton, kvmarm, kvm, Will Deacon, Julien Thierry, maz,
jean-philippe
On Mon, 17 Mar 2025 10:39:44 +0000
Alexandru Elisei <alexandru.elisei@arm.com> wrote:
Hi,
> Hi Oliver,
>
> I'm CC'ing Marc and Andre (Andre is the only person that I know for a fact
> that ran 32 bit kvmtool).
>
> Haven't looked at the patches in detail, but as someone who ocassionally
> contributes to kvmtool, I have to say it's always nice to have fewer things
> to worry about. I, for one, never used 32 bit kvmtool, I just compiled for
> 32 bit arm to make sure it doesn't break.
Well, it's of course always easier to just remove code and features,
especially if one doesn't have a use for this feature in the first place.
But I clearly see that 32-bit host support is *very* niche today,
especially with dropped host kernel support, and that new features like NV
and RME don't apply for that anyway, and are far more important, so I am
fine with letting it go. So long, and thanks for all the fish!
Cheers,
Andre
> If nobody objects to dropping support for 32 bit kvmtool, I'm planning to
> review the patches.
>
> Thanks,
> Alex
>
> On Fri, Mar 14, 2025 at 03:25:07PM -0700, Oliver Upton wrote:
> > 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.
> >
> > 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 | 6 +-
> > .../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 | 212 +++++++++++-
> > {arm => arm64}/pci.c | 4 +-
> > {arm/aarch64 => arm64}/pmu.c | 2 +-
> > {arm/aarch64 => arm64}/pvtime.c | 0
> > {arm => arm64}/timer.c | 4 +-
> > 42 files changed, 495 insertions(+), 1139 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 (97%)
> > 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
> > --
> > 2.39.5
> >
> >
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [RFC kvmtool 0/9] arm: Drop support for 32-bit kvmtool
2025-03-14 22:25 [RFC kvmtool 0/9] arm: Drop support for 32-bit kvmtool Oliver Upton
` (9 preceding siblings ...)
2025-03-17 10:39 ` [RFC kvmtool 0/9] arm: Drop support for 32-bit kvmtool Alexandru Elisei
@ 2025-03-17 11:14 ` Marc Zyngier
10 siblings, 0 replies; 20+ messages in thread
From: Marc Zyngier @ 2025-03-17 11:14 UTC (permalink / raw)
To: Oliver Upton; +Cc: kvmarm, kvm, Will Deacon, Julien Thierry
On 2025-03-14 22:25, Oliver Upton wrote:
> 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.
coprolithe! :D
>
> Of course, this has no effect on the support for 32-bit guests on
> 64-bit
> KVM.
>
> 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
FWIW:
Acked-by: Marc Zyngier <maz@kernel.org>
M.
--
Jazz is not dead. It just smells funny...
^ permalink raw reply [flat|nested] 20+ messages in thread