Skip to content

RFC Enable MTTCG on PowerPC

Nikunj A Dadhania qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 40 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4spapr-hcall: take iothread lock during handler callhw/ppc/spapr_hcall.c+9 -26 replies
2/4target-ppc: with MTTCG report more threadstarget-ppc/kvm.c target-ppc/kvm_ppc.h+2 -26 replies
3/4target-ppc: use atomic_cmpxchg for ld/st reservationtarget-ppc/translate.c+21 -39 replies
4/4target-ppc: flush tlb from all the cpucputlb.c include/exec/exec-all.h target-ppc/mmu-hash64.c+18 -110 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [Qemu-devel] [PATCH RFC 0/4] Enable MTTCG on PowerPC

The series is a first attempt at enabling Multi-Threaded TCG on PowerPC. Changes that were needed to enable PowerPC are pretty simple;

Patch 01: Take a iothread lock during hcall, as hcall can generate io requests
02: For TCG, we were harcoding smt as 1, this gets rid of the limitation 03: Use atomic_cmpxchg in store conditional
04: With more threads, flush the entry from each cpu.
This can be optimized further.

The patches are based on the Alex Bennee's base enabling patches for MTTCG[1] and Emilios's cmpxchg atomics. The consolidated tree of the above patches is here:

https://github.com/stsquad/qemu/tree/mttcg/base-patches-v4-with-cmpxchg-atomics-v2

Apart from the above, PPC patches are based out of ppc-for-2.8 and load/store consolidation patches [2]

Series with all dependent patches available here:
https://github.com/nikunjad/qemu/tree/ppc_mttcg_v1

Testing:
========

-smp 4,cores=1,threads=4 -accel tcg,thread=multi

TODO
====
Implement msgsndp instructions(door-bell), newer kernels enable it depending on the PVR. I have been using following workaround to boot.
https://github.com/nikunjad/qemu/commit/2c10052c5f93418a6b920e6ba3ce1813fcf50bc4

[1] https://www.mail-archive.com/[email protected]/msg391966.html
[2] https://lists.gnu.org/archive/html/qemu-ppc/2016-08/msg00265.html

Nikunj A Dadhania (4):
spapr-hcall: take iothread lock during handler call
target-ppc: with MTTCG report more threads
target-ppc: use atomic_cmpxchg for ld/st reservation
target-ppc: flush tlb from all the cpu

 cputlb.c                | 15 +++++++++++++++
 hw/ppc/spapr_hcall.c    | 11 +++++++++--
 include/exec/exec-all.h |  2 ++
 target-ppc/kvm.c        |  2 +-
 target-ppc/kvm_ppc.h    |  2 +-
 target-ppc/mmu-hash64.c |  2 +-
 target-ppc/translate.c  | 24 +++++++++++++++++++++---
 7 files changed, 50 insertions(+), 8 deletions(-)
Signature · 1 line
2.7.4