From: kernel test robot <lkp@intel.com>
To: Xin3 Li <xin3.li@intel.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [xinli-intel-fred-public:intel-lkp 20/21] arch/x86/kvm/vmx/tdx.c:779:33: error: call to undeclared function 'read_msr'; ISO C99 and later do not support implicit function declarations
Date: Wed, 25 Jun 2025 15:00:19 +0800 [thread overview]
Message-ID: <202506251414.ubuFeMUa-lkp@intel.com> (raw)
tree: https://github.com/xinli-intel/linux-fred-public.git intel-lkp
head: f5a7aa46f2de853090449e1a5bb733628907c08b
commit: 4c8b4516efd0095821b118c1d1beaa3fd32d6dbe [20/21] KVM: VMX: Remove read_msr() defined in <asm/kvm_host.h>
config: x86_64-buildonly-randconfig-006-20250625 (https://download.01.org/0day-ci/archive/20250625/202506251414.ubuFeMUa-lkp@intel.com/config)
compiler: clang version 20.1.7 (https://github.com/llvm/llvm-project 6146a88f60492b520a36f8f8f3231e15f3cc6082)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250625/202506251414.ubuFeMUa-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/202506251414.ubuFeMUa-lkp@intel.com/
All errors (new ones prefixed by >>):
>> arch/x86/kvm/vmx/tdx.c:779:33: error: call to undeclared function 'read_msr'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
779 | vt->msr_host_kernel_gs_base = read_msr(MSR_KERNEL_GS_BASE);
| ^
1 error generated.
vim +/read_msr +779 arch/x86/kvm/vmx/tdx.c
90cfe144c8ed98 Sean Christopherson 2025-02-22 764
81bf40d54cd56e Isaku Yamahata 2025-01-29 765 /*
81bf40d54cd56e Isaku Yamahata 2025-01-29 766 * Compared to vmx_prepare_switch_to_guest(), there is not much to do
81bf40d54cd56e Isaku Yamahata 2025-01-29 767 * as SEAMCALL/SEAMRET calls take care of most of save and restore.
81bf40d54cd56e Isaku Yamahata 2025-01-29 768 */
81bf40d54cd56e Isaku Yamahata 2025-01-29 769 void tdx_prepare_switch_to_guest(struct kvm_vcpu *vcpu)
81bf40d54cd56e Isaku Yamahata 2025-01-29 770 {
81bf40d54cd56e Isaku Yamahata 2025-01-29 771 struct vcpu_vt *vt = to_vt(vcpu);
81bf40d54cd56e Isaku Yamahata 2025-01-29 772
81bf40d54cd56e Isaku Yamahata 2025-01-29 773 if (vt->guest_state_loaded)
81bf40d54cd56e Isaku Yamahata 2025-01-29 774 return;
81bf40d54cd56e Isaku Yamahata 2025-01-29 775
81bf40d54cd56e Isaku Yamahata 2025-01-29 776 if (likely(is_64bit_mm(current->mm)))
81bf40d54cd56e Isaku Yamahata 2025-01-29 777 vt->msr_host_kernel_gs_base = current->thread.gsbase;
81bf40d54cd56e Isaku Yamahata 2025-01-29 778 else
81bf40d54cd56e Isaku Yamahata 2025-01-29 @779 vt->msr_host_kernel_gs_base = read_msr(MSR_KERNEL_GS_BASE);
81bf40d54cd56e Isaku Yamahata 2025-01-29 780
8af099037527c5 Adrian Hunter 2025-01-29 781 vt->host_debugctlmsr = get_debugctlmsr();
8af099037527c5 Adrian Hunter 2025-01-29 782
81bf40d54cd56e Isaku Yamahata 2025-01-29 783 vt->guest_state_loaded = true;
81bf40d54cd56e Isaku Yamahata 2025-01-29 784 }
81bf40d54cd56e Isaku Yamahata 2025-01-29 785
:::::: The code at line 779 was first introduced by commit
:::::: 81bf40d54cd56e33b4cd381cc719efaa53832468 KVM: TDX: vcpu_run: save/restore host state(host kernel gs)
:::::: TO: Isaku Yamahata <isaku.yamahata@intel.com>
:::::: CC: Paolo Bonzini <pbonzini@redhat.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2025-06-25 7:01 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=202506251414.ubuFeMUa-lkp@intel.com \
--to=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=xin3.li@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.