Author: andrew
Date: Wed Aug 12 17:06:22 2015
New Revision: 286674
URL: https://svnweb.freebsd.org/changeset/base/286674

Log:
  Set the counter-timer virtual offset to a know value, it may not have been
  set by the boot code and are reset to an implementation defined value that
  may be unknown.
  
  Sponsored by: ABT Systems Ltd

Modified:
  head/sys/arm64/arm64/locore.S

Modified: head/sys/arm64/arm64/locore.S
==============================================================================
--- head/sys/arm64/arm64/locore.S       Wed Aug 12 16:53:37 2015        
(r286673)
+++ head/sys/arm64/arm64/locore.S       Wed Aug 12 17:06:22 2015        
(r286674)
@@ -220,6 +220,14 @@ drop_to_el1:
        /* Don't trap to EL2 for CP15 traps */
        msr     hstr_el2, xzr
 
+       /* Enable access to the physical timers at EL1 */
+       mrs     x2, cnthctl_el2
+       orr     x2, x2, #(CNTHCTL_EL1PCTEN | CNTHCTL_EL1PCEN)
+       msr     cnthctl_el2, x2
+
+       /* Set the counter offset to a known value */
+       msr     cntvoff_el2, xzr
+
        /* Hypervisor trap functions */
        adr     x2, hyp_vectors
        msr     vbar_el2, x2
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to