@@ -4353,12 +4353,6 @@ int main(int argc, char **argv, char **envp)
exit(1);
}
-#ifdef CONFIG_TPM
- if (tpm_init() < 0) {
- exit(1);
- }
-#endif
-
/* init the bluetooth world */
if (foreach_device_config(DEV_BT, bt_parse))
exit(1);
@@ -4477,6 +4471,17 @@ int main(int argc, char **argv, char **envp)
exit(1);
}
+ /*
+ * For compatible with Xen stubdom vTPM driver, make
+ * sure QEMU machine class is initialized and QEMU has
+ * registered Xen stubdom vTPM driver.
+ */
+#ifdef CONFIG_TPM
+ if (tpm_init() < 0) {
+ exit(1);
+ }
+#endif
+
/* Check if IGD GFX passthrough. */
igd_gfx_passthru();