xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Keir Fraser <keir.fraser@eu.citrix.com>
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>
Subject: Re: current not very current (vs curr_vcpu)
Date: Tue, 23 Feb 2010 19:55:06 -0800	[thread overview]
Message-ID: <20100223195506.0e260a58@mantra.us.oracle.com> (raw)
In-Reply-To: <C7A9F308.B143%keir.fraser@eu.citrix.com>

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

> On 23/02/2010 19:46, "Mukesh Rathor" <mukesh.rathor@oracle.com> 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

  reply	other threads:[~2010-02-24  3:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-19  4:21 current not very current (vs curr_vcpu) Mukesh Rathor
2010-02-19  8:12 ` Keir Fraser
2010-02-19 19:23   ` Mukesh Rathor
2010-02-19 21:34     ` Keir Fraser
2010-02-20  3:50       ` Mukesh Rathor
2010-02-20  7:45         ` Keir Fraser
2010-02-22 18:59           ` Mukesh Rathor
2010-02-23 19:46           ` Mukesh Rathor
2010-02-23 21:03             ` Keir Fraser
2010-02-24  3:55               ` Mukesh Rathor [this message]
2010-02-24 10:45                 ` Keir Fraser
2010-02-25  1:06                   ` Mukesh Rathor
2010-02-25  8:07                     ` Keir Fraser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100223195506.0e260a58@mantra.us.oracle.com \
    --to=mukesh.rathor@oracle.com \
    --cc=Xen-devel@lists.xensource.com \
    --cc=keir.fraser@eu.citrix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).