From: kernel test robot <lkp@intel.com>
To: Kai Huang <kai.huang@intel.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
kvm@vger.kernel.org, Robert Hu <robert.hu@intel.com>,
Farrah Chen <farrah.chen@intel.com>,
Danmei Wei <danmei.wei@intel.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: [kvm:kvm-tdx-5.17 23/141] arch/x86/kernel/process.c:785:42: error: implicit declaration of function 'platform_has_tdx'
Date: Sat, 16 Apr 2022 06:52:45 +0800 [thread overview]
Message-ID: <202204160600.8e4g9QZR-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/virt/kvm/kvm.git kvm-tdx-5.17
head: a50e4531e92e36f185ea32843c149c4703451109
commit: bf2274dac8e8671ae89971ae8c89f4f2f8f13095 [23/141] x86: Flush cache of TDX private memory during kexec()
config: x86_64-randconfig-a016 (https://download.01.org/0day-ci/archive/20220416/202204160600.8e4g9QZR-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 8e43cbab33765c476337571e5ed11b005199dd0d)
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://git.kernel.org/pub/scm/virt/kvm/kvm.git/commit/?id=bf2274dac8e8671ae89971ae8c89f4f2f8f13095
git remote add kvm https://git.kernel.org/pub/scm/virt/kvm/kvm.git
git fetch --no-tags kvm kvm-tdx-5.17
git checkout bf2274dac8e8671ae89971ae8c89f4f2f8f13095
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
>> arch/x86/kernel/process.c:785:42: error: implicit declaration of function 'platform_has_tdx' [-Werror,-Wimplicit-function-declaration]
if ((cpuid_eax(0x8000001f) & BIT(0)) || platform_has_tdx())
^
1 error generated.
vim +/platform_has_tdx +785 arch/x86/kernel/process.c
749
750 void stop_this_cpu(void *dummy)
751 {
752 local_irq_disable();
753 /*
754 * Remove this CPU:
755 */
756 set_cpu_online(smp_processor_id(), false);
757 disable_local_APIC();
758 mcheck_cpu_clear(this_cpu_ptr(&cpu_info));
759
760 /*
761 * Use wbinvd on processors that support SME. This provides support
762 * for performing a successful kexec when going from SME inactive
763 * to SME active (or vice-versa). The cache must be cleared so that
764 * if there are entries with the same physical address, both with and
765 * without the encryption bit, they don't race each other when flushed
766 * and potentially end up with the wrong entry being committed to
767 * memory.
768 *
769 * Test the CPUID bit directly because the machine might've cleared
770 * X86_FEATURE_SME due to cmdline options.
771 *
772 * In case of kexec, similar to SME, if TDX is ever enabled, the
773 * cachelines of TDX private memory (including PAMTs) used by TDX
774 * module need to be flushed before transiting to the new kernel,
775 * otherwise they may silently corrupt the new kernel.
776 *
777 * Note TDX is enabled on demand at runtime, and enabling TDX has a
778 * state machine protected with a mutex to prevent concurrent calls
779 * from multiple callers. Holding the mutex is required to get the
780 * TDX enabling status, but this function runs in interrupt context.
781 * So to make it simple, always flush cache when platform supports
782 * TDX (detected at boot time), regardless whether TDX is truly
783 * enabled by kernel.
784 */
> 785 if ((cpuid_eax(0x8000001f) & BIT(0)) || platform_has_tdx())
786 native_wbinvd();
787 for (;;) {
788 /*
789 * Use native_halt() so that memory contents don't change
790 * (stack usage and variables) after possibly issuing the
791 * native_wbinvd() above.
792 */
793 native_halt();
794 }
795 }
796
--
0-DAY CI Kernel Test Service
https://01.org/lkp
reply other threads:[~2022-04-15 22: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=202204160600.8e4g9QZR-lkp@intel.com \
--to=lkp@intel.com \
--cc=danmei.wei@intel.com \
--cc=farrah.chen@intel.com \
--cc=kai.huang@intel.com \
--cc=kbuild-all@lists.01.org \
--cc=kvm@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=pbonzini@redhat.com \
--cc=robert.hu@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;
as well as URLs for NNTP newsgroup(s).