[igt-dev] [PATCH i-g-t] lib/intel_batchbuffer: Fix relocs across the 4GB address boundary

Imre Deak imre.deak at intel.com
Mon Nov 9 12:06:32 UTC 2020


If the delta of a relocation target wrt. the object base address crosses
the 4GB address boundary the upper 32bit of the target address will be
incorrect, fix this.

Cc: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
Cc: Chris Wilson <chris at chris-wilson.co.uk>
Signed-off-by: Imre Deak <imre.deak at intel.com>
---
 lib/intel_batchbuffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index fc73495c0..7b4cfb0dd 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -1850,7 +1850,7 @@ static uint64_t __intel_bb_emit_reloc(struct intel_bb *ibb,
 
 	intel_bb_out(ibb, delta + address);
 	if (ibb->gen >= 8)
-		intel_bb_out(ibb, address >> 32);
+		intel_bb_out(ibb, (delta + address) >> 32);
 
 	return address;
 }
-- 
2.25.1



More information about the igt-dev mailing list