public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Mohammed Gamal <m.gamal005@gmail.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH] x86 emulator: Add 'push es' instruction (opcode 0x06)
Date: Mon, 17 Aug 2009 11:03:00 +0300	[thread overview]
Message-ID: <4A890EB4.3000603@redhat.com> (raw)
In-Reply-To: <20090816175138.GA8521@mohd-laptop>

On 08/16/2009 08:51 PM, Mohammed Gamal wrote:
>
> +static void emulate_push_sreg(struct x86_emulate_ctxt *ctxt, int seg)
> +{
> +	struct decode_cache *c =&ctxt->decode;
> +	struct kvm_segment segment;
> +	kvm_x86_ops->get_segment(ctxt->vcpu,&segment, seg);
> +	c->src.ptr = (unsigned long *)&segment.selector;
> +	emulate_push(ctxt);
> +}
>    

This will pick up random junk from segment.type if used in 32-bit mode, 
since segment.selector is only 16 bits wide.

btw, I see that emulate_push() uses src.val, not src.ptr.  Have you 
tested this?


-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2009-08-17  8:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-16 17:51 [PATCH] x86 emulator: Add 'push es' instruction (opcode 0x06) Mohammed Gamal
2009-08-17  8:03 ` Avi Kivity [this message]
2009-08-17  8:22   ` Mohammed Gamal
  -- strict thread matches above, loose matches on Subject: below --
2009-08-17 19:16 Mohammed Gamal
     [not found] <20090816010921.GA22103@mohd-laptop>
2009-08-16  8:42 ` Avi Kivity
2009-08-16  1:07 Mohammed Gamal
2009-08-16  0:53 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=4A890EB4.3000603@redhat.com \
    --to=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