All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] MIPS: Get ready for non-executable stack.
@ 2014-12-03 23:44 David Daney
  2014-12-03 23:44 ` [PATCH 1/3] MIPS: Add FPU emulator counter for non-FPU instructions emulated David Daney
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: David Daney @ 2014-12-03 23:44 UTC (permalink / raw)
  To: linux-mips, ralf
  Cc: Leonid Yegoshin, Zubair.Kakakhel, geert+renesas, peterz,
	paul.gortmaker, macro, chenhc, cl, mingo, richard, zajec5,
	james.hogan, keescook, tj, alex, pbonzini, blogic, paul.burton,
	qais.yousef, linux-kernel, markos.chandras, dengcheng.zhu,
	manuel.lauss, lars.persson, David Daney

From: David Daney <david.daney@cavium.com>

Currently the MIPS FPU emulator uses eXecute Out of Line (XOL) on the
stack to handle instructions in the delay slots of FPU branches.
Because of this MIPS cannot have a non-executable stack.

A previous patch set from Leonid Yegoshin attempts to address the
problem by moving the XOL location to a thread private mapping of a
dedicated page.

I present here an alternative: Add an instruction set emulator and use
it to execute the FPU delay slot instructions.  The benefit of this
approach is that we don't have to allocate a page per user-space
thread for XOL, and we keep the TLB handling code slightly simpler as
a result.

Currently this is a proof of concept, as it doesn't yet handle MIPS64
nor microMIPS instructions.  But it is sufficient to run the entire
Debian distribution on a FPU-less CPU.

Comments welcome.

David Daney (3):
  MIPS: Add FPU emulator counter for non-FPU instructions emulated.
  MIPS: Add full ISA emulator.
  MIPS: Use full instruction emulation for FPU emulator delay slot
    emulation.

 arch/mips/include/asm/fpu_emulator.h |   1 +
 arch/mips/kernel/Makefile            |   3 +-
 arch/mips/kernel/insn-emul.c         | 815 +++++++++++++++++++++++++++++++++++
 arch/mips/math-emu/cp1emu.c          |  13 +-
 arch/mips/math-emu/me-debugfs.c      |   1 +
 5 files changed, 830 insertions(+), 3 deletions(-)
 create mode 100644 arch/mips/kernel/insn-emul.c

-- 
1.7.11.7

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

end of thread, other threads:[~2014-12-04 20:32 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-03 23:44 [PATCH 0/3] MIPS: Get ready for non-executable stack David Daney
2014-12-03 23:44 ` [PATCH 1/3] MIPS: Add FPU emulator counter for non-FPU instructions emulated David Daney
2014-12-03 23:44 ` [PATCH 2/3] MIPS: Add full ISA emulator David Daney
2014-12-03 23:55   ` Leonid Yegoshin
2014-12-03 23:55     ` Leonid Yegoshin
2014-12-04  0:20     ` David Daney
2014-12-04  0:20       ` David Daney
2014-12-04  0:52       ` Leonid Yegoshin
2014-12-04  0:52         ` Leonid Yegoshin
2014-12-04  1:29         ` David Daney
2014-12-04  1:29           ` David Daney
     [not found]           ` <547FBF63.70802@imgtec.com>
2014-12-04  2:21             ` David Daney
2014-12-04  2:21               ` David Daney
2014-12-04 10:16               ` Paul Burton
2014-12-04 10:16                 ` Paul Burton
2014-12-04 10:45                 ` Qais Yousef
2014-12-04 10:45                   ` Qais Yousef
2014-12-04 11:49       ` Maciej W. Rozycki
2014-12-04 17:40         ` David Daney
2014-12-04 17:40           ` David Daney
2014-12-04 20:32           ` Maciej W. Rozycki
2014-12-03 23:44 ` [PATCH 3/3] MIPS: Use full instruction emulation for FPU emulator delay slot emulation David Daney

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.