Quoting Stephen Boyd (2014-02-27 16:09:51)
On 02/27/14 15:57, Sebastian Capella wrote: Just curious, is there a reason for the RELOC_HIDE() here? Or __pa_symbol() for that matter? It looks like only x86 uses this on the __nosave_{begin,end} symbol. Maybe it's copy-pasta?
Hi Stephen,
Thanks for your comments!
I see this in the original version of the patch in 2011, we took it from there.
From what I read, it sounds like the RELOC_HIDE is used to prevent optimizations by gcc where it may assume that any arithmetic on the address of a symbol will remain within the bounds of the symbol. (http://lists.linuxcoding.com/kernel/2006-q3/msg17979.html)
Since we're using this symbol's address to get the physical address, which is well out of the symbol's bounds, and not really a C behavior, it seems like this would continue to be appropriate.
pfn_is_nosave seems like variations of the same checks on other architectures. Maybe some clever person will know a nice way to make it common :)
Thanks!
Sebastian