Skip to content

Add KVM support for PPC64 (970) hosts

Alexander Graf kvm-ppc 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest23 patches 48 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/23Pass PVR in sregsarch/powerpc/include/asm/kvm.h+1 -07 replies
1/23Pass PVR in sregsarch/powerpc/include/asm/kvm.h+2 -00 replies
2/23Add PPC64 definitionsarch/powerpc/include/asm/kvm_asm.h+39 -00 replies
3/23Add PPC64 fields to vcpu structsarch/powerpc/include/asm/kvm_host.h+79 -11 reply
4/23Add asm/970_kvm.harch/powerpc/include/asm/kvm_970.h+131 -00 replies
5/23Add common PPC64 KVM asm helpersarch/powerpc/include/asm/kvm_970_asm.h+128 -05 replies
6/23Add 970 highmem asm codearch/powerpc/include/asm/kvm_ppc.h arch/powerpc/kvm/970_interrupts.S+423 -03 replies
7/23Add SLB switching code for entry/exitarch/powerpc/kvm/970_slb.S+456 -03 replies
7/23Add SLB switching code for entry/exitarch/powerpc/kvm/book3s_64_slb.S+456 -00 replies
8/23Add interrupt handling codearch/powerpc/kvm/970_rmhandlers.S+128 -03 replies
8/23Add interrupt handling codearch/powerpc/kvm/book3s_64_rmhandlers.S+133 -00 replies
9/23Add 970.carch/powerpc/kvm/970.c+946 -00 replies
10/23Add 970 Host MMU handlingarch/powerpc/kvm/970_mmu_host.c+439 -00 replies
11/23Add 970 guest MMUarch/powerpc/kvm/970_mmu.c+466 -00 replies
12/23Add 74xx guest MMUarch/powerpc/kvm/74xx_mmu.c+357 -00 replies
13/23Add 970 specific opcode emulationarch/powerpc/kvm/970_emulate.c+338 -00 replies
14/23Add mfdec emulationarch/powerpc/kvm/emulate.c+12 -10 replies
14/23Add mfdec emulationarch/powerpc/kvm/emulate.c+12 -10 replies
15/23Add desktop PowerPC specific emulationarch/powerpc/kvm/emulate.c+30 -00 replies
15/23Add desktop PowerPC specific emulationarch/powerpc/kvm/emulate.c+30 -00 replies
16/23Make head_64.S aware of KVM real mode codearch/powerpc/include/asm/exception.h arch/powerpc/kernel/exceptions-64s.S arch/powerpc/kernel/head_64.S+16 -00 replies
16/23Make head_64.S aware of KVM real mode codearch/powerpc/include/asm/exception.h arch/powerpc/kernel/exceptions-64s.S arch/powerpc/kernel/head_64.S+16 -00 replies
17/23Patch SLB sizearch/powerpc/mm/slb.c+13 -00 replies
17/23Patch SLB sizearch/powerpc/mm/slb.c+13 -00 replies
18/23Add PPC64 offsets to asm-offsets.carch/powerpc/kernel/asm-offsets.c+13 -00 replies
19/23Export symbols for KVM modulearch/powerpc/kernel/ppc_ksyms.c arch/powerpc/kernel/time.c arch/powerpc/mm/hash_utils_64.c +3 more+12 -10 replies
19/23Export symbols for KVM modulearch/powerpc/kernel/ppc_ksyms.c arch/powerpc/kernel/time.c arch/powerpc/mm/hash_utils_64.c +3 more+12 -10 replies
20/23Export KVM symbols for modulearch/powerpc/kvm/970_exports.c+24 -00 replies
20/23Export KVM symbols for modulearch/powerpc/kvm/book3s_64_exports.c+24 -00 replies
21/23Include PPC64 target in buildsystemarch/powerpc/kvm/Kconfig arch/powerpc/kvm/Makefile+31 -10 replies
22/23Hack in dirty logging for VGAarch/powerpc/kvm/powerpc.c+20 -14 replies
23/23Fix trace.harch/powerpc/kvm/trace.h+3 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/23] Add KVM support for PPC64 (970) hosts

KVM for PowerPC only supports embedded cores at the moment.

While it makes sense to virtualize on small machines, it's even more fun to do so on big boxes. So I figured we need KVM for PowerPC64 as well.

