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


Groups > linux.kernel > #1563548

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

From Paolo Bonzini <pbonzini@redhat.com>
Newsgroups linux.kernel
Subject Re: [patch 3/5] kvmclock: export kvmclock clocksource pointer
Date 2017-01-20 14:10 +0100
Message-ID <t1H75-7EL-49@gated-at.bofh.it> (permalink)
References <t1Gul-7bo-3@gated-at.bofh.it> <t1Gum-7bo-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



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();
> 
> 

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[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

csiph-web