hv: vapic: add mcfg table support

Add MCFG table support to allow guest access PCIe external CFG space by ECAM

Tracked-On: #4623
Signed-off-by: Li Fei1 <fei1.li@intel.com>
This commit is contained in:
Li Fei1
2020-04-14 15:36:26 +08:00
committed by wenlingz
parent 4eb3f5a0c7
commit 1dccbdbaa2
4 changed files with 53 additions and 9 deletions

View File

@@ -36,6 +36,7 @@
* XSDT -> 0xf2480 (36 bytes + 8*7 table addrs, 4 used)
* FADT -> 0xf2500 (244 bytes fixed for ACPI 2.0)
* DSDT -> 0xf2600 (36 bytes fixed for an empty DSDT)
* MCFG -> 0xf2700 (36 bytes fixed + 8 bytes reserved + 1 * 16 bytes)
* MADT -> 0xf2740 (depends on #CPUs)
*/
#define ACPI_BASE 0xf2400U
@@ -44,12 +45,16 @@
#define ACPI_XSDT_ADDR (ACPI_BASE + 0x080U)
#define ACPI_FADT_ADDR (ACPI_BASE + 0x100U)
#define ACPI_DSDT_ADDR (ACPI_BASE + 0x200U)
#define ACPI_MCFG_ADDR (ACPI_BASE + 0x300U)
#define ACPI_MADT_ADDR (ACPI_BASE + 0x340U)
#define ACPI_OEM_ID "ACRN "
#define ACPI_ASL_COMPILER_ID "INTL"
#define ACPI_ASL_COMPILER_VERSION 0x20190802U
/* virtual PCI MMCFG address base for pre/post-launched VM. */
#define VIRT_PCI_MMCFG_BASE 0xE0000000UL
struct acrn_vm;
struct acpi_table_info {
struct acpi_table_rsdp rsdp;
@@ -58,6 +63,8 @@ struct acpi_table_info {
struct {
struct acpi_table_fadt fadt;
struct acpi_table_header dsdt; /* an empty DSDT */
struct acpi_table_mcfg mcfg;
struct acpi_mcfg_allocation mcfg_entry; /* mcfg_entry msut be declared fellowing mcfg */
struct acpi_table_madt madt;
struct acpi_madt_local_apic_nmi lapic_nmi;
struct acpi_madt_local_apic lapic_array[MAX_PCPU_NUM];