x86/kvm, ptp/kvm: Add clocksource ID, set system_counterval_t.cs_id
authorPeter Hilber <peter.hilber@opensynergy.com>
Thu, 1 Feb 2024 01:04:49 +0000 (02:04 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 7 Feb 2024 16:05:21 +0000 (17:05 +0100)
commit576bd4962f19bb8f437f8cecbb25e4202438c41e
treea439ff8bc5f25d132d9e9a5c2806b2fee37811be
parenta2c1fe72062a5dd69de4dfe892f6436d6c0479dd
x86/kvm, ptp/kvm: Add clocksource ID, set system_counterval_t.cs_id

Add a clocksource ID for the x86 kvmclock.

Also, for ptp_kvm, set the recently added struct system_counterval_t member
cs_id to the clocksource ID (x86 kvmclock or ARM Generic Timer). In the
future, get_device_system_crosststamp() will compare the clocksource ID in
struct system_counterval_t, rather than the clocksource.

For now, to avoid touching too many subsystems at once, extract the
clocksource ID from the clocksource. The clocksource dereference will be
removed once everything is converted over..

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-5-peter.hilber@opensynergy.com
arch/x86/kernel/kvmclock.c
drivers/ptp/ptp_kvm_common.c
include/linux/clocksource_ids.h