ACPI: tables: avoid relocations for table signature array
authorArd Biesheuvel <ardb@kernel.org>
Wed, 17 Jun 2020 08:25:05 +0000 (10:25 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 24 Jun 2020 15:38:51 +0000 (17:38 +0200)
commit2229a12b64a4df7128b6e2d86be2688f8c76efec
tree4a700a181cb9e8dab1c9444b0b16e09f40b39c65
parent48778464bb7d346b47157d21ffde2af6b2d39110
ACPI: tables: avoid relocations for table signature array

On architectures that implement KASLR using the ELF native RELA relocation
format (such as arm64), every absolute reference in the code incurs an
overhead of 24 bytes in the .rela section. So storing a 41 element array
of 4 character signature strings using an array of pointer-to-char incurs
an 8x overhead (32 bytes per entry => ~1500 bytes), and given the fixed
length of the entries, and the fact that the array is only used locally,
it is much better to use an array of arrays here, which gets rid of the
overhead entirely.

While at it, make it __initconst, as it is never referenced except from
__init code.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/tables.c