Re: [PATCH] kvm: x86: emulate MSR_PLATFORM_INFO msr bits

From: kernel test robot
Date: Tue Aug 22 2023 - 12:50:48 EST


Hi Hao,

kernel test robot noticed the following build errors:

[auto build test ERROR on kvm/queue]
[also build test ERROR on mst-vhost/linux-next tip/x86/core linus/master v6.5-rc7 next-20230822]
[cannot apply to kvm/linux-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Hao-Xiang/kvm-x86-emulate-MSR_PLATFORM_INFO-msr-bits/20230821-125755
base: https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue
patch link: https://lore.kernel.org/r/1692588151-33716-1-git-send-email-hao.xiang%40linux.alibaba.com
patch subject: [PATCH] kvm: x86: emulate MSR_PLATFORM_INFO msr bits
config: i386-randconfig-003-20230822 (https://download.01.org/0day-ci/archive/20230823/202308230059.Z4m5fuN7-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230823/202308230059.Z4m5fuN7-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308230059.Z4m5fuN7-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

arch/x86/kvm/x86.c: In function 'kvm_get_msr_platform_info':
>> arch/x86/kvm/x86.c:1695:31: error: 'MSR_PLATFORM_INFO_MAX_NON_TURBO_RATIO' undeclared (first use in this function); did you mean 'MSR_PLATFORM_INFO_MAX_NON_TURBO_LIM_RATIO'?
1695 | msr_platform_info &= (MSR_PLATFORM_INFO_MAX_NON_TURBO_RATIO |
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| MSR_PLATFORM_INFO_MAX_NON_TURBO_LIM_RATIO
arch/x86/kvm/x86.c:1695:31: note: each undeclared identifier is reported only once for each function it appears in


vim +1695 arch/x86/kvm/x86.c

1678
1679
1680 static u64 kvm_get_msr_platform_info(void)
1681 {
1682 u64 msr_platform_info = 0;
1683
1684 rdmsrl_safe(MSR_PLATFORM_INFO, &msr_platform_info);
1685 /*
1686 * MSR_PLATFORM_INFO bits:
1687 * bit 15:8, Maximum Non-Turbo Ratio (MAX_NON_TURBO_LIM_RATIO)
1688 * bit 31, CPUID Faulting Enabled (CPUID_FAULTING_EN)
1689 * bit 47:40, Maximum Efficiency Ratio (MAX_EFFICIENCY_RATIO)
1690 *
1691 * Emulate part msr bits, expose above msr info to guest,
1692 * to make sure guest can get correct turbo frequency info.
1693 */
1694
> 1695 msr_platform_info &= (MSR_PLATFORM_INFO_MAX_NON_TURBO_RATIO |
1696 MSR_PLATFORM_INFO_MAX_EFFICIENCY_RATIO);
1697 msr_platform_info |= MSR_PLATFORM_INFO_CPUID_FAULT;
1698
1699 return msr_platform_info;
1700 }
1701

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki