Re: [PATCH v4 02/10] KVM: arm/arm64: Factor out hypercall handling from PSCI code

From: kbuild test robot
Date: Mon Sep 02 2019 - 03:07:36 EST


Hi Steven,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[cannot apply to v5.3-rc6 next-20190830]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Steven-Price/arm64-Stolen-time-support/20190901-185152
config: i386-randconfig-a002-201935 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-11) 7.4.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All error/warnings (new ones prefixed by >>):

In file included from include/kvm/arm_hypercalls.h:7:0,
from <command-line>:0:
>> arch/x86/include/asm/kvm_emulate.h:349:22: error: 'NR_VCPU_REGS' undeclared here (not in a function)
unsigned long _regs[NR_VCPU_REGS];
^~~~~~~~~~~~
In file included from <command-line>:0:0:
>> include/kvm/arm_hypercalls.h:9:33: warning: 'struct kvm_vcpu' declared inside parameter list will not be visible outside of this definition or declaration
int kvm_hvc_call_handler(struct kvm_vcpu *vcpu);
^~~~~~~~
include/kvm/arm_hypercalls.h:11:45: warning: 'struct kvm_vcpu' declared inside parameter list will not be visible outside of this definition or declaration
static inline u32 smccc_get_function(struct kvm_vcpu *vcpu)
^~~~~~~~
include/kvm/arm_hypercalls.h: In function 'smccc_get_function':
>> include/kvm/arm_hypercalls.h:13:9: error: implicit declaration of function 'vcpu_get_reg' [-Werror=implicit-function-declaration]
return vcpu_get_reg(vcpu, 0);
^~~~~~~~~~~~
include/kvm/arm_hypercalls.h: At top level:
include/kvm/arm_hypercalls.h:16:51: warning: 'struct kvm_vcpu' declared inside parameter list will not be visible outside of this definition or declaration
static inline unsigned long smccc_get_arg1(struct kvm_vcpu *vcpu)
^~~~~~~~
include/kvm/arm_hypercalls.h:21:51: warning: 'struct kvm_vcpu' declared inside parameter list will not be visible outside of this definition or declaration
static inline unsigned long smccc_get_arg2(struct kvm_vcpu *vcpu)
^~~~~~~~
include/kvm/arm_hypercalls.h:26:51: warning: 'struct kvm_vcpu' declared inside parameter list will not be visible outside of this definition or declaration
static inline unsigned long smccc_get_arg3(struct kvm_vcpu *vcpu)
^~~~~~~~
include/kvm/arm_hypercalls.h:31:44: warning: 'struct kvm_vcpu' declared inside parameter list will not be visible outside of this definition or declaration
static inline void smccc_set_retval(struct kvm_vcpu *vcpu,
^~~~~~~~
include/kvm/arm_hypercalls.h: In function 'smccc_set_retval':
>> include/kvm/arm_hypercalls.h:37:2: error: implicit declaration of function 'vcpu_set_reg'; did you mean 'smccc_set_retval'? [-Werror=implicit-function-declaration]
vcpu_set_reg(vcpu, 0, a0);
^~~~~~~~~~~~
smccc_set_retval
cc1: some warnings being treated as errors

vim +/NR_VCPU_REGS +349 arch/x86/include/asm/kvm_emulate.h

a584539b24b87d arch/x86/include/asm/kvm_emulate.h Paolo Bonzini 2015-04-01 290
9dac77fa4011bd arch/x86/include/asm/kvm_emulate.h Avi Kivity 2011-06-01 291 struct x86_emulate_ctxt {
0225fb509d51fc arch/x86/include/asm/kvm_emulate.h Mathias Krause 2012-08-30 292 const struct x86_emulate_ops *ops;
9dac77fa4011bd arch/x86/include/asm/kvm_emulate.h Avi Kivity 2011-06-01 293
9dac77fa4011bd arch/x86/include/asm/kvm_emulate.h Avi Kivity 2011-06-01 294 /* Register state before/after emulation. */
9dac77fa4011bd arch/x86/include/asm/kvm_emulate.h Avi Kivity 2011-06-01 295 unsigned long eflags;
9dac77fa4011bd arch/x86/include/asm/kvm_emulate.h Avi Kivity 2011-06-01 296 unsigned long eip; /* eip before instruction emulation */
9dac77fa4011bd arch/x86/include/asm/kvm_emulate.h Avi Kivity 2011-06-01 297 /* Emulated execution mode, represented by an X86EMUL_MODE value. */
9d1b39a967871b arch/x86/include/asm/kvm_emulate.h Gleb Natapov 2012-09-03 298 enum x86emul_mode mode;
9dac77fa4011bd arch/x86/include/asm/kvm_emulate.h Avi Kivity 2011-06-01 299
9dac77fa4011bd arch/x86/include/asm/kvm_emulate.h Avi Kivity 2011-06-01 300 /* interruptibility state, as a result of execution of STI or MOV SS */
9dac77fa4011bd arch/x86/include/asm/kvm_emulate.h Avi Kivity 2011-06-01 301 int interruptibility;
9dac77fa4011bd arch/x86/include/asm/kvm_emulate.h Avi Kivity 2011-06-01 302
9dac77fa4011bd arch/x86/include/asm/kvm_emulate.h Avi Kivity 2011-06-01 303 bool perm_ok; /* do not check permissions if true */
b51e974fcdabd0 arch/x86/include/asm/kvm_emulate.h Borislav Petkov 2013-09-22 304 bool ud; /* inject an #UD if host doesn't support insn */
c8401dda2f0a00 arch/x86/include/asm/kvm_emulate.h Paolo Bonzini 2017-06-07 305 bool tf; /* TF value before instruction (after for syscall/sysret) */
9dac77fa4011bd arch/x86/include/asm/kvm_emulate.h Avi Kivity 2011-06-01 306
9dac77fa4011bd arch/x86/include/asm/kvm_emulate.h Avi Kivity 2011-06-01 307 bool have_exception;
9dac77fa4011bd arch/x86/include/asm/kvm_emulate.h Avi Kivity 2011-06-01 308 struct x86_exception exception;
9dac77fa4011bd arch/x86/include/asm/kvm_emulate.h Avi Kivity 2011-06-01 309
1ce19dc16ce913 arch/x86/include/asm/kvm_emulate.h Borislav Petkov 2013-09-22 310 /*
1ce19dc16ce913 arch/x86/include/asm/kvm_emulate.h Borislav Petkov 2013-09-22 311 * decode cache
1ce19dc16ce913 arch/x86/include/asm/kvm_emulate.h Borislav Petkov 2013-09-22 312 */
1ce19dc16ce913 arch/x86/include/asm/kvm_emulate.h Borislav Petkov 2013-09-22 313
1ce19dc16ce913 arch/x86/include/asm/kvm_emulate.h Borislav Petkov 2013-09-22 314 /* current opcode length in bytes */
1ce19dc16ce913 arch/x86/include/asm/kvm_emulate.h Borislav Petkov 2013-09-22 315 u8 opcode_len;
e4e03deda83b1f drivers/kvm/x86_emulate.h Laurent Vivier 2007-09-18 316 u8 b;
c4f035c60dad45 arch/x86/include/asm/kvm_emulate.h Avi Kivity 2011-04-04 317 u8 intercept;
e4e03deda83b1f drivers/kvm/x86_emulate.h Laurent Vivier 2007-09-18 318 u8 op_bytes;
e4e03deda83b1f drivers/kvm/x86_emulate.h Laurent Vivier 2007-09-18 319 u8 ad_bytes;
e4e03deda83b1f drivers/kvm/x86_emulate.h Laurent Vivier 2007-09-18 320 struct operand src;
0dc8d10f7d848b arch/x86/include/asm/kvm_x86_emulate.h Guillaume Thouvenin 2008-12-04 321 struct operand src2;
e4e03deda83b1f drivers/kvm/x86_emulate.h Laurent Vivier 2007-09-18 322 struct operand dst;
ef65c88912cafe arch/x86/include/asm/kvm_emulate.h Avi Kivity 2010-07-29 323 int (*execute)(struct x86_emulate_ctxt *ctxt);
d09beabd7cd4cf arch/x86/include/asm/kvm_emulate.h Joerg Roedel 2011-04-04 324 int (*check_perm)(struct x86_emulate_ctxt *ctxt);
41061cdb98a0be arch/x86/include/asm/kvm_emulate.h Bandan Das 2014-04-16 325 /*
41061cdb98a0be arch/x86/include/asm/kvm_emulate.h Bandan Das 2014-04-16 326 * The following six fields are cleared together,
41061cdb98a0be arch/x86/include/asm/kvm_emulate.h Bandan Das 2014-04-16 327 * the rest are initialized unconditionally in x86_decode_insn
41061cdb98a0be arch/x86/include/asm/kvm_emulate.h Bandan Das 2014-04-16 328 * or elsewhere
41061cdb98a0be arch/x86/include/asm/kvm_emulate.h Bandan Das 2014-04-16 329 */
c44b4c6ab80eef arch/x86/include/asm/kvm_emulate.h Bandan Das 2014-04-16 330 bool rip_relative;
c44b4c6ab80eef arch/x86/include/asm/kvm_emulate.h Bandan Das 2014-04-16 331 u8 rex_prefix;
c44b4c6ab80eef arch/x86/include/asm/kvm_emulate.h Bandan Das 2014-04-16 332 u8 lock_prefix;
c44b4c6ab80eef arch/x86/include/asm/kvm_emulate.h Bandan Das 2014-04-16 333 u8 rep_prefix;
c44b4c6ab80eef arch/x86/include/asm/kvm_emulate.h Bandan Das 2014-04-16 334 /* bitmaps of registers in _regs[] that can be read */
c44b4c6ab80eef arch/x86/include/asm/kvm_emulate.h Bandan Das 2014-04-16 335 u32 regs_valid;
c44b4c6ab80eef arch/x86/include/asm/kvm_emulate.h Bandan Das 2014-04-16 336 /* bitmaps of registers in _regs[] that have been written */
c44b4c6ab80eef arch/x86/include/asm/kvm_emulate.h Bandan Das 2014-04-16 337 u32 regs_dirty;
e4e03deda83b1f drivers/kvm/x86_emulate.h Laurent Vivier 2007-09-18 338 /* modrm */
e4e03deda83b1f drivers/kvm/x86_emulate.h Laurent Vivier 2007-09-18 339 u8 modrm;
e4e03deda83b1f drivers/kvm/x86_emulate.h Laurent Vivier 2007-09-18 340 u8 modrm_mod;
e4e03deda83b1f drivers/kvm/x86_emulate.h Laurent Vivier 2007-09-18 341 u8 modrm_reg;
e4e03deda83b1f drivers/kvm/x86_emulate.h Laurent Vivier 2007-09-18 342 u8 modrm_rm;
09ee57cdae3156 arch/x86/include/asm/kvm_emulate.h Avi Kivity 2010-08-01 343 u8 modrm_seg;
573e80fe04db1a arch/x86/include/asm/kvm_emulate.h Bandan Das 2014-04-16 344 u8 seg_override;
c44b4c6ab80eef arch/x86/include/asm/kvm_emulate.h Bandan Das 2014-04-16 345 u64 d;
36dd9bb5ce32bc arch/x86/include/asm/kvm_emulate.h Avi Kivity 2011-06-01 346 unsigned long _eip;
cbd27ee783f1e5 arch/x86/include/asm/kvm_emulate.h Avi Kivity 2012-06-10 347 struct operand memop;
b5c9ff731f3cee arch/x86/include/asm/kvm_emulate.h Takuya Yoshikawa 2011-05-25 348 /* Fields above regs are cleared together. */
dd856efafe6097 arch/x86/include/asm/kvm_emulate.h Avi Kivity 2012-08-27 @349 unsigned long _regs[NR_VCPU_REGS];
f09ed83e211d25 arch/x86/include/asm/kvm_emulate.h Avi Kivity 2011-09-13 350 struct operand *memopp;
6226686954c4cc drivers/kvm/x86_emulate.h Avi Kivity 2007-11-20 351 struct fetch_cache fetch;
7b262e90fc20a4 arch/x86/include/asm/kvm_emulate.h Gleb Natapov 2010-03-18 352 struct read_cache io_read;
9de41573675cba arch/x86/include/asm/kvm_emulate.h Gleb Natapov 2010-04-28 353 struct read_cache mem_read;
e4e03deda83b1f drivers/kvm/x86_emulate.h Laurent Vivier 2007-09-18 354 };
e4e03deda83b1f drivers/kvm/x86_emulate.h Laurent Vivier 2007-09-18 355

:::::: The code at line 349 was first introduced by commit
:::::: dd856efafe6097a5c9104725c2bca74430423db8 KVM: x86 emulator: access GPRs on demand

:::::: TO: Avi Kivity <avi@xxxxxxxxxx>
:::::: CC: Marcelo Tosatti <mtosatti@xxxxxxxxxx>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip