[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] current not very current (vs curr_vcpu)



On Tue, 23 Feb 2010 21:03:04 +0000
Keir Fraser <keir.fraser@xxxxxxxxxxxxx> wrote:

> On 23/02/2010 19:46, "Mukesh Rathor" <mukesh.rathor@xxxxxxxxxx> wrote:
> 
> > struct cpu_user_regs *regs = guest_cpu_user_regs(); <------
> > 
> > The cpu is clearly running idle_vcpu, so current is correctly
> > pointing to idle vcpu. But guest_mode() is showing guest mode
> > incorrectly.
> > 
> > I'm not much familiar with ns16550 stuff, so cant' think of a fix
> > other than just setting regs to current stack pointer in
> > ns16550_poll().
> > 
> > __asm__ ( "movq %%rsp,%0" : "=r" (val));
> > struct cpu_user_regs *regs = val;
> > 
> > Let me know if you like the fix and I'll submit a patch.
> 
> Given the only thing this apparently affected was some of your own
> ad-hoc debug code, do we really care about this at all? We can
> probably happily just leave it.

Well, I'm afraid not. It breaks the debug code to debug the hang. More
importantly, it also breaks my debuggers, which some people from outside
oracle are also using. Most of our new high end servers are accessed
via virtual serial port, so if ns16550_poll() call is related to it,
then it'll only get worse. Moreover, anybody reading and copying that
code to do something similar will be misled.

I realize it's ugly, and the fix is more than just setting regs to 
current stack pointer. But I'm willing to do the work and come up
with something. Since, it's broken already, it'll be low risk to you.

I can come up with some sort of glue code that'll push 
eflgas/cs/eip/cpu_user_regs on the current stack and then set regs. Let
me know if you think of better idea, or think that is the best approach.

execute_timers -> ns16550_poll_glue -> ns16550_poll(data, regs)
   where ns16550_poll_glue in some file.S will just push context on
   stack.

thanks,
Mukesh


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.