tenstorrent / tt-umd

User-Mode Driver for Tenstorrent hardware
Apache License 2.0
9 stars 5 forks source link

REG_TLB code path untangling #116

Open joelsmithTT opened 1 month ago

joelsmithTT commented 1 month ago

tt_SiliconDevice::write_mmio_device_register will pad the input buffer if size isn't a multiple of four. If the buffer is padded, the value of the padding is undefined but will be written to the chip. Callers attempting to use "REG_TLB" as a mechanism to perform e.g. 2 byte write of device memory via UC mapping may find this behavior surprising.

Suggestions:

broskoTT commented 1 day ago

We should untangle this REG_TLB path. tt_debuda just hit an issue where write_to_device accepts 64bit address, which can then call write_mmio_device_register which also accepts 64bit address, but if write_device_memory is called it accepts 32bit address. Specifically on ARC the L1 address space sits high in 36bit address space (on Wormhole), so they're unable to hit those addresses without fallback_tlb "REG_TLB".

joelsmithTT commented 1 day ago

Ouch. That's broken. We should use uint64_t for addresses everywhere, uint32_t is a bug. There are plenty of locations in Blackhole that require 64 bits to address.

broskoTT commented 10 hours ago

I'll fix that issue as part of https://github.com/tenstorrent/tt-umd/issues/281