From: peterz@infradead.org (Peter Zijlstra)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/5] kernel/jump_label: implement generic support for relative references
Date: Thu, 28 Jun 2018 11:25:04 +0200 [thread overview]
Message-ID: <20180628092504.GC2494@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <CAKv+Gu-xPR6UEiP0NT0zYXKRYXqwFCXP=nf0cC87PZdDYBZB4A@mail.gmail.com>
On Thu, Jun 28, 2018 at 11:04:45AM +0200, Ard Biesheuvel wrote:
> On 28 June 2018 at 11:02, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> >>> @@ -56,7 +72,9 @@ jump_label_sort_entries(struct jump_entry *start, struct jump_entry *stop)
> >>>
> >>> size = (((unsigned long)stop - (unsigned long)start)
> >>> / sizeof(struct jump_entry));
> >>> - sort(start, size, sizeof(struct jump_entry), jump_label_cmp, NULL);
> >>> + sort(start, size, sizeof(struct jump_entry), jump_label_cmp,
> >>> + IS_ENABLED(CONFIG_HAVE_ARCH_JUMP_LABEL_RELATIVE) ? jump_label_swap
> >>> + : NULL);
> >>> }
> >>
> >> That will result in jump_label_swap being an unused symbol for some
> >> compile options.
> >
> > No, and isn't that the point of IS_ENABLED()? The compiler sees a
> > reference to jump_label_swap(), so it won't complain about it being
> > unused.
Ah, ok. I hadn't figured it was quite that smart about it.
> > Meh. I thought IS_ENABLED() was preferred over #ifdef, no?
Dunno, I just reacted to the proposed code's uglyness :-)
> ... and it means the sort() routine will unconditionally perform an
> indirect function call even if the arch does not require it.
Yeah, not sure I care about that here, this is a one time affair, very
far away from any fast paths.
next prev parent reply other threads:[~2018-06-28 9:25 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-27 16:05 [PATCH 0/5] add support for relative references in jump tables Ard Biesheuvel
2018-06-27 16:06 ` [PATCH 1/5] kernel/jump_label: abstract jump_entry member accessors Ard Biesheuvel
2018-06-28 8:40 ` Peter Zijlstra
2018-06-27 16:06 ` [PATCH 2/5] kernel/jump_label: implement generic support for relative references Ard Biesheuvel
2018-06-28 8:50 ` Peter Zijlstra
2018-06-28 9:02 ` Ard Biesheuvel
2018-06-28 9:04 ` Ard Biesheuvel
2018-06-28 9:25 ` Peter Zijlstra [this message]
2018-06-28 9:29 ` Ard Biesheuvel
2018-06-28 9:37 ` Peter Zijlstra
2018-06-27 16:06 ` [PATCH 3/5] arm64/kernel: jump_label: switch to " Ard Biesheuvel
2018-06-28 9:17 ` Will Deacon
2018-06-27 16:06 ` [PATCH 4/5] x86: jump_label: switch to jump_entry accessors Ard Biesheuvel
2018-06-28 9:11 ` Peter Zijlstra
2018-06-28 9:14 ` Ard Biesheuvel
2018-06-27 16:06 ` [PATCH 5/5] x86/kernel: jump_table: use relative references Ard Biesheuvel
2018-06-28 8:31 ` Peter Zijlstra
2018-06-28 8:34 ` Ard Biesheuvel
2018-06-28 9:28 ` Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180628092504.GC2494@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).