2021-01-26 13:31:35 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2020 Intel Corporation. All rights reserved.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef RTCT_H
|
|
|
|
#define RTCT_H
|
|
|
|
|
2021-05-27 09:14:33 +08:00
|
|
|
/*Entry IDs for RTCT version 2*/
|
|
|
|
#define RTCT_V2_COMPATIBILITY 0U
|
|
|
|
#define RTCT_V2_RTCD_LIMIT 1U
|
|
|
|
#define RTCT_V2_CRL_BINARY 2U
|
|
|
|
#define RTCT_V2_IA_WAYMASK 3U
|
|
|
|
#define RTCT_V2_WRC_WAYMASK 4U
|
|
|
|
#define RTCT_V2_GT_WAYMASK 5U
|
|
|
|
#define RTCT_V2_SSRAM_WAYMASK 6U
|
|
|
|
#define RTCT_V2_SSRAM 7U
|
|
|
|
#define RTCT_V2_MEMORY_HIERARCHY_LATENCY 8U
|
|
|
|
#define RTCT_V2_ERROR_LOG_ADDRESS 9U
|
|
|
|
|
2021-01-26 15:16:25 +08:00
|
|
|
struct rtct_entry {
|
|
|
|
uint16_t size;
|
2021-05-25 09:46:58 +08:00
|
|
|
uint16_t format_version;
|
2021-01-26 15:16:25 +08:00
|
|
|
uint32_t type;
|
|
|
|
uint32_t data[64];
|
|
|
|
} __packed;
|
|
|
|
|
2021-05-27 09:14:33 +08:00
|
|
|
struct rtct_entry_data_compatibility {
|
2022-01-10 11:55:15 +08:00
|
|
|
uint32_t rtct_ver_major;
|
|
|
|
uint32_t rtct_ver_minor;
|
|
|
|
uint32_t rtcd_ver_major;
|
|
|
|
uint32_t rtcd_ver_Minor;
|
2021-05-27 09:14:33 +08:00
|
|
|
} __packed;
|
|
|
|
|
2022-01-06 21:57:34 +08:00
|
|
|
struct rtct_entry_data_ssram_waymask {
|
|
|
|
uint32_t cache_level;
|
|
|
|
uint32_t cache_id;
|
|
|
|
uint32_t waymask;
|
|
|
|
} __packed;
|
|
|
|
|
2021-05-27 09:14:33 +08:00
|
|
|
struct rtct_entry_data_ssram_v2 {
|
|
|
|
uint32_t cache_level;
|
|
|
|
uint32_t cache_id;
|
|
|
|
uint64_t base;
|
|
|
|
uint32_t size;
|
|
|
|
uint32_t shared;
|
|
|
|
} __packed;
|
|
|
|
|
2022-01-10 11:55:15 +08:00
|
|
|
uint64_t get_vssram_gpa_base(void);
|
|
|
|
uint64_t get_vssram_size(void);
|
2022-01-06 11:08:06 +08:00
|
|
|
uint8_t *get_vssram_vrtct(void);
|
dm: parse bootargs of vssram regions
1) With this patch, '--ssram' option is updated to enable
vSSRAM feature support for ACRN user VMs.
'--ssram' argument of Device Model shall follow below format:
--ssram {Ln,vcpu=vcpu_set,size=nK|M;}
example:
--ssram L2,vcpu=0,1,size=4K;L2,vcpu=2,3,size=1M;L3,vcpu=all,size=2M
2) define data structure and variable
to store the configuration data for later processing.
3) add new API to cleanup configuration data when VM shutdown.
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
2022-01-06 12:32:29 +08:00
|
|
|
void clean_vssram_configs(void);
|
2022-01-06 11:08:06 +08:00
|
|
|
int init_vssram(struct vmctx *ctx);
|
2022-01-06 22:27:43 +08:00
|
|
|
void deinit_vssram(struct vmctx *ctx);
|
dm: parse bootargs of vssram regions
1) With this patch, '--ssram' option is updated to enable
vSSRAM feature support for ACRN user VMs.
'--ssram' argument of Device Model shall follow below format:
--ssram {Ln,vcpu=vcpu_set,size=nK|M;}
example:
--ssram L2,vcpu=0,1,size=4K;L2,vcpu=2,3,size=1M;L3,vcpu=all,size=2M
2) define data structure and variable
to store the configuration data for later processing.
3) add new API to cleanup configuration data when VM shutdown.
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
2022-01-06 12:32:29 +08:00
|
|
|
int parse_vssram_buf_params(const char *opt);
|
2021-01-26 15:16:25 +08:00
|
|
|
|
2021-01-26 13:31:35 +08:00
|
|
|
#endif /* RTCT_H */
|