I have an Orion O6 with 64 GB RAM. I’m using firmware 1.0.0-3, which offers MTE support, and a MTE-capable kernel without kASAN. I can prove that MTE is not happy on this platform.
I wrote a program that allocates a block of memory with MTE (using Linux mmap system call). Then it fills the allocation tag area for the block with a pattern. Then it checks the pattern for correctness. And when the block gets large enough to not fit in CPU caches, I get failures (mte-failures.txt in zip file). You can build and run the test yourself, just unpack the zip file and run make.
I believe the reason the test fails is that the Arm MTSX block used to provide MTE tag storage in LPDDR5 does not support CD8180’s memory map shape. The MTSX block is configured by the Cortex-M SE core during boot, while setting up the CI-700 interconnect.
The setup, even for 64 GB RAM (which splits the RAM range into [ 0x0080000000, 0x07FFFFFFFF ] low 30 GB range and [ 0x8000000000, 0x887FFFFFFF ] high 34 GB range), configures the MTSX for contiguous memory map (mtu_tag_addr_ctl.memory_map_mode = 000b). What’s worse, the MTSX tag base address is set as follows for different amounts of RAM:
RAM mtu_tag_addr_base (+ tags + 64MB)
4096 MB: 0000000174000000 0000000180000000
8192 MB: 000000026c000000 0000000280000000
16384 MB: 000000045c000000 0000000480000000
32768 MB: 000000083c000000 0000000880000000
65536 MB: 0000000ffc000000 0000001080000000
For 32 GB and 64 GB RAM, the base falls outside of defined RAM regions. I wonder if this is the source of MTE trouble. Please ask CIX for a comment on this. If nothing else helps, you could restrict RAM size with MTE enabled to 30 GB, then everything will fit in the contiguous, low RAM range:
RAM mtu_tag_addr_base (+ tags + 64MB)
30720 MB: 00000007c0000000 0000000800000000
For a 32 GB board this is not much of a sacrifice, you get 29 GB with MTE instead of the 31 GB you could theoretically get. (For 64 GB it is a pity, but better than not having MTE that actually works.)
You could also use 30 GB of low range for data, and put MTSX tags at the start of the high range.
I can’t attach a ZIP file because my account is new. But I have uploaded it for you: Filebin | 0dsgzt1ltpau8nmj
Thank you for your attention, I know this is very technical, but I hope I can help CIX debug this quickly.