public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sheng Yang <sheng@linux.intel.com>
To: Avi Kivity <avi@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>, kvm@vger.kernel.org
Subject: Re: [PATCH 1/2] test: Add IDT framework
Date: Thu, 10 Jun 2010 17:55:04 +0800	[thread overview]
Message-ID: <201006101755.04411.sheng@linux.intel.com> (raw)
In-Reply-To: <4C10B51C.9070502@redhat.com>

On Thursday 10 June 2010 17:49:16 Avi Kivity wrote:
> On 06/10/2010 06:31 AM, Sheng Yang wrote:
> > +
> > +#define EXCEPTION_REGION_BEGIN(r, lb) \
> > +    asm volatile("pushq $"lb"\n\t" \
> > +                 "mov $2, %0\n\t" \
> > +                 : "=r"(r))
> > +#define EXCEPTION_REGION_END(r, lb) \
> > +    asm volatile("popq %%rdx\n\t" \
> > +		 "mov $0, %0\n\t" \
> > +                 lb":\n\t": \
> > +                 "=r"(r) :: "%rdx")
> 
> These mess up the stack, no?  So if any intervening code uses %rsp based
> addressing, it will get incorrect information.

Yes, but I meant to only include instruction directly in the “region”, and support 
nobody should touch $rsp then. It's directly and simple enough.
> 
> I suggest using a special data section like the kernel.

Kind of more complex...
> 
> Also, most tests that use asm don't need an exception region, but will
> want to trap an exception on a single address.  So need a macro designed
> to be placed in asm in front of the faulting instruction.

Use region here is due to we don't know the size of instruction(or I don't know 
how to get it)... Use a label here seems the simplest way to get the address 
right.

--
regards
Yang, Sheng

  reply	other threads:[~2010-06-10  9:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-10  3:31 [PATCH 1/2] test: Add IDT framework Sheng Yang
2010-06-10  3:31 ` [PATCH 2/2] test: Add XSAVE unit test Sheng Yang
2010-06-10  9:49 ` [PATCH 1/2] test: Add IDT framework Avi Kivity
2010-06-10  9:55   ` Sheng Yang [this message]
2010-06-10 10:55     ` Avi Kivity
2010-06-10 13:32       ` Avi Kivity

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=201006101755.04411.sheng@linux.intel.com \
    --to=sheng@linux.intel.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.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