Kamble, Nitin A
2006-Apr-19 20:02 UTC
[Xen-devel] [PATCH] avoid injection of missed timer interrupts while debugging a guest
Hi Keir, Ian, Today if we stop the guest for debugging using the gdbserver and then continue with the guest execution the PIT finds that the time has gone ahead and it missed to inject so many timer ticks, and it tries to inject all of those one by one. So after the gdb continue command the guest just handles the timer interrupts for a long time before it can do anything else. This patch changes this PIT behavior, if it finds that the guest is being debugged then it does not try to inject missing timer ticks. Please apply or comment. Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> Thanks & Regards, Nitin ------------------------------------------------------------------------ ----------- Open Source Technology Center, Intel Corp _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Apr-19 20:18 UTC
[Xen-devel] Re: [PATCH] avoid injection of missed timer interrupts while debugging a guest
On 19 Apr 2006, at 21:02, Kamble, Nitin A wrote:> Hi Keir, Ian, > Today if we stop the guest for debugging using the gdbserver and then > continue with the guest execution the PIT finds that the time has gone > ahead and it missed to inject so many timer ticks, and it tries to > inject all of those one by one. So after the gdb continue command the > guest just handles the timer interrupts for a long time before it can > do anything else. > This patch changes this PIT behavior, if it finds that the guest > is being debugged then it does not try to inject missing timer ticks.How about not accounting missed ticks across DOMF_ctrl_pause''d periods? This would mean that missing_ticks would still be accounted for a DOMF_debugger guest that is not currently being debugged, and will also nicely handle any other circumstances in which a guest might get paused by control software for any reason. I suppose it''ll be a bigger patch though. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Kamble, Nitin A
2006-Apr-19 21:28 UTC
[Xen-devel] RE: [PATCH] avoid injection of missed timer interrupts while debugging a guest
Hi Keir, Gdbserver does use the xc_ptrace(PTRACE_ATTACH), and the PTRACE_ATTACH uses xc_domain_pause() to pause the running guest for debugging. This is the same interface called by "xm pause". One more thing, the PIT missed timer ticks injection code is invoked later after the domain is un-paused, so at the time of that invocation the domain is no more paused. I think what you are saying can be achieved by keeping a flag that will tell the PIT code that the domain was paused & unpaused and so if you have missed ticks do not try to inject it. Did I understand you correctly, and do you think the "domain_was_paused" flag is the right solution? Thanks & Regards, Nitin ----------------------------------------------------------------------------------- Open Source Technology Center, Intel Corp>-----Original Message----- >From: Keir Fraser [mailto:Keir.Fraser@cl.cam.ac.uk] >Sent: Wednesday, April 19, 2006 1:18 PM >To: Kamble, Nitin A >Cc: xen-devel@lists.xensource.com; Ian Pratt >Subject: Re: [PATCH] avoid injection of missed timer interrupts while >debugging a guest > > >On 19 Apr 2006, at 21:02, Kamble, Nitin A wrote: > >> Hi Keir, Ian, >> Today if we stop the guest for debugging using the gdbserver and then >> continue with the guest execution the PIT finds that the time has gone >> ahead and it missed to inject so many timer ticks, and it tries to >> inject all of those one by one. So after the gdb continue command the >> guest just handles the timer interrupts for a long time before it can >> do anything else. >> This patch changes this PIT behavior, if it finds that the guest >> is being debugged then it does not try to inject missing timer ticks. > >How about not accounting missed ticks across DOMF_ctrl_pause''d periods? >This would mean that missing_ticks would still be accounted for a >DOMF_debugger guest that is not currently being debugged, and will also >nicely handle any other circumstances in which a guest might get paused >by control software for any reason. I suppose it''ll be a bigger patch >though. > > -- Keir_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Apr-19 21:30 UTC
[Xen-devel] Re: [PATCH] avoid injection of missed timer interrupts while debugging a guest
On 19 Apr 2006, at 22:28, Kamble, Nitin A wrote:> Gdbserver does use the xc_ptrace(PTRACE_ATTACH), and the > PTRACE_ATTACH uses xc_domain_pause() to pause the running guest for > debugging. > This is the same interface called by "xm pause". > One more thing, the PIT missed timer ticks injection code is invoked > later after the domain is un-paused, so at the time of that invocation > the domain is no more paused. > I think what you are saying can be achieved by keeping a flag that > will tell the PIT code that the domain was paused & unpaused and so if > you have missed ticks do not try to inject it. > Did I understand you correctly, and do you think the > "domain_was_paused" flag is the right solution?Yes, you''ve got it. It is rather a pain as you note -- you essentially want a notifier on pause so the hvm code can maintain this flag that you can check-and-clear the next time you try to account missed ticks. On the other hand, a check for debugger mode is a bit gross and bizarre in the guts of HVM timer handling code. :-) I would at least like to see a patch that tries the more general approach and then we can pick between them. There is also the question of whether or not we do generally want to account missed ticks if a domain is paused for some reason. But I''m pretty sure the answer is ''no''. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Kamble, Nitin A
2006-Apr-19 22:05 UTC
[Xen-devel] RE: [PATCH] avoid injection of missed timer interrupts while debugging a guest
Hi Keir, Here is the patch for avoiding missing timer ticks injection for the paused domain. Signed-Off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Thanks & Regards, Nitin ------------------------------------------------------------------------ ----------- Open Source Technology Center, Intel Corp>-----Original Message----- >From: Keir Fraser [mailto:Keir.Fraser@cl.cam.ac.uk] >Sent: Wednesday, April 19, 2006 2:31 PM >To: Kamble, Nitin A >Cc: xen-devel@lists.xensource.com; Ian Pratt >Subject: Re: [PATCH] avoid injection of missed timer interrupts while >debugging a guest > > >On 19 Apr 2006, at 22:28, Kamble, Nitin A wrote: > >> Gdbserver does use the xc_ptrace(PTRACE_ATTACH), and the >> PTRACE_ATTACH uses xc_domain_pause() to pause the running guest for >> debugging. >> This is the same interface called by "xm pause". >> One more thing, the PIT missed timer ticks injection code is invoked >> later after the domain is un-paused, so at the time of thatinvocation>> the domain is no more paused. >> I think what you are saying can be achieved by keeping a flag that >> will tell the PIT code that the domain was paused & unpaused and soif>> you have missed ticks do not try to inject it. >> Did I understand you correctly, and do you think the >> "domain_was_paused" flag is the right solution? > >Yes, you''ve got it. It is rather a pain as you note -- you essentially >want a notifier on pause so the hvm code can maintain this flag that >you can check-and-clear the next time you try to account missed ticks. >On the other hand, a check for debugger mode is a bit gross and bizarre >in the guts of HVM timer handling code. :-) I would at least like to >see a patch that tries the more general approach and then we can pick >between them. > >There is also the question of whether or not we do generally want to >account missed ticks if a domain is paused for some reason. But I''m >pretty sure the answer is ''no''. > > -- Keir_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel