<div dir="ltr"><div dir="ltr">On Wed, Oct 2, 2019 at 9:26 AM Chris Murphy <<a href="mailto:lists@colorremedies.com">lists@colorremedies.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
systemd-243-2.gitfab6f01.fc31.x86_64<br>
<br>
systemd-analyze reports very high firmware times, seemingly related to<br>
uptime since last cold boot. That is, if I poweroff then boot, the<br>
time for firmware seems reasonable; whereas reboots appear to show<br>
cumulative time for only the firmware value.<br>
<br>
This is in a qemu-kvm VM, using edk2-ovmf-20190501stable-4.fc31.noarch<br>
<br></blockquote><div><br></div><div>systemd-analyze calculates the time delta based on the LoaderTimeInitUSec EFI variable, which is stored by systemd-boot during initialization.</div><div><br></div><div>systemd-boot reads the time by calling 'rdtsc' and dividing it by estimated ticks/ms. It assumes that the TSC starts at 0, so "firmware time" is just (current_tsc - 0). (The code is at: <a href="https://github.com/systemd/systemd/blob/master/src/boot/efi/util.c#L15-L60">https://github.com/systemd/systemd/blob/master/src/boot/efi/util.c#L15-L60</a>)</div><div><br></div><div>Based on this mailing list thread, it looks like qemu-kvm did not reset the TSC on soft reboot in the past, and I'm not sure if the patches to make it do so were actually applied or not: <a href="https://qemu-devel.nongnu.narkive.com/jbnsv2H8/patch-kvm-clear-guest-tsc-on-reset">https://qemu-devel.nongnu.narkive.com/jbnsv2H8/patch-kvm-clear-guest-tsc-on-reset</a></div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Mantas Mikulėnas</div></div></div>