From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akQox-00064G-1Y for qemu-devel@nongnu.org; Mon, 28 Mar 2016 02:38:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1akQos-0004Dq-VS for qemu-devel@nongnu.org; Mon, 28 Mar 2016 02:38:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35435) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akQos-0004Dg-Pm for qemu-devel@nongnu.org; Mon, 28 Mar 2016 02:38:34 -0400 Date: Mon, 28 Mar 2016 09:38:30 +0300 From: "Michael S. Tsirkin" Message-ID: <20160328093818-mutt-send-email-mst@redhat.com> References: <1458320487-19603-1-git-send-email-armbru@redhat.com> <87shzk3u9w.fsf@blackfin.pond.sub.org> <56F8C8FE.8010209@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56F8C8FE.8010209@gmail.com> Subject: Re: [Qemu-devel] [PULL 00/40] ivshmem: Fixes, cleanups, device model split List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: marcel@redhat.com Cc: Peter Maydell , Markus Armbruster , QEMU Developers On Mon, Mar 28, 2016 at 09:02:38AM +0300, Marcel Apfelbaum wrote: > On 03/21/2016 02:11 PM, Markus Armbruster wrote: > >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. > > > > Had anyone handled this already? > > Thanks, > Marcel No - pls post this as a patch. > > > >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; > > } > >