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] [day] [month] [year] [list]
Date:	Tue, 1 Nov 2011 14:24:38 -0700
From:	Ben Widawsky <ben@...dawsk.net>
To:	Ben Widawsky <ben@...dawsk.net>
Cc:	Dave Airlie <airlied@...hat.com>,
	Keith Packard <keithp@...thp.com>,
	dri-devel@...ts.freedesktop.org, intel-gfx@...ts.freedesktop.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/i915: iommu workaround related cleanups

On Tue,  1 Nov 2011 11:29:49 -0700
Ben Widawsky <ben@...dawsk.net> wrote:

> Cleanups recommended by Dave Airlie.
> 
> Cc: Keith Packard <keithp@...thp.com>
> Signed-off-by: Ben Widawsky <ben@...dawsk.net>
> ---
>  drivers/char/agp/intel-agp.h |    6 ++++++
>  drivers/char/agp/intel-gtt.c |    7 ++++---
>  2 files changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/char/agp/intel-agp.h b/drivers/char/agp/intel-agp.h
> index 5da67f1..d8fa7d6 100644
> --- a/drivers/char/agp/intel-agp.h
> +++ b/drivers/char/agp/intel-agp.h
> @@ -238,4 +238,10 @@
>  int intel_gmch_probe(struct pci_dev *pdev,
>  			       struct agp_bridge_data *bridge);
>  void intel_gmch_remove(struct pci_dev *pdev);
> +
> +#ifdef CONFIG_INTEL_IOMMU
> +/* This is a special note from the iommu driver that we are mapped through it */
> +extern int intel_iommu_gfx_mapped;
> +#endif
> +
>  #endif
> diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c
> index c92424c..11985fb 100644
> --- a/drivers/char/agp/intel-gtt.c
> +++ b/drivers/char/agp/intel-gtt.c
> @@ -1183,14 +1183,13 @@ static void gen6_cleanup(void)
>  {
>  }
>  
> +#ifdef CONFIG_INTEL_IOMMU
>  /* Certain Gen5 chipsets require require idling the GPU before
>   * unmapping anything from the GTT when VT-d is enabled.
>   */
>  static inline int needs_idle_maps(void)
>  {
> -#ifdef CONFIG_INTEL_IOMMU
>  	const unsigned short gpu_devid = intel_private.pcidev->device;
> -	extern int intel_iommu_gfx_mapped;
>  
>  	/* Query intel_iommu to see if we need the workaround. Presumably that
>  	 * was loaded first.
> @@ -1199,9 +1198,11 @@ static inline int needs_idle_maps(void)
>  	     gpu_devid == PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG) &&
>  	     intel_iommu_gfx_mapped)
>  		return 1;
> -#endif
>  	return 0;
>  }
> +#else
> +static inline bool needs_idle_maps(void) { return false; }
> +#endif
>  
>  static int i9xx_setup(void)
>  {


I should have kept the ints and bools consistent. So if this patch looks
interesting to anyone, let's just say:

+#else
+static inline int needs_idle_maps(void) { return 0; }
+#endif

--
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