From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6Is4-0004sB-38 for qemu-devel@nongnu.org; Tue, 08 Dec 2015 09:04:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a6Iry-0005Kd-Uw for qemu-devel@nongnu.org; Tue, 08 Dec 2015 09:03:59 -0500 Received: from e06smtp08.uk.ibm.com ([195.75.94.104]:59823) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6Iry-0005KR-Kw for qemu-devel@nongnu.org; Tue, 08 Dec 2015 09:03:54 -0500 Received: from localhost by e06smtp08.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 8 Dec 2015 14:03:53 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 918F517D805A for ; Tue, 8 Dec 2015 14:04:21 +0000 (GMT) Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id tB8E3oVL8847664 for ; Tue, 8 Dec 2015 14:03:50 GMT Received: from d06av02.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id tB8E3ngI027892 for ; Tue, 8 Dec 2015 07:03:49 -0700 References: <1449118802-12047-1-git-send-email-stefanha@redhat.com> <1449118802-12047-3-git-send-email-stefanha@redhat.com> <20151207110251.6391b306.cornelia.huck@de.ibm.com> <20151207174229.4edc6004.cornelia.huck@de.ibm.com> <20151208095954.GD5071@noname.str.redhat.com> <20151208130008.5d0fc318.cornelia.huck@de.ibm.com> <5666CD48.4050600@de.ibm.com> <5666DB13.7020501@de.ibm.com> <20151208134522.GE5071@noname.str.redhat.com> <5666E1F1.5030903@de.ibm.com> From: Christian Borntraeger Message-ID: <5666E345.704@de.ibm.com> Date: Tue, 8 Dec 2015 15:03:49 +0100 MIME-Version: 1.0 In-Reply-To: <5666E1F1.5030903@de.ibm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL for-2.5 2/4] block: Don't wait serialising for non-COR read requests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Cornelia Huck , Peter Maydell , Fam Zheng , qemu-devel@nongnu.org, Stefan Hajnoczi On 12/08/2015 02:58 PM, Christian Borntraeger wrote: [...9 >>> >>> Not a compiler bug. gcc uses a floating point register 8 to spill >>> the pointer of blk (which is call saved) submit_request will later >>> on call qemu_coroutine_enter and after returning from >>> qemu_coroutine_enter, the fpr8 contains junk. Not sure yet, what happened. >> >> Coroutines don't save the FPU state, so you're not supposed to use >> floating point operations inside coroutines. That the compiler spills >> some integer value into a floating point register is a bit nasty... > > Just checked. bdrv_aligned_preadv does also use fprs (also for filling > and spilling). Some versions of gcc seem to like that as the LDGR and LGDR > instructions are pretty cheap and move the content from/to fprs in a bitwise > fashion. So this coroutine DOES trash floating point registers. > > Without the patch gcc seems to be fine with the 16 gprs and does not > spilling/filling from/to fprs in bdrv_aligned_preadv. > > Christian Kevin, I am wondering. gcc saves/restores f8 in the generated code for the coroutine and setjmp/longjmp also save/restore the fprs. why do coroutines do not save the FPU state (which code does a light weight switching) Christian