x86/tsc: Add clocksource ID, set system_counterval_t.cs_id
authorPeter Hilber <peter.hilber@opensynergy.com>
Thu, 1 Feb 2024 01:04:48 +0000 (02:04 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 7 Feb 2024 16:05:21 +0000 (17:05 +0100)
commita2c1fe72062a5dd69de4dfe892f6436d6c0479dd
tree4a6f1f7136f96a078e23b881cba855e901b828d2
parent93630d6df7507fa4e664110b1878c06a0c00b0b9
x86/tsc: Add clocksource ID, set system_counterval_t.cs_id

Add a clocksource ID for TSC and a distinct one for the early TSC.

Use distinct IDs for TSC and early TSC, since those also have distinct
clocksource structs. This should help to keep existing semantics when
comparing clocksources.

Also, set the recently added struct system_counterval_t member cs_id to the
TSC ID in the cases where the clocksource member is being set to the TSC
clocksource. In the future, get_device_system_crosststamp() will compare
the clocksource ID in struct system_counterval_t, rather than the
clocksource.

For the x86 ART related code, system_counterval_t.cs == NULL corresponds to
system_counterval_t.cs_id == CSID_GENERIC (0).

Signed-off-by: Peter Hilber <peter.hilber@opensynergy.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20240201010453.2212371-4-peter.hilber@opensynergy.com
arch/x86/kernel/tsc.c
include/linux/clocksource_ids.h