[<prev] [next>] [day] [month] [year] [list]
Message-ID: <158505983648.28353.2870003990478698787.tip-bot2@tip-bot2>
Date: Tue, 24 Mar 2020 14:23:56 -0000
From: "tip-bot2 for Alexey Makhalov" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Alexey Makhalov <amakhalov@...are.com>,
Borislav Petkov <bp@...e.de>,
Thomas Hellstrom <thellstrom@...are.com>,
Thomas Gleixner <tglx@...utronix.de>, x86 <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: [tip: x86/vmware] x86/vmware: Remove vmware_sched_clock_setup()
The following commit has been merged into the x86/vmware branch of tip:
Commit-ID: dd735f4707e603ac5b541b5f30de87c3c7bd60dd
Gitweb: https://git.kernel.org/tip/dd735f4707e603ac5b541b5f30de87c3c7bd60dd
Author: Alexey Makhalov <amakhalov@...are.com>
AuthorDate: Mon, 23 Mar 2020 19:57:04
Committer: Borislav Petkov <bp@...e.de>
CommitterDate: Tue, 24 Mar 2020 09:31:06 +01:00
x86/vmware: Remove vmware_sched_clock_setup()
Move cyc2ns setup logic to separate function.
This separation will allow to use cyc2ns mult/shift pair
not only for the sched_clock but also for other clocks
such as steal_clock.
Signed-off-by: Alexey Makhalov <amakhalov@...are.com>
Signed-off-by: Borislav Petkov <bp@...e.de>
Reviewed-by: Thomas Hellstrom <thellstrom@...are.com>
Reviewed-by: Thomas Gleixner <tglx@...utronix.de>
Link: https://lkml.kernel.org/r/20200323195707.31242-3-amakhalov@vmware.com
---
arch/x86/kernel/cpu/vmware.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index d280560..efb22fa 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -122,7 +122,7 @@ static unsigned long long notrace vmware_sched_clock(void)
return ns;
}
-static void __init vmware_sched_clock_setup(void)
+static void __init vmware_cyc2ns_setup(void)
{
struct cyc2ns_data *d = &vmware_cyc2ns;
unsigned long long tsc_now = rdtsc();
@@ -132,8 +132,7 @@ static void __init vmware_sched_clock_setup(void)
d->cyc2ns_offset = mul_u64_u32_shr(tsc_now, d->cyc2ns_mul,
d->cyc2ns_shift);
- pv_ops.time.sched_clock = vmware_sched_clock;
- pr_info("using sched offset of %llu ns\n", d->cyc2ns_offset);
+ pr_info("using clock offset of %llu ns\n", d->cyc2ns_offset);
}
static void __init vmware_paravirt_ops_setup(void)
@@ -141,8 +140,14 @@ static void __init vmware_paravirt_ops_setup(void)
pv_info.name = "VMware hypervisor";
pv_ops.cpu.io_delay = paravirt_nop;
- if (vmware_tsc_khz && vmw_sched_clock)
- vmware_sched_clock_setup();
+ if (vmware_tsc_khz == 0)
+ return;
+
+ vmware_cyc2ns_setup();
+
+ if (vmw_sched_clock)
+ pv_ops.time.sched_clock = vmware_sched_clock;
+
}
#else
#define vmware_paravirt_ops_setup() do {} while (0)
Powered by blists - more mailing lists