mbox series

[v2,0/8] KVM: PPC: Book3S HV: Nested guest migration fixes

Message ID 171759276071.1480.9356137231993600304.stgit@linux.ibm.com (mailing list archive)
Headers show
Series KVM: PPC: Book3S HV: Nested guest migration fixes | expand

Message

Shivaprasad G Bhat June 5, 2024, 1:06 p.m. UTC
The series fixes the issues exposed by the kvm-unit-tests[1]
sprs-migration test.

The SDAR, MMCR3 were seen to have some typo/refactoring bugs.
The first two patches fix them.

The remaining patches take care of save-restoring the guest
state elements for DEXCR, HASHKEYR and HASHPKEYR SPRs with PHYP
during entry-exit. The KVM_PPC_REG too for them are missing which
are added for use by the QEMU.

References:
[1]: https://github.com/kvm-unit-tests/kvm-unit-tests

---

Changelog:
v1: https://lore.kernel.org/kvm/171741555734.11675.17428208097186191736.stgit@c0c876608f2d/
 - Reordered the patches in a way to introduce the SPRs first as
   suggested.
 - Added Reviewed-bys to the reviewed ones.
 - Added 2 more patches to handle the hashpkeyr state

Shivaprasad G Bhat (8):
      KVM: PPC: Book3S HV: Fix the set_one_reg for MMCR3
      KVM: PPC: Book3S HV: Fix the get_one_reg of SDAR
      KVM: PPC: Book3S HV: Add one-reg interface for DEXCR register
      KVM: PPC: Book3S HV nestedv2: Keep nested guest DEXCR in sync
      KVM: PPC: Book3S HV: Add one-reg interface for HASHKEYR register
      KVM: PPC: Book3S HV nestedv2: Keep nested guest HASHKEYR in sync
      KVM: PPC: Book3S HV: Add one-reg interface for HASHPKEYR register
      KVM: PPC: Book3S HV nestedv2: Keep nested guest HASHPKEYR in sync


 Documentation/virt/kvm/api.rst        |  3 +++
 arch/powerpc/include/asm/kvm_host.h   |  3 +++
 arch/powerpc/include/uapi/asm/kvm.h   |  3 +++
 arch/powerpc/kvm/book3s_hv.c          | 22 ++++++++++++++++++++--
 arch/powerpc/kvm/book3s_hv.h          |  3 +++
 arch/powerpc/kvm/book3s_hv_nestedv2.c | 18 ++++++++++++++++++
 6 files changed, 50 insertions(+), 2 deletions(-)

--
Signature

Comments

Nicholas Piggin June 6, 2024, 3:06 a.m. UTC | #1
On Wed Jun 5, 2024 at 11:06 PM AEST, Shivaprasad G Bhat wrote:
> The series fixes the issues exposed by the kvm-unit-tests[1]
> sprs-migration test.
>
> The SDAR, MMCR3 were seen to have some typo/refactoring bugs.
> The first two patches fix them.
>
> The remaining patches take care of save-restoring the guest
> state elements for DEXCR, HASHKEYR and HASHPKEYR SPRs with PHYP
> during entry-exit. The KVM_PPC_REG too for them are missing which
> are added for use by the QEMU.

These and the qemu patches all look good now. I'll give them
some testing and send R-B in the next day or two. I'm trying
to write a k-u-t for the hashpkey migration case...

Thanks,
Nick

>
> References:
> [1]: https://github.com/kvm-unit-tests/kvm-unit-tests
>
> ---
>
> Changelog:
> v1: https://lore.kernel.org/kvm/171741555734.11675.17428208097186191736.stgit@c0c876608f2d/
>  - Reordered the patches in a way to introduce the SPRs first as
>    suggested.
>  - Added Reviewed-bys to the reviewed ones.
>  - Added 2 more patches to handle the hashpkeyr state
>
> Shivaprasad G Bhat (8):
>       KVM: PPC: Book3S HV: Fix the set_one_reg for MMCR3
>       KVM: PPC: Book3S HV: Fix the get_one_reg of SDAR
>       KVM: PPC: Book3S HV: Add one-reg interface for DEXCR register
>       KVM: PPC: Book3S HV nestedv2: Keep nested guest DEXCR in sync
>       KVM: PPC: Book3S HV: Add one-reg interface for HASHKEYR register
>       KVM: PPC: Book3S HV nestedv2: Keep nested guest HASHKEYR in sync
>       KVM: PPC: Book3S HV: Add one-reg interface for HASHPKEYR register
>       KVM: PPC: Book3S HV nestedv2: Keep nested guest HASHPKEYR in sync
>
>
>  Documentation/virt/kvm/api.rst        |  3 +++
>  arch/powerpc/include/asm/kvm_host.h   |  3 +++
>  arch/powerpc/include/uapi/asm/kvm.h   |  3 +++
>  arch/powerpc/kvm/book3s_hv.c          | 22 ++++++++++++++++++++--
>  arch/powerpc/kvm/book3s_hv.h          |  3 +++
>  arch/powerpc/kvm/book3s_hv_nestedv2.c | 18 ++++++++++++++++++
>  6 files changed, 50 insertions(+), 2 deletions(-)
>
> --
> Signature
Michael Ellerman June 20, 2024, 2:29 p.m. UTC | #2
On Wed, 05 Jun 2024 13:06:00 +0000, Shivaprasad G Bhat wrote:
> The series fixes the issues exposed by the kvm-unit-tests[1]
> sprs-migration test.
> 
> The SDAR, MMCR3 were seen to have some typo/refactoring bugs.
> The first two patches fix them.
> 
> The remaining patches take care of save-restoring the guest
> state elements for DEXCR, HASHKEYR and HASHPKEYR SPRs with PHYP
> during entry-exit. The KVM_PPC_REG too for them are missing which
> are added for use by the QEMU.
> 
> [...]

Applied to powerpc/topic/ppc-kvm.

[1/8] KVM: PPC: Book3S HV: Fix the set_one_reg for MMCR3
      https://git.kernel.org/powerpc/c/f9ca6a10be20479d526f27316cc32cfd1785ed39
[2/8] KVM: PPC: Book3S HV: Fix the get_one_reg of SDAR
      https://git.kernel.org/powerpc/c/009f6f42c67e9de737d6d3d199f92b21a8cb9622
[3/8] KVM: PPC: Book3S HV: Add one-reg interface for DEXCR register
      https://git.kernel.org/powerpc/c/1a1e6865f516696adcf6e94f286c7a0f84d78df3
[4/8] KVM: PPC: Book3S HV nestedv2: Keep nested guest DEXCR in sync
      https://git.kernel.org/powerpc/c/2d6be3ca3276ab30fb14f285d400461a718d45e7
[5/8] KVM: PPC: Book3S HV: Add one-reg interface for HASHKEYR register
      https://git.kernel.org/powerpc/c/e9eb790b25577a15d3f450ed585c59048e4e6c44
[6/8] KVM: PPC: Book3S HV nestedv2: Keep nested guest HASHKEYR in sync
      https://git.kernel.org/powerpc/c/1e97c1eb785fe2dc863c2bd570030d6fcf4b5e5b
[7/8] KVM: PPC: Book3S HV: Add one-reg interface for HASHPKEYR register
      https://git.kernel.org/powerpc/c/9a0d2f4995ddde3022c54e43f9ece4f71f76f6e8
[8/8] KVM: PPC: Book3S HV nestedv2: Keep nested guest HASHPKEYR in sync
      https://git.kernel.org/powerpc/c/0b65365f3fa95c2c5e2094739151a05cabb3c48a

cheers