Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jul 2019 00:13:26 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Konstantin Belousov <kib@FreeBSD.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r349988 - head/sys/x86/iommu
Message-ID:  <20190714211326.GU47193@kib.kiev.ua>
In-Reply-To: <201907142108.x6EL8sA1089787@repo.freebsd.org>
References:  <201907142108.x6EL8sA1089787@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jul 14, 2019 at 09:08:54PM +0000, Konstantin Belousov wrote:
> Author: kib
> Date: Sun Jul 14 21:08:54 2019
> New Revision: 349988
> URL: https://svnweb.freebsd.org/changeset/base/349988
In dmar_find(), refuse to search for DMAR unit for non-PCI device.

Eventually this should be reworked, because ACPI DMAR table can
specify ANND entries for scoping ACPI namespace enumerated devices.
But code to match DMAR unit against such device is missed currently
anyway.

Sorry.
> 
> Log:
>   PR:	239143
>   Reported and tested by:	Wes Maag <jwmaag@gmail.com>
>   Sponsored by:	The FreeBSD Foundation
>   MFC after:	1 week
> 
> Modified:
>   head/sys/x86/iommu/intel_drv.c
> 
> Modified: head/sys/x86/iommu/intel_drv.c
> ==============================================================================
> --- head/sys/x86/iommu/intel_drv.c	Sun Jul 14 16:05:47 2019	(r349987)
> +++ head/sys/x86/iommu/intel_drv.c	Sun Jul 14 21:08:54 2019	(r349988)
> @@ -770,6 +770,13 @@ dmar_find(device_t dev, bool verbose)
>  	const char *banner;
>  	int i, dev_domain, dev_busno, dev_path_len;
>  
> +	/*
> +	 * This function can only handle PCI(e) devices.
> +	 */
> +	if (device_get_devclass(device_get_parent(dev)) !=
> +	    devclass_find("pci"))
> +		return (NULL);
> +
>  	dmar_dev = NULL;
>  	dev_domain = pci_get_domain(dev);
>  	dev_path_len = dmar_dev_depth(dev);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190714211326.GU47193>