diff --git a/hypervisor/arch/x86/configs/apl-mrb.config b/hypervisor/arch/x86/configs/apl-mrb.config index 9ced6362b..8e3957cb5 100644 --- a/hypervisor/arch/x86/configs/apl-mrb.config +++ b/hypervisor/arch/x86/configs/apl-mrb.config @@ -7,3 +7,4 @@ CONFIG_PLATFORM_RAM_SIZE=0x200000000 CONFIG_SOS_RAM_SIZE=0x200000000 CONFIG_UOS_RAM_SIZE=0x200000000 CONFIG_IOMMU_BUS_NUM=0x10 +CONFIG_RDT_ENABLED=n diff --git a/hypervisor/arch/x86/configs/apl-mrb/board.c b/hypervisor/arch/x86/configs/apl-mrb/board.c index 39a4fe849..70c937298 100644 --- a/hypervisor/arch/x86/configs/apl-mrb/board.c +++ b/hypervisor/arch/x86/configs/apl-mrb/board.c @@ -14,8 +14,12 @@ #endif 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_l3_clos_array[MAX_PLATFORM_CLOS_NUM]; +#endif + const struct cpu_state_table board_cpu_state_tbl; const union pci_bdf plat_hidden_pdevs[MAX_HIDDEN_PDEVS_NUM] = { diff --git a/hypervisor/arch/x86/configs/apl-up2.config b/hypervisor/arch/x86/configs/apl-up2.config index 736010f36..514637391 100644 --- a/hypervisor/arch/x86/configs/apl-up2.config +++ b/hypervisor/arch/x86/configs/apl-up2.config @@ -3,3 +3,4 @@ CONFIG_BOARD="apl-up2" CONFIG_SERIAL_PCI=y CONFIG_SERIAL_PCI_BDF="0:18.0" CONFIG_HV_RAM_START=0x5e000000 +CONFIG_RDT_ENABLED=n diff --git a/hypervisor/arch/x86/configs/apl-up2/board.c b/hypervisor/arch/x86/configs/apl-up2/board.c index 88789767f..8ab72dbe7 100644 --- a/hypervisor/arch/x86/configs/apl-up2/board.c +++ b/hypervisor/arch/x86/configs/apl-up2/board.c @@ -16,6 +16,7 @@ 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_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, }, }; +#endif const struct cpu_state_table board_cpu_state_tbl; diff --git a/hypervisor/arch/x86/configs/dnv-cb2.config b/hypervisor/arch/x86/configs/dnv-cb2.config index d90be1e28..8b3ea4b4c 100644 --- a/hypervisor/arch/x86/configs/dnv-cb2.config +++ b/hypervisor/arch/x86/configs/dnv-cb2.config @@ -2,3 +2,4 @@ CONFIG_BOARD="dnv-cb2" CONFIG_SERIAL_LEGACY=y CONFIG_SERIAL_PIO_BASE=0x1000 +CONFIG_RDT_ENABLED=n diff --git a/hypervisor/arch/x86/configs/dnv-cb2/board.c b/hypervisor/arch/x86/configs/dnv-cb2/board.c index b87453bc2..c877990a8 100644 --- a/hypervisor/arch/x86/configs/dnv-cb2/board.c +++ b/hypervisor/arch/x86/configs/dnv-cb2/board.c @@ -14,7 +14,11 @@ #endif 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_l3_clos_array[MAX_PLATFORM_CLOS_NUM]; +#endif + const struct cpu_state_table board_cpu_state_tbl; const union pci_bdf plat_hidden_pdevs[MAX_HIDDEN_PDEVS_NUM]; diff --git a/hypervisor/arch/x86/configs/generic.config b/hypervisor/arch/x86/configs/generic.config index 44c8da457..5824a4ace 100644 --- a/hypervisor/arch/x86/configs/generic.config +++ b/hypervisor/arch/x86/configs/generic.config @@ -1,3 +1,4 @@ # Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib) CONFIG_BOARD="generic" CONFIG_SERIAL_LEGACY=y +CONFIG_RDT_ENABLED=n diff --git a/hypervisor/arch/x86/configs/generic/board.c b/hypervisor/arch/x86/configs/generic/board.c index b87453bc2..c877990a8 100644 --- a/hypervisor/arch/x86/configs/generic/board.c +++ b/hypervisor/arch/x86/configs/generic/board.c @@ -14,7 +14,11 @@ #endif 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_l3_clos_array[MAX_PLATFORM_CLOS_NUM]; +#endif + const struct cpu_state_table board_cpu_state_tbl; const union pci_bdf plat_hidden_pdevs[MAX_HIDDEN_PDEVS_NUM]; diff --git a/hypervisor/arch/x86/configs/icl-rvp.config b/hypervisor/arch/x86/configs/icl-rvp.config index 108caa028..e84ba7202 100644 --- a/hypervisor/arch/x86/configs/icl-rvp.config +++ b/hypervisor/arch/x86/configs/icl-rvp.config @@ -3,3 +3,4 @@ CONFIG_BOARD="icl-rvp" CONFIG_SERIAL_LEGACY=y CONFIG_SOS_RAM_SIZE=0x600000000 CONFIG_UOS_RAM_SIZE=0x600000000 +CONFIG_RDT_ENABLED=n diff --git a/hypervisor/arch/x86/configs/icl-rvp/board.c b/hypervisor/arch/x86/configs/icl-rvp/board.c index b87453bc2..c877990a8 100644 --- a/hypervisor/arch/x86/configs/icl-rvp/board.c +++ b/hypervisor/arch/x86/configs/icl-rvp/board.c @@ -14,7 +14,11 @@ #endif 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_l3_clos_array[MAX_PLATFORM_CLOS_NUM]; +#endif + const struct cpu_state_table board_cpu_state_tbl; const union pci_bdf plat_hidden_pdevs[MAX_HIDDEN_PDEVS_NUM]; diff --git a/hypervisor/arch/x86/configs/nuc6cayh.config b/hypervisor/arch/x86/configs/nuc6cayh.config index 147e9ecea..6ce5c84e5 100644 --- a/hypervisor/arch/x86/configs/nuc6cayh.config +++ b/hypervisor/arch/x86/configs/nuc6cayh.config @@ -5,3 +5,4 @@ CONFIG_BOARD="nuc6cayh" CONFIG_SERIAL_PCI=y CONFIG_SERIAL_PCI_BDF="0:18.0" CONFIG_HV_RAM_START=0x20000000 +CONFIG_RDT_ENABLED=n diff --git a/hypervisor/arch/x86/configs/nuc6cayh/board.c b/hypervisor/arch/x86/configs/nuc6cayh/board.c index b87453bc2..c877990a8 100644 --- a/hypervisor/arch/x86/configs/nuc6cayh/board.c +++ b/hypervisor/arch/x86/configs/nuc6cayh/board.c @@ -14,7 +14,11 @@ #endif 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_l3_clos_array[MAX_PLATFORM_CLOS_NUM]; +#endif + const struct cpu_state_table board_cpu_state_tbl; const union pci_bdf plat_hidden_pdevs[MAX_HIDDEN_PDEVS_NUM]; diff --git a/hypervisor/arch/x86/configs/nuc7i7dnb.config b/hypervisor/arch/x86/configs/nuc7i7dnb.config index 53a32889d..3dd57ec45 100644 --- a/hypervisor/arch/x86/configs/nuc7i7dnb.config +++ b/hypervisor/arch/x86/configs/nuc7i7dnb.config @@ -2,3 +2,4 @@ CONFIG_BOARD="nuc7i7dnb" CONFIG_SERIAL_LEGACY=y CONFIG_HV_RAM_START=0x60000000 +CONFIG_RDT_ENABLED=n diff --git a/hypervisor/arch/x86/configs/nuc7i7dnb/board.c b/hypervisor/arch/x86/configs/nuc7i7dnb/board.c index 612635195..c7ef59918 100644 --- a/hypervisor/arch/x86/configs/nuc7i7dnb/board.c +++ b/hypervisor/arch/x86/configs/nuc7i7dnb/board.c @@ -56,7 +56,10 @@ struct dmar_info plat_dmar_info = { .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_l3_clos_array[MAX_PLATFORM_CLOS_NUM]; +#endif + const struct cpu_state_table board_cpu_state_tbl; const union pci_bdf plat_hidden_pdevs[MAX_HIDDEN_PDEVS_NUM]; diff --git a/hypervisor/arch/x86/cpu.c b/hypervisor/arch/x86/cpu.c index c05cbed31..7288e663d 100644 --- a/hypervisor/arch/x86/cpu.c +++ b/hypervisor/arch/x86/cpu.c @@ -262,9 +262,11 @@ void init_pcpu_post(uint16_t pcpu_id) init_sched(pcpu_id); +#ifdef CONFIG_RDT_ENABLED if (!setup_clos(pcpu_id)) { panic("CLOS resource MSRs setup incorrectly!"); } +#endif enable_smep(); diff --git a/hypervisor/arch/x86/rdt.c b/hypervisor/arch/x86/rdt.c index a002b56fe..08123534d 100644 --- a/hypervisor/arch/x86/rdt.c +++ b/hypervisor/arch/x86/rdt.c @@ -42,6 +42,7 @@ const uint16_t hv_clos = 0U; */ const uint16_t platform_clos_num = MAX_PLATFORM_CLOS_NUM; +#ifdef CONFIG_RDT_ENABLED static void rdt_read_cat_capability(int res) { uint32_t eax = 0U, ebx = 0U, ecx = 0U, edx = 0U; @@ -158,6 +159,13 @@ uint64_t clos2pqr_msr(uint16_t clos) return pqr_assoc; } +#else +uint64_t clos2pqr_msr(uint16_t clos) +{ + (void)(clos); + return 0UL; +} +#endif bool is_platform_rdt_capable(void) { diff --git a/hypervisor/include/arch/x86/board.h b/hypervisor/include/arch/x86/board.h index aea17e9ad..c9415e04e 100644 --- a/hypervisor/include/arch/x86/board.h +++ b/hypervisor/include/arch/x86/board.h @@ -20,8 +20,12 @@ struct platform_clos_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_l3_clos_array[MAX_PLATFORM_CLOS_NUM]; +#endif + extern const struct cpu_state_table board_cpu_state_tbl; extern const union pci_bdf plat_hidden_pdevs[MAX_HIDDEN_PDEVS_NUM];