linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/8] use r14 for a per-cpu kernel register
@ 2017-12-20 14:51 Nicholas Piggin
  2017-12-20 14:51 ` [RFC PATCH 1/8] powerpc/64s: stop using r14 register Nicholas Piggin
                   ` (7 more replies)
  0 siblings, 8 replies; 12+ messages in thread
From: Nicholas Piggin @ 2017-12-20 14:51 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Nicholas Piggin

This makes r14 a fixed register and used to store per-cpu stuff in
the kernel, including read-write fields that are retained over
interrupts. It ends up being most useful for speeding up per-cpu
pointer dereferencing and soft-irq masking and testing. But it can
also reduce the number of loads and stores in the interrupt entry
paths by moving several bits of interest into r14 (another bit I'm
looking at is adding a bit for HSTATE_IN_GUEST to speed up kvmtest).

The series goes on top of Maddy's softi-irq patches, it works on 64s,
but KVM and 64e are probably broken at the moment. So it's not
intended to merge yet, but if people like the result then maybe the
first patch can be merged to stop using r14 in preparation.

Nicholas Piggin (8):
  powerpc/64s: stop using r14 register
  powerpc/64s: poison r14 register while in kernel
  powerpc/64s: put the per-cpu data_offset in r14
  powerpc/64s: put io_sync bit into r14
  powerpc/64s: put work_pending bit into r14
  powerpc/64s: put irq_soft_mask bits into r14
  powerpc/64s: put irq_soft_mask and irq_happened bits into r14
  powerpc/64s: inline local_irq_enable/restore

 arch/powerpc/Makefile                          |   1 +
 arch/powerpc/crypto/md5-asm.S                  |  40 +++----
 arch/powerpc/crypto/sha1-powerpc-asm.S         |  10 +-
 arch/powerpc/include/asm/exception-64s.h       | 127 +++++++++++----------
 arch/powerpc/include/asm/hw_irq.h              | 130 ++++++++++-----------
 arch/powerpc/include/asm/io.h                  |  11 +-
 arch/powerpc/include/asm/irqflags.h            |  24 ++--
 arch/powerpc/include/asm/kvm_book3s_asm.h      |   2 +-
 arch/powerpc/include/asm/kvm_ppc.h             |   6 +-
 arch/powerpc/include/asm/paca.h                |  73 +++++++++++-
 arch/powerpc/include/asm/percpu.h              |   2 +-
 arch/powerpc/include/asm/ppc_asm.h             |  21 +++-
 arch/powerpc/include/asm/spinlock.h            |  21 ++--
 arch/powerpc/kernel/asm-offsets.c              |  23 +++-
 arch/powerpc/kernel/entry_32.S                 |   4 +-
 arch/powerpc/kernel/entry_64.S                 |  95 ++++++++++------
 arch/powerpc/kernel/exceptions-64s.S           |  52 ++++-----
 arch/powerpc/kernel/head_64.S                  |  25 ++--
 arch/powerpc/kernel/idle_book3s.S              |  86 +++++++-------
 arch/powerpc/kernel/irq.c                      |  92 ++++++---------
 arch/powerpc/kernel/kgdb.c                     |   8 +-
 arch/powerpc/kernel/optprobes_head.S           |   3 +-
 arch/powerpc/kernel/paca.c                     |   1 -
 arch/powerpc/kernel/process.c                  |   6 +-
 arch/powerpc/kernel/setup_64.c                 |  19 +++-
 arch/powerpc/kernel/time.c                     |  15 +--
 arch/powerpc/kernel/tm.S                       |  40 ++++---
 arch/powerpc/kernel/trace/ftrace_64_mprofile.S |  10 +-
 arch/powerpc/kvm/book3s_hv.c                   |   6 +-
 arch/powerpc/kvm/book3s_hv_interrupts.S        |   5 +-
 arch/powerpc/kvm/book3s_hv_rmhandlers.S        |   3 +-
 arch/powerpc/kvm/book3s_interrupts.S           |  93 +++++++++++----
 arch/powerpc/kvm/book3s_pr.c                   |   6 +
 arch/powerpc/lib/checksum_64.S                 |  66 +++++------
 arch/powerpc/lib/copypage_power7.S             |  32 +++---
 arch/powerpc/lib/copyuser_power7.S             | 152 ++++++++++++-------------
 arch/powerpc/lib/crtsavres.S                   |   3 +
 arch/powerpc/lib/memcpy_power7.S               |  80 ++++++-------
 arch/powerpc/lib/sstep.c                       |   1 +
 arch/powerpc/xmon/xmon.c                       |   7 +-
 40 files changed, 764 insertions(+), 637 deletions(-)

-- 
2.15.0

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

end of thread, other threads:[~2017-12-22 15:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-20 14:51 [RFC PATCH 0/8] use r14 for a per-cpu kernel register Nicholas Piggin
2017-12-20 14:51 ` [RFC PATCH 1/8] powerpc/64s: stop using r14 register Nicholas Piggin
2017-12-20 14:52 ` [RFC PATCH 2/8] powerpc/64s: poison r14 register while in kernel Nicholas Piggin
2017-12-20 14:52 ` [RFC PATCH 3/8] powerpc/64s: put the per-cpu data_offset in r14 Nicholas Piggin
2017-12-20 17:53   ` Gabriel Paubert
2017-12-22 13:50     ` Nicholas Piggin
2017-12-20 14:52 ` [RFC PATCH 4/8] powerpc/64s: put io_sync bit into r14 Nicholas Piggin
2017-12-22 15:08   ` Thiago Jung Bauermann
2017-12-20 14:52 ` [RFC PATCH 5/8] powerpc/64s: put work_pending " Nicholas Piggin
2017-12-20 14:52 ` [RFC PATCH 6/8] powerpc/64s: put irq_soft_mask bits " Nicholas Piggin
2017-12-20 14:52 ` [RFC PATCH 7/8] powerpc/64s: put irq_soft_mask and irq_happened " Nicholas Piggin
2017-12-20 14:52 ` [RFC PATCH 8/8] powerpc/64s: inline local_irq_enable/restore Nicholas Piggin

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