]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
sh: Optimize runtime disabling of trapped I/O.
authorPaul Mundt <lethal@linux-sh.org>
Wed, 27 Jan 2010 12:56:57 +0000 (21:56 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Wed, 27 Jan 2010 12:56:57 +0000 (21:56 +0900)
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>
arch/sh/kernel/io_trapped.c

index 16b83cc89a410e12fc311447863660004e6399ed..4a8bb4eeb8ad7ffc5dee5a312712fafda419028c 100644 (file)
@@ -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;