|
|
Subscribe / Log in / New account

KVM: arm64: Support for Arm v8.8 memcpy instructions in KVM guests

From:  Kristina Martsenko <kristina.martsenko-AT-arm.com>
To:  kvmarm-AT-lists.linux.dev, linux-arm-kernel-AT-lists.infradead.org
Subject:  [PATCH 0/3] KVM: arm64: Support for Arm v8.8 memcpy instructions in KVM guests
Date:  Fri, 15 Sep 2023 13:48:37 +0100
Message-ID:  <20230915124840.474888-1-kristina.martsenko@arm.com>
Cc:  Marc Zyngier <maz-AT-kernel.org>, Oliver Upton <oliver.upton-AT-linux.dev>, James Morse <james.morse-AT-arm.com>, Suzuki K Poulose <suzuki.poulose-AT-arm.com>, Zenghui Yu <yuzenghui-AT-huawei.com>, Catalin Marinas <catalin.marinas-AT-arm.com>, Will Deacon <will-AT-kernel.org>, Vladimir Murzin <vladimir.murzin-AT-arm.com>, Colton Lewis <coltonlewis-AT-google.com>, linux-kernel-AT-vger.kernel.org
Archive-link:  Article

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/20230509142235.3284028-1-kris...


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



Copyright © 2023, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds