From patchwork Tue Jan 24 17:09:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 9535573 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D386C6042D for ; Tue, 24 Jan 2017 17:13:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C26AD26E51 for ; Tue, 24 Jan 2017 17:13:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B674B26E56; Tue, 24 Jan 2017 17:13:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A7B226E51 for ; Tue, 24 Jan 2017 17:13:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751105AbdAXRMp (ORCPT ); Tue, 24 Jan 2017 12:12:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58022 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750854AbdAXRLy (ORCPT ); Tue, 24 Jan 2017 12:11:54 -0500 Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 97AC5C056793; Tue, 24 Jan 2017 17:11:55 +0000 (UTC) Received: from amt.cnet (vpn1-4-101.gru2.redhat.com [10.97.4.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id F139F1959AD; Tue, 24 Jan 2017 17:11:53 +0000 (UTC) Received: from amt.cnet (localhost [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 8F576100917; Tue, 24 Jan 2017 15:10:49 -0200 (BRST) Received: (from marcelo@localhost) by amt.cnet (8.14.7/8.14.7/Submit) id v0OHAn9P015031; Tue, 24 Jan 2017 15:10:49 -0200 Message-Id: <20170124171020.452295368@redhat.com> User-Agent: quilt/0.60-1 Date: Tue, 24 Jan 2017 15:09:41 -0200 From: Marcelo Tosatti To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Paolo Bonzini , Radim Krcmar , Richard Cochran , Miroslav Lichvar , Marcelo Tosatti Subject: [patch 3/4] kvmclock: export kvmclock clocksource pointer References: <20170124170938.909652059@redhat.com> Content-Disposition: inline; filename=kvmclock-export-clocksource X-Scanned-By: MIMEDefang 2.74 on 10.5.11.28 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 24 Jan 2017 17:11:55 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP To be used by KVM PTP driver. Signed-off-by: Marcelo Tosatti --- arch/x86/include/asm/kvmclock.h | 6 ++++++ arch/x86/kernel/kvmclock.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) v2: export kvmclock clocksource structure directly (Paolo) 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-20 11:05:28.720038512 -0200 @@ -0,0 +1,6 @@ +#ifndef _ASM_X86_KVM_CLOCK_H +#define _ASM_X86_KVM_CLOCK_H + +extern struct clocksource kvm_clock; + +#endif /* _ASM_X86_KVM_CLOCK_H */ Index: kvm-ptpdriver/arch/x86/kernel/kvmclock.c =================================================================== --- kvm-ptpdriver.orig/arch/x86/kernel/kvmclock.c 2017-01-20 10:03:44.750489955 -0200 +++ kvm-ptpdriver/arch/x86/kernel/kvmclock.c 2017-01-20 11:05:03.137971637 -0200 @@ -28,6 +28,7 @@ #include #include +#include static int kvmclock __ro_after_init = 1; static int msr_kvm_system_time = MSR_KVM_SYSTEM_TIME; @@ -174,7 +175,7 @@ return ret; } -static struct clocksource kvm_clock = { +struct clocksource kvm_clock = { .name = "kvm-clock", .read = kvm_clock_get_cycles, .rating = 400,