mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-24 18:27:18 +00:00
dm: verify the "iasl" version
This patch does: - define IASL_MIN_VER in the top-level Makefile and pass it Device Model - verify the "iasl" version at run time if "iasl" version is older than IASL_MIN_VER, refuse to launch the post-launched VM and exit directly. Tracked-On: #7880 Signed-off-by: Shiqing Gao <shiqing.gao@intel.com> Acked-by: Wang, Yu1 <yu1.wang@intel.com>
This commit is contained in:
committed by
acrnsi-robot
parent
cc309bd973
commit
59b6d7b404
@@ -96,6 +96,9 @@
|
||||
#define ASL_TEMPLATE "dm.XXXXXXX"
|
||||
#define ASL_SUFFIX ".aml"
|
||||
|
||||
#define ASL_VER_PATTERN "ASL+ Optimizing Compiler/Disassembler version "
|
||||
#define ASL_VER_STR_LEN 256
|
||||
|
||||
static char asl_compiler[MAXPATHLEN] = {0};
|
||||
|
||||
uint64_t audio_nhlt_len = 0;
|
||||
@@ -1150,6 +1153,39 @@ acrn_parse_iasl(char *arg)
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
check_iasl_version(void)
|
||||
{
|
||||
int ret = -1;
|
||||
static char cmd_iasl_ver[MAXPATHLEN + 10];
|
||||
static char buf[ASL_VER_STR_LEN];
|
||||
char *ver_str, *cp;
|
||||
uint32_t ver, min_ver;
|
||||
|
||||
snprintf(cmd_iasl_ver, sizeof(cmd_iasl_ver),
|
||||
"%s -v", asl_compiler);
|
||||
FILE *fd_iasl_ver = popen(cmd_iasl_ver, "r");
|
||||
|
||||
if (fd_iasl_ver != NULL)
|
||||
{
|
||||
while (fgets(buf, ASL_VER_STR_LEN, fd_iasl_ver) != NULL) {
|
||||
if (strstr(buf, ASL_VER_PATTERN)) {
|
||||
ver_str = buf + strlen(ASL_VER_PATTERN);
|
||||
pr_info("iasl version: %s", ver_str);
|
||||
|
||||
if ((!dm_strtoui(ver_str, &cp, 10, &ver)) &&
|
||||
(!dm_strtoui(IASL_MIN_VER, &cp, 10, &min_ver)) &&
|
||||
(ver >= min_ver)) {
|
||||
ret = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pclose(fd_iasl_ver);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
get_iasl_compiler(void)
|
||||
{
|
||||
|
Reference in New Issue
Block a user