From nobody@FreeBSD.org  Wed Jan  4 10:33:27 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D40191065673
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  4 Jan 2012 10:33:27 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id BED658FC19
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  4 Jan 2012 10:33:27 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q04AXRbr062723
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 4 Jan 2012 10:33:27 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q04AXRWx062716;
	Wed, 4 Jan 2012 10:33:27 GMT
	(envelope-from nobody)
Message-Id: <201201041033.q04AXRWx062716@red.freebsd.org>
Date: Wed, 4 Jan 2012 10:33:27 GMT
From: Vitaly <vitaly.belousov@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: problem with mpt driver for lsi controlled connected to FreeBSD thru VT-d technology
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         163812
>Category:       kern
>Synopsis:       [mpt] problem with mpt driver for lsi controlled connected to FreeBSD thru VT-d technology
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-scsi
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 04 10:40:08 UTC 2012
>Closed-Date:    Fri Feb 24 00:53:14 UTC 2012
>Last-Modified:  Fri Feb 24 00:53:14 UTC 2012
>Originator:     Vitaly
>Release:        9.0 RC3
>Organization:
NA
>Environment:
FreeBSD nasbox.tpaktop.com 9.0-RC3 FreeBSD 9.0-RC3 #0: Sun Dec  4 08:56:36 UTC 2011     root@farrell.c se.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
On barebone must be installed ESXi hypervisor 5.0. Over ESXi I'm trying
to install or even use already installed VM with FreeBSD 9.0 RC3 (8.2
has the same symptoms). The main condition is - using physical controller
LSI 1086 as passthroug device, configured at ESXi thru VT-d technology
and it has to be added to FreeBSD virtual machine as PCI device.

As only booting procedure reaches mpt driver loading I've got these errors:

http://www.tpaktop.com/error.png

And after 300 seconds booting looks to be freezed finally.
>How-To-Repeat:
Try to boot FreeBSD over ESXi with passtrough LSI controller device which
is calls mpt driver.
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-amd64->freebsd-scsi 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Jan 4 16:33:35 UTC 2012 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=163812 

From: Marius Strobl <marius@alchemy.franken.de>
To: bug-followup@FreeBSD.org, vitaly.belousov@gmail.com
Cc:  
Subject: kern/163812: [mpt] problem with mpt driver for lsi controlled connected to FreeBSD thru VT-d technology
Date: Wed, 1 Feb 2012 00:36:36 +0100

 Could you please test whether setting the follwing hints:
 hint.mpt.0.msi_enable=0
 hint.mpt.1.msi_enable=0
 makes a difference?
 Could you please also provide the output of `pciconv -lcv` on such a
 guest?
 
 Marius
 

