From patchwork Mon Mar 21 12:11:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 8632061 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4AAD59F3D1 for ; Mon, 21 Mar 2016 12:11:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B3087202F2 for ; Mon, 21 Mar 2016 12:11:57 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 094EE202D1 for ; Mon, 21 Mar 2016 12:11:57 +0000 (UTC) Received: from localhost ([::1]:57411 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahygd-0001ci-A5 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 21 Mar 2016 08:11:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahygU-0001ca-Px for qemu-devel@nongnu.org; Mon, 21 Mar 2016 08:11:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ahygQ-0006ZU-Qd for qemu-devel@nongnu.org; Mon, 21 Mar 2016 08:11:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41136) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahygQ-0006ZJ-L9 for qemu-devel@nongnu.org; Mon, 21 Mar 2016 08:11:42 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 3DC3E6445E; Mon, 21 Mar 2016 12:11:42 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-41.ams2.redhat.com [10.36.116.41]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2LCBeYT023620 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 21 Mar 2016 08:11:41 -0400 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 05EFA303F90D; Mon, 21 Mar 2016 13:11:39 +0100 (CET) From: Markus Armbruster To: "Michael S. Tsirkin" , Marcel Apfelbaum References: <1458320487-19603-1-git-send-email-armbru@redhat.com> Date: Mon, 21 Mar 2016 13:11:39 +0100 In-Reply-To: (Peter Maydell's message of "Mon, 21 Mar 2016 09:45:03 +0000") Message-ID: <87shzk3u9w.fsf@blackfin.pond.sub.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 21 Mar 2016 12:11:42 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Cc: Peter Maydell , QEMU Developers Subject: Re: [Qemu-devel] [PULL 00/40] ivshmem: Fixes, cleanups, device model split X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Peter Maydell writes: [...] > Also some new clang ubsan warnings on x86 Linux: > GTESTER check-qtest-i386 > [deleted existing warnings about slirp code] > /home/petmay01/linaro/qemu-for-merges/hw/pci/pci.c:166:23: runtime > error: shift exponent -1 is negative > /home/petmay01/linaro/qemu-for-merges/hw/pci/pci.c:171:24: runtime > error: shift exponent -1 is negative > /home/petmay01/linaro/qemu-for-merges/hw/pci/pci.c:172:24: runtime > error: shift exponent -1 is negative Root cause tracked down with the appended patch. PCI maintainers, you might want to steal it. diff --git a/hw/pci/pci.c b/hw/pci/pci.c index e67664d..1937c42 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -163,11 +163,13 @@ int pci_bar(PCIDevice *d, int reg) static inline int pci_irq_state(PCIDevice *d, int irq_num) { + assert(irq_num >= 0); return (d->irq_state >> irq_num) & 0x1; } static inline void pci_set_irq_state(PCIDevice *d, int irq_num, int level) { + assert(irq_num >= 0); d->irq_state &= ~(0x1 << irq_num); d->irq_state |= level << irq_num; }