From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kevin O'Connor Subject: Re: [Qemu-devel] [PATCH] SeaBios: Fix reset procedure reentrancy problem on qemu-kvm platform Date: Tue, 22 Dec 2015 10:51:18 -0500 Message-ID: <20151222155118.GC18343@morn.lan> References: <20151119134039.GA27717@morn.lan> <33183CC9F5247A488A2544077AF19020B02B72BA@SZXEMA503-MBS.china.huawei.com> <20151218231326.GA4138@morn.lan> <33183CC9F5247A488A2544077AF19020B02B7A73@SZXEMA503-MBS.china.huawei.com> <20151219151159.GA22542@morn.lan> <33183CC9F5247A488A2544077AF19020B02B7BC2@SZXEMA503-MBS.china.huawei.com> <20151220143320.GA23942@morn.lan> <33183CC9F5247A488A2544077AF19020B02B7D39@SZXEMA503-MBS.china.huawei.com> <20151221184714.GB27329@morn.lan> <33183CC9F5247A488A2544077AF19020B02B81F5@SZXEMA503-MBS.china.huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "Xulei (Stone)" , Paolo Bonzini , qemu-devel , "seabios@seabios.org" , "Huangweidong (C)" , "kvm@vger.kernel.org" , Radim Krcmar To: "Gonglei (Arei)" Return-path: Received: from mail-qg0-f44.google.com ([209.85.192.44]:34867 "EHLO mail-qg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755319AbbLVPvU (ORCPT ); Tue, 22 Dec 2015 10:51:20 -0500 Received: by mail-qg0-f44.google.com with SMTP id o11so57223592qge.2 for ; Tue, 22 Dec 2015 07:51:20 -0800 (PST) Content-Disposition: inline In-Reply-To: <33183CC9F5247A488A2544077AF19020B02B81F5@SZXEMA503-MBS.china.huawei.com> Sender: kvm-owner@vger.kernel.org List-ID: 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