提交 8a34e087 编写于 作者: Y Yang Yingliang 提交者: Xie XiuQi

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: NYang Yingliang <yangyingliang@huawei.com>
上级 109a10b4
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
struct arch_clocksource_data { struct arch_clocksource_data {
bool vdso_direct; /* Usable for direct VDSO access? */ bool vdso_direct; /* Usable for direct VDSO access? */
bool vdso_fix; /* Need avoid the clock bug in VDSO? */
}; };
#endif #endif
...@@ -38,7 +38,6 @@ struct vdso_data { ...@@ -38,7 +38,6 @@ struct vdso_data {
__u32 tz_minuteswest; /* Whacky timezone stuff */ __u32 tz_minuteswest; /* Whacky timezone stuff */
__u32 tz_dsttime; __u32 tz_dsttime;
__u32 use_syscall; __u32 use_syscall;
__u32 vdso_fix; /* Avoid the clock bug in VDSO */
}; };
#endif /* !__ASSEMBLY__ */ #endif /* !__ASSEMBLY__ */
......
...@@ -224,7 +224,6 @@ void update_vsyscall(struct timekeeper *tk) ...@@ -224,7 +224,6 @@ void update_vsyscall(struct timekeeper *tk)
smp_wmb(); smp_wmb();
vdso_data->use_syscall = use_syscall; 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_sec = tk->xtime_sec;
vdso_data->xtime_coarse_nsec = tk->tkr_mono.xtime_nsec >> vdso_data->xtime_coarse_nsec = tk->tkr_mono.xtime_nsec >>
tk->tkr_mono.shift; tk->tkr_mono.shift;
......
...@@ -76,7 +76,6 @@ static bool arch_timer_c3stop; ...@@ -76,7 +76,6 @@ static bool arch_timer_c3stop;
static bool arch_timer_mem_use_virtual; static bool arch_timer_mem_use_virtual;
static bool arch_counter_suspend_stop; static bool arch_counter_suspend_stop;
static bool vdso_default = true; static bool vdso_default = true;
static bool vdso_fix = false;
static cpumask_t evtstrm_available = CPU_MASK_NONE; static cpumask_t evtstrm_available = CPU_MASK_NONE;
static bool evtstrm_enable = IS_ENABLED(CONFIG_ARM_ARCH_TIMER_EVTSTREAM); 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 ...@@ -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. * change both the default value and the vdso itself.
*/ */
if (wa->read_cntvct_el0) { if (wa->read_cntvct_el0) {
clocksource_counter.archdata.vdso_direct = true; clocksource_counter.archdata.vdso_direct = false;
clocksource_counter.archdata.vdso_fix = true; vdso_default = false;
vdso_default = true;
vdso_fix = true;
} }
} }
...@@ -858,7 +855,7 @@ static void arch_counter_set_user_access(void) ...@@ -858,7 +855,7 @@ static void arch_counter_set_user_access(void)
* need to be workaround. The vdso may have been already * need to be workaround. The vdso may have been already
* disabled though. * 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()); pr_info("CPU%d: Trapping CNTVCT access\n", smp_processor_id());
else else
cntkctl |= ARCH_TIMER_USR_VCT_ACCESS_EN; cntkctl |= ARCH_TIMER_USR_VCT_ACCESS_EN;
...@@ -993,7 +990,6 @@ static void __init arch_counter_register(unsigned type) ...@@ -993,7 +990,6 @@ static void __init arch_counter_register(unsigned type)
arch_timer_read_counter = arch_counter_get_cntpct; arch_timer_read_counter = arch_counter_get_cntpct;
clocksource_counter.archdata.vdso_direct = vdso_default; clocksource_counter.archdata.vdso_direct = vdso_default;
clocksource_counter.archdata.vdso_fix = vdso_fix;
} else { } else {
arch_timer_read_counter = arch_counter_get_cntvct_mem; arch_timer_read_counter = arch_counter_get_cntvct_mem;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册