mbox series

[00/12] KVM: PPC: Nested APIv2 : Performance improvements

Message ID 20231201132618.555031-1-vaibhav@linux.ibm.com (mailing list archive)
Headers show
Series KVM: PPC: Nested APIv2 : Performance improvements | expand

Message

Vaibhav Jain Dec. 1, 2023, 1:26 p.m. UTC
From: vaibhav <vajain21@vajain21.in.ibm.com>


This patch series introduces series of performance improvements to recently
added support for Nested APIv2 PPC64 Guests via [1]. Details for Nested
APIv2 for PPC64 Guests is available in Documentation/powerpc/kvm-nested.rst.

This patch series introduces various optimizations for a Nested APIv2
guests namely:

* Reduce the number times L1 hypervisor requests for L2 state from L0.
* Register the L2 VPA with L1
* Optimizing interrupt delivery of some interrupt types.
* Optimize emulation of mmio loads/stores for L2 in L1.

The hcalls needed for testing these patches have been implemented in the
spapr qemu model and is available at [2].

There are scripts available to assist in setting up an environment for
testing nested guests at [3].

These patches are consequence of insights from on going performance
engineering effort for improving performance of Nested APIv2
Guests. Special thanks goes to:
* Gautam Menghani
* Jordan Niethe
* Nicholas Piggin
* Vaidyanathan Srinivasan

Refs:
[1] https://lore.kernel.org/all/20230905034658.82835-1-jniethe5@gmail.com
[2] https://github.com/planetharsh/qemu/tree/upstream-0714-kop
[3] https://github.com/iamjpn/kvm-powervm-test

Jordan Niethe (11):
  KVM: PPC: Book3S HV nestedv2: Invalidate RPT before deleting a guest
  KVM: PPC: Book3S HV nestedv2: Avoid reloading the tb offset
  KVM: PPC: Book3S HV nestedv2: Do not check msr on hcalls
  KVM: PPC: Book3S HV nestedv2: Get the PID only if needed to copy
    tofrom a guest
  KVM: PPC: Book3S HV nestedv2: Ensure LPCR_MER bit is passed to the L0
  KVM: PPC: Book3S HV nestedv2: Do not inject certain interrupts
  KVM: PPC: Book3S HV nestedv2: Avoid msr check in
    kvmppc_handle_exit_hv()
  KVM: PPC: Book3S HV nestedv2: Do not call H_COPY_TOFROM_GUEST
  KVM: PPC: Book3S HV nestedv2: Register the VPA with the L0
  KVM: PPC: Reduce reliance on analyse_instr() in mmio emulation
  KVM: PPC: Book3S HV nestedv2: Do not cancel pending decrementer
    exception

Nicholas Piggin (1):
  KVM: PPC: Book3S HV: Handle pending exceptions on guest entry with
    MSR_EE

 arch/powerpc/include/asm/kvm_book3s.h    | 10 +++-
 arch/powerpc/include/asm/kvm_book3s_64.h |  1 +
 arch/powerpc/kvm/book3s.c                |  4 +-
 arch/powerpc/kvm/book3s_64_mmu_radix.c   |  7 ++-
 arch/powerpc/kvm/book3s_hv.c             | 72 +++++++++++++++++-------
 arch/powerpc/kvm/book3s_hv_nested.c      |  2 +-
 arch/powerpc/kvm/book3s_hv_nestedv2.c    | 29 ++++++++++
 arch/powerpc/kvm/emulate_loadstore.c     | 21 ++++---
 8 files changed, 107 insertions(+), 39 deletions(-)

Comments

Michael Ellerman Dec. 21, 2023, 10:44 a.m. UTC | #1
On Fri, 01 Dec 2023 18:56:05 +0530, Vaibhav Jain wrote:
> This patch series introduces series of performance improvements to recently
> added support for Nested APIv2 PPC64 Guests via [1]. Details for Nested
> APIv2 for PPC64 Guests is available in Documentation/powerpc/kvm-nested.rst.
> 
> This patch series introduces various optimizations for a Nested APIv2
> guests namely:
> 
> [...]

Applied to powerpc/topic/ppc-kvm.

[01/12] KVM: PPC: Book3S HV nestedv2: Invalidate RPT before deleting a guest
        https://git.kernel.org/powerpc/c/7d370e1812b9a5f5cc68aaa5991bf7d31d8ff52c
[02/12] KVM: PPC: Book3S HV nestedv2: Avoid reloading the tb offset
        https://git.kernel.org/powerpc/c/e0d4acbcba3f2d63dc15bc5432c8e26fc9e19675
[03/12] KVM: PPC: Book3S HV nestedv2: Do not check msr on hcalls
        https://git.kernel.org/powerpc/c/63ccae78cd88b52fb1d598ae33fa8408ce067b30
[04/12] KVM: PPC: Book3S HV nestedv2: Get the PID only if needed to copy tofrom a guest
        https://git.kernel.org/powerpc/c/e678748a8dca5b57041a84a66577f6168587b3f7
[05/12] KVM: PPC: Book3S HV nestedv2: Ensure LPCR_MER bit is passed to the L0
        https://git.kernel.org/powerpc/c/ec0f6639fa8853cf6bfdfc3588aada7eeb7e5e37
[06/12] KVM: PPC: Book3S HV: Handle pending exceptions on guest entry with MSR_EE
        https://git.kernel.org/powerpc/c/ecd10702baae5c16a91d139bde7eff84ce55daee
[07/12] KVM: PPC: Book3S HV nestedv2: Do not inject certain interrupts
        https://git.kernel.org/powerpc/c/df938a5576f3f3b08e1f217c660385c0d58a0b91
[08/12] KVM: PPC: Book3S HV nestedv2: Avoid msr check in kvmppc_handle_exit_hv()
        https://git.kernel.org/powerpc/c/a9a3de530d7531bf6cd3f6ccda769cd94c1105a0
[09/12] KVM: PPC: Book3S HV nestedv2: Do not call H_COPY_TOFROM_GUEST
        https://git.kernel.org/powerpc/c/4bc8ff6f170c78f64446c5d5f9ef6771eefd3416
[10/12] KVM: PPC: Book3S HV nestedv2: Register the VPA with the L0
        https://git.kernel.org/powerpc/c/db1dcfae1dae3c042f348175ac0394e2fc14b1b3
[11/12] KVM: PPC: Reduce reliance on analyse_instr() in mmio emulation
        https://git.kernel.org/powerpc/c/797a5af8fc7297b19e5c6b1713956ebf1e6c1cde
[12/12] KVM: PPC: Book3S HV nestedv2: Do not cancel pending decrementer exception
        https://git.kernel.org/powerpc/c/180c6b072bf360b686e53d893d8dcf7dbbaec6bb

cheers