lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20091002215019.GB23379@8bytes.org>
Date:	Fri, 2 Oct 2009 23:50:19 +0200
From:	Joerg Roedel <joro@...tes.org>
To:	Fenghua Yu <fenghua.yu@...el.com>
Cc:	David Woodhouse <dwmw2@...radead.org>,
	Jesse Barnes <jbarnes@...tuousgeek.org>,
	Francois Isabelle <Francois.Isabelle@...kontron.com>,
	iommu@...ts.linux-foundation.org,
	Grant Grundler <grundler@...isc-linux.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] pciehp_driver.c: PCIe hot plug for Intel iommu -
	call IOMMU API in hot remove

On Fri, Oct 02, 2009 at 02:18:44PM -0700, Fenghua Yu wrote:
> IOMMU API iommu_detach_devcie() is called to hot remove a PCIe device.
> 
> A hot added device will be added into an IOMMU domain when it first does IOMMU
> op. So there is no need to add more code for hot add. 
> 
> Signed-off-by: Fenghua Yu <fenghua.yu@...el.com>
> 
> ---
> 
>  drivers/pci/pci-driver.c |    8 ++++++++
>  1 files changed, 8 insertions(+)
> 
> diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
> index e5d47be..b8f0592 100644
> --- a/drivers/pci/pci-driver.c
> +++ b/drivers/pci/pci-driver.c
> @@ -17,6 +17,7 @@
>  #include <linux/slab.h>
>  #include <linux/sched.h>
>  #include <linux/cpu.h>
> +#include <linux/iommu.h>
>  #include "pci.h"
>  
>  struct pci_dynid {
> @@ -390,6 +391,13 @@ static int pci_device_remove(struct device * dev)
>  	 */
>  
>  	pci_dev_put(pci_dev);
> +
> +	/*
> +	 * Remove this pci device from its iommu domain.
> +	 */
> +	if (iommu_found())
> +		iommu_detach_device(NULL, dev);
> +
>  	return 0;
>  }

NACK!

This breaks with AMD IOMMU driver.
Just implement a VT-d specific notifier callback for device removal on
the pci bus.

	Joerg

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