From: Marius Strobl <marius@alchemy.franken.de>
To: Vitaly Belousov <vitaly.belousov@gmail.com>, bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/163812: [mpt] problem with mpt driver for lsi controlled connected to FreeBSD thru VT-d technology
Date: Wed, 1 Feb 2012 21:45:05 +0100

 On Wed, Feb 01, 2012 at 01:56:43PM +0400, Vitaly Belousov wrote:
 > Good day Maruis,
 > 
 > Yes, it helps. Now system can boot. Thanks a lot.
 > 
 > Here is my pciconf list as you requested:
 > 
 
 Thanks! Judging the VMware documentation, there should be some
 pciPassthru0.msiEnabled knob somewhere for configuring whether
 the PCI pass-through supports MSI or not. Could you please check
 whether it's set to true or false for that guest?
 
 Marius
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/163812: commit references a PR
Date: Tue, 14 Feb 2012 00:18:50 +0000 (UTC)

 Author: marius
 Date: Tue Feb 14 00:18:35 2012
 New Revision: 231621
 URL: http://svn.freebsd.org/changeset/base/231621
 
 Log:
   - As it turns out, MSI-X is broken for at least LSI SAS1068E when passed
     through by VMware so blacklist their PCI-PCI bridge for MSI/MSI-X here.
     Note that besides currently there not being a quirk type that disables
     MSI-X only and there's no evidence that MSI doesn't work with the VMware
     pass-through, it's really questionable whether MSI generally works in
     that setup as VMware only mention three know working devices [1, p. 4].
     Also not that this quirk entry currently doesn't affect the devices
     emulated by VMware in any way as these don't claim support MSI/MSI-X to
     begin with. [2]
     While at it, make the PCI quirk table const and static.
   - Remove some duplicated empty lines.
   - Use DEVMETHOD_END.
   
   PR:		163812, http://forums.freebsd.org/showthread.php?t=27899 [2]
   Reviewed by:	jhb
   MFC after:	3 days
 
 Modified:
   head/sys/dev/pci/pci.c
 
 Modified: head/sys/dev/pci/pci.c
 ==============================================================================
 --- head/sys/dev/pci/pci.c	Tue Feb 14 00:18:18 2012	(r231620)
 +++ head/sys/dev/pci/pci.c	Tue Feb 14 00:18:35 2012	(r231621)
 @@ -73,7 +73,6 @@ __FBSDID("$FreeBSD$");
  #define	PCIR_IS_BIOS(cfg, reg)						\
  	(((cfg)->hdrtype == PCIM_HDRTYPE_NORMAL && reg == PCIR_BIOS) ||	\
  	 ((cfg)->hdrtype == PCIM_HDRTYPE_BRIDGE && reg == PCIR_BIOS_1))
 -	    
  
  static pci_addr_t	pci_mapbase(uint64_t mapreg);
  static const char	*pci_maptype(uint64_t mapreg);
 @@ -171,7 +170,7 @@ static device_method_t pci_methods[] = {
  	DEVMETHOD(pci_msi_count,	pci_msi_count_method),
  	DEVMETHOD(pci_msix_count,	pci_msix_count_method),
  
 -	{ 0, 0 }
 +	DEVMETHOD_END
  };
  
  DEFINE_CLASS_0(pci, pci_driver, pci_methods, 0);
 @@ -183,7 +182,6 @@ MODULE_VERSION(pci, 1);
  static char	*pci_vendordata;
  static size_t	pci_vendordata_size;
  
 -
  struct pci_quirk {
  	uint32_t devid;	/* Vendor/device of the card */
  	int	type;
 @@ -194,7 +192,7 @@ struct pci_quirk {
  	int	arg2;
  };
  
 -struct pci_quirk pci_quirks[] = {
 +static const struct pci_quirk const pci_quirks[] = {
  	/* The Intel 82371AB and 82443MX has a map register at offset 0x90. */
  	{ 0x71138086, PCI_QUIRK_MAP_REG,	0x90,	 0 },
  	{ 0x719b8086, PCI_QUIRK_MAP_REG,	0x90,	 0 },
 @@ -227,6 +225,12 @@ struct pci_quirk pci_quirks[] = {
  	{ 0x74501022, PCI_QUIRK_DISABLE_MSI,	0,	0 },
  
  	/*
 +	 * MSI-X doesn't work with at least LSI SAS1068E passed through by
 +	 * VMware.
 +	 */
 +	{ 0x079015ad, PCI_QUIRK_DISABLE_MSI,	0,	0 },
 +
 +	/*
  	 * Some virtualization environments emulate an older chipset
  	 * but support MSI just fine.  QEMU uses the Intel 82440.
  	 */
 @@ -724,7 +728,6 @@ pci_read_cap(device_t pcib, pcicfgregs *
  		}
  	}
  
 -	
  #if defined(__i386__) || defined(__amd64__) || defined(__powerpc__)
  	/*
  	 * Enable the MSI mapping window for all HyperTransport
 @@ -1873,7 +1876,7 @@ pci_remap_intr_method(device_t bus, devi
  int
  pci_msi_device_blacklisted(device_t dev)
  {
 -	struct pci_quirk *q;
 +	const struct pci_quirk *q;
  
  	if (!pci_honor_msi_blacklist)
  		return (0);
 @@ -1893,7 +1896,7 @@ pci_msi_device_blacklisted(device_t dev)
  static int
  pci_msi_vm_chipset(device_t dev)
  {
 -	struct pci_quirk *q;
 +	const struct pci_quirk *q;
  
  	for (q = &pci_quirks[0]; q->devid; q++) {
  		if (q->devid == pci_get_devid(dev) &&
 @@ -3023,7 +3026,7 @@ pci_add_resources(device_t bus, device_t
  	struct pci_devinfo *dinfo = device_get_ivars(dev);
  	pcicfgregs *cfg = &dinfo->cfg;
  	struct resource_list *rl = &dinfo->resources;
 -	struct pci_quirk *q;
 +	const struct pci_quirk *q;
  	int i;
  
  	/* ATA devices needs special map treatment */
 @@ -3864,7 +3867,6 @@ pci_write_ivar(device_t dev, device_t ch
  	}
  }
  
 -
  #include "opt_ddb.h"
  #ifdef DDB
  #include <ddb/ddb.h>
 @@ -4021,7 +4023,6 @@ out:;
  	return (res);
  }
  
 -
  struct resource *
  pci_alloc_resource(device_t dev, device_t child, int type, int *rid,
  		   u_long start, u_long end, u_long count, u_int flags)
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/163812: commit references a PR
Date: Fri, 24 Feb 2012 00:43:04 +0000 (UTC)

 Author: marius
 Date: Fri Feb 24 00:42:50 2012
 New Revision: 232091
 URL: http://svn.freebsd.org/changeset/base/232091
 
 Log:
   Forced commit to denote that the commit message of r231621 should have read:
   
   - As it turns out, MSI-X is broken for at least LSI SAS1068E when passed
     through by VMware so blacklist their PCI-PCI bridge for MSI/MSI-X here.
     Note that besides currently there not being a quirk type that disables
     MSI-X only and there's no evidence that MSI doesn't work with the VMware
     pass-through, it's really questionable whether MSI generally works in
     that setup as VMware only mention three know working devices [1, p. 4].
     Also not that this quirk entry currently doesn't affect the devices
     emulated by VMware in any way as these don't claim support MSI/MSI-X to
     begin with. [2]
     While at it, make the PCI quirk table const and static.
   - Remove some duplicated empty lines.
   - Use DEVMETHOD_END.
   
   PR:		163812, http://forums.freebsd.org/showthread.php?t=27899 [2]
   Reviewed by:	jhb
   MFC after:	3 days
   
   [1]: http://www.vmware.com/pdf/vsp_4_vmdirectpath_host.pdf
 
 Modified:
   head/sys/dev/pci/pci.c
 
 Modified: head/sys/dev/pci/pci.c
 ==============================================================================
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/163812: commit references a PR
Date: Fri, 24 Feb 2012 00:47:34 +0000 (UTC)

 Author: marius
 Date: Fri Feb 24 00:47:14 2012
 New Revision: 232092
 URL: http://svn.freebsd.org/changeset/base/232092
 
 Log:
   MFC: r231621
   
   - As it turns out, MSI-X is broken for at least LSI SAS1068E when passed
     through by VMware so blacklist their PCI-PCI bridge for MSI/MSI-X here.
     Note that besides currently there not being a quirk type that disables
     MSI-X only and there's no evidence that MSI doesn't work with the VMware
     pass-through, it's really questionable whether MSI generally works in
     that setup as VMware only mention three know working devices [1, p. 4].
     Also not that this quirk entry currently doesn't affect the devices
     emulated by VMware in any way as these don't claim support MSI/MSI-X to
     begin with. [2]
     While at it, make the PCI quirk table const and static.
   - Remove some duplicated empty lines.
   - Use DEVMETHOD_END.
   
   PR:		163812, http://forums.freebsd.org/showthread.php?t=27899 [2]
   Reviewed by:	jhb
   
   [1]: http://www.vmware.com/pdf/vsp_4_vmdirectpath_host.pdf
 
 Modified:
   stable/9/sys/dev/pci/pci.c
 Directory Properties:
   stable/9/sys/   (props changed)
   stable/9/sys/amd64/include/xen/   (props changed)
   stable/9/sys/boot/   (props changed)
   stable/9/sys/boot/i386/efi/   (props changed)
   stable/9/sys/boot/ia64/efi/   (props changed)
   stable/9/sys/boot/ia64/ski/   (props changed)
   stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
   stable/9/sys/boot/powerpc/ofw/   (props changed)
   stable/9/sys/cddl/contrib/opensolaris/   (props changed)
   stable/9/sys/conf/   (props changed)
   stable/9/sys/contrib/dev/acpica/   (props changed)
   stable/9/sys/contrib/octeon-sdk/   (props changed)
   stable/9/sys/contrib/pf/   (props changed)
   stable/9/sys/contrib/x86emu/   (props changed)
 
 Modified: stable/9/sys/dev/pci/pci.c
 ==============================================================================
 --- stable/9/sys/dev/pci/pci.c	Fri Feb 24 00:42:50 2012	(r232091)
 +++ stable/9/sys/dev/pci/pci.c	Fri Feb 24 00:47:14 2012	(r232092)
 @@ -73,7 +73,6 @@ __FBSDID("$FreeBSD$");
  #define	PCIR_IS_BIOS(cfg, reg)						\
  	(((cfg)->hdrtype == PCIM_HDRTYPE_NORMAL && reg == PCIR_BIOS) ||	\
  	 ((cfg)->hdrtype == PCIM_HDRTYPE_BRIDGE && reg == PCIR_BIOS_1))
 -	    
  
  static pci_addr_t	pci_mapbase(uint64_t mapreg);
  static const char	*pci_maptype(uint64_t mapreg);
 @@ -171,7 +170,7 @@ static device_method_t pci_methods[] = {
  	DEVMETHOD(pci_msi_count,	pci_msi_count_method),
  	DEVMETHOD(pci_msix_count,	pci_msix_count_method),
  
 -	{ 0, 0 }
 +	DEVMETHOD_END
  };
  
  DEFINE_CLASS_0(pci, pci_driver, pci_methods, 0);
 @@ -183,7 +182,6 @@ MODULE_VERSION(pci, 1);
  static char	*pci_vendordata;
  static size_t	pci_vendordata_size;
  
 -
  struct pci_quirk {
  	uint32_t devid;	/* Vendor/device of the card */
  	int	type;
 @@ -194,7 +192,7 @@ struct pci_quirk {
  	int	arg2;
  };
  
 -struct pci_quirk pci_quirks[] = {
 +static const struct pci_quirk const pci_quirks[] = {
  	/* The Intel 82371AB and 82443MX has a map register at offset 0x90. */
  	{ 0x71138086, PCI_QUIRK_MAP_REG,	0x90,	 0 },
  	{ 0x719b8086, PCI_QUIRK_MAP_REG,	0x90,	 0 },
 @@ -227,6 +225,12 @@ struct pci_quirk pci_quirks[] = {
  	{ 0x74501022, PCI_QUIRK_DISABLE_MSI,	0,	0 },
  
  	/*
 +	 * MSI-X doesn't work with at least LSI SAS1068E passed through by
 +	 * VMware.
 +	 */
 +	{ 0x079015ad, PCI_QUIRK_DISABLE_MSI,	0,	0 },
 +
 +	/*
  	 * Some virtualization environments emulate an older chipset
  	 * but support MSI just fine.  QEMU uses the Intel 82440.
  	 */
 @@ -724,7 +728,6 @@ pci_read_cap(device_t pcib, pcicfgregs *
  		}
  	}
  
 -	
  #if defined(__i386__) || defined(__amd64__) || defined(__powerpc__)
  	/*
  	 * Enable the MSI mapping window for all HyperTransport
 @@ -1873,7 +1876,7 @@ pci_remap_intr_method(device_t bus, devi
  int
  pci_msi_device_blacklisted(device_t dev)
  {
 -	struct pci_quirk *q;
 +	const struct pci_quirk *q;
  
  	if (!pci_honor_msi_blacklist)
  		return (0);
 @@ -1893,7 +1896,7 @@ pci_msi_device_blacklisted(device_t dev)
  static int
  pci_msi_vm_chipset(device_t dev)
  {
 -	struct pci_quirk *q;
 +	const struct pci_quirk *q;
  
  	for (q = &pci_quirks[0]; q->devid; q++) {
  		if (q->devid == pci_get_devid(dev) &&
 @@ -3023,7 +3026,7 @@ pci_add_resources(device_t bus, device_t
  	struct pci_devinfo *dinfo = device_get_ivars(dev);
  	pcicfgregs *cfg = &dinfo->cfg;
  	struct resource_list *rl = &dinfo->resources;
 -	struct pci_quirk *q;
 +	const struct pci_quirk *q;
  	int i;
  
  	/* ATA devices needs special map treatment */
 @@ -3864,7 +3867,6 @@ pci_write_ivar(device_t dev, device_t ch
  	}
  }
  
 -
  #include "opt_ddb.h"
  #ifdef DDB
  #include <ddb/ddb.h>
 @@ -4021,7 +4023,6 @@ out:;
  	return (res);
  }
  
 -
  struct resource *
  pci_alloc_resource(device_t dev, device_t child, int type, int *rid,
  		   u_long start, u_long end, u_long count, u_int flags)
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/163812: commit references a PR
Date: Fri, 24 Feb 2012 00:48:40 +0000 (UTC)

 Author: marius
 Date: Fri Feb 24 00:48:27 2012
 New Revision: 232093
 URL: http://svn.freebsd.org/changeset/base/232093
 
 Log:
   MFC: r231621
   
   - As it turns out, MSI-X is broken for at least LSI SAS1068E when passed
     through by VMware so blacklist their PCI-PCI bridge for MSI/MSI-X here.
     Note that besides currently there not being a quirk type that disables
     MSI-X only and there's no evidence that MSI doesn't work with the VMware
     pass-through, it's really questionable whether MSI generally works in
     that setup as VMware only mention three know working devices [1, p. 4].
     Also not that this quirk entry currently doesn't affect the devices
     emulated by VMware in any way as these don't claim support MSI/MSI-X to
     begin with. [2]
     While at it, make the PCI quirk table const and static.
   - Remove some duplicated empty lines.
   - Use DEVMETHOD_END.
   
   PR:		163812, http://forums.freebsd.org/showthread.php?t=27899 [2]
   Reviewed by:	jhb
   Approved by:	re (kib)
   
   [1]: http://www.vmware.com/pdf/vsp_4_vmdirectpath_host.pdf
 
 Modified:
   stable/8/sys/dev/pci/pci.c
 Directory Properties:
   stable/8/sys/   (props changed)
   stable/8/sys/amd64/include/xen/   (props changed)
   stable/8/sys/boot/   (props changed)
   stable/8/sys/cddl/contrib/opensolaris/   (props changed)
   stable/8/sys/contrib/dev/acpica/   (props changed)
   stable/8/sys/contrib/pf/   (props changed)
   stable/8/sys/dev/e1000/   (props changed)
 
 Modified: stable/8/sys/dev/pci/pci.c
 ==============================================================================
 --- stable/8/sys/dev/pci/pci.c	Fri Feb 24 00:47:14 2012	(r232092)
 +++ stable/8/sys/dev/pci/pci.c	Fri Feb 24 00:48:27 2012	(r232093)
 @@ -170,7 +170,7 @@ static device_method_t pci_methods[] = {
  	DEVMETHOD(pci_msi_count,	pci_msi_count_method),
  	DEVMETHOD(pci_msix_count,	pci_msix_count_method),
  
 -	{ 0, 0 }
 +	DEVMETHOD_END
  };
  
  DEFINE_CLASS_0(pci, pci_driver, pci_methods, 0);
 @@ -182,7 +182,6 @@ MODULE_VERSION(pci, 1);
  static char	*pci_vendordata;
  static size_t	pci_vendordata_size;
  
 -
  struct pci_quirk {
  	uint32_t devid;	/* Vendor/device of the card */
  	int	type;
 @@ -193,7 +192,7 @@ struct pci_quirk {
  	int	arg2;
  };
  
 -struct pci_quirk pci_quirks[] = {
 +static const struct pci_quirk const pci_quirks[] = {
  	/* The Intel 82371AB and 82443MX has a map register at offset 0x90. */
  	{ 0x71138086, PCI_QUIRK_MAP_REG,	0x90,	 0 },
  	{ 0x719b8086, PCI_QUIRK_MAP_REG,	0x90,	 0 },
 @@ -226,6 +225,12 @@ struct pci_quirk pci_quirks[] = {
  	{ 0x74501022, PCI_QUIRK_DISABLE_MSI,	0,	0 },
  
  	/*
 +	 * MSI-X doesn't work with at least LSI SAS1068E passed through by
 +	 * VMware.
 +	 */
 +	{ 0x079015ad, PCI_QUIRK_DISABLE_MSI,	0,	0 },
 +
 +	/*
  	 * Some virtualization environments emulate an older chipset
  	 * but support MSI just fine.  QEMU uses the Intel 82440.
  	 */
 @@ -1813,7 +1818,7 @@ pci_remap_intr_method(device_t bus, devi
  int
  pci_msi_device_blacklisted(device_t dev)
  {
 -	struct pci_quirk *q;
 +	const struct pci_quirk *q;
  
  	if (!pci_honor_msi_blacklist)
  		return (0);
 @@ -1833,7 +1838,7 @@ pci_msi_device_blacklisted(device_t dev)
  static int
  pci_msi_vm_chipset(device_t dev)
  {
 -	struct pci_quirk *q;
 +	const struct pci_quirk *q;
  
  	for (q = &pci_quirks[0]; q->devid; q++) {
  		if (q->devid == pci_get_devid(dev) &&
 @@ -2788,7 +2793,7 @@ pci_add_resources(device_t bus, device_t
  	struct pci_devinfo *dinfo = device_get_ivars(dev);
  	pcicfgregs *cfg = &dinfo->cfg;
  	struct resource_list *rl = &dinfo->resources;
 -	struct pci_quirk *q;
 +	const struct pci_quirk *q;
  	int i;
  
  	/* ATA devices needs special map treatment */
 @@ -3593,7 +3598,6 @@ pci_write_ivar(device_t dev, device_t ch
  	}
  }
  
 -
  #include "opt_ddb.h"
  #ifdef DDB
  #include <ddb/ddb.h>
 @@ -3734,7 +3738,6 @@ out:;
  	return (res);
  }
  
 -
  struct resource *
  pci_alloc_resource(device_t dev, device_t child, int type, int *rid,
  		   u_long start, u_long end, u_long count, u_int flags)
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/163812: commit references a PR
Date: Fri, 24 Feb 2012 00:49:31 +0000 (UTC)

 Author: marius
 Date: Fri Feb 24 00:49:18 2012
 New Revision: 232094
 URL: http://svn.freebsd.org/changeset/base/232094
 
 Log:
   MFC: r231621
   
   - As it turns out, MSI-X is broken for at least LSI SAS1068E when passed
     through by VMware so blacklist their PCI-PCI bridge for MSI/MSI-X here.
     Note that besides currently there not being a quirk type that disables
     MSI-X only and there's no evidence that MSI doesn't work with the VMware
     pass-through, it's really questionable whether MSI generally works in
     that setup as VMware only mention three know working devices [1, p. 4].
     Also not that this quirk entry currently doesn't affect the devices
     emulated by VMware in any way as these don't claim support MSI/MSI-X to
     begin with. [2]
     While at it, make the PCI quirk table const and static.
   - Remove some duplicated empty lines.
   - Use DEVMETHOD_END.
   
   PR:		163812, http://forums.freebsd.org/showthread.php?t=27899 [2]
   Reviewed by:	jhb
   
   [1]: http://www.vmware.com/pdf/vsp_4_vmdirectpath_host.pdf
 
 Modified:
   stable/7/sys/dev/pci/pci.c
 Directory Properties:
   stable/7/sys/   (props changed)
   stable/7/sys/cddl/contrib/opensolaris/   (props changed)
   stable/7/sys/contrib/dev/acpica/   (props changed)
   stable/7/sys/contrib/pf/   (props changed)
 
 Modified: stable/7/sys/dev/pci/pci.c
 ==============================================================================
 --- stable/7/sys/dev/pci/pci.c	Fri Feb 24 00:48:27 2012	(r232093)
 +++ stable/7/sys/dev/pci/pci.c	Fri Feb 24 00:49:18 2012	(r232094)
 @@ -160,7 +160,7 @@ static device_method_t pci_methods[] = {
  	DEVMETHOD(pci_msi_count,	pci_msi_count_method),
  	DEVMETHOD(pci_msix_count,	pci_msix_count_method),
  
 -	{ 0, 0 }
 +	DEVMETHOD_END
  };
  
  DEFINE_CLASS_0(pci, pci_driver, pci_methods, 0);
 @@ -172,7 +172,6 @@ MODULE_VERSION(pci, 1);
  static char	*pci_vendordata;
  static size_t	pci_vendordata_size;
  
 -
  struct pci_quirk {
  	uint32_t devid;	/* Vendor/device of the card */
  	int	type;
 @@ -183,7 +182,7 @@ struct pci_quirk {
  	int	arg2;
  };
  
 -struct pci_quirk pci_quirks[] = {
 +static const struct pci_quirk const pci_quirks[] = {
  	/* The Intel 82371AB and 82443MX has a map register at offset 0x90. */
  	{ 0x71138086, PCI_QUIRK_MAP_REG,	0x90,	 0 },
  	{ 0x719b8086, PCI_QUIRK_MAP_REG,	0x90,	 0 },
 @@ -216,6 +215,12 @@ struct pci_quirk pci_quirks[] = {
  	{ 0x74501022, PCI_QUIRK_DISABLE_MSI,	0,	0 },
  
  	/*
 +	 * MSI-X doesn't work with at least LSI SAS1068E passed through by
 +	 * VMware.
 +	 */
 +	{ 0x079015ad, PCI_QUIRK_DISABLE_MSI,	0,	0 },
 +
 +	/*
  	 * Some virtualization environments emulate an older chipset
  	 * but support MSI just fine.  QEMU uses the Intel 82440.
  	 */
 @@ -1767,7 +1772,7 @@ pci_remap_msi_irq(device_t dev, u_int ir
  int
  pci_msi_device_blacklisted(device_t dev)
  {
 -	struct pci_quirk *q;
 +	const struct pci_quirk *q;
  
  	if (!pci_honor_msi_blacklist)
  		return (0);
 @@ -1787,7 +1792,7 @@ pci_msi_device_blacklisted(device_t dev)
  static int
  pci_msi_vm_chipset(device_t dev)
  {
 -	struct pci_quirk *q;
 +	const struct pci_quirk *q;
  
  	for (q = &pci_quirks[0]; q->devid; q++) {
  		if (q->devid == pci_get_devid(dev) &&
 @@ -2627,7 +2632,7 @@ pci_add_resources(device_t bus, device_t
  	struct pci_devinfo *dinfo = device_get_ivars(dev);
  	pcicfgregs *cfg = &dinfo->cfg;
  	struct resource_list *rl = &dinfo->resources;
 -	struct pci_quirk *q;
 +	const struct pci_quirk *q;
  	int i;
  
  	/* ATA devices needs special map treatment */
 @@ -3423,7 +3428,6 @@ pci_write_ivar(device_t dev, device_t ch
  	}
  }
  
 -
  #include "opt_ddb.h"
  #ifdef DDB
  #include <ddb/ddb.h>
 @@ -3564,7 +3568,6 @@ out:;
  	return (res);
  }
  
 -
  struct resource *
  pci_alloc_resource(device_t dev, device_t child, int type, int *rid,
  		   u_long start, u_long end, u_long count, u_int flags)
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: marius 
State-Changed-When: Fri Feb 24 00:52:53 UTC 2012 
State-Changed-Why:  
close 

http://www.freebsd.org/cgi/query-pr.cgi?pr=163812 
>Unformatted:
