ARMv7 Generic Timers: Difference between revisions

no edit summary
[unchecked revision][unchecked revision]
No edit summary
No edit summary
Line 7:
This upcounter can be read in two forms, and these readout-forms are logically distinct from the actual value of the syscounter (though the physcounter will usually reflect the syscounter exactly):
* Physical upcounter readout ("physcounter"). This is read as a 64-bit read using the CNTPCT register.
* Virtual upcounter readout ("virtcounter"). This is the value of the physical timer, minus a 64-bit virtual offset (CNTVOFF). This is read using the CNTVCT register.
 
The feature also specifies a set of 4 timers per CPU which base their operation on these two upcounters:
Line 51:
 
=== CNTPCT ===
 
Use ISB to ensure that CNTPCT reads are executed in order.
 
* Is always accessible from PL2.
* Is always accessible from PL1 modes. However, if hypervisor extensions are supported accesses to CNTPCT will generate a hyp-trap from PL1 unless CNTHCTL.PL1PCTEN is set to 1.
* Is only accessible from PL0 modes if CNTKCTL.PL0CTEN is set to 1. IfAttempts to access CNTPCT from PL0 when CNTKCTL.PL0CTEN==0 will trigger an #UNDEFINED exception.
 
CNTPCT is logically meant to be read by PL2 hypervisors when they need to read a timestamp value. It can be read by '''secure''' PL1 software with no hindrances as well.
There is no statement about whether or not it can be accessed from PL3 monitors.
 
=== CNTVOFF ===
 
* Accessible as R/W from PL2.
* Accessible from PL3 (Monitor mode) only when SCR.NS==1.
 
If the virtualization extensions are not supported, accesses to CNTVOFF from '''PL3''' are <tt>UNPREDICTABLE</tt>, and reads of CNTVCT act as if CNTVOFF is zero.
CNTVOFF is logically meant to be written by a PL2 hypervisor when switching between GuestVMs. It is also writeable by PL3 when SCR.NS=1, but this is not very useful to a PL3 monitor.
 
=== CNTVCT ===
 
In a processor that doesn't support the virtualization extensions, CNTVCT is identical to CNTPCT.
 
* Always accessible from '''secure''' PL1.
* Always accessible from '''non-secure''' PL1 and PL2.
* Accessible from PL0 modes when CNTKCTL.PL0VCTEN==1.
 
CNTVCT is logically meant to be used by both '''secure''' and '''non-secure''' PL1 kernels. It can be read by PL2 hypervisors, but the usefulness of such a read is questionable, when they can instead read CNTPCT.
There is no statement about whether or not it can be accessed from PL3 monitors.
 
= Timers =
Anonymous user