qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Andriy Gapon <avg@FreeBSD.org>
Cc: "Andreas Färber" <afaerber@suse.de>,
	"Gleb Natapov" <gleb@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] in_asm substitute for accel=kvm:tcg
Date: Thu, 19 Sep 2013 18:53:26 +0200	[thread overview]
Message-ID: <523B2C06.3060309@redhat.com> (raw)
In-Reply-To: <523B0BE0.90102@FreeBSD.org>

Il 19/09/2013 16:36, Andriy Gapon ha scritto:
> Not sure how the code ends up at 0x9315 after that.

Events are dropped, probably corresponding to more emulation.

> And here is original assembly code:
> rret_tramp:     movw $MEM_ESPR-0x08,%sp         # Reset stack pointer
>                 pushal                          # Save gp regs
>                 pushl %gs                       # Save
>                 pushl %fs                       #  seg
>                 pushl %ds                       #  regs
>                 pushl %es
>                 pushfl                          # Save %eflags
>                 cli                             # Disable interrupts
>                 std                             # String ops dec
>                 xorw %ax,%ax                    # Reset seg
>                 movw %ax,%ds                    #  regs
>                 movw %ax,%es                    #  (%ss is already 0)
>                 lidt idtdesc                    # Set IDT
>                 lgdt gdtdesc                    # Set GDT
>                 mov %cr0,%eax                   # Switch to protected
>                 inc %ax                         #  mode
>                 mov %eax,%cr0                   #
>                 ljmp $SEL_SCODE,$rret_tramp.1   # To 32-bit code
>                 .code32
> rret_tramp.1:   xorl %ecx,%ecx                  # Zero
>                 movb $SEL_SDATA,%cl             # Setup
>                 movw %cx,%ss                    #  32-bit
>                 movw %cx,%ds                    #  seg
>                 movw %cx,%es                    #  regs
>                 movl MEM_ESPR-0x04,%esp         # Switch to kernel stack
>                 leal 0x44(%esp,1),%esi          # Base of frame
>                 andb $~0x2,tss_desc+0x5         # Clear TSS busy
>                 movb $SEL_TSS,%cl               # Set task
>                 ltr %cx                         #  register
> 
> I can provide full logs, etc.
> Please let me know what else I could do.
> Thanks!
> -- 

1) Can you try loading the kvm_intel module with
emulate_invalid_guest_state=0?

2) What are the contents of fs and gs?  Why are they not zeroed?
Perhaps that is causing invalid guest state emulation to run, and then
something is triggering a bug in emulate_invalid_guest_state itself.

3) What is at 0x9315?

Paolo

  reply	other threads:[~2013-09-19 16:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-17 11:37 [Qemu-devel] in_asm substitute for accel=kvm:tcg Andriy Gapon
2013-09-17 12:32 ` Andreas Färber
2013-09-17 14:33   ` Andriy Gapon
2013-09-17 18:49     ` Gleb Natapov
2013-09-19 14:36       ` Andriy Gapon
2013-09-19 16:53         ` Paolo Bonzini [this message]
2013-09-19 17:18           ` Andriy Gapon
2013-09-19 17:26             ` Paolo Bonzini
2013-09-19 18:05               ` Andriy Gapon
2013-09-19 17:49           ` Andriy Gapon
2013-09-22  6:31             ` Gleb Natapov
2013-09-22  8:05               ` Andriy Gapon
2013-09-22  8:17                 ` Gleb Natapov
2013-09-22  9:41                   ` Andriy Gapon

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=523B2C06.3060309@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=afaerber@suse.de \
    --cc=avg@FreeBSD.org \
    --cc=gleb@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).