backport of arm64: mte: move register initialization to C