From: Michael LeBeane Date: Mon, 20 May 2019 20:39:40 +0000 (-0400) Subject: arch-gcn3: Fix stride bug in buffer OOB detection logic X-Git-Tag: v20.1.0.0~426 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f509fa735ca7a2969c99fd9606157ba72a4abe9c;p=gem5.git arch-gcn3: Fix stride bug in buffer OOB detection logic The out-of-range logic for buffer accesses is missing the top 4 bits of const_stride when dealing with scratch buffers. This can cause perfectly valid scratch acceses to be suppressed when const_stride is large. Change-Id: I8f94d44c242fda26cf6dfb75db04fa3aca934b3e Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29968 Reviewed-by: Anthony Gutierrez Reviewed-by: Matt Sinclair Maintainer: Anthony Gutierrez Tested-by: kokoro --- diff --git a/src/arch/gcn3/insts/op_encodings.hh b/src/arch/gcn3/insts/op_encodings.hh index 202dd1d82..b35fb3d68 100644 --- a/src/arch/gcn3/insts/op_encodings.hh +++ b/src/arch/gcn3/insts/op_encodings.hh @@ -651,7 +651,7 @@ namespace Gcn3ISA * non-formatted accesses, this is done on a per-lane * basis. */ - if (rsrc_desc.stride == 0 || !rsrc_desc.swizzleEn) { + if (stride == 0 || !rsrc_desc.swizzleEn) { if (buf_off + stride * buf_idx >= rsrc_desc.numRecords - s_offset.rawData()) { DPRINTF(GCN3, "mubuf out-of-bounds condition 1: " @@ -659,13 +659,13 @@ namespace Gcn3ISA "const_stride = %llx, " "const_num_records = %llx\n", lane, buf_off + stride * buf_idx, - rsrc_desc.stride, rsrc_desc.numRecords); + stride, rsrc_desc.numRecords); oobMask.set(lane); continue; } } - if (rsrc_desc.stride != 0 && rsrc_desc.swizzleEn) { + if (stride != 0 && rsrc_desc.swizzleEn) { if (buf_idx >= rsrc_desc.numRecords || buf_off >= stride) { DPRINTF(GCN3, "mubuf out-of-bounds condition 2: "