Re: [PATCH 4/8] KVM: x86: allow kvm_x86_ops.set_efer to return a value

kernel test robot
2020-08-25T22:49:23Z

[-- Attachment #1: Type: text/plain, Size: 3145 bytes --]

Hi Maxim,

I love your patch! Yet something to improve:

[auto build test ERROR on kvm/linux-next]
[also build test ERROR on v5.9-rc2 next-20200825]
[cannot apply to vhost/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]

url: https://github.com/0day-ci/linux/commits/Maxim-Levitsky/KVM-nSVM-ondemand-nested-state-allocation-nested-guest-state-caching/20200820-171720
base: https://git.kernel.org/pub/scm/virt/kvm/kvm.git linux-next
config: x86_64-randconfig-a001-20200826 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 77e5a195f818b9ace91f7b12ab948b21d7918238)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> arch/x86/kvm/vmx/vmx.c:2865:5: error: conflicting types for 'vmx_set_efer'
int vmx_set_efer(struct kvm_vcpu *vcpu, u64 efer)
^
arch/x86/kvm/vmx/vmx.h:337:6: note: previous declaration is here
void vmx_set_efer(struct kvm_vcpu *vcpu, u64 efer);
^
>> arch/x86/kvm/vmx/vmx.c:7913:14: error: incompatible function pointer types initializing 'int (*)(struct kvm_vcpu *, u64)' (aka 'int (*)(struct kvm_vcpu *, unsigned long long)') with an expression of type 'void (struct kvm_vcpu *, u64)' (aka 'void (struct kvm_vcpu *, unsigned long long)') [-Werror,-Wincompatible-function-pointer-types]
.set_efer = vmx_set_efer,
^~~~~~~~~~~~
2 errors generated.

# https://github.com/0day-ci/linux/commit/9196b5409d5cb9f0b5536914ecb139ce456ea889
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Maxim-Levitsky/KVM-nSVM-ondemand-nested-state-allocation-nested-guest-state-caching/20200820-171720
git checkout 9196b5409d5cb9f0b5536914ecb139ce456ea889
vim +/vmx_set_efer +2865 arch/x86/kvm/vmx/vmx.c

2864
> 2865 int vmx_set_efer(struct kvm_vcpu *vcpu, u64 efer)
2866 {
2867 struct vcpu_vmx *vmx = to_vmx(vcpu);
2868 struct shared_msr_entry *msr = find_msr_entry(vmx, MSR_EFER);
2869
2870 if (!msr)
2871 return 1;
2872
2873 vcpu->arch.efer = efer;
2874 if (efer & EFER_LMA) {
2875 vm_entry_controls_setbit(to_vmx(vcpu), VM_ENTRY_IA32E_MODE);
2876 msr->data = efer;
2877 } else {
2878 vm_entry_controls_clearbit(to_vmx(vcpu), VM_ENTRY_IA32E_MODE);
2879
2880 msr->data = efer & ~EFER_LME;
2881 }
2882 setup_msrs(vmx);
2883 return 0;
2884 }
2885

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 35969 bytes --]