qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [SeaBIOS] SeaBIOS booting time optimization


From: Stefan Berger
Subject: Re: [Qemu-devel] [SeaBIOS] SeaBIOS booting time optimization
Date: Wed, 21 Nov 2018 00:43:34 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0

On 11/20/18 11:51 AM, Stefano Garzarella wrote:
On Tue, Nov 20, 2018 at 5:13 PM Steve Douthit <address@hidden> wrote:
On 11/20/18 10:55 AM, Kevin O'Connor wrote:
On Mon, Nov 19, 2018 at 07:38:39PM +0100, Stefano Garzarella wrote:
just an update, I enabled the debug prints and I saw two timeouts fired
with a lot
of time lost (~780ms between "init timer" and "Scan for VGA ..."),
putting other prints I discovered that a lot of time is spent in the
tpm_setup(),
during the probe of the 2 TPM devices:

00.548869 init timer
00.549677 ./src/post.c:157 platform_hardware_setup
00.550182 ./src/hw/tpm_drivers.c:579 tpmhw_probe
01.300833 WARNING - Timeout at wait_reg8:81!
01.301388 ./src/hw/tpm_drivers.c:579 tpmhw_probe
01.331843 WARNING - Timeout at wait_reg8:81!
01.332316 ./src/post.c:160 platform_hardware_setup
01.333358 Scan for VGA option rom
FYI, this was raised a few months ago - see:

https://mail.coreboot.org/pipermail/seabios/2018-March/012186.html

IIRC, it should be possible to verify the TPM device is present before
trying to wait for it.
We could skip probing entirely if there's no TCPA or TPM2 ACPI tables.
There'd need to be some option to force probing in the case of
missing/broken ACPI configurations.
I've just tried the
0001-tpm-Check-for-TPM-related-ACPI-tables-before-attempt.patch
(https://mail.coreboot.org/pipermail/seabios/2018-March/012188.html)
and it solves my issue with the TPM.

I have tried it with the attached patch of that mail. We have to apply it, also for QEMU. It is this patch here:

From: Stephen Douthit <address@hidden>
Date: Wed, 7 Mar 2018 13:17:36 -0500
Subject: [PATCH] tpm: Check for TPM related ACPI tables before attempting hw
 probe

Signed-off-by: Stephen Douthit <address@hidden>
---
 src/tcgbios.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/tcgbios.c b/src/tcgbios.c
index 40b3028..24846d3 100644
--- a/src/tcgbios.c
+++ b/src/tcgbios.c
@@ -968,6 +968,13 @@ tpm_setup(void)
     if (!CONFIG_TCGBIOS)
         return;

+    int ret = tpm_tpm2_probe();
+    if (ret) {
+        ret = tpm_tcpa_probe();
+        if (ret)
+            return;
+    }
+
     TPM_version = tpmhw_probe();
     if (TPM_version == TPM_VERSION_NONE)
         return;
@@ -976,13 +983,6 @@ tpm_setup(void)
             "TCGBIOS: Detected a TPM %s.\n",
              (TPM_version == TPM_VERSION_1_2) ? "1.2" : "2");

-    int ret = tpm_tpm2_probe();
-    if (ret) {
-        ret = tpm_tcpa_probe();
-        if (ret)
-            return;
-    }
-
     TPM_working = 1;

     if (runningOnXen())
--
2.14.3





Thanks,
Stefano

-Kevin






reply via email to

[Prev in Thread] Current Thread [Next in Thread]