lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230818011256.211078-3-peter.hilber@opensynergy.com>
Date:   Fri, 18 Aug 2023 03:12:53 +0200
From:   Peter Hilber <peter.hilber@...nsynergy.com>
To:     linux-kernel@...r.kernel.org
Cc:     Peter Hilber <peter.hilber@...nsynergy.com>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Wanpeng Li <wanpengli@...cent.com>,
        Vitaly Kuznetsov <vkuznets@...hat.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
        "H. Peter Anvin" <hpa@...or.com>,
        Richard Cochran <richardcochran@...il.com>,
        kvm@...r.kernel.org, netdev@...r.kernel.org,
        Sean Christopherson <seanjc@...gle.com>
Subject: [RFC PATCH 2/4] x86/kvm: Add clocksource id for kvm-clock

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@...nsynergy.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