public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Yuan Yao <yuan.yao@intel.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org,
	Isaku Yamahata <isaku.yamahata@intel.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
Date: Sat, 23 Apr 2022 07:52:58 +0800	[thread overview]
Message-ID: <202204230704.f0zI8eIQ-lkp@intel.com> (raw)

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@intel.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

                 reply	other threads:[~2022-04-22 23:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202204230704.f0zI8eIQ-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=isaku.yamahata@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=yuan.yao@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox