My current plan is: - add a bit to domain_flags to indicate that a domain is being debugged - enable / disable bit using new DOM0 op - (DOM0_DOMU_DEBUG?), call new DOM0 op in PTRACE_ATTACH - on int3 and trace trap pause domain if debug bit is set - pause domain when exiting vcpu up / down if debug bit is set (I know this will be a point of debate so I explain below *) Why doesn't GETDOMAININFO return a bitmask of online vcpus? It looks as if the only way to find out what vcpus are online is to iterate through, up to maxvcpuid. Do GETVCPUINFO and GETVCPUCONTEXT take vcpuids? In other words, if I have 4 cpus online I do a get call on 3, down 2, then do a get call on 3 again, will I get the same result? Where is an example of userspace code iterating through the online vcpus? * The way gdb native knows about thread create / death is by interfacing with the thread library through libthreaddb. ln libthreaddb a breakpoint is set on the thread creation and exit functions. The "right" way to do what I'm trying to do is to write a libthreaddb for each guest OS. However, I'm not going to do that. Hence my first choice to add the pause to xen itself. I could do without this but it seems kind of messy to have to figure out what vcpus are up every time a breakpoint is hit with the current interfaces. Alternatively, if GETDOMAININFO had a online vcpuid bitmask I could just compare the current bitmask with the previous one. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2005-Nov-14 10:07 UTC
Re: [Xen-devel] questions about adding MP support to gdbserver
> Why doesn''t GETDOMAININFO return a bitmask of online vcpus? It looks > as if the only way to find out what vcpus are online is to iterate > through, up to maxvcpuid.Yes, that''s the correct approach.> Do GETVCPUINFO and GETVCPUCONTEXT take vcpuids? In other words, if I > have 4 cpus online I do a get call on 3, down 2, then do a get call on > 3 again, will I get the same result?Yes.> Where is an example of userspace code iterating through the online > vcpus? > http://lists.xensource.com/xen-develThere are examples in xenstat, but it uses its own interface library (not libxenctrl) so it will probably only confuse. You have the right approach described above anyway: 1. getdomaininfo 2. for (i = 0; i <= info.max_vcpu_id; i++) 3. getvcpuinfo / getvcpucontext 4. info.online tells you whether the vcpu is up or down 5. either way, getvcpucontext will succeed if the domU has booted that vcpu -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Kip Macy
2005-Nov-14 17:33 UTC
Re: [Xen-devel] questions about adding MP support to gdbserver
Polling every breakpoint seems rather unwieldy. However, given that this will probably never be used with more than 4 processors it will work fine. Thanks. -Kip There are examples in xenstat, but it uses its own interface library> (not libxenctrl) so it will probably only confuse. You have the right > approach described above anyway: > 1. getdomaininfo > 2. for (i = 0; i <= info.max_vcpu_id; i++) > 3. getvcpuinfo / getvcpucontext > 4. info.online tells you whether the vcpu is up or down > 5. either way, getvcpucontext will succeed if the domU has booted > that vcpu > > -- Keir > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel