Skip to content

Commit

Permalink
sh: Optimize runtime disabling of trapped I/O.
Browse files Browse the repository at this point in the history
Presently trapped I/O is only registered if it's not explicitly disabled
for the platforms that select it openly. From the fault path this runs
through an address lookup before figuring out that nothing matches and
falls back through the error path, but we can forego the lookup
completely by testing if it's been explicitly disabled. This provides a
measurable speedup for things like qemu that rely on runtime disabling.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Paul Mundt committed Jan 27, 2010
1 parent 485773f commit 08b36c4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/sh/kernel/io_trapped.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ int handle_trapped_io(struct pt_regs *regs, unsigned long address)
insn_size_t instruction;
int tmp;

if (trapped_io_disable)
return 0;
if (!lookup_tiop(address))
return 0;

Expand Down

0 comments on commit 08b36c4

Please sign in to comment.