powerpc: Unify FP/VMX/VSX state handling between KVM and main kernel
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest6 patches 6 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | powerpc: Put FP/VSX and VR state into structuresarch/ arch/ arch/ +14 more | +200 | 2 replies | |
| 2/6 | powerpc: Provide for giveup_fpu/altivec to save state in alternate locationarch/ arch/ arch/ +3 more | +71 | 2 replies | |
| 3/6 | KVM: PPC: Use load_fp/vr_state rather than load_up_fpu/altivecarch/ arch/ arch/ +3 more | +14 | 0 replies | |
| 4/6 | KVM: PPC: Store FP/VSX/VMX state in thread_fp/vr_state structuresarch/ arch/ arch/ +6 more | +131 | 0 replies | |
| 5/6 | KVM: PPC: Book3S: Load/save FP/VMX/VSX state directly to/from vcpu structarch/ arch/ arch/ | +19 | 1 reply | |
| 6/6 | KVM: PPC: Book3S HV: Use load/store_fp_state functions in HV guest entry/exitarch/ arch/ | +18 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/6] powerpc: Unify FP/VMX/VSX state handling between KVM and main kernel
Currently on powerpc we store and access floating-point and vector state in various ad-hoc arrays in places such as the thread_struct and the kvm_vcpu_arch struct. This leads to code duplication for the code that transfers this state between CPU registers and memory, and leads to double-copying in the case of PR KVM, where we copy state from the kvm_vcpu_arch struct to the thread_struct, and then load it up into CPU registers from the thread_struct.
To simplify all this, this patch series defines a struct for storing FP/VSX state including FPSCR, and a struct for storing vector state (VMX/Altivec) including VSCR. These structs then get used in both the thread_struct and the kvm_vcpu_arch struct, enabling us to use common functions for loading and storing the CPU register state, and avoid double copying. The benefit can be seen in that the series deletes 330 more lines than it adds.
This series will also help greatly in implementing the support in KVM for saving and restoring transactional register state on POWER8.
This series is against the "queue" branch of the kvm.git tree. I used that as a base because it has pulled in Linus' tree recently and thus has the most recent powerpc code from Ben H's next branch as well as the latest KVM code.
Paul.
arch/powerpc/include/asm/kvm_book3s.h | 3 - arch/powerpc/include/asm/kvm_host.h | 12 +-- arch/powerpc/include/asm/ppc_asm.h | 95 ++--------------- arch/powerpc/include/asm/processor.h | 47 +++++---- arch/powerpc/include/asm/sfp-machine.h | 2 +- arch/powerpc/include/asm/switch_to.h | 2 - arch/powerpc/kernel/align.c | 6 +- arch/powerpc/kernel/asm-offsets.c | 36 +++---- arch/powerpc/kernel/fpu.S | 84 +++++++-------- arch/powerpc/kernel/ppc_ksyms.c | 4 + arch/powerpc/kernel/process.c | 15 ++- arch/powerpc/kernel/ptrace.c | 49 ++++----- arch/powerpc/kernel/ptrace32.c | 11 +- arch/powerpc/kernel/signal_32.c | 72 ++++++------- arch/powerpc/kernel/signal_64.c | 29 +++--- arch/powerpc/kernel/tm.S | 41 ++++---- arch/powerpc/kernel/traps.c | 10 +- arch/powerpc/kernel/vecemu.c | 6 +- arch/powerpc/kernel/vector.S | 77 +++++++------- arch/powerpc/kvm/book3s.c | 38 +++++-- arch/powerpc/kvm/book3s_exports.c | 4 - arch/powerpc/kvm/book3s_hv.c | 42 -------- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 82 ++++----------- arch/powerpc/kvm/book3s_paired_singles.c | 169 +++++++++++++++---------------- arch/powerpc/kvm/book3s_pr.c | 145 +++++--------------------- arch/powerpc/kvm/book3s_rmhandlers.S | 47 --------- arch/powerpc/kvm/booke.c | 21 ---- arch/powerpc/kvm/booke.h | 5 +- arch/powerpc/kvm/powerpc.c | 4 +- 29 files changed, 414 insertions(+), 744 deletions(-)