From 59e3f562b87b1d6ffb44f84ad84820a4cc915bbe Mon Sep 17 00:00:00 2001 From: Jason Chen CJ Date: Fri, 14 Dec 2018 13:34:42 +0800 Subject: [PATCH] remove check_tsc there is no need to clear CR4.TSD as there is no user mode in ACRN hypervisor. Tracked-On: #1842 Signed-off-by: Jason Chen CJ --- doc/developer-guides/hld/hv-timer.rst | 3 --- hypervisor/arch/x86/cpu.c | 3 --- hypervisor/arch/x86/timer.c | 9 --------- hypervisor/include/arch/x86/timer.h | 5 ----- 4 files changed, 20 deletions(-) diff --git a/doc/developer-guides/hld/hv-timer.rst b/doc/developer-guides/hld/hv-timer.rst index ce157bc72..8a4f07735 100644 --- a/doc/developer-guides/hld/hv-timer.rst +++ b/doc/developer-guides/hld/hv-timer.rst @@ -42,9 +42,6 @@ Interfaces Design .. doxygenfunction:: timer_init :project: Project ACRN -.. doxygenfunction:: check_tsc - :project: Project ACRN - .. doxygenfunction:: calibrate_tsc :project: Project ACRN diff --git a/hypervisor/arch/x86/cpu.c b/hypervisor/arch/x86/cpu.c index eeaf3f594..65b18a4b1 100644 --- a/hypervisor/arch/x86/cpu.c +++ b/hypervisor/arch/x86/cpu.c @@ -429,9 +429,6 @@ void init_cpu_post(uint16_t pcpu_id) enable_smap(); - /* Make sure rdtsc is enabled */ - check_tsc(); - cpu_xsave_init(); if (pcpu_id == BOOT_CPU_ID) { diff --git a/hypervisor/arch/x86/timer.c b/hypervisor/arch/x86/timer.c index 548914575..1696f0cb6 100644 --- a/hypervisor/arch/x86/timer.c +++ b/hypervisor/arch/x86/timer.c @@ -189,15 +189,6 @@ void timer_init(void) } } -void check_tsc(void) -{ - uint64_t temp64; - - /* Ensure time-stamp timer is turned on for each CPU */ - CPU_CR_READ(cr4, &temp64); - CPU_CR_WRITE(cr4, (temp64 & ~CR4_TSD)); -} - static uint64_t pit_calibrate_tsc(uint32_t cal_ms_arg) { #define PIT_TICK_RATE 1193182U diff --git a/hypervisor/include/arch/x86/timer.h b/hypervisor/include/arch/x86/timer.h index e90179776..fd3daabb0 100644 --- a/hypervisor/include/arch/x86/timer.h +++ b/hypervisor/include/arch/x86/timer.h @@ -116,11 +116,6 @@ void del_timer(struct hv_timer *timer); */ void timer_init(void); -/** - * @brief Check tsc to make sure rdtsc is enabled. - */ -void check_tsc(void); - /** * @brief Calibrate tsc. *