Skip to content

KVM: PPC: Power10 2nd DAWR enablement

Ravi Bangoria kvm kvm-ppc linuxppc-dev lkml 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 0 repliesNew
  2. v24 patches 2 repliesSuperseded

Changes in v3 from the cover letter

- Patch #1. If L0 version > L1, L0 hv_guest_state will contain some additional fields which won't be filled while reading from L1 memory and thus they can contain garbage. Initialize l2_hv with 0s to avoid such situations.
- Patch #3. Introduce per vm flag dawr1_enabled.
- Patch #4. Instead of auto enabling KVM_CAP_PPC_DAWR1, let user check and enable it manually. Also move KVM_CAP_PPC_DAWR1 check / enable logic inside #if defined(CONFIG_KVM_BOOK3S_HV_POSSIBLE).
- Explain KVM_CAP_PPC_DAWR1 in Documentation/virt/kvm/api.rst
- Rebased on top of 5.10-rc3.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4KVM: PPC: Allow nested guest creation when L0 hv_guest_state > L1arch/powerpc/include/asm/hvcall.h arch/powerpc/kvm/book3s_hv_nested.c+60 -120 replies
2/4KVM: PPC: Rename current DAWR macros and variablesarch/powerpc/include/asm/kvm_host.h arch/powerpc/kernel/asm-offsets.c arch/powerpc/kvm/book3s_hv.c +2 more+30 -300 replies
3/4KVM: PPC: Add infrastructure to support 2nd DAWRDocumentation/virt/kvm/api.rst arch/powerpc/include/asm/hvcall.h arch/powerpc/include/asm/kvm_host.h +6 more+91 -10 replies
4/4KVM: PPC: Introduce new capability for 2nd DAWRDocumentation/virt/kvm/api.rst arch/powerpc/include/asm/kvm_ppc.h arch/powerpc/kvm/book3s_hv.c +3 more+35 -00 replies

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchFabiano Rosas
1/4R-b
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/4] KVM: PPC: Power10 2nd DAWR enablement

Enable p10 2nd DAWR feature for Book3S kvm guest. DAWR is a hypervisor resource and thus H_SET_MODE hcall is used to set/unset it. A new case H_SET_MODE_RESOURCE_SET_DAWR1 is introduced in H_SET_MODE hcall for setting/unsetting 2nd DAWR. Also, new capability KVM_CAP_PPC_DAWR1 has been added to query 2nd DAWR support via kvm ioctl.

This feature also needs to be enabled in Qemu to really use it. I'll post Qemu patches once kvm patches get accepted.

v2: https://lore.kernel.org/kvm/[email protected]

v2->v3:
- Patch #1. If L0 version > L1, L0 hv_guest_state will contain some additional fields which won't be filled while reading from L1 memory and thus they can contain garbage. Initialize l2_hv with 0s to avoid such situations.
- Patch #3. Introduce per vm flag dawr1_enabled.
- Patch #4. Instead of auto enabling KVM_CAP_PPC_DAWR1, let user check and enable it manually. Also move KVM_CAP_PPC_DAWR1 check / enable logic inside #if defined(CONFIG_KVM_BOOK3S_HV_POSSIBLE).
- Explain KVM_CAP_PPC_DAWR1 in Documentation/virt/kvm/api.rst
- Rebased on top of 5.10-rc3.

v1->v2:
- patch #1: New patch
- patch #2: Don't rename KVM_REG_PPC_DAWR, it's an uapi macro
- patch #3: Increment HV_GUEST_STATE_VERSION
- Split kvm and selftests patches into different series
- Patches rebased to paulus/kvm-ppc-next (cf59eb13e151) + few other watchpoint patches which are yet to be merged in paulus/kvm-ppc-next.

Ravi Bangoria (4):
KVM: PPC: Allow nested guest creation when L0 hv_guest_state > L1
KVM: PPC: Rename current DAWR macros and variables
KVM: PPC: Add infrastructure to support 2nd DAWR
KVM: PPC: Introduce new capability for 2nd DAWR

 Documentation/virt/kvm/api.rst            | 12 ++++
 arch/powerpc/include/asm/hvcall.h         | 25 ++++++-
 arch/powerpc/include/asm/kvm_host.h       |  7 +-
 arch/powerpc/include/asm/kvm_ppc.h        |  1 +
 arch/powerpc/include/uapi/asm/kvm.h       |  2 +
 arch/powerpc/kernel/asm-offsets.c         |  6 +-
 arch/powerpc/kvm/book3s_hv.c              | 79 +++++++++++++++++++----
 arch/powerpc/kvm/book3s_hv_nested.c       | 70 ++++++++++++++++----
 arch/powerpc/kvm/book3s_hv_rmhandlers.S   | 43 +++++++++---
 arch/powerpc/kvm/powerpc.c                | 10 +++
 include/uapi/linux/kvm.h                  |  1 +
 tools/arch/powerpc/include/uapi/asm/kvm.h |  2 +
 tools/include/uapi/linux/kvm.h            |  1 +
 13 files changed, 216 insertions(+), 43 deletions(-)
Signature · 1 line
2.26.2