[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202204230704.f0zI8eIQ-lkp@intel.com>
Date: Sat, 23 Apr 2022 07:52:58 +0800
From: kernel test robot <lkp@...el.com>
To: Yuan Yao <yuan.yao@...el.com>
Cc: llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
linux-kernel@...r.kernel.org,
Isaku Yamahata <isaku.yamahata@...el.com>
Subject: [intel-tdx:kvm-upstream-workaround 275/293]
arch/x86/kvm/vmx/tdx.c:2513:6: warning: variable 'intr_info' set but not
used
tree: https://github.com/intel/tdx.git kvm-upstream-workaround
head: d32e9a403c5c4f16dc577cbe92148e5b80f79d59
commit: da013991b3b3b4a9e20f84f268dc69f139aa8bdb [275/293] KVM: TDX: Basic exception injection support for DEBUG TDX guest
config: x86_64-allmodconfig (https://download.01.org/0day-ci/archive/20220423/202204230704.f0zI8eIQ-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 5bd87350a5ae429baf8f373cb226a57b62f87280)
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
# https://github.com/intel/tdx/commit/da013991b3b3b4a9e20f84f268dc69f139aa8bdb
git remote add intel-tdx https://github.com/intel/tdx.git
git fetch --no-tags intel-tdx kvm-upstream-workaround
git checkout da013991b3b3b4a9e20f84f268dc69f139aa8bdb
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash arch/x86/kvm/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
>> arch/x86/kvm/vmx/tdx.c:2513:6: warning: variable 'intr_info' set but not used [-Wunused-but-set-variable]
u32 intr_info;
^
1 warning generated.
vim +/intr_info +2513 arch/x86/kvm/vmx/tdx.c
2498
2499 void tdx_set_gdt(struct kvm_vcpu *vcpu, struct desc_ptr *dt)
2500 {
2501 if (!is_debug_td(vcpu))
2502 return;
2503
2504 td_vmcs_write32(to_tdx(vcpu), GUEST_GDTR_LIMIT, dt->size);
2505 td_vmcs_write64(to_tdx(vcpu), GUEST_GDTR_BASE, dt->address);
2506 }
2507 void tdx_queue_exception(struct kvm_vcpu *vcpu)
2508 {
2509 struct vcpu_tdx *tdx;
2510 unsigned int nr;
2511 bool has_error_code;
2512 u32 error_code;
> 2513 u32 intr_info;
2514
2515 if (KVM_BUG_ON(!is_debug_td(vcpu), vcpu->kvm))
2516 return;
2517
2518 tdx = to_tdx(vcpu);
2519 nr = vcpu->arch.exception.nr;
2520 has_error_code = vcpu->arch.exception.has_error_code;
2521 error_code = vcpu->arch.exception.error_code;
2522 intr_info = nr | INTR_INFO_VALID_MASK;
2523
2524 kvm_deliver_exception_payload(vcpu);
2525
2526 if (has_error_code) {
2527 td_vmcs_write32(tdx, VM_ENTRY_EXCEPTION_ERROR_CODE,
2528 error_code);
2529 intr_info |= INTR_INFO_DELIVER_CODE_MASK;
2530 }
2531
2532 if (kvm_exception_is_soft(nr)) {
2533 td_vmcs_write32(tdx, VM_ENTRY_INSTRUCTION_LEN,
2534 vcpu->arch.event_exit_inst_len);
2535 intr_info |= INTR_TYPE_SOFT_EXCEPTION;
2536 } else {
2537 intr_info |= INTR_TYPE_HARD_EXCEPTION;
2538 }
2539
2540 pr_warn_once("Exception injection is not supported by TDX.\n");
2541 /* td_vmcs_write32(tdx, VM_ENTRY_INTR_INFO_FIELD, intr_info);*/
2542 }
2543
--
0-DAY CI Kernel Test Service
https://01.org/lkp
Powered by blists - more mailing lists