Yu Liao (2): timekeeping: Make CLOCKSOURCE_VALIDATE_LAST_CYCLE configurable config: make CLOCKSOURCE_VALIDATE_LAST_CYCLE not set by default
arch/arm64/configs/openeuler_defconfig | 1 + kernel/time/Kconfig | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-)
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I8QEV8 CVE: NA
-------------------------------
Currently, only x86 architecture supports the CLOCKSOURCE_VALIDATE_LAST_CYCLE option. This option ensures that the timestamps returned by the clocksource are monotonically increasing, and helps avoid issues caused by hardware failures.
This commit makes CLOCKSOURCE_VALIDATE_LAST_CYCLE configurable on the arm64 architecture, helps increase system stability and reliability.
Signed-off-by: Yu Liao liaoyu15@huawei.com --- kernel/time/Kconfig | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/kernel/time/Kconfig b/kernel/time/Kconfig index bae8f11070be..5e0d37461b93 100644 --- a/kernel/time/Kconfig +++ b/kernel/time/Kconfig @@ -17,11 +17,6 @@ config ARCH_CLOCKSOURCE_DATA config ARCH_CLOCKSOURCE_INIT bool
-# Clocksources require validation of the clocksource against the last -# cycle update - x86/TSC misfeature -config CLOCKSOURCE_VALIDATE_LAST_CYCLE - bool - # Timekeeping vsyscall support config GENERIC_TIME_VSYSCALL bool @@ -209,5 +204,13 @@ config CLOCKSOURCE_WATCHDOG_MAX_SKEW_US per million. If the clocksource is good enough for NTP, it is good enough for the clocksource watchdog!
+# Clocksources require validation of the clocksource against the last +# cycle update - x86/TSC misfeature +config CLOCKSOURCE_VALIDATE_LAST_CYCLE + bool "Validate last cycle of clocksource" + help + Enable this option to validate the last cycle to prevent issues + caused by clocksource going backwards. + endmenu endif
openeuler inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I8QEV8 CVE: NA
-------------------------------
The ARM ARM states the following (where a CPU is a device):
The system counter must provide a uniform view of system time. More precisely, it must be impossible for the following sequence of events to show system time going backwards:
1) Device A reads the time from the system counter.
2) Device A communicates with another agent in the system, Device B.
3) After recognizing the communication from Device A, Device B reads the time from the system counter.
So make CLOCKSOURCE_VALIDATE_LAST_CYCLE unset by default.
Signed-off-by: Yu Liao liaoyu15@huawei.com --- arch/arm64/configs/openeuler_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/arch/arm64/configs/openeuler_defconfig b/arch/arm64/configs/openeuler_defconfig index 5142567aeeff..332edc342d6c 100644 --- a/arch/arm64/configs/openeuler_defconfig +++ b/arch/arm64/configs/openeuler_defconfig @@ -72,6 +72,7 @@ CONFIG_CONTEXT_TRACKING_USER=y # CONFIG_CONTEXT_TRACKING_USER_FORCE is not set CONFIG_NO_HZ=y CONFIG_HIGH_RES_TIMERS=y +# CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE is not set # end of Timers subsystem
CONFIG_BPF=y
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/3517 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/I...
FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/3517 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/I...