acrn-config: remap PCI vbar address to high memory

1. If the device configure space is not fixed by ACPI and its pbar address
is above 4G or lower than 2G, then remap the vbar address to high memory.
2. Due to GPU might have huge MMIO space which would result in
HV_RAM_SIZE overflow, skip its vBAR remapping for now when the size high
than 1GB.

Tracked-On: #4458
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
This commit is contained in:
Wei Liu
2020-03-06 11:04:46 +08:00
committed by wenlingz
parent 830df76f1e
commit 91b06a35ee
3 changed files with 141 additions and 41 deletions

View File

@@ -39,6 +39,11 @@ KNOWN_HIDDEN_PDEVS_BOARD_DB = {
'apl-up2':['00:0d:0'],
}
SIZE_K = common.SIZE_K
SIZE_M = common.SIZE_M
SIZE_2G = common.SIZE_2G
SIZE_4G = common.SIZE_4G
def prepare(check_git):
""" check environment """
@@ -433,3 +438,8 @@ def undline_name(name):
:return: name_str which contain'_'
"""
return common.undline_name(name)
def round_up(addr, mem_align):
"""Keep memory align"""
return common.round_up(addr, mem_align)

View File

@@ -25,6 +25,11 @@ START_HPA_SIZE_LIST = ['0x20000000', '0x40000000', '0x80000000', 'CONFIG_SOS_RAM
MULTI_ITEM = ["guest_flag", "pcpu_id", "input", "block", "network"]
SIZE_K = 1024
SIZE_M = SIZE_K * 1024
SIZE_2G = 2 * SIZE_M * SIZE_K
SIZE_4G = 2 * SIZE_2G
class MultiItem():
@@ -681,3 +686,8 @@ def get_vuart_info_id(config_file, idx):
vm_id += 1
return tmp_tag
def round_up(addr, mem_align):
"""Keep memory align"""
return ((addr + (mem_align - 1)) & (~(mem_align - 1)))