mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-21 13:08:42 +00:00
hv: vtd: allocate drhd_dev_scope based on board file
Determine the size of drhd_dev_scope based on DRHD_MAX_DEVSCOPE_COUNT in board file instead of hardcoding. The current default value 16 will be used if it is not defined in board file to keep compatibility, a warning will be raised in this case. Tracked-On: #8494 Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com> Reviewed-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
parent
65f84d6ae6
commit
5c351bee0f
@ -473,7 +473,7 @@ static inline uint16_t dma_frcd_up_sid(uint64_t up_sid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define MAX_DRHDS DRHD_COUNT
|
#define MAX_DRHDS DRHD_COUNT
|
||||||
#define MAX_DRHD_DEVSCOPES 16U
|
#define MAX_DRHD_DEVSCOPES DRHD_MAX_DEVSCOPE_COUNT
|
||||||
|
|
||||||
#define DMAR_CONTEXT_TRANSLATION_TYPE_TRANSLATED 0x00U
|
#define DMAR_CONTEXT_TRANSLATION_TYPE_TRANSLATED 0x00U
|
||||||
#define DMAR_CONTEXT_TRANSLATION_TYPE_RESERVED 0x01U
|
#define DMAR_CONTEXT_TRANSLATION_TYPE_RESERVED 0x01U
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
#
|
#
|
||||||
|
|
||||||
|
import logging
|
||||||
|
|
||||||
import board_cfg_lib
|
import board_cfg_lib
|
||||||
import acrn_config_utilities
|
import acrn_config_utilities
|
||||||
|
|
||||||
@ -190,7 +192,7 @@ def drhd_info_parser(config):
|
|||||||
Parse DRHD information
|
Parse DRHD information
|
||||||
:param config: it is a file pointer to write acpi information
|
:param config: it is a file pointer to write acpi information
|
||||||
"""
|
"""
|
||||||
prev_num = 0
|
has_drhd_max_devscope_count = False
|
||||||
|
|
||||||
drhd_lines = board_cfg_lib.get_info(
|
drhd_lines = board_cfg_lib.get_info(
|
||||||
acrn_config_utilities.BOARD_INFO_FILE, "<DRHD_INFO>", "</DRHD_INFO>")
|
acrn_config_utilities.BOARD_INFO_FILE, "<DRHD_INFO>", "</DRHD_INFO>")
|
||||||
@ -200,8 +202,19 @@ def drhd_info_parser(config):
|
|||||||
|
|
||||||
if not drhd_lines:
|
if not drhd_lines:
|
||||||
print("\n#define DRHD_COUNT\t\t8U", file=config)
|
print("\n#define DRHD_COUNT\t\t8U", file=config)
|
||||||
|
print("\n#define DRHD_MAX_DEVSCOPE_COUNT\t16U", file=config)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
for drhd in drhd_lines:
|
||||||
|
if "DRHD_MAX_DEVSCOPE_COUNT" in drhd:
|
||||||
|
has_drhd_max_devscope_count = True
|
||||||
|
break
|
||||||
|
|
||||||
|
if not has_drhd_max_devscope_count:
|
||||||
|
logging.warning("DRHD_MAX_DEVSCOPE_COUNT is not defined in board.xml, using default 16U. "
|
||||||
|
"Generate board.xml with latest board inspector to remove this warning.")
|
||||||
|
print("\n#define DRHD_MAX_DEVSCOPE_COUNT\t16U", file=config)
|
||||||
|
|
||||||
for drhd in drhd_lines:
|
for drhd in drhd_lines:
|
||||||
print(drhd.strip(), file=config)
|
print(drhd.strip(), file=config)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user