lkml.org 
[lkml]   [2023]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[RFC PATCH 2/4] x86/kvm: Add clocksource id for kvm-clock
    Date
    Add a clocksource id for kvm-clock, so that it can be identified through
    enum clocksource_ids.

    This will keep ptp_kvm working on x86 in the future, when
    get_device_system_crosststamp() would be changed to compare enum
    clocksource_ids, rather than struct clocksource *. It also makes
    identifying kvm-clock easier for outside code in general.

    Signed-off-by: Peter Hilber <peter.hilber@opensynergy.com>
    ---
    arch/x86/kernel/kvmclock.c | 2 ++
    include/linux/clocksource_ids.h | 1 +
    2 files changed, 3 insertions(+)

    diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
    index fb8f52149be9..a686733a2d20 100644
    --- a/arch/x86/kernel/kvmclock.c
    +++ b/arch/x86/kernel/kvmclock.c
    @@ -4,6 +4,7 @@
    */

    #include <linux/clocksource.h>
    +#include <linux/clocksource_ids.h>
    #include <linux/kvm_para.h>
    #include <asm/pvclock.h>
    #include <asm/msr.h>
    @@ -160,6 +161,7 @@ struct clocksource kvm_clock = {
    .rating = 400,
    .mask = CLOCKSOURCE_MASK(64),
    .flags = CLOCK_SOURCE_IS_CONTINUOUS,
    + .id = CSID_KVM_CLOCK,
    .enable = kvm_cs_enable,
    };
    EXPORT_SYMBOL_GPL(kvm_clock);
    diff --git a/include/linux/clocksource_ids.h b/include/linux/clocksource_ids.h
    index 86d23abfde2a..11d3cc318dc1 100644
    --- a/include/linux/clocksource_ids.h
    +++ b/include/linux/clocksource_ids.h
    @@ -8,6 +8,7 @@ enum clocksource_ids {
    CSID_ARM_ARCH_COUNTER,
    CSID_TSC_EARLY,
    CSID_TSC,
    + CSID_KVM_CLOCK,
    CSID_MAX,
    };

    --
    2.39.2
    \
     
     \ /
      Last update: 2023-08-18 03:15    [W:4.603 / U:0.068 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site