[PATCH 5.8 165/255] arm64: Move handling of erratum 1418040 into C code