Hey folks. I'm looking into making the remote GDB stub work with fast model
CPUs in gem5, and one major obstacle is that breakpoints are implemented
using a PCEventQueue which is stored as part of the System object. Events
that are supposed to happen at particular PCs are registered with it, and
the the CPUs check every instruction whether they've hit an interesting PC.

In the fast model CPUs and in the KVM cpus (I think) the CPUs chew through
lots of instructions without stopping to check their PCs at each one. At
least in fast model there's an API to set breakpoints, but I'm not sure
about KVM.

In any case, it seems to me that having a single polling based mechanism to
check for PC based events is not good enough when we have non-polling based
CPU implementations. Could someone more familiar with the KVM
implementations comment on what (if anything) they do to handle
breakpoints? Is there a way around this problem I'm just not aware of?

Also, has there been any discussion about how to replace the PCEventQueue?
I considered delegating the mechanism to the CPUs like the instruction and
load count based mechanisms, but there isn't a convenient list of all CPUs
in a system, and PCEvents are a more long lived type of entity. For
example, you might want to create an event that happens every time printk
would print something, and you want that to happen on all contexts/CPUs in
a system no matter when they came into existence or got set up. Once nice
property of the centralized event queue is that this is handled
automatically since it's a central source of truth.

Gabe
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to