[PATCH 1/2] ARM: kvm: fix a bad BSYM() usage

Russell King - ARM Linux linux at arm.linux.org.uk
Mon May 11 03:17:39 PDT 2015


On Mon, May 11, 2015 at 10:56:57AM +0100, Dave P Martin wrote:
> ldr= will do the right thing *if* the target symbol's type is correctly
> annotated.  This means that ldr =some_local_code_symbol does the right
> thing for branch target addresses if and only if some_local_code_symbol
> is marked with .type %function (or ENDPROC).
> 
> The fact that a symbol is in a code section is *not* enough.
> 
> For ARM code this never mattered, so local symbols in .S files are
> probably under-annotated in general.  BSYM() might have been used to
> work around this in some cases.
> 
> We should check that all the BSYMs removed by this series from ldr=
> and .long/.word etc. point to a correctly annotated symbol, and add
> the annotations if not.

I guess the problem here is that people forget what a patch series is
actually doing and then start making comments based on hypothetical
stuff rather than what the series is actually doing.

To recap, this series:

1. Removes the wrong usage of BSYM() in the KVM code.  This is used with
   the symbol "panic" which is a function declared by generic C code.
   Therefore, panic will have the appropriate annotations attached to
   this symbol, unless GCC itself is buggy.

   This is the _only_ case of "ldr rd, =BSYM(sym)".

2. It replaces the remaining "adr rd, BSYM(sym)" with a new "badr" macro,
   and removes the BSYM() preprocessor macro.  The new "badr" macro which
   is identical in behaviour to the former, but ensures that BSYM()
   doesn't get mis-used with "ldr".

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.



More information about the linux-arm-kernel mailing list