Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1563532 > unrolled thread

[patch 3/5] kvmclock: export kvmclock clocksource pointer

Started byMarcelo Tosatti <mtosatti@redhat.com>
First post2017-01-20 13:30 +0100
Last post2017-01-20 14:10 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [patch 3/5] kvmclock: export kvmclock clocksource pointer Marcelo Tosatti <mtosatti@redhat.com> - 2017-01-20 13:30 +0100
    Re: [patch 3/5] kvmclock: export kvmclock clocksource pointer Paolo Bonzini <pbonzini@redhat.com> - 2017-01-20 14:10 +0100

#1563532 — [patch 3/5] kvmclock: export kvmclock clocksource pointer

FromMarcelo Tosatti <mtosatti@redhat.com>
Date2017-01-20 13:30 +0100
Subject[patch 3/5] kvmclock: export kvmclock clocksource pointer
Message-ID<t1Gum-7bo-19@gated-at.bofh.it>
To be used by KVM PTP driver.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

---
 arch/x86/include/asm/kvmclock.h |    6 ++++++
 arch/x86/kernel/kvmclock.c      |    6 ++++++
 2 files changed, 12 insertions(+)

Index: kvm-ptpdriver/arch/x86/include/asm/kvmclock.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ kvm-ptpdriver/arch/x86/include/asm/kvmclock.h	2017-01-18 18:20:35.463472189 -0200
@@ -0,0 +1,6 @@
+#ifndef _ASM_X86_KVM_CLOCK_H
+#define _ASM_X86_KVM_CLOCK_H
+
+struct clocksource *get_kvmclock_cs(void);
+
+#endif /* _ASM_X86_KVM_CLOCK_H */
Index: kvm-ptpdriver/arch/x86/kernel/kvmclock.c
===================================================================
--- kvm-ptpdriver.orig/arch/x86/kernel/kvmclock.c	2017-01-11 21:22:13.306315984 -0200
+++ kvm-ptpdriver/arch/x86/kernel/kvmclock.c	2017-01-18 18:20:02.543397125 -0200
@@ -28,6 +28,7 @@
 
 #include <asm/x86_init.h>
 #include <asm/reboot.h>
+#include <asm/kvmclock.h>
 
 static int kvmclock __ro_after_init = 1;
 static int msr_kvm_system_time = MSR_KVM_SYSTEM_TIME;
@@ -182,6 +183,11 @@
 	.flags = CLOCK_SOURCE_IS_CONTINUOUS,
 };
 
+struct clocksource *get_kvmclock_cs(void)
+{
+	return &kvm_clock;
+}
+
 int kvm_register_clock(char *txt)
 {
 	int cpu = smp_processor_id();

[toc] | [next] | [standalone]


#1563548

FromPaolo Bonzini <pbonzini@redhat.com>
Date2017-01-20 14:10 +0100
Message-ID<t1H75-7EL-49@gated-at.bofh.it>
In reply to#1563532

On 20/01/2017 13:20, Marcelo Tosatti wrote:
> To be used by KVM PTP driver.
> 
> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
> 
> ---
>  arch/x86/include/asm/kvmclock.h |    6 ++++++
>  arch/x86/kernel/kvmclock.c      |    6 ++++++
>  2 files changed, 12 insertions(+)
> 
> Index: kvm-ptpdriver/arch/x86/include/asm/kvmclock.h
> ===================================================================
> --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> +++ kvm-ptpdriver/arch/x86/include/asm/kvmclock.h	2017-01-18 18:20:35.463472189 -0200
> @@ -0,0 +1,6 @@
> +#ifndef _ASM_X86_KVM_CLOCK_H
> +#define _ASM_X86_KVM_CLOCK_H
> +
> +struct clocksource *get_kvmclock_cs(void);
> +
> +#endif /* _ASM_X86_KVM_CLOCK_H */
> Index: kvm-ptpdriver/arch/x86/kernel/kvmclock.c
> ===================================================================
> --- kvm-ptpdriver.orig/arch/x86/kernel/kvmclock.c	2017-01-11 21:22:13.306315984 -0200
> +++ kvm-ptpdriver/arch/x86/kernel/kvmclock.c	2017-01-18 18:20:02.543397125 -0200
> @@ -28,6 +28,7 @@
>  
>  #include <asm/x86_init.h>
>  #include <asm/reboot.h>
> +#include <asm/kvmclock.h>
>  
>  static int kvmclock __ro_after_init = 1;
>  static int msr_kvm_system_time = MSR_KVM_SYSTEM_TIME;
> @@ -182,6 +183,11 @@
>  	.flags = CLOCK_SOURCE_IS_CONTINUOUS,
>  };
>  
> +struct clocksource *get_kvmclock_cs(void)
> +{
> +	return &kvm_clock;

You can export kvm_clock directly (rename it to clocksource_kvmclock if
you prefer).

Paolo

> +}
> +
>  int kvm_register_clock(char *txt)
>  {
>  	int cpu = smp_processor_id();
> 
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web