diff --git a/hypervisor/arch/x86/configs/apl-mrb/board.c b/hypervisor/arch/x86/configs/apl-mrb/board.c index a3cac5953..fed30e6fc 100644 --- a/hypervisor/arch/x86/configs/apl-mrb/board.c +++ b/hypervisor/arch/x86/configs/apl-mrb/board.c @@ -6,6 +6,7 @@ #include #include +#include #ifndef CONFIG_ACPI_PARSE_ENABLED #error "DMAR info is not available, please set ACPI_PARSE_ENABLED to y in Kconfig. \ @@ -15,3 +16,4 @@ struct dmar_info plat_dmar_info; struct platform_clos_info platform_clos_array[MAX_PLATFORM_CLOS_NUM]; 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-mrb/misc_cfg.h b/hypervisor/arch/x86/configs/apl-mrb/misc_cfg.h index bb3cbdd29..32069b7a8 100644 --- a/hypervisor/arch/x86/configs/apl-mrb/misc_cfg.h +++ b/hypervisor/arch/x86/configs/apl-mrb/misc_cfg.h @@ -41,4 +41,6 @@ "cma=64M@0- " \ "panic_print=0x1f" +#define MAX_HIDDEN_PDEVS_NUM 0U + #endif /* MISC_CFG_H */ diff --git a/hypervisor/arch/x86/configs/apl-up2/board.c b/hypervisor/arch/x86/configs/apl-up2/board.c index ad5e51a94..bdd974839 100644 --- a/hypervisor/arch/x86/configs/apl-up2/board.c +++ b/hypervisor/arch/x86/configs/apl-up2/board.c @@ -7,6 +7,7 @@ #include #include #include +#include #ifndef CONFIG_ACPI_PARSE_ENABLED #error "DMAR info is not available, please set ACPI_PARSE_ENABLED to y in Kconfig. \ @@ -35,3 +36,11 @@ struct platform_clos_info platform_clos_array[MAX_PLATFORM_CLOS_NUM] = { }; const struct cpu_state_table board_cpu_state_tbl; + +const union pci_bdf plat_hidden_pdevs[MAX_HIDDEN_PDEVS_NUM] = { + { + .bits.b = 0x0, + .bits.d = 0xd, + .bits.f = 0x0, + }, +}; diff --git a/hypervisor/arch/x86/configs/apl-up2/misc_cfg.h b/hypervisor/arch/x86/configs/apl-up2/misc_cfg.h index 655b6dad6..77dc2101d 100644 --- a/hypervisor/arch/x86/configs/apl-up2/misc_cfg.h +++ b/hypervisor/arch/x86/configs/apl-up2/misc_cfg.h @@ -37,4 +37,6 @@ "i915.enable_guc=0x02 " \ "cma=64M@0- " +#define MAX_HIDDEN_PDEVS_NUM 1U + #endif /* MISC_CFG_H */ diff --git a/hypervisor/arch/x86/configs/dnv-cb2/board.c b/hypervisor/arch/x86/configs/dnv-cb2/board.c index a3cac5953..fed30e6fc 100644 --- a/hypervisor/arch/x86/configs/dnv-cb2/board.c +++ b/hypervisor/arch/x86/configs/dnv-cb2/board.c @@ -6,6 +6,7 @@ #include #include +#include #ifndef CONFIG_ACPI_PARSE_ENABLED #error "DMAR info is not available, please set ACPI_PARSE_ENABLED to y in Kconfig. \ @@ -15,3 +16,4 @@ struct dmar_info plat_dmar_info; struct platform_clos_info platform_clos_array[MAX_PLATFORM_CLOS_NUM]; 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/dnv-cb2/misc_cfg.h b/hypervisor/arch/x86/configs/dnv-cb2/misc_cfg.h index 8630b4282..453c0dc47 100644 --- a/hypervisor/arch/x86/configs/dnv-cb2/misc_cfg.h +++ b/hypervisor/arch/x86/configs/dnv-cb2/misc_cfg.h @@ -26,4 +26,6 @@ #define SOS_BOOTARGS_DIFF "" #endif +#define MAX_HIDDEN_PDEVS_NUM 0U + #endif /* MISC_CFG_H */ diff --git a/hypervisor/arch/x86/configs/generic/board.c b/hypervisor/arch/x86/configs/generic/board.c index a3cac5953..fed30e6fc 100644 --- a/hypervisor/arch/x86/configs/generic/board.c +++ b/hypervisor/arch/x86/configs/generic/board.c @@ -6,6 +6,7 @@ #include #include +#include #ifndef CONFIG_ACPI_PARSE_ENABLED #error "DMAR info is not available, please set ACPI_PARSE_ENABLED to y in Kconfig. \ @@ -15,3 +16,4 @@ struct dmar_info plat_dmar_info; struct platform_clos_info platform_clos_array[MAX_PLATFORM_CLOS_NUM]; 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/misc_cfg.h b/hypervisor/arch/x86/configs/generic/misc_cfg.h index 622205d26..baca80fe1 100644 --- a/hypervisor/arch/x86/configs/generic/misc_cfg.h +++ b/hypervisor/arch/x86/configs/generic/misc_cfg.h @@ -27,4 +27,6 @@ #define SOS_BOOTARGS_DIFF "" #endif +#define MAX_HIDDEN_PDEVS_NUM 0U + #endif /* MISC_CFG_H */ diff --git a/hypervisor/arch/x86/configs/icl-rvp/board.c b/hypervisor/arch/x86/configs/icl-rvp/board.c index a3cac5953..fed30e6fc 100644 --- a/hypervisor/arch/x86/configs/icl-rvp/board.c +++ b/hypervisor/arch/x86/configs/icl-rvp/board.c @@ -6,6 +6,7 @@ #include #include +#include #ifndef CONFIG_ACPI_PARSE_ENABLED #error "DMAR info is not available, please set ACPI_PARSE_ENABLED to y in Kconfig. \ @@ -15,3 +16,4 @@ struct dmar_info plat_dmar_info; struct platform_clos_info platform_clos_array[MAX_PLATFORM_CLOS_NUM]; 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/board.c b/hypervisor/arch/x86/configs/nuc6cayh/board.c index a3cac5953..fed30e6fc 100644 --- a/hypervisor/arch/x86/configs/nuc6cayh/board.c +++ b/hypervisor/arch/x86/configs/nuc6cayh/board.c @@ -6,6 +6,7 @@ #include #include +#include #ifndef CONFIG_ACPI_PARSE_ENABLED #error "DMAR info is not available, please set ACPI_PARSE_ENABLED to y in Kconfig. \ @@ -15,3 +16,4 @@ struct dmar_info plat_dmar_info; struct platform_clos_info platform_clos_array[MAX_PLATFORM_CLOS_NUM]; 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/misc_cfg.h b/hypervisor/arch/x86/configs/nuc6cayh/misc_cfg.h index ec2955b4a..adab8833c 100644 --- a/hypervisor/arch/x86/configs/nuc6cayh/misc_cfg.h +++ b/hypervisor/arch/x86/configs/nuc6cayh/misc_cfg.h @@ -26,4 +26,6 @@ #define SOS_BOOTARGS_DIFF "" #endif +#define MAX_HIDDEN_PDEVS_NUM 0U + #endif /* MISC_CFG_H */ diff --git a/hypervisor/arch/x86/configs/nuc7i7dnb/board.c b/hypervisor/arch/x86/configs/nuc7i7dnb/board.c index 5951121c3..096fb883c 100644 --- a/hypervisor/arch/x86/configs/nuc7i7dnb/board.c +++ b/hypervisor/arch/x86/configs/nuc7i7dnb/board.c @@ -6,6 +6,7 @@ #include #include +#include static struct dmar_dev_scope drhd0_dev_scope[DRHD0_DEV_CNT] = { { @@ -57,3 +58,4 @@ struct dmar_info plat_dmar_info = { struct platform_clos_info platform_clos_array[MAX_PLATFORM_CLOS_NUM]; 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/misc_cfg.h b/hypervisor/arch/x86/configs/nuc7i7dnb/misc_cfg.h index 5e23727c9..c753586dd 100644 --- a/hypervisor/arch/x86/configs/nuc7i7dnb/misc_cfg.h +++ b/hypervisor/arch/x86/configs/nuc7i7dnb/misc_cfg.h @@ -27,4 +27,6 @@ #define SOS_BOOTARGS_DIFF "" #endif +#define MAX_HIDDEN_PDEVS_NUM 0U + #endif /* MISC_CFG_H */ diff --git a/hypervisor/hw/pci.c b/hypervisor/hw/pci.c index b5de9a31c..3c2b441a8 100644 --- a/hypervisor/hw/pci.c +++ b/hypervisor/hw/pci.c @@ -202,7 +202,7 @@ void enable_disable_pci_intx(union pci_bdf bdf, bool enable) } } -static bool is_hidden_pdev(union pci_bdf pbdf) +static bool is_hv_owned_pdev(union pci_bdf pbdf) { bool hidden = false; /* if it is debug uart, hide it*/ @@ -216,7 +216,7 @@ static bool is_hidden_pdev(union pci_bdf pbdf) static void pci_init_pdev(union pci_bdf pbdf, uint32_t drhd_index) { - if (!is_hidden_pdev(pbdf)) { + if (!is_hv_owned_pdev(pbdf)) { init_pdev(pbdf.value, drhd_index); } } diff --git a/hypervisor/include/arch/x86/board.h b/hypervisor/include/arch/x86/board.h index cab5069be..b10a0ff0e 100644 --- a/hypervisor/include/arch/x86/board.h +++ b/hypervisor/include/arch/x86/board.h @@ -9,6 +9,7 @@ #include #include #include +#include /* forward declarations */ struct acrn_vm; @@ -21,6 +22,7 @@ struct platform_clos_info { extern struct dmar_info plat_dmar_info; extern struct platform_clos_info platform_clos_array[MAX_PLATFORM_CLOS_NUM]; extern const struct cpu_state_table board_cpu_state_tbl; +extern const union pci_bdf plat_hidden_pdevs[MAX_HIDDEN_PDEVS_NUM]; /* board specific functions */ void create_prelaunched_vm_e820(struct acrn_vm *vm); diff --git a/hypervisor/include/hw/pci.h b/hypervisor/include/hw/pci.h index 87d9053f8..39537d260 100644 --- a/hypervisor/include/hw/pci.h +++ b/hypervisor/include/hw/pci.h @@ -320,5 +320,4 @@ static inline bool is_pci_cfg_bridge(uint8_t header_type) bool pdev_need_bar_restore(const struct pci_pdev *pdev); void pdev_restore_bar(const struct pci_pdev *pdev); - #endif /* PCI_H_ */