hv:Change structure boot_cpu_data to static

-- Change boot_cpu_data to static, only used in cpu_caps.c,
-- Add get_cpu_info() api, it will call this api instead of
   boot_cpu_data except cpu_caps.c

Tracked-On: #1842
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
This commit is contained in:
Mingqiang Chi
2019-01-03 10:24:21 +08:00
committed by wenlingz
parent 7c4dd0d277
commit 09ff94fc49
8 changed files with 26 additions and 15 deletions

View File

@@ -36,8 +36,6 @@ struct cpuinfo_x86 {
char model_name[64];
};
extern struct cpuinfo_x86 boot_cpu_data;
bool has_monitor_cap(void);
bool is_apicv_reg_virtualization_supported(void);
bool is_apicv_intr_delivery_supported(void);
@@ -50,5 +48,6 @@ void init_cpu_model_name(void);
bool check_cpu_security_cap(void);
void cpu_l1d_flush(void);
int detect_hardware_support(void);
struct cpuinfo_x86 *get_cpu_info(void);
#endif /* CPUINFO_H */

View File

@@ -51,8 +51,7 @@
#define CACHE_LINE_SIZE 64U
/* IA32E Paging constants */
#define IA32E_REF_MASK \
(boot_cpu_data.physical_address_mask)
#define IA32E_REF_MASK ((get_cpu_info())->physical_address_mask)
extern uint8_t ld_text_end;