diff options
| author | Borislav Petkov <[email protected]> | 2013-06-09 10:07:32 +0000 |
|---|---|---|
| committer | H. Peter Anvin <[email protected]> | 2013-06-21 00:37:19 +0000 |
| commit | 5700f743b597951743da9c7d891d3989aac0486e (patch) | |
| tree | e0482b8bb6ec72bc1db19bcd853922efb97b36bc /tools/perf/util/scripting-engines/trace-event-perl.c | |
| parent | x86, cpu: Add a synthetic, always true, cpu feature (diff) | |
| download | kernel-5700f743b597951743da9c7d891d3989aac0486e.tar.gz kernel-5700f743b597951743da9c7d891d3989aac0486e.zip | |
x86: Sanity-check static_cpu_has usage
static_cpu_has may be used only after alternatives have run. Before that
it always returns false if constant folding with __builtin_constant_p()
doesn't happen. And you don't want that.
This patch is the result of me debugging an issue where I overzealously
put static_cpu_has in code which executed before alternatives have run
and had to spend some time with scratching head and cursing at the
monitor.
So add a jump to a warning which screams loudly when we use this
function too early. The alternatives patch that check away in
conjunction with patching the rest of the kernel image.
[ hpa: factored this into its own configuration option. If we want to
have an overarching option, it should be an option which selects
other options, not as a group option in the source code. ]
Signed-off-by: Borislav Petkov <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: H. Peter Anvin <[email protected]>
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-perl.c')
0 files changed, 0 insertions, 0 deletions
