Skip to content

Introduce and use absolute_pointer macro

Guenter Roeck linux-alpha linux-parisc linux-sparse lkml netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 47 repliesIn review
  2. v14 patches 9 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4compiler.h: Introduce absolute_pointer macroinclude/linux/compiler.h+2 -03 replies
2/4net: i825xx: Use absolute_pointer for memcpy from fixed memory locationdrivers/net/ethernet/i825xx/82596.c+1 -11 reply
3/4alpha: Move setup.h out of uapiarch/alpha/include/asm/setup.h arch/alpha/include/uapi/asm/setup.h+46 -390 replies
4/4alpha: Use absolute_pointer to define COMMAND_LINEarch/alpha/include/asm/setup.h+1 -10 replies

Reviews trailers per patch

2 of 4 patches have a Reviewed-by or Acked-by.

PatchGeert Uytterhoeven
1/4R-b
2/4R-b
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/4] Introduce and use absolute_pointer macro

Kernel test builds currently fail for several architectures with error messages such as the following.

drivers/net/ethernet/i825xx/82596.c: In function 'i82596_probe':
./arch/m68k/include/asm/string.h:72:25: error:
'__builtin_memcpy' reading 6 bytes from a region of size 0
[-Werror=stringop-overread]

Such warnings may be reported by gcc 11.x for string and memory operations on fixed addresses if gcc's builtin functions are used for those operations.

This patch series introduces absolute_pointer() to fix the problem. absolute_pointer() disassociates a pointer from its originating symbol type and context, and thus prevents gcc from making assumptions about pointers passed to memory operations.

v2: Drop parisc patch (the problem will be solved differently)
alpha: Move setup.h out of uapi
Define COMMAND_LINE for alpha as absolute_pointer instead of using absolute_pointer on the define.

----------------------------------------------------------------
Guenter Roeck (4):
compiler.h: Introduce absolute_pointer macro
net: i825xx: Use absolute_pointer for memcpy from fixed memory location
alpha: Move setup.h out of uapi
alpha: Use absolute_pointer to define COMMAND_LINE

 arch/alpha/include/asm/setup.h      | 43 +++++++++++++++++++++++++++++++++++++
 arch/alpha/include/uapi/asm/setup.h | 42 +++---------------------------------
 drivers/net/ethernet/i825xx/82596.c |  2 +-
 include/linux/compiler.h            |  2 ++
 4 files changed, 49 insertions(+), 40 deletions(-)
 create mode 100644 arch/alpha/include/asm/setup.h