All of lore.kernel.org
 help / color / mirror / Atom feed
* [kvm:kvm-tdx-5.17 23/141] arch/x86/kernel/process.c:785:42: error: implicit declaration of function 'platform_has_tdx'
@ 2022-04-15 22:52 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-04-15 22:52 UTC (permalink / raw)
  To: Kai Huang
  Cc: llvm, kbuild-all, kvm, Robert Hu, Farrah Chen, Danmei Wei, Paolo Bonzini

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-15 22:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-15 22:52 [kvm:kvm-tdx-5.17 23/141] arch/x86/kernel/process.c:785:42: error: implicit declaration of function 'platform_has_tdx' kernel test robot

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.