Skip to content

KVM ARM64 pre_fault_memory

Jack Thomson kvmarm linux-arm-kernel linux-kselftest lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 4 repliesIn review
  2. v33 patches 6 repliesSuperseded
  3. v24 patches 7 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v16 patches5 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3KVM: arm64: Add pre_fault_memory implementationDocumentation/virt/kvm/api.rst arch/arm64/kvm/Kconfig arch/arm64/kvm/arm.c +1 more+79 -54 replies
2/3KVM: selftests: Enable pre_fault_memory_test for arm64tools/testing/selftests/kvm/Makefile.kvm tools/testing/selftests/kvm/pre_fault_memory_test.c+63 -230 replies
3/3KVM: selftests: Add option for different backing in pre-fault teststools/testing/selftests/kvm/pre_fault_memory_test.c+33 -90 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH v4 0/3] KVM ARM64 pre_fault_memory

From: Jack Thomson <[email protected]>

This patch series adds ARM64 support for the KVM_PRE_FAULT_MEMORY feature, which was previously only available on x86 [1]. This allows us to reduce the number of stage-2 faults during execution. This is of benefit in post-copy migration scenarios, particularly in memory intensive applications, where we are experiencing high latencies due to the stage-2 faults.

Patch Overview:

- The first patch adds support for the KVM_PRE_FAULT_MEMORY ioctl on arm64.

- The second patch updates the pre_fault_memory_test to support arm64.

- The last patch extends the pre_fault_memory_test to cover different vm memory backings.

With regards to the additional parameter to user_mem_abort, noted in the v3 review, would you like this to be fixed in this series or would a follow-up series be ok? I also found a series from Sean which looks to address this [2].

=== Changes Since v3 [3] ===

- Updated to now return -EOPNOTSUPP for pKVM. Previously this was not checked.
- When running a nested guest, properly resolve the L2 IPA to L1 IPA before pre faulting.
- Refactoring, page_size is now unsigned and ordered definitions at top of pre_fault function.

Thanks Marc for your review

=== Changes Since v2 [4] ===

- Update fault info synthesize value. Thanks Suzuki
- Remove change to selftests for unaligned mmap allocations. Thanks Sean

[1]: https://lore.kernel.org/kvm/[email protected]
[2]: https://lore.kernel.org/linux-arm-kernel/[email protected]/
[3]: https://lore.kernel.org/linux-arm-kernel/[email protected]
[4]: https://lore.kernel.org/linux-arm-kernel/[email protected]

Jack Thomson (3):
KVM: arm64: Add pre_fault_memory implementation
KVM: selftests: Enable pre_fault_memory_test for arm64
KVM: selftests: Add option for different backing in pre-fault tests

 Documentation/virt/kvm/api.rst                |   3 +-
 arch/arm64/kvm/Kconfig                        |   1 +
 arch/arm64/kvm/arm.c                          |   1 +
 arch/arm64/kvm/mmu.c                          |  79 +++++++++++-
 tools/testing/selftests/kvm/Makefile.kvm      |   1 +
 .../selftests/kvm/pre_fault_memory_test.c     | 115 ++++++++++++++----
 6 files changed, 169 insertions(+), 31 deletions(-)

base-commit: 3611ca7c12b740e250d83f8bbe3554b740c503b0

Signature · 1 line
2.43.0