From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kevin O'Connor Subject: Re: [PATCH] SeaBios: Fix reset procedure reentrancy problem on qemu-kvm platform Date: Mon, 21 Dec 2015 13:47:14 -0500 Message-ID: <20151221184714.GB27329@morn.lan> References: <8E78D212B8C25246BE4CE7EA0E645FE52B5BE3@SZXEMI504-MBS.china.huawei.com> <8E78D212B8C25246BE4CE7EA0E645FE52B72B7@SZXEMI504-MBS.china.huawei.com> <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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "Huangweidong \(C\)" , "kvm@vger.kernel.org" , Radim Krcmar , "seabios@seabios.org" , "Xulei \(Stone\)" , qemu-devel , Paolo Bonzini To: "Gonglei (Arei)" Return-path: Content-Disposition: inline In-Reply-To: <33183CC9F5247A488A2544077AF19020B02B7D39@SZXEMA503-MBS.china.huawei.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org List-Id: kvm.vger.kernel.org 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? I'm not familiar with how to "inject a NMI" - can you describe the process in more detail? -Kevin --- a/src/romlayout.S +++ b/src/romlayout.S @@ -548,7 +548,9 @@ 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 ORG 0xe3fe .global entry_13_official From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51701) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aB5UT-0000FW-0V for qemu-devel@nongnu.org; Mon, 21 Dec 2015 13:47:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aB5UP-0007kY-RB for qemu-devel@nongnu.org; Mon, 21 Dec 2015 13:47:24 -0500 Received: from mail-qg0-x22d.google.com ([2607:f8b0:400d:c04::22d]:34650) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aB5UP-0007kU-JF for qemu-devel@nongnu.org; Mon, 21 Dec 2015 13:47:21 -0500 Received: by mail-qg0-x22d.google.com with SMTP id 74so46317862qgh.1 for ; Mon, 21 Dec 2015 10:47:21 -0800 (PST) Date: Mon, 21 Dec 2015 13:47:14 -0500 From: Kevin O'Connor Message-ID: <20151221184714.GB27329@morn.lan> References: <8E78D212B8C25246BE4CE7EA0E645FE52B5BE3@SZXEMI504-MBS.china.huawei.com> <8E78D212B8C25246BE4CE7EA0E645FE52B72B7@SZXEMI504-MBS.china.huawei.com> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <33183CC9F5247A488A2544077AF19020B02B7D39@SZXEMA503-MBS.china.huawei.com> Subject: Re: [Qemu-devel] [PATCH] SeaBios: Fix reset procedure reentrancy problem on qemu-kvm platform List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Gonglei (Arei)" Cc: "Huangweidong (C)" , "kvm@vger.kernel.org" , Radim Krcmar , "seabios@seabios.org" , "Xulei (Stone)" , qemu-devel , Paolo Bonzini 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? I'm not familiar with how to "inject a NMI" - can you describe the process in more detail? -Kevin --- a/src/romlayout.S +++ b/src/romlayout.S @@ -548,7 +548,9 @@ 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 ORG 0xe3fe .global entry_13_official