diff options
author | Paul E. McKenney <[email protected]> | 2024-08-02 08:46:17 -0700 |
---|---|---|
committer | Thomas Gleixner <[email protected]> | 2024-08-02 18:37:13 +0200 |
commit | 4ac1dd3245b9067f929ab30141bb0475e9e32fc5 (patch) | |
tree | ed88e578ab43ce539cd5dac73b5f81953b6d792e /lib/crypto/mpi/mpi-mul.c | |
parent | f33a5d4bd9c2e545857b2cf7481eb721bcab867c (diff) |
clocksource: Set cs_watchdog_read() checks based on .uncertainty_margin
Right now, cs_watchdog_read() does clocksource sanity checks based
on WATCHDOG_MAX_SKEW, which sets a floor on any clocksource's
.uncertainty_margin. These sanity checks can therefore act
inappropriately for clocksources with large uncertainty margins.
One reason for a clocksource to have a large .uncertainty_margin is when
that clocksource has long read-out latency, given that it does not make
sense for the .uncertainty_margin to be smaller than the read-out latency.
With the current checks, cs_watchdog_read() could reject all normal
reads from a clocksource with long read-out latencies, such as those
from legacy clocksources that are no longer implemented in hardware.
Therefore, recast the cs_watchdog_read() checks in terms of the
.uncertainty_margin values of the clocksources involved in the timespan in
question. The first covers two watchdog reads and one cs read, so use
twice the watchdog .uncertainty_margin plus that of the cs. The second
covers only a pair of watchdog reads, so use twice the watchdog
.uncertainty_margin.
Reported-by: Borislav Petkov <[email protected]>
Signed-off-by: Paul E. McKenney <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/all/[email protected]
Diffstat (limited to 'lib/crypto/mpi/mpi-mul.c')
0 files changed, 0 insertions, 0 deletions