Files
acrn-hypervisor/devicemodel/include/rtct.h
Yonghua Huang 154a446c5c dm: build vRTCT of Software SRAM for Post-launch RTVM
This patch prepares vRTCT for post-RTVM instead of
  pass-thru native RTCT:
   - Configurations are based on Service VM native RTCT.
   - Remap vLAPIC IDs in vRTCT.
   - Remap base address of SW SRAM memory regions
     from HPA to GPA.
   - HPA base of Software SRAM shall be parsed from PTCT
     instead of hardcoding.

Tracked-On: #5649
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Reviewed-by: Fei Li <fei1.li@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2021-01-28 11:29:25 +08:00

53 lines
1.2 KiB
C

/*
* Copyright (C) 2020 Intel Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef RTCT_H
#define RTCT_H
#define RTCT_ENTRY_TYPE_PTCD_LIMIT 1U
#define RTCT_ENTRY_TYPE_PTCM_BINARY 2U
#define RTCT_ENTRY_TYPE_WRC_L3_MASKS 3U
#define RTCT_ENTRY_TYPE_GT_L3_MASKS 4U
#define RTCT_ENTRY_TYPE_PSRAM 5U
#define RTCT_ENTRY_TYPE_STREAM_DATAPATH 6U
#define RTCT_ENTRY_TYPE_TIMEAWARE_SUBSYS 7U
#define RTCT_ENTRY_TYPE_RT_IOMMU 8U
#define RTCT_ENTRY_TYPE_MEM_HIERARCHY_LATENCY 9U
/* TODO: Move to high-memory region. */
#define SOFTWARE_SRAM_BASE_HPA 0x40080000UL
#define SOFTWARE_SRAM_BASE_GPA 0x40080000UL
#define SOFTWARE_SRAM_MAX_SIZE 0x00800000UL
struct rtct_entry {
uint16_t size;
uint16_t format;
uint32_t type;
uint32_t data[64];
} __packed;
struct rtct_entry_data_psram {
uint32_t cache_level;
uint64_t base;
uint32_t ways;
uint32_t size;
uint32_t apic_id_tbl[64];
} __packed;
struct rtct_entry_data_mem_hi_latency {
uint32_t hierarchy;
uint32_t clock_cycles;
uint32_t apic_id_tbl[64];
} __packed;
uint64_t get_software_sram_base_hpa(void);
uint64_t get_software_sram_size(void);
uint8_t *build_vrtct(struct vmctx *ctx, void *cfg);
#endif /* RTCT_H */