From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH] xen/arm: Propagate clock-frequency to DOMU if present in the DT timer node Date: Sun, 7 Jun 2015 22:04:14 +0100 Message-ID: <5574B1CE.7060903@citrix.com> References: <1433342886-14790-1-git-send-email-julien.grall@citrix.com> <4EE5B48738DDED408878C97C8E050A8B1D7A4A4B@SJEXCHMB05.corp.ad.broadcom.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z1hjw-00042J-W4 for xen-devel@lists.xenproject.org; Sun, 07 Jun 2015 21:04:21 +0000 In-Reply-To: <4EE5B48738DDED408878C97C8E050A8B1D7A4A4B@SJEXCHMB05.corp.ad.broadcom.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "Chris (Christopher) Brand" , "xen-devel@lists.xenproject.org" Cc: "ian.jackson@eu.citrix.com" , "stefano.stabellini@citrix.com" , "tim@xen.org" , "ian.campbell@citrix.com" , "wei.liu2@citrix.com" List-Id: xen-devel@lists.xenproject.org On 05/06/2015 21:14, Chris (Christopher) Brand wrote: > Hi Julien, Hi Chris, >> When the property "clock-frequency" is present in the DT timer node, it means that the bootloader/firmware didn't correctly configured the > CNTFRQ/CNTFRQ_EL0 on each processor. > > I did try this out, and it didn't affect my results. I don't understand why, though :-) My test was limited as I don't have a platform where CNTFRQ/CNTFRQ_EL0 is not valid. I may have done a mistake in the code. > What I see is that in preinit_xen_time(), the call to dt_property_read_u32() returns zero. When I built Xen, I set CONFIG_DTB_FILE, and looking at the corresponding dts file it has a timer node with a clock-frequency property. I know that our bootloader also creates a DTB, though, and it looks like that one does *not* have a clock-frequency property in the timer node, so I guess Xen ends up using that one somehow. CNTFRQ on core 0 (only) is also set to the correct frequency, so I end up with the correct frequency in my Dom0 kernel anyway. dt_property_read_u32 returns 0 when it cannot find a property or because the size of the value is not valid. The device tree provided via CONFIG_DTB_FILE will always take precedence to the one pass by the bootloader. How do you set CONFIG_DTB_FILE? I would also look to see if by any chance the wrong device tree is set via CONFIG_DTB_FILE. You can check what is the device tree used by dumping it from DOM0. Thought, it may be slightly different (some nodes are rewritten). You can dump it using dtc -I fs /proc/device-tree -O dts Regards, [1] http://wiki.xen.org/wiki/Xen_ARM_with_Virtualization_Extensions/Multiboot -- Julien Grall