[Beignet] [PATCH] Pad instruction stream with 8 nops;
Zhigang Gong
zhigang.gong at linux.intel.com
Wed Jun 5 02:01:26 PDT 2013
In general, this patch looks good to me. The only thing I'm not sure
is that whether this brings any performance side effect. It will add 8
nops after the EOT send message as below. Will those 8 nop instructions be
executed or they will be ignored?
send(8) null g0<8,8,1>UD
thread_spawnerunsupported target 7 mlen 1 rlen 0 { align1 WE_normal 1Q EOT };
nop ;
nop ;
nop ;
nop ;
nop ;
nop ;
nop ;
nop ;
On Wed, Jun 05, 2013 at 09:09:57AM +0800, Zou Nan hai wrote:
> According to Bspec, EU may access 8 instrunctions beyond the
> kernel program because of prefetch.
> Pad the instruction stream with 8 nop to avoid access into an
> invalide page.
>
> Signed-off-by: Zou Nanhai <nanhai.zou at intel.com>
> ---
> backend/src/backend/gen_context.cpp | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/backend/src/backend/gen_context.cpp b/backend/src/backend/gen_context.cpp
> index 18f6c11..b9c0392 100644
> --- a/backend/src/backend/gen_context.cpp
> +++ b/backend/src/backend/gen_context.cpp
> @@ -72,6 +72,10 @@ namespace gbe
> }
> p->pop();
> }
> + /* per spec, pad the instruction stream with 8 nop to avoid
> + instruction prefetcher prefetch into an invalide page */
> + for(int i = 0; i < 8; i++)
> + p->NOP();
> }
>
> void GenContext::patchBranches(void) {
> --
> 1.7.9.5
>
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list