Files
acrn-hypervisor/misc/config_tools/acpi_gen/acpi_const.py
Junjie Mao d2543720a5 config_tools: adjust the layout of vACPI images
The current vACPI image layout reserves 512 bytes for vDSDT. Given the fact
that the size of vDSDT of a pre-launched VM grows when more devices are
assigned to the VM, this size limit can be easily exceeded. As an example,
a single pass-through TSN NIC requires 291 bytes in vDSDT to define device
objects representing its PCS (Physical Coding Sublayer), which means the
current reserved space for vDSDT does not allow two TSN NICs to be assigned
to the same VM.

This patch enlarges the reserved space for vDSDT to 2432 bytes by moving
the MCFG and MADT spaces. 768 bytes are still reserved for MADT which
is sufficient to encode the LAPIC information for more than 64 vCPUs.

This patch is added in v2 of the series.

Tracked-On: #6287
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-08-09 09:05:01 +08:00

54 lines
1.8 KiB
Python

# Copyright (C) 2019 Intel Corporation.
# SPDX-License-Identifier: BSD-3-Clause
"""constant for offline ACPI generator.
"""
import os, sys
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'library'))
import common
VM_CONFIGS_PATH = os.path.join(common.SOURCE_ROOT_DIR, 'misc', 'config_tools')
TEMPLATE_ACPI_PATH = os.path.join(VM_CONFIGS_PATH, 'acpi_template', 'template')
ACPI_TABLE_LIST = [('rsdp.asl', 'rsdp.aml'), ('xsdt.asl', 'xsdt.aml'), ('facp.asl', 'facp.aml'),
('mcfg.asl', 'mcfg.aml'), ('apic.asl', 'apic.aml'), ('tpm2.asl', 'tpm2.aml'),
('dsdt.aml', 'dsdt.aml'), ('PTCT', 'ptct.aml'), ('RTCT', 'rtct.aml')]
ACPI_BASE = 0x7ff00000
ACPI_RSDP_ADDR_OFFSET = 0x0 # (36 bytes fixed)
ACPI_XSDT_ADDR_OFFSET = 0x80 # (36 bytes + 8*7 table addrs)
ACPI_FADT_ADDR_OFFSET = 0x100 # (268 bytes)
ACPI_DSDT_ADDR_OFFSET = 0x240 # (variable)
ACPI_MCFG_ADDR_OFFSET = 0xBC0 # (60 bytes)
ACPI_MADT_ADDR_OFFSET = 0xC00 # (62 + 8*n bytes, where n is the number of vCPUs)
ACPI_RTCT_ADDR_OFFSET = 0xF00
ACPI_TPM2_ADDR_OFFSET = 0x1300 # (52 bytes)
ACPI_RSDP_ADDR = (ACPI_BASE + ACPI_RSDP_ADDR_OFFSET)
ACPI_XSDT_ADDR = (ACPI_BASE + ACPI_XSDT_ADDR_OFFSET)
ACPI_FADT_ADDR = (ACPI_BASE + ACPI_FADT_ADDR_OFFSET)
ACPI_MCFG_ADDR = (ACPI_BASE + ACPI_MCFG_ADDR_OFFSET)
ACPI_MADT_ADDR = (ACPI_BASE + ACPI_MADT_ADDR_OFFSET)
ACPI_TPM2_ADDR = (ACPI_BASE + ACPI_TPM2_ADDR_OFFSET)
ACPI_DSDT_ADDR = (ACPI_BASE + ACPI_DSDT_ADDR_OFFSET)
ACPI_RTCT_ADDR = (ACPI_BASE + ACPI_RTCT_ADDR_OFFSET)
ACPI_FACS_ADDR = 0x0
VIRT_PCI_MMCFG_BASE = 0xE0000000
ACPI_MADT_TYPE_IOAPIC = 1
VIOAPIC_BASE = 0xFEC00000
ACPI_MADT_TYPE_LOCAL_APIC = 0
ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4
TSN_DEVICE_LIST = ['8086:4ba0',
'8086:4bb0',
'8086:4b32']
RTCT = ['RTCT', 'PTCT']