From: Kevin O'Connor <kevin@koconnor.net>
To: "Gonglei (Arei)" <arei.gonglei@huawei.com>
Cc: "Xulei (Stone)" <stone.xulei@huawei.com>,
Paolo Bonzini <pbonzini@redhat.com>,
qemu-devel <qemu-devel@nongnu.org>,
"seabios@seabios.org" <seabios@seabios.org>,
"Huangweidong (C)" <weidong.huang@huawei.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
Radim Krcmar <rkrcmar@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] SeaBios: Fix reset procedure reentrancy problem on qemu-kvm platform
Date: Tue, 22 Dec 2015 10:51:18 -0500 [thread overview]
Message-ID: <20151222155118.GC18343@morn.lan> (raw)
In-Reply-To: <33183CC9F5247A488A2544077AF19020B02B81F5@SZXEMA503-MBS.china.huawei.com>
On Tue, Dec 22, 2015 at 02:14:12AM +0000, Gonglei (Arei) wrote:
> > From: Kevin O'Connor [mailto:kevin@koconnor.net]
> > Sent: Tuesday, December 22, 2015 2:47 AM
> > To: Gonglei (Arei)
> > Cc: Xulei (Stone); Paolo Bonzini; qemu-devel; seabios@seabios.org;
> > Huangweidong (C); kvm@vger.kernel.org; Radim Krcmar
> > Subject: Re: [Qemu-devel] [PATCH] SeaBios: Fix reset procedure reentrancy
> > problem on qemu-kvm platform
> >
> > On Mon, Dec 21, 2015 at 09:41:32AM +0000, Gonglei (Arei) wrote:
> > > When the gurb of OS is booting, then the softirq and C function
> > > send_disk_op() may use extra stack of SeaBIOS. If we inject a NMI,
> > > romlayout.S: irqentry_extrastack is invoked, and the extra stack will
> > > be used again. And the stack of first calling will be broken, so that the
> > SeaBIOS stuck.
> > >
> > > You can easily reproduce the problem.
> > >
> > > 1. start on guest
> > > 2. reset the guest
> > > 3. inject a NMI when the guest show the grub surface 4. then the guest
> > > stuck
> >
> > Does the SeaBIOS patch below help?
>
> Sorry, it doesn't work. What's worse is we cannot stop SeaBIOS stuck by
> Setting "CONFIG_ENTRY_EXTRASTACK=n" after applying this patch.
Oops, can you try with the patch below instead?
> > I'm not familiar with how to "inject a
> > NMI" - can you describe the process in more detail?
> >
>
> 1. Qemu Command line:
>
> #: /home/qemu/x86_64-softmmu/qemu-system-x86_64 -enable-kvm -m 4096 -smp 8 -name suse -vnc 0.0.0.0:10 \
> -device virtio-scsi-pci,id=scsi0 -drive file=/home/suse11_sp3_32_2,if=none,id=drive-scsi0-0-0-0,format=raw,cache=none,aio=native \
> -device scsi-hd,bus=scsi0.0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0 \
> -chardev file,id=seabios,path=/home/seabios.log -device isa-debugcon,iobase=0x402,chardev=seabios \
> -monitor stdio -qmp unix:/tmp/qmp,server,nowait
>
> 2. Inject a NMI by QMP:
>
> #: /home/qemu/scripts/qmp # ./qmp-shell /tmp/qmp
> Welcome to the QMP low-level shell!
> Connected to QEMU 2.5.0
>
> (QEMU) system_reset
> {"return": {}}
> (QEMU) inject-nmi
> {"return": {}}
> (QEMU) inject-nmi
> {"return": {}}
>
I tried a few simple tests but was not able to reproduce.
-Kevin
--- a/src/romlayout.S
+++ b/src/romlayout.S
@@ -548,7 +548,10 @@ entry_post:
ENTRY_INTO32 _cfunc32flat_handle_post // Normal entry point
ORG 0xe2c3
- IRQ_ENTRY 02
+ .global entry_02
+entry_02:
+ ENTRY handle_02 // NMI handler does not switch onto extra stack
+ iretw
ORG 0xe3fe
.global entry_13_official
WARNING: multiple messages have this Message-ID (diff)
From: Kevin O'Connor <kevin@koconnor.net>
To: "Gonglei (Arei)" <arei.gonglei@huawei.com>
Cc: "Huangweidong (C)" <weidong.huang@huawei.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
Radim Krcmar <rkrcmar@redhat.com>,
"seabios@seabios.org" <seabios@seabios.org>,
"Xulei (Stone)" <stone.xulei@huawei.com>,
qemu-devel <qemu-devel@nongnu.org>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] SeaBios: Fix reset procedure reentrancy problem on qemu-kvm platform
Date: Tue, 22 Dec 2015 10:51:18 -0500 [thread overview]
Message-ID: <20151222155118.GC18343@morn.lan> (raw)
In-Reply-To: <33183CC9F5247A488A2544077AF19020B02B81F5@SZXEMA503-MBS.china.huawei.com>
On Tue, Dec 22, 2015 at 02:14:12AM +0000, Gonglei (Arei) wrote:
> > From: Kevin O'Connor [mailto:kevin@koconnor.net]
> > Sent: Tuesday, December 22, 2015 2:47 AM
> > To: Gonglei (Arei)
> > Cc: Xulei (Stone); Paolo Bonzini; qemu-devel; seabios@seabios.org;
> > Huangweidong (C); kvm@vger.kernel.org; Radim Krcmar
> > Subject: Re: [Qemu-devel] [PATCH] SeaBios: Fix reset procedure reentrancy
> > problem on qemu-kvm platform
> >
> > On Mon, Dec 21, 2015 at 09:41:32AM +0000, Gonglei (Arei) wrote:
> > > When the gurb of OS is booting, then the softirq and C function
> > > send_disk_op() may use extra stack of SeaBIOS. If we inject a NMI,
> > > romlayout.S: irqentry_extrastack is invoked, and the extra stack will
> > > be used again. And the stack of first calling will be broken, so that the
> > SeaBIOS stuck.
> > >
> > > You can easily reproduce the problem.
> > >
> > > 1. start on guest
> > > 2. reset the guest
> > > 3. inject a NMI when the guest show the grub surface 4. then the guest
> > > stuck
> >
> > Does the SeaBIOS patch below help?
>
> Sorry, it doesn't work. What's worse is we cannot stop SeaBIOS stuck by
> Setting "CONFIG_ENTRY_EXTRASTACK=n" after applying this patch.
Oops, can you try with the patch below instead?
> > I'm not familiar with how to "inject a
> > NMI" - can you describe the process in more detail?
> >
>
> 1. Qemu Command line:
>
> #: /home/qemu/x86_64-softmmu/qemu-system-x86_64 -enable-kvm -m 4096 -smp 8 -name suse -vnc 0.0.0.0:10 \
> -device virtio-scsi-pci,id=scsi0 -drive file=/home/suse11_sp3_32_2,if=none,id=drive-scsi0-0-0-0,format=raw,cache=none,aio=native \
> -device scsi-hd,bus=scsi0.0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0 \
> -chardev file,id=seabios,path=/home/seabios.log -device isa-debugcon,iobase=0x402,chardev=seabios \
> -monitor stdio -qmp unix:/tmp/qmp,server,nowait
>
> 2. Inject a NMI by QMP:
>
> #: /home/qemu/scripts/qmp # ./qmp-shell /tmp/qmp
> Welcome to the QMP low-level shell!
> Connected to QEMU 2.5.0
>
> (QEMU) system_reset
> {"return": {}}
> (QEMU) inject-nmi
> {"return": {}}
> (QEMU) inject-nmi
> {"return": {}}
>
I tried a few simple tests but was not able to reproduce.
-Kevin
--- a/src/romlayout.S
+++ b/src/romlayout.S
@@ -548,7 +548,10 @@ entry_post:
ENTRY_INTO32 _cfunc32flat_handle_post // Normal entry point
ORG 0xe2c3
- IRQ_ENTRY 02
+ .global entry_02
+entry_02:
+ ENTRY handle_02 // NMI handler does not switch onto extra stack
+ iretw
ORG 0xe3fe
.global entry_13_official
next prev parent reply other threads:[~2015-12-22 15:51 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-03 6:58 [Qemu-devel] [PATCH] SeaBios: Fix reset procedure reentrancy problem on qemu-kvm platform Xulei (Stone, Euler)
2015-11-04 0:48 ` Gonglei
2015-11-04 17:42 ` Kevin O'Connor
2015-11-06 9:12 ` Xulei (Stone)
2015-11-09 13:32 ` Kevin O'Connor
2015-11-09 20:06 ` Kevin O'Connor
2015-11-09 20:27 ` Kevin O'Connor
2015-11-19 1:04 ` Xulei (Stone)
2015-11-19 12:42 ` Xulei (Stone)
2015-11-19 13:40 ` Kevin O'Connor
2015-11-20 2:05 ` Xulei (Stone)
[not found] ` <33183CC9F5247A488A2544077AF19020B02B72BA@SZXEMA503-MBS.china.huawei.com>
2015-12-18 23:13 ` Kevin O'Connor
2015-12-18 23:13 ` Kevin O'Connor
2015-12-19 6:28 ` Gonglei (Arei)
2015-12-19 6:28 ` [Qemu-devel] " Gonglei (Arei)
2015-12-19 12:03 ` Gonglei (Arei)
2015-12-19 12:03 ` [Qemu-devel] " Gonglei (Arei)
2015-12-19 15:11 ` Kevin O'Connor
2015-12-19 15:11 ` Kevin O'Connor
2015-12-20 9:49 ` Gonglei (Arei)
2015-12-20 9:49 ` [Qemu-devel] " Gonglei (Arei)
2015-12-20 14:33 ` Kevin O'Connor
2015-12-20 14:33 ` Kevin O'Connor
2015-12-21 9:41 ` Gonglei (Arei)
2015-12-21 9:41 ` [Qemu-devel] " Gonglei (Arei)
2015-12-21 18:47 ` Kevin O'Connor
2015-12-21 18:47 ` [Qemu-devel] " Kevin O'Connor
2015-12-22 2:14 ` Gonglei (Arei)
2015-12-22 2:14 ` Gonglei (Arei)
2015-12-22 3:15 ` Xulei (Stone)
2015-12-22 3:15 ` [Qemu-devel] " Xulei (Stone)
2015-12-22 15:38 ` Kevin O'Connor
2015-12-22 15:38 ` [Qemu-devel] " Kevin O'Connor
2015-12-22 15:51 ` Kevin O'Connor [this message]
2015-12-22 15:51 ` Kevin O'Connor
2015-12-23 6:40 ` Gonglei (Arei)
2015-12-23 6:40 ` [Qemu-devel] " Gonglei (Arei)
2015-12-23 18:06 ` Kevin O'Connor
2015-12-23 18:06 ` Kevin O'Connor
2015-12-19 1:08 ` Gonglei (Arei)
2015-12-19 1:08 ` [Qemu-devel] " Gonglei (Arei)
-- strict thread matches above, loose matches on Subject: below --
2015-11-04 0:19 Xulei (Stone, Euler)
2015-11-03 6:29 Xulei (Stone, Euler)
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=20151222155118.GC18343@morn.lan \
--to=kevin@koconnor.net \
--cc=arei.gonglei@huawei.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rkrcmar@redhat.com \
--cc=seabios@seabios.org \
--cc=stone.xulei@huawei.com \
--cc=weidong.huang@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.