linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] powerpc: Unify FP/VMX/VSX state handling between KVM and main kernel
@ 2013-09-10 10:20 Paul Mackerras
  2013-09-10 10:20 ` [PATCH 1/6] powerpc: Put FP/VSX and VR state into structures Paul Mackerras
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Paul Mackerras @ 2013-09-10 10:20 UTC (permalink / raw)
  To: Alexander Graf, Benjamin Herrenschmidt; +Cc: linuxppc-dev, kvm-ppc, kvm

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(-)

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-09-10 23:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-10 10:20 [PATCH 0/6] powerpc: Unify FP/VMX/VSX state handling between KVM and main kernel Paul Mackerras
2013-09-10 10:20 ` [PATCH 1/6] powerpc: Put FP/VSX and VR state into structures Paul Mackerras
2013-09-10 17:07   ` Alexander Graf
2013-09-10 23:52     ` Paul Mackerras
2013-09-10 10:21 ` [PATCH 2/6] powerpc: Provide for giveup_fpu/altivec to save state in alternate location Paul Mackerras
2013-09-10 17:12   ` Alexander Graf
2013-09-10 23:54     ` Paul Mackerras
2013-09-10 10:21 ` [PATCH 3/6] KVM: PPC: Use load_fp/vr_state rather than load_up_fpu/altivec Paul Mackerras
2013-09-10 10:21 ` [PATCH 4/6] KVM: PPC: Store FP/VSX/VMX state in thread_fp/vr_state structures Paul Mackerras
2013-09-10 10:22 ` [PATCH 5/6] KVM: PPC: Book3S: Load/save FP/VMX/VSX state directly to/from vcpu struct Paul Mackerras
2013-09-10 18:54   ` Alexander Graf
2013-09-10 10:22 ` [PATCH 6/6] KVM: PPC: Book3S HV: Use load/store_fp_state functions in HV guest entry/exit Paul Mackerras
2013-09-10 18:57   ` Alexander Graf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).