diff --git a/devicemodel/core/main.c b/devicemodel/core/main.c index bc6de4d1b..6963a0271 100644 --- a/devicemodel/core/main.c +++ b/devicemodel/core/main.c @@ -92,6 +92,7 @@ bool lapic_pt; bool is_rtvm; bool pt_tpm2; bool pt_rtct; +bool vtpm2; bool is_winvm; bool skip_pci_mem64bar_workaround = false; @@ -945,7 +946,8 @@ main(int argc, char *argv[]) pt_rtct = true; break; case CMD_OPT_ACPIDEV_PT: - if (parse_pt_acpidev(optarg) != 0) + /* FIXME: check acpi TPM device rules in acpi device famework init functions */ + if (vtpm2 || parse_pt_acpidev(optarg) != 0) errx(EX_USAGE, "invalid pt acpi dev param %s", optarg); break; case CMD_OPT_MMIODEV_PT: diff --git a/devicemodel/hw/platform/tpm/tpm.c b/devicemodel/hw/platform/tpm/tpm.c index 353624082..6a656c0f5 100644 --- a/devicemodel/hw/platform/tpm/tpm.c +++ b/devicemodel/hw/platform/tpm/tpm.c @@ -73,6 +73,7 @@ int acrn_parse_vtpm2(char *arg) return -1; strncpy(sock_path, value, len + 1); } + vtpm2 = true; return 0; } diff --git a/devicemodel/include/dm.h b/devicemodel/include/dm.h index 3e8e6b23d..89f3df68d 100644 --- a/devicemodel/include/dm.h +++ b/devicemodel/include/dm.h @@ -52,6 +52,7 @@ extern bool lapic_pt; extern bool is_rtvm; extern bool pt_tpm2; extern bool pt_rtct; +extern bool vtpm2; extern bool is_winvm; int vmexit_task_switch(struct vmctx *ctx, struct vhm_request *vhm_req,