From: Marcelo Tosatti <mtosatti@redhat.com>
To: Mohammed Gamal <m.gamal005@gmail.com>
Cc: avi@redhat.com, kvm@vger.kernel.org
Subject: Re: [PATCH] test: Add emulator test for iret instruction
Date: Wed, 28 Jul 2010 17:32:18 -0300 [thread overview]
Message-ID: <20100728203218.GA30659@amt.cnet> (raw)
In-Reply-To: <AANLkTi=uaY2EQM32vab_6UcWfCJ-u_YDoByfyis2Nr7d@mail.gmail.com>
On Wed, Jul 28, 2010 at 11:28:05PM +0300, Mohammed Gamal wrote:
> On Wed, Jul 28, 2010 at 10:55 PM, Marcelo Tosatti <mtosatti@redhat.com> wrote:
> > On Wed, Jul 28, 2010 at 12:39:01PM +0300, Mohammed Gamal wrote:
> >> This adds a unit test for real mode emulation of the iret instruction
> >>
> >> Signed-off-by: Mohammed Gamal <m.gamal005@gmail.com>
> >>
> >> ---
> >> Changes from v1:
> >> - Added test for 16-bit iret
> >> - Added tests for returned eflags
> >> ---
> >> kvm/test/x86/realmode.c | 79 +++++++++++++++++++++++++++++++++++++++++++++++
> >> 1 files changed, 79 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/kvm/test/x86/realmode.c b/kvm/test/x86/realmode.c
> >> index bd79348..74456c3 100644
> >> --- a/kvm/test/x86/realmode.c
> >> +++ b/kvm/test/x86/realmode.c
> >> @@ -865,6 +865,84 @@ void test_pusha_popa()
> >> print_serial("Pusha/Popa Test2: PASS\n");
> >> }
> >>
> >> +void test_iret()
> >> +{
> >> + struct regs inregs = { 0 }, outregs;
> >> +
> >> + MK_INSN(iret32, "pushf\n\t"
> >> + "pushl %cs\n\t"
> >> + "call 1f\n\t" /* a near call will push eip onto the stack */
> >> + "jmp 2f\n\t"
> >> + "1: iret\n\t"
> >> + "2:\n\t"
> >> + );
> >> +
> >> + MK_INSN(iret16, "pushfw\n\t"
> >> + "pushw %cs\n\t"
> >> + "callw 1f\n\t"
> >> + "jmp 2f\n\t"
> >> + "1: iretw\n\t"
> >> + "2:\n\t");
> >
> > Unless iret causes a task switch, it will not cause an exit.
> >
> >
> The test covers only the real mode case, we won't have a task switch there, no?
No. And there is no vmexit for iret, so it does not go through the
emulator.
next prev parent reply other threads:[~2010-07-28 20:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-28 9:39 [PATCH] test: Add emulator test for iret instruction Mohammed Gamal
2010-07-28 19:55 ` Marcelo Tosatti
2010-07-28 20:28 ` Mohammed Gamal
2010-07-28 20:32 ` Marcelo Tosatti [this message]
2010-07-28 20:36 ` Mohammed Gamal
[not found] ` <20100728205627.GA31469@amt.cnet>
[not found] ` <AANLkTi=tguT3Y2qStz-Z31HQF684VDiG=gomJfB34AJj@mail.gmail.com>
2010-07-28 23:16 ` Mohammed Gamal
2010-07-28 23:18 ` Mohammed Gamal
2010-07-29 1:21 ` Marcelo Tosatti
2010-07-29 15:50 ` Marcelo Tosatti
-- strict thread matches above, loose matches on Subject: below --
2010-07-27 23:22 Mohammed Gamal
2010-07-28 4:21 ` Avi Kivity
2010-07-28 4:28 ` Avi Kivity
2010-07-27 23:03 Mohammed Gamal
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=20100728203218.GA30659@amt.cnet \
--to=mtosatti@redhat.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=m.gamal005@gmail.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