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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Sun, 3 May 2020 14:37:07 -0600
From:   "Jason A. Donenfeld" <Jason@...c4.com>
To:     Chris Wilson <chris@...is-wilson.co.uk>
Cc:     intel-gfx@...ts.freedesktop.org,
        LKML <linux-kernel@...r.kernel.org>,
        stable <stable@...r.kernel.org>,
        Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
        David Laight <David.Laight@...lab.com>,
        Christoph Hellwig <hch@...radead.org>
Subject: Re: [PATCH] drm/i915: Avoid using simd from interrupt context

On Sun, May 3, 2020 at 2:31 PM Chris Wilson <chris@...is-wilson.co.uk> wrote:
>
> Query whether or not we are in a legal context for using SIMD, before
> using SSE4.2 registers.
>
> Suggested-by: Jason A. Donenfeld <Jason@...c4.com>
> Signed-off-by: Chris Wilson <chris@...is-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/i915_memcpy.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_memcpy.c b/drivers/gpu/drm/i915/i915_memcpy.c
> index 7b3b83bd5ab8..fc18d6c28d5f 100644
> --- a/drivers/gpu/drm/i915/i915_memcpy.c
> +++ b/drivers/gpu/drm/i915/i915_memcpy.c
> @@ -24,6 +24,7 @@
>
>  #include <linux/kernel.h>
>  #include <asm/fpu/api.h>
> +#include <asm/simd.h>
>
>  #include "i915_memcpy.h"
>
> @@ -115,6 +116,9 @@ bool i915_memcpy_from_wc(void *dst, const void *src, unsigned long len)
>         if (unlikely(((unsigned long)dst | (unsigned long)src | len) & 15))
>                 return false;
>
> +       if (unlikely(!may_use_simd()))
> +               return false;
> +
>         if (static_branch_likely(&has_movntdqa)) {
>                 if (likely(len))
>                         __memcpy_ntdqa(dst, src, len >> 4);
> --
> 2.20.1

Looks like you beat me to the punch. Thanks for doing this.

Reviewed-by: Jason A. Donenfeld <Jason@...c4.com>

Powered by blists - more mailing lists