Received: from eggs.gnu.org ([2001:4830:134:3::10]:45406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDVfE-00066g-AP for qemu-devel@nongnu.org; Tue, 20 Jan 2015 05:04:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YDVfA-00089s-SQ for qemu-devel@nongnu.org; Tue, 20 Jan 2015 05:04:00 -0500 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:46826) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDVfA-00089c-Kg for qemu-devel@nongnu.org; Tue, 20 Jan 2015 05:03:56 -0500 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 20 Jan 2015 10:03:55 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 5A2D82190067 for ; Tue, 20 Jan 2015 10:03:52 +0000 (GMT) Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t0KA3rIA63045706 for ; Tue, 20 Jan 2015 10:03:53 GMT Received: from d06av01.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t0KA3p0r030736 for ; Tue, 20 Jan 2015 03:03:52 -0700 Date: Tue, 20 Jan 2015 11:03:48 +0100 From: Cornelia Huck Message-ID: <20150120110348.66afc423.cornelia.huck@de.ibm.com> In-Reply-To: <87h9vln5tm.fsf@blackfin.pond.sub.org> References: <1420790680-3266-1-git-send-email-blaschka@linux.vnet.ibm.com> <1420790680-3266-3-git-send-email-blaschka@linux.vnet.ibm.com> <87h9vln5tm.fsf@blackfin.pond.sub.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/3 V3] s390: implement pci instructions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: borntraeger@de.ibm.com, Frank Blaschka , Frank Blaschka , qemu-devel@nongnu.org On Tue, 20 Jan 2015 10:45:41 +0100 Markus Armbruster wrote: > This patch makes Coverity unhappy: > > *** CID 1264326: Unintended sign extension (SIGN_EXTENSION) > /hw/s390x/s390-pci-inst.c: 787 in stpcifc_service_call() > 781 stq_p(&fib.pal, pbdev->pal); > 782 stq_p(&fib.iota, pbdev->g_iota); > 783 stq_p(&fib.aibv, pbdev->routes.adapter.ind_addr); > 784 stq_p(&fib.aisb, pbdev->routes.adapter.summary_addr); > 785 stq_p(&fib.fmb_addr, pbdev->fmb_addr); > 786 > >>> CID 1264326: Unintended sign extension (SIGN_EXTENSION) > >>> Suspicious implicit sign extension: "pbdev->isc" with type > >>> "unsigned char" (8 bits, unsigned) is promoted in "(pbdev->isc << > >>> 28) | (pbdev->noi << 16)" to type "int" (32 bits, signed), then > >>> sign-extended to type "unsigned long" (64 bits, unsigned). If > >>> "(pbdev->isc << 28) | (pbdev->noi << 16)" is greater than > >>> 0x7FFFFFFF, the upper bits of the result will all be 1. > 787 data = (pbdev->isc << 28) | (pbdev->noi << 16) | > 788 (pbdev->routes.adapter.ind_offset << 8) | (pbdev->sum << 7) | > 789 pbdev->routes.adapter.summary_offset; > 790 stw_p(&fib.data, data); > 791 > 792 if (pbdev->fh >> ENABLE_BIT_OFFSET) { There's a fix for this (and the memory leak): http://marc.info/?l=qemu-devel&m=142124886620078&w=2 The patch is sitting in my queue, will send with the next pile of s390x updates.