On Sun, 30 Mar 2008 20:26:08 +0300 Pekka Paalanen <pq@iki.fi> wrote:One more idea: D) Emulate the faulting instruction. In __ioremap(), do the mapping, but steal it for mmiotrace's personal use, and return a bogus mapping that is identifiable in #pf handler. When something accesses the bogus mapping, emulate and step over the faulting instruction using the stolen IO memory mapping. This would get rid of the debug trap and single stepping, and also remove the need to disarm the mmio page, which means tracing would work reliably on SMP without any page table kludges. This would also remove the yet another instruction decoding code that mmiotrace has. The catch is the instruction emulation. I see KVM has some emulation code, but I cannot understand it without a deep study that would take me weeks. Is that general enough to be used, or could it be generalized? Mmiotrace, apart from executing the instruction with a modified address, would need to extract the type of IO memory access, width and the data read/written. And since it is dealing with IO memory, the emulation should be very careful to access the hardware exactly like the original instruction would have. Maybe also kmemcheck could use this approach, since the current approach is very much like in mmiotrace: #pf, show page, single step, #db trap, hide page. Are there other x86(_64) instruction emulation facilities in the kernel I might use? Or, if the emulation cannot be used, what would it take to make at least instruction decoding general enough so that mmiotrace could use that instead of its own decoding? I fear modifying KVM emulation code is a too heavy job for me personally. -- Pekka Paalanen http://www.iki.fi/pq/ --
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Andi Kleen | [PATCH x86] [0/16] Various i386/x86-64 changes |
| Vladislav Bolkhovitin | Re: Integration of SCST in the mainstream Linux kernel |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
git: | |
| Gerrit Renker | [PATCH 0/37] dccp: Feature negotiation - last call for comments |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Natalie Protasevich | [BUG] New Kernel Bugs |
| Arjan van de Ven | Re: [GIT]: Networking |
