Re: [PATCH v6 8/8] x86/kernel: jump_table: use relative references

2017-12-28 Thread Steven Rostedt
On Thu, 28 Dec 2017 16:26:07 + Ard Biesheuvel wrote: > On 28 December 2017 at 16:19, Steven Rostedt wrote: > > On Wed, 27 Dec 2017 08:50:33 + > > Ard Biesheuvel wrote: > > > >> static inline jump_label_t jump_entry_code(const struct jump_entry *entry) > >> { > >> - return entry-

Re: [PATCH v6 8/8] x86/kernel: jump_table: use relative references

2017-12-28 Thread Ard Biesheuvel
On 28 December 2017 at 16:19, Steven Rostedt wrote: > On Wed, 27 Dec 2017 08:50:33 + > Ard Biesheuvel wrote: > >> static inline jump_label_t jump_entry_code(const struct jump_entry *entry) >> { >> - return entry->code; >> + return (jump_label_t)&entry->code + entry->code; > > I'm pa

Re: [PATCH v6 8/8] x86/kernel: jump_table: use relative references

2017-12-28 Thread Steven Rostedt
On Wed, 27 Dec 2017 08:50:33 + Ard Biesheuvel wrote: > static inline jump_label_t jump_entry_code(const struct jump_entry *entry) > { > - return entry->code; > + return (jump_label_t)&entry->code + entry->code; I'm paranoid about doing arithmetic on abstract types. What happens in

[PATCH v6 8/8] x86/kernel: jump_table: use relative references

2017-12-27 Thread Ard Biesheuvel
Similar to the arm64 case, 64-bit x86 can benefit from using 32-bit relative references rather than 64-bit absolute ones when emitting struct jump_entry instances. Not only does this reduce the memory footprint of the entries themselves by 50%, it also removes the need for carrying relocation metad