qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Dietmar Maurer <dietmar@proxmox.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] pxe boot problems
Date: Wed, 29 Jan 2014 19:09:08 +0100	[thread overview]
Message-ID: <52E943C4.70409@redhat.com> (raw)
In-Reply-To: <52E93E94.10409@redhat.com>

On 01/29/14 18:47, Paolo Bonzini wrote:
> Il 29/01/2014 18:34, Laszlo Ersek ha scritto:

>> KVM chokes on the LJMPW instruction. (It needs to emulate it on this
>> host CPU, but the emulation code fails to decode the instruction.)
>>
>> I *guess* upstream Linux commit
>>
>>     commit 414e6277fd148f6470261cef50a7fed0d88a2825
>>     Author: Gleb Natapov <gleb@redhat.com>
>>     Date:   Wed Apr 28 19:15:26 2010 +0300
>>
>>         KVM: x86 emulator: handle "far address" source operand
>>
>>         ljmp/lcall instruction operand contains address and segment.
>>         It can be 10 bytes long. Currently we decode it as two different
>>         operands. Fix it by introducing new kind of operand that can hold
>>         entire far address.
>>
>>         Signed-off-by: Gleb Natapov <gleb@redhat.com>
>>         Signed-off-by: Avi Kivity <avi@redhat.com>
>>
>> which had been first released in v2.6.36, should be ported to the RHEL-6
>> kernel.
> 
> That's a candidate, but the commit does not say _what_ is being fixed
> exactly and the RHEL6 kernel does have code to decode 0xea.

Yes, but as far I can see, the commit (which is not in RHEL-6) changes
*how* the operand of ljmp is decoded.

>From "opcode_table" in RHEL-6's "arch/x86/kvm/emulate.c":


        /* 0xE8 - 0xEF */
        SrcImm | Stack, SrcImm | ImplicitOps,
        SrcImmU | Src2Imm16 | No64, SrcImmByte | ImplicitOps,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^

and the patch changes that to

        SrcImmFAddr | No64

and adds new logic to fetch this source operand type.

... Which then seems to have an effect on what goes into
load_segment_descriptor() as segment selector, in the emulation of 0xea.

Of course I'm insufficiently equipped to debate this with you in earnest
:), but it seemed relevant to me.

Thanks,
Laszlo

  reply	other threads:[~2014-01-29 18:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-29 11:49 [Qemu-devel] pxe boot problems Dietmar Maurer
2014-01-29 13:01 ` Laszlo Ersek
2014-01-29 17:34   ` Laszlo Ersek
2014-01-29 17:47     ` Paolo Bonzini
2014-01-29 18:09       ` Laszlo Ersek [this message]
2014-01-29 18:13         ` Paolo Bonzini
2014-01-30  0:07           ` Laszlo Ersek
2014-01-30  6:37   ` Dietmar Maurer
2014-01-30 11:38     ` Laszlo Ersek
  -- strict thread matches above, loose matches on Subject: below --
2014-01-29  7:59 Dietmar Maurer

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=52E943C4.70409@redhat.com \
    --to=lersek@redhat.com \
    --cc=dietmar@proxmox.com \
    --cc=kraxel@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).