2023-09-15 16:28:27

by Kristina Martsenko

[permalink] [raw]
Subject: [PATCH 0/3] KVM: arm64: Support for Arm v8.8 memcpy instructions in KVM guests

Hi,

This series adds support for using the new Arm memory copy instructions in KVM
guests. A previous series [1] added support for using the instructions in
userspace applications. Similarly to that series, the main thing to note here
is the handling for when a memcpy is stopped and continued on a different type
of CPU. See patch #2 for details.

As background, the Armv8.8 extension adds new instructions to perform memcpy(),
memset() and memmove() operations in hardware (FEAT_MOPS). The aim is to avoid
having many different performance-optimal memcpy implementations in software
(tailored to CPU model and copy size) and the overhead of selecting between
them. The new instructions are intended to be at least as fast as any
alternative instruction sequence.

The series has been tested on the Arm FVP.

Thanks,
Kristina

[1] https://lore.kernel.org/all/[email protected]/


Kristina Martsenko (3):
KVM: arm64: Configure HCRX_EL2 dynamically
KVM: arm64: Add handler for MOPS exceptions
KVM: arm64: Expose MOPS instructions to guests

arch/arm64/include/asm/kvm_emulate.h | 10 ++++
arch/arm64/include/asm/kvm_host.h | 1 +
arch/arm64/include/asm/traps.h | 54 ++++++++++++++++++-
arch/arm64/kernel/traps.c | 48 +----------------
arch/arm64/kvm/arm.c | 1 +
arch/arm64/kvm/hyp/include/hyp/switch.h | 19 ++++++-
.../arm64/kvm/hyp/include/nvhe/fixed_config.h | 3 +-
arch/arm64/kvm/hyp/nvhe/hyp-main.c | 1 +
arch/arm64/kvm/hyp/nvhe/pkvm.c | 1 +
arch/arm64/kvm/hyp/nvhe/switch.c | 2 +
arch/arm64/kvm/hyp/vhe/switch.c | 1 +
arch/arm64/kvm/sys_regs.c | 1 -
12 files changed, 90 insertions(+), 52 deletions(-)


base-commit: 0bb80ecc33a8fb5a682236443c1e740d5c917d1d
--
2.25.1