From 8a34e087f770d71e8cf7a16418f9016e6b17588a Mon Sep 17 00:00:00 2001 From: Yang Yingliang Date: Mon, 27 May 2019 16:34:24 +0800 Subject: [PATCH] Revert "arm64: arch_timer: Disable CNTVCT_EL0 trap if workaround is enabled" hulk inclusion category: performance bugzilla: 16082 CVE: NA ------------------------------------------------- This reverts commit 47819486652f2dc95ad1fe6a1a862a3c2971d657. 487f18a5f1cf ("arm64: vdso: do cntvct workaround in the VDSO") and 47819486652f ("arm64: arch_timer: Disable CNTVCT_EL0 trap if workaround is enabled") are not needed for now. Apply these two patches later. Signed-off-by: Yang Yingliang --- arch/arm64/include/asm/clocksource.h | 1 - arch/arm64/include/asm/vdso_datapage.h | 1 - arch/arm64/kernel/vdso.c | 1 - drivers/clocksource/arm_arch_timer.c | 10 +++------- 4 files changed, 3 insertions(+), 10 deletions(-) diff --git a/arch/arm64/include/asm/clocksource.h b/arch/arm64/include/asm/clocksource.h index 734428342ebf..0ece64a26c8c 100644 --- a/arch/arm64/include/asm/clocksource.h +++ b/arch/arm64/include/asm/clocksource.h @@ -4,7 +4,6 @@ struct arch_clocksource_data { bool vdso_direct; /* Usable for direct VDSO access? */ - bool vdso_fix; /* Need avoid the clock bug in VDSO? */ }; #endif diff --git a/arch/arm64/include/asm/vdso_datapage.h b/arch/arm64/include/asm/vdso_datapage.h index 4c4fc13bfea5..2b9a63771eda 100644 --- a/arch/arm64/include/asm/vdso_datapage.h +++ b/arch/arm64/include/asm/vdso_datapage.h @@ -38,7 +38,6 @@ struct vdso_data { __u32 tz_minuteswest; /* Whacky timezone stuff */ __u32 tz_dsttime; __u32 use_syscall; - __u32 vdso_fix; /* Avoid the clock bug in VDSO */ }; #endif /* !__ASSEMBLY__ */ diff --git a/arch/arm64/kernel/vdso.c b/arch/arm64/kernel/vdso.c index ade5ca532c28..9fb0c0c95a85 100644 --- a/arch/arm64/kernel/vdso.c +++ b/arch/arm64/kernel/vdso.c @@ -224,7 +224,6 @@ void update_vsyscall(struct timekeeper *tk) smp_wmb(); vdso_data->use_syscall = use_syscall; - vdso_data->vdso_fix = tk->tkr_mono.clock->archdata.vdso_fix; vdso_data->xtime_coarse_sec = tk->xtime_sec; vdso_data->xtime_coarse_nsec = tk->tkr_mono.xtime_nsec >> tk->tkr_mono.shift; diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index 43fcd3facd99..0445ad7e559e 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -76,7 +76,6 @@ static bool arch_timer_c3stop; static bool arch_timer_mem_use_virtual; static bool arch_counter_suspend_stop; static bool vdso_default = true; -static bool vdso_fix = false; static cpumask_t evtstrm_available = CPU_MASK_NONE; static bool evtstrm_enable = IS_ENABLED(CONFIG_ARM_ARCH_TIMER_EVTSTREAM); @@ -551,10 +550,8 @@ void arch_timer_enable_workaround(const struct arch_timer_erratum_workaround *wa * change both the default value and the vdso itself. */ if (wa->read_cntvct_el0) { - clocksource_counter.archdata.vdso_direct = true; - clocksource_counter.archdata.vdso_fix = true; - vdso_default = true; - vdso_fix = true; + clocksource_counter.archdata.vdso_direct = false; + vdso_default = false; } } @@ -858,7 +855,7 @@ static void arch_counter_set_user_access(void) * need to be workaround. The vdso may have been already * disabled though. */ - if (arch_timer_this_cpu_has_cntvct_wa() && !vdso_fix) + if (arch_timer_this_cpu_has_cntvct_wa()) pr_info("CPU%d: Trapping CNTVCT access\n", smp_processor_id()); else cntkctl |= ARCH_TIMER_USR_VCT_ACCESS_EN; @@ -993,7 +990,6 @@ static void __init arch_counter_register(unsigned type) arch_timer_read_counter = arch_counter_get_cntpct; clocksource_counter.archdata.vdso_direct = vdso_default; - clocksource_counter.archdata.vdso_fix = vdso_fix; } else { arch_timer_read_counter = arch_counter_get_cntvct_mem; } -- GitLab