DM: TPM: Do not set VTPM and passthough TPM simultaneously

The TPM information in ACPI table is for both VPTM and passthough TPM,
so only one TPM device is allowed.

Tracked-On: #5913
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
This commit is contained in:
Tao Yuhong 2021-04-20 07:15:29 -04:00 committed by wenlingz
parent cb8a6a7514
commit 63dd23bc9e
3 changed files with 5 additions and 1 deletions

View File

@ -92,6 +92,7 @@ bool lapic_pt;
bool is_rtvm; bool is_rtvm;
bool pt_tpm2; bool pt_tpm2;
bool pt_rtct; bool pt_rtct;
bool vtpm2;
bool is_winvm; bool is_winvm;
bool skip_pci_mem64bar_workaround = false; bool skip_pci_mem64bar_workaround = false;
@ -945,7 +946,8 @@ main(int argc, char *argv[])
pt_rtct = true; pt_rtct = true;
break; break;
case CMD_OPT_ACPIDEV_PT: 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); errx(EX_USAGE, "invalid pt acpi dev param %s", optarg);
break; break;
case CMD_OPT_MMIODEV_PT: case CMD_OPT_MMIODEV_PT:

View File

@ -73,6 +73,7 @@ int acrn_parse_vtpm2(char *arg)
return -1; return -1;
strncpy(sock_path, value, len + 1); strncpy(sock_path, value, len + 1);
} }
vtpm2 = true;
return 0; return 0;
} }

View File

@ -52,6 +52,7 @@ extern bool lapic_pt;
extern bool is_rtvm; extern bool is_rtvm;
extern bool pt_tpm2; extern bool pt_tpm2;
extern bool pt_rtct; extern bool pt_rtct;
extern bool vtpm2;
extern bool is_winvm; extern bool is_winvm;
int vmexit_task_switch(struct vmctx *ctx, struct vhm_request *vhm_req, int vmexit_task_switch(struct vmctx *ctx, struct vhm_request *vhm_req,