On Tue, Jul 18, 2006 at 04:18:15PM -0700, Mike Kravetz wrote:
I assume checking must be done at run time via something like,
if (cpu_has_feature(CPU_FTR_PURR))
If you do it in the hcall asm instead (like Paulus suggested), then it's
better to use BEGIN_FTR_SECTION/END_FTR_SECTION() around it, that way
the PURR reads just get nopped out instead of adding tests and branches.
Also assume that it would make sense to do this determination at
initialization/boot time and put the result in the statistic data
structure. In this way we would know it is in the same cache line
we are updating with other stats. Or, should cur_cpu_spec->cpu_features
be 'sufficiently hot' to make this a non-issue?
If you use the FTR_SECTION stuff then it'll be taken care of
automatically at boot time. Doing that from C is messy, I don't think
anyone has had reason to do it before.
-Olof