[PATCH] D36742: [LLD][ELF][AArch64] Implement scanner for Cortex-A53 Erratum 843419

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 5 03:24:10 PST 2017


peter.smith added a comment.

>> peter.smith updated this revision to Diff 125355.
>>  peter.smith added a comment.
>> 
>> Updated and rebased after addition of range-extension thunks for aarch64.
>> 
>> - The erratum scanning is now done within the same loop as range extension thunks.
>> - Added a new test case of an erratum sequence that will only be detected on the second pass. As the scanner only detects patches and doesn't try and fix them we cannot test the case where a new thunk is required due to a patch being added.
> 
> What is the plan for when we detect sequences to patch on mulitple
> iterations? Given that the address of the instructions are important, we
> can end up patching sequences that in the end are in addresses that
> don't actually need patching, no?
> 
> That is probably fine as avoiding it would probably require a fancier
> optimization algorithm.
> 
> LGTM.
> 
> Cheers,
> Rafael

The plan is to leave them in. This can result in a small amount of wasted code size (each patch instance is 8-bytes) but it isn't significant compared to the overall size of the program. There is a clever way of mitigating the problem by padding out the size of a patch such that it doesn't disturb the base address modulo 0x1000 of following sections. Although this wastes quite a lot of bytes for small programs.

Thanks very much for the review.


https://reviews.llvm.org/D36742





More information about the llvm-commits mailing list