Skip to contentSkip to conversation

Is there a way to interrupt MMIO with kprobes/ltt/etc...

DISCUSSION Rusty Lynch 2 participants 2 messages Nov 8, 2002

lore
Share & tools
lore
#0 lore raw

I have been looking into the possible ways a fault injection tool could be implemented on the available tools/hooks in the 2.5 kernel. I can see how kprobes would help by allowing me to setup handlers when a specific address is executed, but what about when a specific memory mapped IO address is touched or looked at?

I know there has been a lot of activity on kprobes, LTT, and others (isn't there something else?). Do any of these patches allow a handler to be called just before some MMIO is accessed? Messing with architecture specific debug registers seems problematic since it makes the solution architecture specific and the number of watch points is pretty limited.

-rustyl

#1 lore raw
Quoted 6 lines · Rusty Lynch

I have been looking into the possible ways a fault injection tool could be implemented on the available tools/hooks in the 2.5 kernel. I can see how kprobes would help by allowing me to setup handlers when a specific address is executed, but what about when a specific memory mapped IO address is touched or looked at?

Quoted 6 lines

I know there has been a lot of activity on kprobes, LTT, and others (isn't there something else?). Do any of these patches allow a handler to be called just before some MMIO is accessed? Messing with architecture specific debug registers seems problematic since it makes the solution architecture specific and the number of watch points is pretty limited.

You could do this with the interface provided by kwatchpoints patch [1] without directly mucking with debug registers. The interface is simple:

int register_kwatch(unsigned long addr, u8 length, u8 type,
kwatch_handler_t handler)

If you don't want to use debug registers or if they are not enough, only other possibility I can think of is to find all code locations where the MMIO space of interest is touched and put execution probes there.

[1] You will need these two patches:
http://marc.theaimsgroup.com/?l=linux-kernel&m=103528454215523&w=2
http://marc.theaimsgroup.com/?l=linux-kernel&m=103528454015520&w=2

Cheers,
Vamsi.

Signature · 5 lines
Vamsi Krishna S.
Linux Technology Center,
IBM Software Lab, Bangalore.
Ph: +91 80 5044959
Internet: [email protected]