Re: [PATCH 01/16] x86/tsc: Add a standalone helpers for getting TSC info from CPUID.0x15

2025-02-11 Thread Sean Christopherson
On Tue, Feb 11, 2025, Borislav Petkov wrote: > On Tue, Feb 11, 2025 at 09:25:47AM -0800, Sean Christopherson wrote: > > Because obviously optimizing code that's called once during boot is super > > critical? > > Because let's stick 'em where they belong and keep headers containing only > small, tr

Re: [PATCH 01/16] x86/tsc: Add a standalone helpers for getting TSC info from CPUID.0x15

2025-02-11 Thread Borislav Petkov
On Tue, Feb 11, 2025 at 09:25:47AM -0800, Sean Christopherson wrote: > Because obviously optimizing code that's called once during boot is super > critical? Because let's stick 'em where they belong and keep headers containing only small, trivial and inlineable functions. Having unusually big func

Re: [PATCH 01/16] x86/tsc: Add a standalone helpers for getting TSC info from CPUID.0x15

2025-02-11 Thread Sean Christopherson
On Tue, Feb 11, 2025, Borislav Petkov wrote: > On Fri, Jan 31, 2025 at 06:17:03PM -0800, Sean Christopherson wrote: > > Extract retrieval of TSC frequency information from CPUID into standalone > > helpers so that TDX guest support and kvmlock can reuse the logic. Provide > > a version that includ

Re: [PATCH 01/16] x86/tsc: Add a standalone helpers for getting TSC info from CPUID.0x15

2025-02-11 Thread Borislav Petkov
On Fri, Jan 31, 2025 at 06:17:03PM -0800, Sean Christopherson wrote: > Extract retrieval of TSC frequency information from CPUID into standalone > helpers so that TDX guest support and kvmlock can reuse the logic. Provide > a version that includes the multiplier math as TDX in particular does NOT

Re: [PATCH 01/16] x86/tsc: Add a standalone helpers for getting TSC info from CPUID.0x15

2025-02-05 Thread Sean Christopherson
On Fri, Jan 31, 2025, Sean Christopherson wrote: > +static inline int cpuid_get_tsc_freq(unsigned int *tsc_khz, > + unsigned int *crystal_khz) > +{ > + unsigned int denominator, numerator; > + > + if (cpuid_get_tsc_info(tsc_khz, &denominator, &numerator)) A

Re: [PATCH 01/16] x86/tsc: Add a standalone helpers for getting TSC info from CPUID.0x15

2025-02-03 Thread Sean Christopherson
On Mon, Feb 03, 2025, Nikunj A Dadhania wrote: > Sean Christopherson writes: > > Extract retrieval of TSC frequency information from CPUID into standalone > > helpers so that TDX guest support and kvmlock can reuse the logic. Provide > > s/kvmlock/kvmclock > > > a version that includes the mult

Re: [PATCH 01/16] x86/tsc: Add a standalone helpers for getting TSC info from CPUID.0x15

2025-02-02 Thread Nikunj A Dadhania
Sean Christopherson writes: > Extract retrieval of TSC frequency information from CPUID into standalone > helpers so that TDX guest support and kvmlock can reuse the logic. Provide s/kvmlock/kvmclock > a version that includes the multiplier math as TDX in particular does NOT > want to use nativ

[PATCH 01/16] x86/tsc: Add a standalone helpers for getting TSC info from CPUID.0x15

2025-01-31 Thread Sean Christopherson
Extract retrieval of TSC frequency information from CPUID into standalone helpers so that TDX guest support and kvmlock can reuse the logic. Provide a version that includes the multiplier math as TDX in particular does NOT want to use native_calibrate_tsc()'s fallback logic that derives the TSC fr