[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v2 04/11] xen/amd: export processor max frequency value
When _CPC table could not provide processor frequency range values for OS governor, we need to read processor max frequency as anchor point. For AMD processors, we export max frequency value from amd_log_freq() Signed-off-by: Penny Zheng <Penny.Zheng@xxxxxxx> --- v1 -> v2: - new commit --- xen/arch/x86/cpu/amd.c | 7 +++++++ xen/arch/x86/include/asm/amd.h | 1 + 2 files changed, 8 insertions(+) diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c index 597b0f073d..489e092815 100644 --- a/xen/arch/x86/cpu/amd.c +++ b/xen/arch/x86/cpu/amd.c @@ -56,6 +56,8 @@ bool __initdata amd_virt_spec_ctrl; static bool __read_mostly fam17_c6_disabled; +DEFINE_PER_CPU_READ_MOSTLY(uint64_t, max_freq_mhz); + static inline int rdmsr_amd_safe(unsigned int msr, unsigned int *lo, unsigned int *hi) { @@ -669,7 +671,12 @@ void amd_log_freq(const struct cpuinfo_x86 *c) printk("CPU%u: %lu ... %lu MHz\n", smp_processor_id(), FREQ(lo), FREQ(hi)); else + { printk("CPU%u: %lu MHz\n", smp_processor_id(), FREQ(lo)); + return; + } + + per_cpu(max_freq_mhz, smp_processor_id()) = FREQ(hi); #undef FREQ } diff --git a/xen/arch/x86/include/asm/amd.h b/xen/arch/x86/include/asm/amd.h index 9c9599a622..96367ba646 100644 --- a/xen/arch/x86/include/asm/amd.h +++ b/xen/arch/x86/include/asm/amd.h @@ -174,4 +174,5 @@ bool amd_setup_legacy_ssbd(void); void amd_set_legacy_ssbd(bool enable); void amd_set_cpuid_user_dis(bool enable); +DECLARE_PER_CPU(uint64_t, max_freq_mhz); #endif /* __AMD_H__ */ -- 2.34.1
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |