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; Thu, 08 Aug 2019 13:27:55 -0700 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BB91C30BD1CC; Thu, 8 Aug 2019 20:27:54 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-117-122.ams2.redhat.com [10.36.117.122]) by smtp.corp.redhat.com (Postfix) with ESMTP id 10DA160A97; Thu, 8 Aug 2019 20:27:52 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v4 29/35] OvmfPkg/OvmfXen: Override PcdFSBClock to Xen vLAPIC timer frequency To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= , Anthony PERARD Cc: devel@edk2.groups.io, Julien Grall , xen-devel@lists.xenproject.org, Jordan Justen , Ard Biesheuvel References: <20190729153944.24239-1-anthony.perard@citrix.com> <20190729153944.24239-30-anthony.perard@citrix.com> <20190807155451.pkld6zhcxljzx6d7@Air-de-Roger> <20190808132832.GU1242@perard.uk.xensource.com> <20190808134423.ybqg3qkpw5ucfzk4@Air-de-Roger> From: "Laszlo Ersek" Message-ID: <604a726a-8443-88ff-8173-31e87bf7489c@redhat.com> Date: Thu, 8 Aug 2019 22:27:52 +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: <20190808134423.ybqg3qkpw5ucfzk4@Air-de-Roger> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Thu, 08 Aug 2019 20:27:54 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 08/08/19 15:44, Roger Pau Monn=C3=A9 wrote: > On Thu, Aug 08, 2019 at 02:28:32PM +0100, Anthony PERARD wrote: >> On Wed, Aug 07, 2019 at 05:54:51PM +0200, Roger Pau Monn=C3=A9 wrote: >>> On Mon, Jul 29, 2019 at 04:39:38PM +0100, Anthony PERARD wrote: >>>> PcdFSBClock is used by SecPeiDxeTimerLibCpu, the TimerLib >>>> implementation. It will also be used by XenTimerDxe. Override >>>> PcdFSBClock to match Xen vLAPIC timer frequency. >>> >>> I'm kind of surprised that his is not automatically detected? >>> >>> Is it a bug in Xen or just always hardcoded on OVMF? >> >> It's hardcoded. Why would you need auto detection when you always run = on >> the same machine ;-). >=20 > I don't think that's part of the HVM/PVH ABI in any way, and if you > hardcode it in OVMF it would prevent Xen from changing the frequency > in the future if such necessity arises. We should try to avoid painting > ourselves into a corner when possible. >=20 > Doesn't OVMF have a way to get this from the hardware itself? It might be possible to change the PCDs access method in the DSC file to "dynamic", and then set it dynamically in XenPlatformPei. That should work fine if only the DXE phase relies on the PCD. However, if PEIMs (other than XenPlatformPei) consume the PCD too, then the ordering (between set/get) might not be trivial to ensure. This kind of problem sometimes requries separate library instances for SEC/PEI/DXE. Thanks Laszlo