Re: [PATCH 0/5 v2] [GIT PULL] x86/jump label: Paranoid checks and 2or 5 byte nops

From: Steven Rostedt
Date: Thu Feb 02 2012 - 17:53:12 EST


On Thu, 2012-02-02 at 14:07 -0800, H. Peter Anvin wrote:

> Would it make more sense to keep track of three states:
>
> "Default"
> "Enabled"
> "Disabled"

Well, it is only default on start up, and every jump label is
initialized then to the ideal nop. Either at boot up, or on module load.

What's nice is that the jump label init calls call the "_static" version
of the update (arch_jump_label_transform_static()), and the
enable/disable calls the non "_static" version
(arch_jump_label_transform()). This means that we can set the "init"
flag depending on which way we got into the common code. The upper layer
only needs to know if the field is enabled or disabled. Remember this is
a x86 specific thing. Other archs do not have a different "default" nop.
There's no reason to save a "default" state, as that would require
changing the common arch layers of jump label.

-- Steve




--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/