From owner-svn-src-all@freebsd.org Fri May 13 11:18:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2359AB39EDD; Fri, 13 May 2016 11:18:29 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E79181D20; Fri, 13 May 2016 11:18:28 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DBISJu015694; Fri, 13 May 2016 11:18:28 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DBISar015693; Fri, 13 May 2016 11:18:28 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605131118.u4DBISar015693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 13 May 2016 11:18:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299658 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2016 11:18:29 -0000 Author: bz Date: Fri May 13 11:18:27 2016 New Revision: 299658 URL: https://svnweb.freebsd.org/changeset/base/299658 Log: When using IOPORT with pci_host_generic we are missing setting the rman_end() which leads to end being before start and thus a signed extended very large number of size later on, which kva_alloc() will fail upon and we will panic. Add the missing call. Debugged with: andrew Reviewed by: br, andrew Sponsored by: DARPA/AFRL Found: while using virtio with gem5 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6337 Modified: head/sys/dev/pci/pci_host_generic.c Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Fri May 13 11:15:33 2016 (r299657) +++ head/sys/dev/pci/pci_host_generic.c Fri May 13 11:18:27 2016 (r299658) @@ -613,6 +613,7 @@ generic_pcie_activate_resource(device_t } if (found) { rman_set_start(r, rman_get_start(r) + phys_base); + rman_set_end(r, rman_get_end(r) + phys_base); BUS_ACTIVATE_RESOURCE(device_get_parent(dev), child, type, rid, r); } else {