KVM: arm64: mixed-width check should be skipped for uninitialized vCPUs
Status from this message: Applied to fixes, thanks!
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v6 Latest2 patches 1 replyApplied
- v52 patches 3 repliesSuperseded
- v43 patches 6 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v3 | 3 patches | 4 replies | Superseded |
Changes in v6 from the cover letter
- Fix typo and minor nits in the selftests [Oliver]
Patches in v6 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | KVM: arm64: mixed-width check should be skipped for uninitialized vCPUsarch/ arch/ arch/ | +72 | 0 replies | |
| 2/2 | KVM: arm64: selftests: Introduce vcpu_width_configtools/ tools/ tools/ | +124 | 0 replies |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Oliver Upton | Andrew Jones |
|---|---|---|
| 1/2 | R-b | |
| 2/2 | R-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v6 0/2] KVM: arm64: mixed-width check should be skipped for uninitialized vCPUs
KVM allows userspace to configure either all EL1 32bit or 64bit vCPUs for a guest. At vCPU reset, vcpu_allowed_register_width() checks if the vcpu's register width is consistent with all other vCPUs'. Since the checking is done even against vCPUs that are not initialized (KVM_ARM_VCPU_INIT has not been done) yet, the uninitialized vCPUs are erroneously treated as 64bit vCPU, which causes the function to incorrectly detect a mixed-width VM.
This series will fix this problem by introducing a new VM flag that indicates the guest needs to be configured with all 32bit or 64bit vCPUs and checking vcpu's register width against the new flag at the vcpu's KVM_ARM_VCPU_INIT (instead of against other vCPUs' register width).
Patch-1 introduces KVM_ARCH_FLAG_EL1_32BIT and KVM_ARCH_FLAG_REG_WIDTH_CONFIGURED bits for kvm->arch.flags and uses them to check vcpu's register width to fix the problem.
Patch-2 introduces a selftest that can test non-mixed-width vCPUs (all 64bit vCPUs or all 32bit vcPUs) can be configured, and mixed-width vCPUs cannot be configured.
The series is based on kvmarm/fixes at:
commit 8872d9b3e35a ("KVM: arm64: Drop unneeded minor version check from PSCI v1.x handler")
v6:
- Fix typo and minor nits in the selftests [Oliver]
v5: https://lore.kernel.org/all/[email protected]/
- Rebase to kvmarm/next (and drop the patch-1 "KVM: arm64: Generalise VM features into a set of flags")
- Use kernel-doc style comments for kvm_set_vm_width() [Oliver]
- Change kvm_set_vm_width() to use if/else instead of a ternary operator for KVM_ARCH_FLAG_EL1_32BIT check [Oliver]
v4: https://lore.kernel.org/all/[email protected]/
- Use different implementation of vcpu_el1_is_32bit() depending on the context. [Marc]
- Rename kvm_register_width_check_or_init() to kvm_set_vm_width(), and call it from kvm_rest_vcpu() instead of from kvm_vcpu_set_target()
- Remove vcpu_allowed_register_width(), and does the same checking in kvm_set_vm_width() instead.
v3: https://lore.kernel.org/all/[email protected]/
- Introduced 'flags' to kvm_arch, and use bits of the flags for a set of booleans for VM feature.
- Changed 'el1_reg_width' to two bits of 'flags' of kvm_arch.
v2: https://lore.kernel.org/all/[email protected]/
- Introduced 'el1_reg_width' for kvm_arch and use it to check vcpu's register width against the flag at the vcpu's KVM_ARM_VCPU_INIT.
v1: https://lore.kernel.org/all/[email protected]/
[1] https://lore.kernel.org/all/[email protected]/
Reiji Watanabe (2):
KVM: arm64: mixed-width check should be skipped for uninitialized
vCPUs
KVM: arm64: selftests: Introduce vcpu_width_config
arch/arm64/include/asm/kvm_emulate.h | 27 ++-- arch/arm64/include/asm/kvm_host.h | 10 ++ arch/arm64/kvm/reset.c | 65 ++++++---- tools/testing/selftests/kvm/.gitignore | 1 + tools/testing/selftests/kvm/Makefile | 1 + .../selftests/kvm/aarch64/vcpu_width_config.c | 122 ++++++++++++++++++ 6 files changed, 196 insertions(+), 30 deletions(-) create mode 100644 tools/testing/selftests/kvm/aarch64/vcpu_width_config.c
Signature · 1 line
2.35.1.1021.g381101b075-goog