Re: [PATCH] x86/mm: annotate no_context with UNWIND_HINTS

From: Josh Poimboeuf
Date: Mon Oct 15 2018 - 12:20:28 EST


On Mon, Oct 15, 2018 at 09:03:40AM -0700, Andy Lutomirski wrote:
> That being said, the generic macro is:
>
> # define unreachable() do { annotate_reachable(); do { } while (1); } while (0)
>
> I'm probably missing some subtlety here, but shouldn't that be
> annotate_*un*reachable()?

That code should have had a comment, but that subtlety was intentional.
As I mentioned earlier, that was a hack for old versions of GCC which
didn't have __builtin_unreachable(). In those cases, GCC doesn't treat
"ud2" as fatal, so this was a way of telling objtool that. Luckily we
can get rid of this hack now that the minimum supported GCC version has
gone up to 4.6.

--
Josh