Re: [PATCH v4 2/6] KVM: x86: Move guest_mode helpers to x86.h

kernel test robot
2026-03-27T03:15:44Z

Hi Yosry,

kernel test robot noticed the following build errors:

[auto build test ERROR on 3d6cdcc8883b5726513d245eef0e91cabfc397f7]

url: https://github.com/intel-lab-lkp/linux/commits/Yosry-Ahmed/KVM-x86-Move-enable_pmu-enable_mediated_pmu-to-pmu-h-and-pmu-c/20260326-191518
base: 3d6cdcc8883b5726513d245eef0e91cabfc397f7
patch link: https://lore.kernel.org/r/20260326031150.3774017-3-yosry%40kernel.org
patch subject: [PATCH v4 2/6] KVM: x86: Move guest_mode helpers to x86.h
config: i386-allmodconfig (https://download.01.org/0day-ci/archive/20260327/202603271150.0WNYfBuF-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260327/202603271150.0WNYfBuF-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603271150.0WNYfBuF-lkp@intel.com/

All errors (new ones prefixed by >>):

In file included from arch/x86/kvm/svm/svm_onhyperv.c:11:
arch/x86/kvm/svm/svm.h: In function 'svm_mark_intercepts_dirty':
>> arch/x86/kvm/svm/svm.h:520:13: error: implicit declaration of function 'is_guest_mode' [-Wimplicit-function-declaration]
520 | if (is_guest_mode(&svm->vcpu))
| ^~~~~~~~~~~~~
In file included from arch/x86/kvm/svm/svm_ops.h:7,
from arch/x86/kvm/svm/svm_onhyperv.c:12:
arch/x86/kvm/x86.h: At top level:
>> arch/x86/kvm/x86.h:169:20: error: conflicting types for 'is_guest_mode'; have 'bool(struct kvm_vcpu *)' {aka '_Bool(struct kvm_vcpu *)'}
169 | static inline bool is_guest_mode(struct kvm_vcpu *vcpu)
| ^~~~~~~~~~~~~
arch/x86/kvm/svm/svm.h:520:13: note: previous implicit declaration of 'is_guest_mode' with type 'int()'
520 | if (is_guest_mode(&svm->vcpu))
| ^~~~~~~~~~~~~
--
In file included from kvm/svm/svm_onhyperv.c:11:
kvm/svm/svm.h: In function 'svm_mark_intercepts_dirty':
kvm/svm/svm.h:520:13: error: implicit declaration of function 'is_guest_mode' [-Wimplicit-function-declaration]
520 | if (is_guest_mode(&svm->vcpu))
| ^~~~~~~~~~~~~
In file included from kvm/svm/svm_ops.h:7,
from kvm/svm/svm_onhyperv.c:12:
arch/x86/kvm/x86.h: At top level:
>> arch/x86/kvm/x86.h:169:20: error: conflicting types for 'is_guest_mode'; have 'bool(struct kvm_vcpu *)' {aka '_Bool(struct kvm_vcpu *)'}
169 | static inline bool is_guest_mode(struct kvm_vcpu *vcpu)
| ^~~~~~~~~~~~~
kvm/svm/svm.h:520:13: note: previous implicit declaration of 'is_guest_mode' with type 'int()'
520 | if (is_guest_mode(&svm->vcpu))
| ^~~~~~~~~~~~~

vim +/is_guest_mode +520 arch/x86/kvm/svm/svm.h

0b97f929831a70 Sean Christopherson 2026-02-18 509
0b97f929831a70 Sean Christopherson 2026-02-18 510 static inline void svm_mark_intercepts_dirty(struct vcpu_svm *svm)
0b97f929831a70 Sean Christopherson 2026-02-18 511 {
0b97f929831a70 Sean Christopherson 2026-02-18 512 vmcb_mark_dirty(svm->vmcb01.ptr, VMCB_INTERCEPTS);
0b97f929831a70 Sean Christopherson 2026-02-18 513
0b97f929831a70 Sean Christopherson 2026-02-18 514 /*
0b97f929831a70 Sean Christopherson 2026-02-18 515 * If L2 is active, recalculate the intercepts for vmcb02 to account
0b97f929831a70 Sean Christopherson 2026-02-18 516 * for the changes made to vmcb01. All intercept configuration is done
0b97f929831a70 Sean Christopherson 2026-02-18 517 * for vmcb01 and then propagated to vmcb02 to combine KVM's intercepts
0b97f929831a70 Sean Christopherson 2026-02-18 518 * with L1's intercepts (from the vmcb12 snapshot).
0b97f929831a70 Sean Christopherson 2026-02-18 519 */
0b97f929831a70 Sean Christopherson 2026-02-18 @520 if (is_guest_mode(&svm->vcpu))
0b97f929831a70 Sean Christopherson 2026-02-18 521 nested_vmcb02_recalc_intercepts(svm);
0b97f929831a70 Sean Christopherson 2026-02-18 522 }
0b97f929831a70 Sean Christopherson 2026-02-18 523

--
0-DAY CI Kernel Test Service