mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-25 15:02:13 +00:00
HV: Remove RDT code if CONFIG_RDT_ENABLED flag
is not set This patch does the following, 1. Removes RDT code if CONFIG_RDT_ENABLED flag is not set. 2. Set the CONFIG_RDT_ENABLED flag only on platforms that support RDT so that build scripts will automatically reflect the config. Tracked-On: #3715 Signed-off-by: Yin Fengwei <fengwei.yin@intel.com> Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
d0665fe220
commit
eaad91fd71
@ -7,3 +7,4 @@ CONFIG_PLATFORM_RAM_SIZE=0x200000000
|
|||||||
CONFIG_SOS_RAM_SIZE=0x200000000
|
CONFIG_SOS_RAM_SIZE=0x200000000
|
||||||
CONFIG_UOS_RAM_SIZE=0x200000000
|
CONFIG_UOS_RAM_SIZE=0x200000000
|
||||||
CONFIG_IOMMU_BUS_NUM=0x10
|
CONFIG_IOMMU_BUS_NUM=0x10
|
||||||
|
CONFIG_RDT_ENABLED=n
|
||||||
|
@ -14,8 +14,12 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct dmar_info plat_dmar_info;
|
struct dmar_info plat_dmar_info;
|
||||||
|
|
||||||
|
#ifdef CONFIG_RDT_ENABLED
|
||||||
struct platform_clos_info platform_l2_clos_array[MAX_PLATFORM_CLOS_NUM];
|
struct platform_clos_info platform_l2_clos_array[MAX_PLATFORM_CLOS_NUM];
|
||||||
struct platform_clos_info platform_l3_clos_array[MAX_PLATFORM_CLOS_NUM];
|
struct platform_clos_info platform_l3_clos_array[MAX_PLATFORM_CLOS_NUM];
|
||||||
|
#endif
|
||||||
|
|
||||||
const struct cpu_state_table board_cpu_state_tbl;
|
const struct cpu_state_table board_cpu_state_tbl;
|
||||||
|
|
||||||
const union pci_bdf plat_hidden_pdevs[MAX_HIDDEN_PDEVS_NUM] = {
|
const union pci_bdf plat_hidden_pdevs[MAX_HIDDEN_PDEVS_NUM] = {
|
||||||
|
@ -3,3 +3,4 @@ CONFIG_BOARD="apl-up2"
|
|||||||
CONFIG_SERIAL_PCI=y
|
CONFIG_SERIAL_PCI=y
|
||||||
CONFIG_SERIAL_PCI_BDF="0:18.0"
|
CONFIG_SERIAL_PCI_BDF="0:18.0"
|
||||||
CONFIG_HV_RAM_START=0x5e000000
|
CONFIG_HV_RAM_START=0x5e000000
|
||||||
|
CONFIG_RDT_ENABLED=n
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
struct dmar_info plat_dmar_info;
|
struct dmar_info plat_dmar_info;
|
||||||
|
|
||||||
|
#ifdef CONFIG_RDT_ENABLED
|
||||||
struct platform_clos_info platform_l3_clos_array[MAX_PLATFORM_CLOS_NUM];
|
struct platform_clos_info platform_l3_clos_array[MAX_PLATFORM_CLOS_NUM];
|
||||||
struct platform_clos_info platform_l2_clos_array[MAX_PLATFORM_CLOS_NUM] = {
|
struct platform_clos_info platform_l2_clos_array[MAX_PLATFORM_CLOS_NUM] = {
|
||||||
{
|
{
|
||||||
@ -35,6 +36,7 @@ struct platform_clos_info platform_l2_clos_array[MAX_PLATFORM_CLOS_NUM] = {
|
|||||||
.msr_index = MSR_IA32_L2_MASK_BASE + 3U,
|
.msr_index = MSR_IA32_L2_MASK_BASE + 3U,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
const struct cpu_state_table board_cpu_state_tbl;
|
const struct cpu_state_table board_cpu_state_tbl;
|
||||||
|
|
||||||
|
@ -2,3 +2,4 @@
|
|||||||
CONFIG_BOARD="dnv-cb2"
|
CONFIG_BOARD="dnv-cb2"
|
||||||
CONFIG_SERIAL_LEGACY=y
|
CONFIG_SERIAL_LEGACY=y
|
||||||
CONFIG_SERIAL_PIO_BASE=0x1000
|
CONFIG_SERIAL_PIO_BASE=0x1000
|
||||||
|
CONFIG_RDT_ENABLED=n
|
||||||
|
@ -14,7 +14,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct dmar_info plat_dmar_info;
|
struct dmar_info plat_dmar_info;
|
||||||
|
|
||||||
|
#ifdef CONFIG_RDT_ENABLED
|
||||||
struct platform_clos_info platform_l2_clos_array[MAX_PLATFORM_CLOS_NUM];
|
struct platform_clos_info platform_l2_clos_array[MAX_PLATFORM_CLOS_NUM];
|
||||||
struct platform_clos_info platform_l3_clos_array[MAX_PLATFORM_CLOS_NUM];
|
struct platform_clos_info platform_l3_clos_array[MAX_PLATFORM_CLOS_NUM];
|
||||||
|
#endif
|
||||||
|
|
||||||
const struct cpu_state_table board_cpu_state_tbl;
|
const struct cpu_state_table board_cpu_state_tbl;
|
||||||
const union pci_bdf plat_hidden_pdevs[MAX_HIDDEN_PDEVS_NUM];
|
const union pci_bdf plat_hidden_pdevs[MAX_HIDDEN_PDEVS_NUM];
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
# Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib)
|
# Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib)
|
||||||
CONFIG_BOARD="generic"
|
CONFIG_BOARD="generic"
|
||||||
CONFIG_SERIAL_LEGACY=y
|
CONFIG_SERIAL_LEGACY=y
|
||||||
|
CONFIG_RDT_ENABLED=n
|
||||||
|
@ -14,7 +14,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct dmar_info plat_dmar_info;
|
struct dmar_info plat_dmar_info;
|
||||||
|
|
||||||
|
#ifdef CONFIG_RDT_ENABLED
|
||||||
struct platform_clos_info platform_l2_clos_array[MAX_PLATFORM_CLOS_NUM];
|
struct platform_clos_info platform_l2_clos_array[MAX_PLATFORM_CLOS_NUM];
|
||||||
struct platform_clos_info platform_l3_clos_array[MAX_PLATFORM_CLOS_NUM];
|
struct platform_clos_info platform_l3_clos_array[MAX_PLATFORM_CLOS_NUM];
|
||||||
|
#endif
|
||||||
|
|
||||||
const struct cpu_state_table board_cpu_state_tbl;
|
const struct cpu_state_table board_cpu_state_tbl;
|
||||||
const union pci_bdf plat_hidden_pdevs[MAX_HIDDEN_PDEVS_NUM];
|
const union pci_bdf plat_hidden_pdevs[MAX_HIDDEN_PDEVS_NUM];
|
||||||
|
@ -3,3 +3,4 @@ CONFIG_BOARD="icl-rvp"
|
|||||||
CONFIG_SERIAL_LEGACY=y
|
CONFIG_SERIAL_LEGACY=y
|
||||||
CONFIG_SOS_RAM_SIZE=0x600000000
|
CONFIG_SOS_RAM_SIZE=0x600000000
|
||||||
CONFIG_UOS_RAM_SIZE=0x600000000
|
CONFIG_UOS_RAM_SIZE=0x600000000
|
||||||
|
CONFIG_RDT_ENABLED=n
|
||||||
|
@ -14,7 +14,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct dmar_info plat_dmar_info;
|
struct dmar_info plat_dmar_info;
|
||||||
|
|
||||||
|
#ifdef CONFIG_RDT_ENABLED
|
||||||
struct platform_clos_info platform_l2_clos_array[MAX_PLATFORM_CLOS_NUM];
|
struct platform_clos_info platform_l2_clos_array[MAX_PLATFORM_CLOS_NUM];
|
||||||
struct platform_clos_info platform_l3_clos_array[MAX_PLATFORM_CLOS_NUM];
|
struct platform_clos_info platform_l3_clos_array[MAX_PLATFORM_CLOS_NUM];
|
||||||
|
#endif
|
||||||
|
|
||||||
const struct cpu_state_table board_cpu_state_tbl;
|
const struct cpu_state_table board_cpu_state_tbl;
|
||||||
const union pci_bdf plat_hidden_pdevs[MAX_HIDDEN_PDEVS_NUM];
|
const union pci_bdf plat_hidden_pdevs[MAX_HIDDEN_PDEVS_NUM];
|
||||||
|
@ -5,3 +5,4 @@ CONFIG_BOARD="nuc6cayh"
|
|||||||
CONFIG_SERIAL_PCI=y
|
CONFIG_SERIAL_PCI=y
|
||||||
CONFIG_SERIAL_PCI_BDF="0:18.0"
|
CONFIG_SERIAL_PCI_BDF="0:18.0"
|
||||||
CONFIG_HV_RAM_START=0x20000000
|
CONFIG_HV_RAM_START=0x20000000
|
||||||
|
CONFIG_RDT_ENABLED=n
|
||||||
|
@ -14,7 +14,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct dmar_info plat_dmar_info;
|
struct dmar_info plat_dmar_info;
|
||||||
|
|
||||||
|
#ifdef CONFIG_RDT_ENABLED
|
||||||
struct platform_clos_info platform_l2_clos_array[MAX_PLATFORM_CLOS_NUM];
|
struct platform_clos_info platform_l2_clos_array[MAX_PLATFORM_CLOS_NUM];
|
||||||
struct platform_clos_info platform_l3_clos_array[MAX_PLATFORM_CLOS_NUM];
|
struct platform_clos_info platform_l3_clos_array[MAX_PLATFORM_CLOS_NUM];
|
||||||
|
#endif
|
||||||
|
|
||||||
const struct cpu_state_table board_cpu_state_tbl;
|
const struct cpu_state_table board_cpu_state_tbl;
|
||||||
const union pci_bdf plat_hidden_pdevs[MAX_HIDDEN_PDEVS_NUM];
|
const union pci_bdf plat_hidden_pdevs[MAX_HIDDEN_PDEVS_NUM];
|
||||||
|
@ -2,3 +2,4 @@
|
|||||||
CONFIG_BOARD="nuc7i7dnb"
|
CONFIG_BOARD="nuc7i7dnb"
|
||||||
CONFIG_SERIAL_LEGACY=y
|
CONFIG_SERIAL_LEGACY=y
|
||||||
CONFIG_HV_RAM_START=0x60000000
|
CONFIG_HV_RAM_START=0x60000000
|
||||||
|
CONFIG_RDT_ENABLED=n
|
||||||
|
@ -56,7 +56,10 @@ struct dmar_info plat_dmar_info = {
|
|||||||
.drhd_units = drhd_info_array,
|
.drhd_units = drhd_info_array,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef CONFIG_RDT_ENABLED
|
||||||
struct platform_clos_info platform_l2_clos_array[MAX_PLATFORM_CLOS_NUM];
|
struct platform_clos_info platform_l2_clos_array[MAX_PLATFORM_CLOS_NUM];
|
||||||
struct platform_clos_info platform_l3_clos_array[MAX_PLATFORM_CLOS_NUM];
|
struct platform_clos_info platform_l3_clos_array[MAX_PLATFORM_CLOS_NUM];
|
||||||
|
#endif
|
||||||
|
|
||||||
const struct cpu_state_table board_cpu_state_tbl;
|
const struct cpu_state_table board_cpu_state_tbl;
|
||||||
const union pci_bdf plat_hidden_pdevs[MAX_HIDDEN_PDEVS_NUM];
|
const union pci_bdf plat_hidden_pdevs[MAX_HIDDEN_PDEVS_NUM];
|
||||||
|
@ -262,9 +262,11 @@ void init_pcpu_post(uint16_t pcpu_id)
|
|||||||
|
|
||||||
init_sched(pcpu_id);
|
init_sched(pcpu_id);
|
||||||
|
|
||||||
|
#ifdef CONFIG_RDT_ENABLED
|
||||||
if (!setup_clos(pcpu_id)) {
|
if (!setup_clos(pcpu_id)) {
|
||||||
panic("CLOS resource MSRs setup incorrectly!");
|
panic("CLOS resource MSRs setup incorrectly!");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
enable_smep();
|
enable_smep();
|
||||||
|
|
||||||
|
@ -42,6 +42,7 @@ const uint16_t hv_clos = 0U;
|
|||||||
*/
|
*/
|
||||||
const uint16_t platform_clos_num = MAX_PLATFORM_CLOS_NUM;
|
const uint16_t platform_clos_num = MAX_PLATFORM_CLOS_NUM;
|
||||||
|
|
||||||
|
#ifdef CONFIG_RDT_ENABLED
|
||||||
static void rdt_read_cat_capability(int res)
|
static void rdt_read_cat_capability(int res)
|
||||||
{
|
{
|
||||||
uint32_t eax = 0U, ebx = 0U, ecx = 0U, edx = 0U;
|
uint32_t eax = 0U, ebx = 0U, ecx = 0U, edx = 0U;
|
||||||
@ -158,6 +159,13 @@ uint64_t clos2pqr_msr(uint16_t clos)
|
|||||||
|
|
||||||
return pqr_assoc;
|
return pqr_assoc;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
uint64_t clos2pqr_msr(uint16_t clos)
|
||||||
|
{
|
||||||
|
(void)(clos);
|
||||||
|
return 0UL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
bool is_platform_rdt_capable(void)
|
bool is_platform_rdt_capable(void)
|
||||||
{
|
{
|
||||||
|
@ -20,8 +20,12 @@ struct platform_clos_info {
|
|||||||
};
|
};
|
||||||
|
|
||||||
extern struct dmar_info plat_dmar_info;
|
extern struct dmar_info plat_dmar_info;
|
||||||
|
|
||||||
|
#ifdef CONFIG_RDT_ENABLED
|
||||||
extern struct platform_clos_info platform_l2_clos_array[MAX_PLATFORM_CLOS_NUM];
|
extern struct platform_clos_info platform_l2_clos_array[MAX_PLATFORM_CLOS_NUM];
|
||||||
extern struct platform_clos_info platform_l3_clos_array[MAX_PLATFORM_CLOS_NUM];
|
extern struct platform_clos_info platform_l3_clos_array[MAX_PLATFORM_CLOS_NUM];
|
||||||
|
#endif
|
||||||
|
|
||||||
extern const struct cpu_state_table board_cpu_state_tbl;
|
extern const struct cpu_state_table board_cpu_state_tbl;
|
||||||
extern const union pci_bdf plat_hidden_pdevs[MAX_HIDDEN_PDEVS_NUM];
|
extern const union pci_bdf plat_hidden_pdevs[MAX_HIDDEN_PDEVS_NUM];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user