From: Marcelo Tosatti <mtosatti@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: Chris Clayton <chris2553@googlemail.com>,
Gleb Natapov <gleb@redhat.com>,
Eric Northup <digitaleric@google.com>,
kvm@vger.kernel.org, Jan Kiszka <jan.kiszka@siemens.com>
Subject: Re: qemu-kvm-1.1.0 crashing with kernel 3.5.0-rc6
Date: Tue, 31 Jul 2012 13:29:40 -0300 [thread overview]
Message-ID: <20120731162940.GA7243@amt.cnet> (raw)
In-Reply-To: <5017A131.8000609@redhat.com>
On Tue, Jul 31, 2012 at 12:11:13PM +0300, Avi Kivity wrote:
> On 07/31/2012 02:36 AM, Marcelo Tosatti wrote:
> > On Mon, Jul 30, 2012 at 07:39:31PM +0300, Avi Kivity wrote:
> >> On 07/30/2012 05:07 PM, Chris Clayton wrote:
> >> >>
> >> >>>> With kernel 3.5.0 with b2da15ac26a0c00 reverted, I have just had 15
> >> >>>> clean invocations of vanilla qemu-kvm-1.1.1. So that commit would seem
> >> >>>> to be the problem.
> >> >>>
> >> >>> Just to be sure, I've run some more tests today. No crashes occurred in
> >> >>> 20 runs of vanilla qemu-kvm-1.1.1 on kernel 3.5.0 with b2da15ac26a0c00
> >> >>> reverted.
> >> >>
> >> >> Ok. I'm trying to reproduce it here on a nested-virt setup, since the
> >> >> code looks correct.
> >> >>
> >> >> What's your preemption settings?
> >> >>
> >> >>
> >> > [chris:~/kernel/linux-3.5.0]$ grep PREEMPT .config
> >> > CONFIG_TREE_PREEMPT_RCU=y
> >> > CONFIG_PREEMPT_RCU=y
> >> > CONFIG_PREEMPT_NOTIFIERS=y
> >> > # CONFIG_PREEMPT_NONE is not set
> >> > # CONFIG_PREEMPT_VOLUNTARY is not set
> >> > CONFIG_PREEMPT=y
> >> > CONFIG_PREEMPT_COUNT=y
> >>
> >> Here's what I think that is happening
> >>
> >> vcpu_load
> >> ...
> >> vmx_save_host_state
> >> vmx_vcpu_run
> >> (ds.cpl, es.cpl cleared by hardware)
> >>
> >> interrupt
> >> push ds, es # pushes bad ds, es
> >> schedule
> >> vmx_vcpu_put
> >> vmx_load_host_state
> >> reload ds, es
> >> pop ds, es # of other thread's stack
> >> iret
> >> # other thread runs
> >> interrupt
> >> schedule # back in vcpu thread
> >> interrupt return: pop ds, es # <-- problem
> >> iret
> >>
> >> ...
> >> vcpu_put
> >>
> >> # bad ds, es, but !vmx->host_state.loaded
> >>
> >> Marcelo, did I miss something here?
> >
> > Don't think so.
>
> So the same problem should happen with %fs and %gs, no?
AFAICS:
depends on CONFIG_X86_32_LAZY_GS for GS, unconditional for FS.
> x86_64 is safe, since it entry_64.S never saves/restores segment registers.
Is the comment
/*
* The sysexit path does not restore ds/es, so we must set them
* to
* a reasonable value ourselves.
*/
Correct?
syscall_exit -> syscall_exit_work -> resume_userspace ->
restore_all -> RESTORE_REGS
next prev parent reply other threads:[~2012-07-31 18:22 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-09 10:57 qemu-kvm-1.1.0 crashing with kernel 3.5.0-rc6 Chris Clayton
2012-07-11 7:09 ` Chris Clayton
2012-07-11 7:12 ` Gleb Natapov
2012-07-11 7:18 ` Chris Clayton
2012-07-11 7:22 ` Gleb Natapov
2012-07-15 19:52 ` Chris Clayton
2012-07-19 12:14 ` Chris Clayton
2012-07-19 12:17 ` Avi Kivity
2012-07-19 18:23 ` Chris Clayton
2012-07-26 9:52 ` Chris Clayton
2012-07-26 10:01 ` Avi Kivity
2012-07-26 10:29 ` Jan Kiszka
2012-07-26 10:45 ` Avi Kivity
2012-07-26 10:49 ` Jan Kiszka
2012-07-26 11:04 ` Jan Kiszka
2012-07-26 11:58 ` Chris Clayton
2012-07-26 12:07 ` Avi Kivity
2012-07-26 23:22 ` Chris Clayton
2012-07-27 10:46 ` Chris Clayton
[not found] ` <CAG7+5M2y8gJvDCNuWsSB3zH=r75H0Mn=JNV+4DBc5xYjM+BJWA@mail.gmail.com>
2012-07-27 19:04 ` Chris Clayton
2012-07-29 12:42 ` Avi Kivity
2012-07-29 14:03 ` Chris Clayton
2012-07-29 14:18 ` Avi Kivity
2012-07-29 14:48 ` Avi Kivity
2012-07-29 15:21 ` Chris Clayton
2012-07-29 15:47 ` Avi Kivity
2012-07-29 16:34 ` Avi Kivity
2012-07-29 17:50 ` Chris Clayton
2012-07-29 17:54 ` Gleb Natapov
2012-07-29 19:10 ` Chris Clayton
2012-07-30 14:00 ` Chris Clayton
2012-07-30 14:03 ` Avi Kivity
2012-07-30 14:07 ` Chris Clayton
2012-07-30 16:39 ` Avi Kivity
2012-07-30 23:36 ` Marcelo Tosatti
2012-07-31 9:11 ` Avi Kivity
2012-07-31 16:29 ` Marcelo Tosatti [this message]
2012-07-31 16:46 ` Avi Kivity
2012-08-01 13:11 ` Avi Kivity
2012-07-26 12:09 ` Jan Kiszka
2012-07-26 11:10 ` Xiao Guangrong
2012-07-26 13:49 ` Chris Clayton
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=20120731162940.GA7243@amt.cnet \
--to=mtosatti@redhat.com \
--cc=avi@redhat.com \
--cc=chris2553@googlemail.com \
--cc=digitaleric@google.com \
--cc=gleb@redhat.com \
--cc=jan.kiszka@siemens.com \
--cc=kvm@vger.kernel.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).