RFC KVM: PPC: Book3S: C-ify the P9 entry/exit code
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest9 patches 8 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/9 | KVM: PPC: Book3S 64: move KVM interrupt entry to a common entry pointarch/ arch/ arch/ +1 more | +40 | 3 replies | |
| 2/9 | KVM: PPC: Book3S 64: Move GUEST_MODE_SKIP test into KVMarch/ arch/ | +42 | 4 replies | |
| 3/9 | KVM: PPC: Book3S 64: add hcall interrupt handlerarch/ arch/ | +6 | 1 reply | |
| 4/9 | KVM: PPC: Book3S HV: Move hcall early register setup to KVMarch/ arch/ arch/ | +32 | 0 replies | |
| 5/9 | powerpc/64s: Remove EXSLB interrupt save areaarch/ arch/ arch/ | +1 | 0 replies | |
| 6/9 | KVM: PPC: Book3S HV: Move interrupt early register setup to KVMarch/ arch/ | +50 | 0 replies | |
| 7/9 | KVM: PPC: Book3S HV: move bad_host_intr check to HV handlerarch/ arch/ arch/ | +10 | 0 replies | |
| 8/9 | KVM: PPC: Book3S HV: Minimise hcall handler calling convention differencesarch/ arch/ | +18 | 0 replies | |
| 9/9 | KVM: PPC: Book3S HV: Implement the rest of the P9 entry/exit handling in Carch/ arch/ arch/ +7 more | +364 | 0 replies |
Reviews trailers per patch
2 of 9 patches have a Reviewed-by or Acked-by.
| Patch | Fabiano Rosas | Daniel Axtens |
|---|---|---|
| 1/9 | R-b | R-b |
| 2/9 | ||
| 3/9 | R-b | |
| 4/9 | ||
| 5/9 | ||
| 6/9 | ||
| 7/9 | ||
| 8/9 | ||
| 9/9 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [RFC PATCH 0/9] KVM: PPC: Book3S: C-ify the P9 entry/exit code
This series goes on top of the KVM patches I sent for the next merge window. It's pretty rough and incomplete at the moment but has started booting a simple guest into busybox in sim.
One of the main points of this is to avoid running KVM in a special mode (aka "realmode") which is hostile to the rest of Linux and can't be instrumented well by core facilities or generally use core code.
The asm itself is also tricky to follow. It's nothing compared with the old HV path when you sit down and go through it, but it's not trivial and sharing code paths makes things painful too.
One issue is what to do about PR-KVM and pre-ISAv3.0 / HPT HV-KVM.
The old path could also be converted similarly to C, although that's a far bigger job. At least removing the asm code sharing makes a (slight) simplification to the old path for now.
This change is a pretty clean break in the low level exit/entry code, and the rest of the code already has many divergences, so I don't think this exacerbates the problem, but if those PR / old-HV are to be maintained well then we should eat the cost early to modernise that code too. If they stay walled off with these interface shims then they'll just be harder to maintain and the problem will definitely not get better.
Now, the number of people who understand PR-KVM and have time to maintain it is roughly zero, and for the old HV path it's approaching zero. The radix, LPAR-per-thread programming model by comparison is so nice and simple, maybe its better to just keep the rest on life support and keep them going for as long as we can with the bare minimum.
Thanks,
Nick
Nicholas Piggin (9):
KVM: PPC: Book3S 64: move KVM interrupt entry to a common entry point
KVM: PPC: Book3S 64: Move GUEST_MODE_SKIP test into KVM
KVM: PPC: Book3S 64: add hcall interrupt handler
KVM: PPC: Book3S HV: Move hcall early register setup to KVM powerpc/64s: Remove EXSLB interrupt save area
KVM: PPC: Book3S HV: Move interrupt early register setup to KVM
KVM: PPC: Book3S HV: move bad_host_intr check to HV handler
KVM: PPC: Book3S HV: Minimise hcall handler calling convention
differences
KVM: PPC: Book3S HV: Implement the rest of the P9 entry/exit handling
in C
arch/powerpc/include/asm/asm-prototypes.h | 2 +- arch/powerpc/include/asm/exception-64s.h | 13 ++ arch/powerpc/include/asm/kvm_asm.h | 3 +- arch/powerpc/include/asm/kvm_book3s_64.h | 2 + arch/powerpc/include/asm/kvm_ppc.h | 2 + arch/powerpc/include/asm/paca.h | 3 +- arch/powerpc/kernel/asm-offsets.c | 1 - arch/powerpc/kernel/exceptions-64s.S | 259 +++------------------- arch/powerpc/kvm/Makefile | 6 + arch/powerpc/kvm/book3s_64_entry.S | 232 +++++++++++++++++++ arch/powerpc/kvm/book3s_hv.c | 21 +- arch/powerpc/kvm/book3s_hv_interrupt.c | 164 ++++++++++++++ arch/powerpc/kvm/book3s_hv_rmhandlers.S | 136 ++---------- arch/powerpc/kvm/book3s_segment.S | 7 + arch/powerpc/kvm/book3s_xive.c | 32 +++ 15 files changed, 523 insertions(+), 360 deletions(-) create mode 100644 arch/powerpc/kvm/book3s_64_entry.S create mode 100644 arch/powerpc/kvm/book3s_hv_interrupt.c
Signature · 1 line
2.23.0