From owner-svn-src-projects@FreeBSD.ORG Mon Aug 6 07:20:26 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AE681065670; Mon, 6 Aug 2012 07:20:26 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26B7F8FC1C; Mon, 6 Aug 2012 07:20:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q767KQdI000610; Mon, 6 Aug 2012 07:20:26 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q767KPtB000608; Mon, 6 Aug 2012 07:20:25 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201208060720.q767KPtB000608@svn.freebsd.org> From: Neel Natu Date: Mon, 6 Aug 2012 07:20:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239086 - projects/bhyve/usr.sbin/bhyve X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2012 07:20:26 -0000 Author: neel Date: Mon Aug 6 07:20:25 2012 New Revision: 239086 URL: http://svn.freebsd.org/changeset/base/239086 Log: Fix a bug in how a 64-bit bar in a pci passthru device would be presented to the guest. Prior to the fix it was possible for such a bar to appear as a 32-bit bar as long as it was allocated from the region below 4GB. This had the potential to confuse some drivers that were particular about the size of the bars. Obtained from: NetApp Modified: projects/bhyve/usr.sbin/bhyve/pci_emul.c Modified: projects/bhyve/usr.sbin/bhyve/pci_emul.c ============================================================================== --- projects/bhyve/usr.sbin/bhyve/pci_emul.c Mon Aug 6 06:51:27 2012 (r239085) +++ projects/bhyve/usr.sbin/bhyve/pci_emul.c Mon Aug 6 07:20:25 2012 (r239086) @@ -455,8 +455,13 @@ pci_emul_alloc_bar(struct pci_devinst *p lobits = PCIM_BAR_MEM_SPACE | PCIM_BAR_MEM_64 | PCIM_BAR_MEM_PREFETCH; break; + } else { + baseptr = &pci_emul_membase32; + limit = PCI_EMUL_MEMLIMIT32; + mask = PCIM_BAR_MEM_BASE; + lobits = PCIM_BAR_MEM_SPACE | PCIM_BAR_MEM_64; } - /* fallthrough */ + break; case PCIBAR_MEM32: baseptr = &pci_emul_membase32; limit = PCI_EMUL_MEMLIMIT32;