KVM: arm64: BUG FIX: Correctly handle zero register transfers
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest4 patches 13 repliesIn review
- v34 patches 0 repliesSuperseded
- v24 patches 6 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 3 patches | 9 replies | Superseded |
Changes in v4 from the cover letter
- Unwrapped assignment in patch 0003
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | KVM: arm64: Correctly handle zero register during MMIOarch/ arch/ arch/ | +28 | 1 reply | |
| 2/4 | KVM: arm64: Remove const from struct sys_reg_paramsarch/ arch/ arch/ | +21 | 1 reply | |
| 3/4 | KVM: arm64: Correctly handle zero register in system register accessesarch/ arch/ arch/ | +45 | 0 replies | |
| 4/4 | KVM: arm64: Get rid of old vcpu_reg()arch/ arch/ arch/ | +14 | 0 replies |
Reviews trailers per patch
All 4 patches have a Reviewed-by or Acked-by.
| Patch | Marc Zyngier |
|---|---|
| 1/4 | R-b |
| 2/4 | R-b |
| 3/4 | R-b |
| 4/4 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v4 0/4] KVM: arm64: BUG FIX: Correctly handle zero register transfers
ARM64 CPU has zero register which is read-only, with a value of 0. However, KVM currently incorrectly recognizes it being SP (because Rt == 31, and in struct user_pt_regs 'regs' array is followed by SP), resulting in invalid value being read, or even SP corruption on write.
The problem has been discovered by performing an operation
*((volatile int *)reg) = 0;
which compiles as "str xzr, [xx]", and resulted in strange values being written.
v3 => v4:
- Unwrapped assignment in patch 0003
v2 => v3:
- Brought back some const modifiers in unaffected functions
v1 => v2:
- Changed type of transfer value to u64 and store it directly in struct sys_reg_params instead of a pointer
- Use lower_32_bits()/upper_32_bits() where appropriate
- Fixed wrong usage of 'Rt' instead of 'Rt2' in kvm_handle_cp_64(), overlooked in v1
- Do not write value back when reading
Pavel Fedin (4):
KVM: arm64: Correctly handle zero register during MMIO
KVM: arm64: Remove const from struct sys_reg_params
KVM: arm64: Correctly handle zero register in system register accesses
KVM: arm64: Get rid of old vcpu_reg()
arch/arm/include/asm/kvm_emulate.h | 12 ++++ arch/arm/kvm/mmio.c | 5 +- arch/arm/kvm/psci.c | 20 +++--- arch/arm64/include/asm/kvm_emulate.h | 18 +++-- arch/arm64/kvm/handle_exit.c | 2 +- arch/arm64/kvm/sys_regs.c | 123 +++++++++++++++++------------------ arch/arm64/kvm/sys_regs.h | 8 +-- arch/arm64/kvm/sys_regs_generic_v8.c | 4 +- 8 files changed, 105 insertions(+), 87 deletions(-)
Signature · 1 line
2.4.4