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:
Jiaqing Zhao
2024-08-01 08:06:15 +00:00
committed by acrnsi-robot
parent 65f84d6ae6
commit 5c351bee0f
2 changed files with 15 additions and 2 deletions

View File

@@ -473,7 +473,7 @@ static inline uint16_t dma_frcd_up_sid(uint64_t up_sid)
}
#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_RESERVED 0x01U