Re: [RFC 1/2] x86/tsc: add a timer to make sure tsc_adjust is always checked

2021-04-11 Thread Feng Tang
On Sat, Apr 10, 2021 at 08:46:38PM +0200, Thomas Gleixner wrote: > Feng, > > On Sat, Apr 10 2021 at 22:38, Feng Tang wrote: > > On Sat, Apr 10, 2021 at 11:27:11AM +0200, Thomas Gleixner wrote: > >> > +static int __init start_sync_check_timer(void) > >> > +{ > >> > +if (!boot_cpu_has(X86_FE

Re: [RFC 1/2] x86/tsc: add a timer to make sure tsc_adjust is always checked

2021-04-10 Thread Thomas Gleixner
Feng, On Sat, Apr 10 2021 at 22:38, Feng Tang wrote: > On Sat, Apr 10, 2021 at 11:27:11AM +0200, Thomas Gleixner wrote: >> > +static int __init start_sync_check_timer(void) >> > +{ >> > + if (!boot_cpu_has(X86_FEATURE_TSC_ADJUST)) >> > + return 0; >> > + >> > + timer_setup(&tsc_sync_che

Re: [RFC 1/2] x86/tsc: add a timer to make sure tsc_adjust is always checked

2021-04-10 Thread Thomas Gleixner
On Sat, Apr 10 2021 at 11:47, Borislav Petkov wrote: > On Sat, Apr 10, 2021 at 11:27:11AM +0200, Thomas Gleixner wrote: >> On Tue, Mar 30 2021 at 16:25, Feng Tang wrote: >> > Normally the tsc_sync will be checked every time system enters idle state, >> > but there is still caveat that a system won

Re: [RFC 1/2] x86/tsc: add a timer to make sure tsc_adjust is always checked

2021-04-10 Thread Borislav Petkov
On Sat, Apr 10, 2021 at 10:48:56PM +0800, Feng Tang wrote: > And the bigger risk is still BIOS's writing to TSC_ADJUST MSR beneath > kernel. For that we need to do more persuasive work with hw guys. Needs a *lot* of perseverance. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes

Re: [RFC 1/2] x86/tsc: add a timer to make sure tsc_adjust is always checked

2021-04-10 Thread Feng Tang
Hi Boris, On Sat, Apr 10, 2021 at 11:47:52AM +0200, Borislav Petkov wrote: > On Sat, Apr 10, 2021 at 11:27:11AM +0200, Thomas Gleixner wrote: > > On Tue, Mar 30 2021 at 16:25, Feng Tang wrote: > > > Normally the tsc_sync will be checked every time system enters idle state, > > > but there is still

Re: [RFC 1/2] x86/tsc: add a timer to make sure tsc_adjust is always checked

2021-04-10 Thread Feng Tang
Hi Thomas, On Sat, Apr 10, 2021 at 11:27:11AM +0200, Thomas Gleixner wrote: > On Tue, Mar 30 2021 at 16:25, Feng Tang wrote: > > Normally the tsc_sync will be checked every time system enters idle state, > > but there is still caveat that a system won't enter idle, either because > > it's too busy

Re: [RFC 1/2] x86/tsc: add a timer to make sure tsc_adjust is always checked

2021-04-10 Thread Borislav Petkov
On Sat, Apr 10, 2021 at 11:27:11AM +0200, Thomas Gleixner wrote: > On Tue, Mar 30 2021 at 16:25, Feng Tang wrote: > > Normally the tsc_sync will be checked every time system enters idle state, > > but there is still caveat that a system won't enter idle, either because > > it's too busy or configur

Re: [RFC 1/2] x86/tsc: add a timer to make sure tsc_adjust is always checked

2021-04-10 Thread Thomas Gleixner
On Tue, Mar 30 2021 at 16:25, Feng Tang wrote: > Normally the tsc_sync will be checked every time system enters idle state, > but there is still caveat that a system won't enter idle, either because > it's too busy or configured purposely to not enter idle. Setup a periodic > timer to make sure the