This patchset implements KVM support for PPC64 hosts and guest support for PPC64 and G3/G4.

To really make use of this, you will also need a modified version of qemu that can deal with KVM on desktop cores. I will send out patches for those later, but want to get feedback on the kernel side first.

In the meanwhile, use the qemu version from
http://www.powerkvm.org/powerkvm.git which already includes all required patches to run PPC32 and PPC64 guests.

Alexander Graf (23):
Pass PVR in sregs
Add PPC64 definitions
Add PPC64 fields to vcpu structs
Add asm/970_kvm.h
Add common PPC64 KVM asm helpers
Add 970 highmem asm code
Add SLB switching code for entry/exit
Add interrupt handling code
Add 970.c
Add 970 Host MMU handling
Add 970 guest MMU
Add 74xx guest MMU
Add 970 specific opcode emulation
Add mfdec emulation
Add desktop PowerPC specific emulation
Make head_64.S aware of KVM real mode code
Patch SLB size
Add PPC64 offsets to asm-offsets.c
Export symbols for KVM module
Export KVM symbols for module
Include PPC64 target in buildsystem
Hack in dirty logging for VGA
Fix trace.h

 arch/powerpc/include/asm/exception.h   |    2 +
 arch/powerpc/include/asm/kvm.h         |    1 +
 arch/powerpc/include/asm/kvm_970.h     |  131 +++++
 arch/powerpc/include/asm/kvm_970_asm.h |  128 +++++
 arch/powerpc/include/asm/kvm_asm.h     |   39 ++
 arch/powerpc/include/asm/kvm_host.h    |   80 +++-
 arch/powerpc/include/asm/kvm_ppc.h     |    1 +
 arch/powerpc/kernel/asm-offsets.c      |   13 +
 arch/powerpc/kernel/exceptions-64s.S   |    8 +
 arch/powerpc/kernel/head_64.S          |    6 +
 arch/powerpc/kernel/ppc_ksyms.c        |    3 +-
 arch/powerpc/kernel/time.c             |    1 +
 arch/powerpc/kvm/74xx_mmu.c            |  357 ++++++++++++
 arch/powerpc/kvm/970.c                 |  947 ++++++++++++++++++++++++++++++++
 arch/powerpc/kvm/970_emulate.c         |  338 ++++++++++++
 arch/powerpc/kvm/970_exports.c         |   24 +
 arch/powerpc/kvm/970_interrupts.S      |  422 ++++++++++++++
 arch/powerpc/kvm/970_mmu.c             |  466 ++++++++++++++++
 arch/powerpc/kvm/970_mmu_host.c        |  439 +++++++++++++++
 arch/powerpc/kvm/970_rmhandlers.S      |  128 +++++
 arch/powerpc/kvm/970_slb.S             |  456 +++++++++++++++
 arch/powerpc/kvm/Kconfig               |   17 +
 arch/powerpc/kvm/Makefile              |   15 +-
 arch/powerpc/kvm/emulate.c             |   43 ++-
 arch/powerpc/kvm/powerpc.c             |   21 +-
 arch/powerpc/kvm/trace.h               |    6 +-
 arch/powerpc/mm/hash_utils_64.c        |    2 +
 arch/powerpc/mm/mmu_context_hash64.c   |    4 +
 arch/powerpc/mm/slb.c                  |   15 +
 kernel/fork.c                          |    1 +
 30 files changed, 4106 insertions(+), 8 deletions(-)
 create mode 100644 arch/powerpc/include/asm/kvm_970.h
 create mode 100644 arch/powerpc/include/asm/kvm_970_asm.h
 create mode 100644 arch/powerpc/kvm/74xx_mmu.c
 create mode 100644 arch/powerpc/kvm/970.c
 create mode 100644 arch/powerpc/kvm/970_emulate.c
 create mode 100644 arch/powerpc/kvm/970_exports.c
 create mode 100644 arch/powerpc/kvm/970_interrupts.S
 create mode 100644 arch/powerpc/kvm/970_mmu.c
 create mode 100644 arch/powerpc/kvm/970_mmu_host.c
 create mode 100644 arch/powerpc/kvm/970_rmhandlers.S
 create mode 100644 arch/powerpc/kvm/970_slb.S