> [Severity: Medium] > What happens here when the arch timer clocksource is reading the virtual > counter with a non-zero CNTVOFF?
[ ... ]
> The commit message states the assumption: > > The driver reads the GTC through the clocksource, which assumes that > the clocksource counter value equals the GTC count, that is a CNTVOFF > of 0. > > The code does not enforce it, though. Could getcrosststamp be withheld > when !is_hyp_mode_available(), or the setup otherwise detected, so that > an unsupported configuration gets -EOPNOTSUPP instead of wrong values?
is_hyp_mode_available() can't be used from a module. The other drivers that cross-timestamp a hardware capture of the Arm counter (dwmac-socfpga, and mlx5 and idpf on arm64) make the same assumption without checking it. A check would belong in common code rather than in each driver, so I would rather leave the assumption stated in the commit message. James