Skip to content

Commit

Permalink
x86: Add a BSP cpu_dev helper
Browse files Browse the repository at this point in the history
Add a function ptr to struct cpu_dev which is destined to be run only
once on the BSP during boot.

Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Link: http://lkml.kernel.org/r/20110805180116.GB26217@aftab
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
  • Loading branch information
Borislav Petkov authored and H. Peter Anvin committed Aug 5, 2011
1 parent dfb09f9 commit a110b5e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/x86/kernel/cpu/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,9 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
filter_cpuid_features(c, false);

setup_smep(c);

if (this_cpu->c_bsp_init)
this_cpu->c_bsp_init(c);
}

void __init early_cpu_init(void)
Expand Down
1 change: 1 addition & 0 deletions arch/x86/kernel/cpu/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ struct cpu_dev {
struct cpu_model_info c_models[4];

void (*c_early_init)(struct cpuinfo_x86 *);
void (*c_bsp_init)(struct cpuinfo_x86 *);
void (*c_init)(struct cpuinfo_x86 *);
void (*c_identify)(struct cpuinfo_x86 *);
unsigned int (*c_size_cache)(struct cpuinfo_x86 *, unsigned int);
Expand Down

0 comments on commit a110b5e

Please sign in to comment.