HV Cx: load cx data to boot_cpu_data when boot

The cx data is hardcoded within HV, load it to boot_cpu_data when HV boot.
The patch provide a3960 soc cx data for example.

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
This commit is contained in:
Victor Sun
2018-04-17 13:52:00 +08:00
committed by Jack Ren
parent d63b9002dd
commit 373a828058
3 changed files with 56 additions and 4 deletions

View File

@@ -236,8 +236,10 @@ enum feature_word {
};
struct cpu_state_info {
uint8_t px_cnt;
uint8_t px_cnt; /* count of all Px states */
struct cpu_px_data *px_data;
uint8_t cx_cnt; /* count of all Cx entries */
struct cpu_cx_data *cx_data;
};
struct cpuinfo_x86 {
@@ -254,7 +256,13 @@ struct cpuinfo_x86 {
extern struct cpuinfo_x86 boot_cpu_data;
#define MAX_PSTATE 20
#define MAX_PSTATE 20 /* max num of supported Px count */
#define MAX_CSTATE 8 /* max num of supported Cx count */
/* We support MAX_CSTATE num of Cx, means have (MAX_CSTATE - 1) Cx entries,
* i.e. supported Cx entry index range from 1 to MAX_CX_ENTRY.
*/
#define MAX_CX_ENTRY (MAX_CSTATE - 1)
/* Function prototypes */
void cpu_dead(uint32_t logical_id);

View File

@@ -292,6 +292,30 @@ struct acrn_vm_pci_msix_remap {
* @brief Info The power state data of a VCPU.
*
*/
#define SPACE_SYSTEM_MEMORY 0
#define SPACE_SYSTEM_IO 1
#define SPACE_PCI_CONFIG 2
#define SPACE_Embedded_Control 3
#define SPACE_SMBUS 4
#define SPACE_PLATFORM_COMM 10
#define SPACE_FFixedHW 0x7F
struct acrn_register {
uint8_t space_id;
uint8_t bit_width;
uint8_t bit_offset;
uint8_t access_size;
uint64_t address;
} __attribute__((aligned(8)));
struct cpu_cx_data {
struct acrn_register cx_reg;
uint8_t type;
uint32_t latency;
uint64_t power;
} __attribute__((aligned(8)));
struct cpu_px_data {
uint64_t core_frequency; /* megahertz */
uint64_t power; /* milliWatts */