Add initial SPAPR PPC64 architecture support
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest7 patches 9 repliesIn review
- v2 posting 2/26 patches 5 repliesSuperseded
- v2 posting 1/22 patches 16 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 8 patches | 6 replies | Superseded |
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | kvm tools: PPC64, add HPT/SDR1 for -PR KVMtools/ tools/ tools/ | +41 | 0 replies | |
| 2/7 | kvm tools: Generate SPAPR PPC64 guest device treetools/ tools/ tools/ +3 more | +312 | 4 replies | |
| 3/7 | kvm tools: Add SPAPR PPC64 hcall & rtascall structuretools/ tools/ tools/ +3 more | +495 | 2 replies | |
| 4/7 | kvm tools: Add SPAPR PPC64 HV consoletools/ tools/ tools/ +1 more | +155 | 0 replies | |
| 5/7 | kvm tools: Add PPC64 XICS interrupt controller supporttools/ tools/ tools/ +5 more | +596 | 0 replies | |
| 6/7 | kvm tools: Add PPC64 PCI Host Bridgetools/ tools/ tools/ +3 more | +519 | 2 replies | |
| 7/7 | kvm tools: Add PPC64 kvm_cpu__emulate_io()tools/ tools/ tools/ | +32 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.
Cover letter [PATCH V4 0/7] Add initial SPAPR PPC64 architecture support
This series adds support for a PPC64 platform, SPAPR, on top of the previous more general PPC64 CPU support. This platform is paravirtualised, with most of the MMU hypercalls being dealt with in the kernel. Userland needs to describe the environment to the machine with a device tree, cope with some hypercalls (and RTAS calls) for hvconsole, PCI config and IRQs, and emulate the interrupt controller (XICS) and PCI Host Bridge of the SPAPR-esque machine.
With this series, normal pSeries kernels boot fine (including RH kernels that include virtio support out of the box). There is no support for PPC32 or 'bare metal' PPC64 guests as yet.
Processor state is set up as a guest kernel would expect (both primary and secondaries), and SMP is fully supported.
The kernels are loaded as flat binaries and booted directly. The intention is to later support loading firmware such as SLOF.
Some of the code within is borrowed/based upon code in QEMU, particularly the XICS emulation, device tree construction and PCI setup.
-- Changes since V3:
- Gained another patch to provide PPC KVM-PR support (widens userbase :p ) This allocates a page table, sets up a few more regs etc. Also, removes restriction that mandates use of hugepages.
Requires KVM-PR to implement H_BULK_REMOVE (separate patch)
- Cleaned up FDT generation to detect host CPU & generate based on its properties; now supports PPC970 as well as POWER7
- Removed redefinition of hypercall #defines, using <asm/hvcall.h> instead
- More sensible MMIO layering; CPU passes MMIO to PHB, PHB then decides which PCI window is accessed.
- Die if kernel-handled hypercalls ever get to userland
- Build in libfdt as sugggested -- it's small and present in our sourcetree, and removes external dependency on 64bit libfdt (which isn't in some distros).
- Spit & polish
Thanks to David & Alex for the PPC-related reviews!
Matt Evans (7):
kvm tools: PPC64, add HPT/SDR1 for -PR KVM kvm tools: Generate SPAPR PPC64 guest device tree kvm tools: Add SPAPR PPC64 hcall & rtascall structure kvm tools: Add SPAPR PPC64 HV console
kvm tools: Add PPC64 XICS interrupt controller support kvm tools: Add PPC64 PCI Host Bridge
kvm tools: Add PPC64 kvm_cpu__emulate_io()
tools/kvm/Makefile | 31 ++- tools/kvm/powerpc/cpu_info.c | 83 ++++ tools/kvm/powerpc/cpu_info.h | 43 +++ tools/kvm/powerpc/include/kvm/kvm-arch.h | 17 + tools/kvm/powerpc/include/kvm/kvm-cpu-arch.h | 12 +- tools/kvm/powerpc/irq.c | 43 ++- tools/kvm/powerpc/kvm-cpu.c | 64 +++- tools/kvm/powerpc/kvm.c | 290 ++++++++++++++- tools/kvm/powerpc/spapr.h | 93 +++++ tools/kvm/powerpc/spapr_hcall.c | 134 +++++++ tools/kvm/powerpc/spapr_hvcons.c | 102 +++++ tools/kvm/powerpc/spapr_hvcons.h | 19 + tools/kvm/powerpc/spapr_pci.c | 423 +++++++++++++++++++++ tools/kvm/powerpc/spapr_pci.h | 57 +++ tools/kvm/powerpc/spapr_rtas.c | 229 ++++++++++++ tools/kvm/powerpc/xics.c | 514 ++++++++++++++++++++++++++ tools/kvm/powerpc/xics.h | 23 ++ 17 files changed, 2150 insertions(+), 27 deletions(-) create mode 100644 tools/kvm/powerpc/cpu_info.c create mode 100644 tools/kvm/powerpc/cpu_info.h create mode 100644 tools/kvm/powerpc/spapr.h create mode 100644 tools/kvm/powerpc/spapr_hcall.c create mode 100644 tools/kvm/powerpc/spapr_hvcons.c create mode 100644 tools/kvm/powerpc/spapr_hvcons.h create mode 100644 tools/kvm/powerpc/spapr_pci.c create mode 100644 tools/kvm/powerpc/spapr_pci.h create mode 100644 tools/kvm/powerpc/spapr_rtas.c create mode 100644 tools/kvm/powerpc/xics.c create mode 100644 tools/kvm/powerpc/xics.h