From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 209.132.183.28, mailfrom: lersek@redhat.com) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by groups.io with SMTP; Fri, 05 Jul 2019 08:02:29 -0700 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D18C79E635; Fri, 5 Jul 2019 15:02:06 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-244.ams2.redhat.com [10.36.116.244]) by smtp.corp.redhat.com (Postfix) with ESMTP id B53CCBA118; Fri, 5 Jul 2019 15:01:58 +0000 (UTC) Subject: Re: [PATCH v3 09/35] OvmfPkg/OvmfXen: use a TimerLib instance that depends only on the CPU To: Anthony PERARD , devel@edk2.groups.io Cc: xen-devel@lists.xenproject.org, Ard Biesheuvel , Jordan Justen , Julien Grall , Andrew Cooper , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= References: <20190704144233.27968-1-anthony.perard@citrix.com> <20190704144233.27968-10-anthony.perard@citrix.com> From: "Laszlo Ersek" Message-ID: <49c9f224-dc09-6fb9-903a-409b98867890@redhat.com> Date: Fri, 5 Jul 2019 17:01:57 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190704144233.27968-10-anthony.perard@citrix.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 05 Jul 2019 15:02:23 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 07/04/19 16:42, Anthony PERARD wrote: > ACPI Timer does not work in a PVH guest, but local APIC works on both > PVH and HVM. > > Note that the use of SecPeiDxeTimerLibCpu might be an issue with a > driver of type DXE_RUNTIME_DRIVER. I've attemptde to find out which of > the DXE_RUNTIME_DRIVER uses the TimerLib at runtime. I've done that by > replacing the TimerLib evaluation in > [LibraryClasses.common.DXE_RUNTIME_DRIVER] by a different one and > check every module that uses it (with the --report-file=report build > option). > > ResetSystemRuntimeDxe is calling the TimerLib API at runtime to do the > operation "EfiResetCold", so this may never complete if the OS have > disabled the Local APIC Timer. > > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1689 > Signed-off-by: Anthony PERARD > --- > > Notes: > v3: > - cleanup .dsc, leave only one TimerLib resolution > - Added a note in the commit message regarding the use of the local apic > by runtime drivers Good note -- yes, the warning in "MdePkg/Library/SecPeiDxeTimerLibCpu/SecPeiDxeTimerLibCpu.inf" applies. I guess Xen setups can live with that potential problem, for now. Acked-by: Laszlo Ersek Thanks Laszlo > > OvmfPkg/OvmfXen.dsc | 7 +------ > 1 file changed, 1 insertion(+), 6 deletions(-) > > diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc > index 9f79d455fa..6288394eb8 100644 > --- a/OvmfPkg/OvmfXen.dsc > +++ b/OvmfPkg/OvmfXen.dsc > @@ -104,7 +104,7 @@ [SkuIds] > ################################################################################ > [LibraryClasses] > PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > - TimerLib|OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf > + TimerLib|MdePkg/Library/SecPeiDxeTimerLibCpu/SecPeiDxeTimerLibCpu.inf > PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf > BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf > BaseLib|MdePkg/Library/BaseLib/BaseLib.inf > @@ -202,7 +202,6 @@ [LibraryClasses.common] > BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf > > [LibraryClasses.common.SEC] > - TimerLib|OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.inf > QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf > !ifdef $(DEBUG_ON_SERIAL_PORT) > DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf > @@ -281,7 +280,6 @@ [LibraryClasses.common.DXE_CORE] > > [LibraryClasses.common.DXE_RUNTIME_DRIVER] > PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf > - TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf > HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf > DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf > MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf > @@ -298,7 +296,6 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER] > > [LibraryClasses.common.UEFI_DRIVER] > PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf > - TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf > HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf > DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf > MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf > @@ -313,7 +310,6 @@ [LibraryClasses.common.UEFI_DRIVER] > > [LibraryClasses.common.DXE_DRIVER] > PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf > - TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf > HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf > MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf > ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf > @@ -337,7 +333,6 @@ [LibraryClasses.common.DXE_DRIVER] > > [LibraryClasses.common.UEFI_APPLICATION] > PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf > - TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf > HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf > MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf > ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf >