All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Kai Huang <kai.huang@intel.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	x86@kernel.org, Dave Hansen <dave.hansen@linux.intel.com>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Subject: [tip:x86/tdx 8/12] arch/x86/coco/tdx/tdx.c:733:27: error: implicit declaration of function '__tdx_hypercall_ret'; did you mean '__tdx_hypercall'?
Date: Wed, 13 Sep 2023 06:32:32 +0800	[thread overview]
Message-ID: <202309130622.Ba60ODDl-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/tdx
head:   d6cb0f01644c5cd2bc51b88df933e07849cfaa76
commit: f9ea69e6406abf2145aba7987e7b81ea1b4ea356 [8/12] x86/tdx: Make TDX_HYPERCALL asm similar to TDX_MODULE_CALL
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20230913/202309130622.Ba60ODDl-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230913/202309130622.Ba60ODDl-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/202309130622.Ba60ODDl-lkp@intel.com/

All errors (new ones prefixed by >>):

   arch/x86/coco/tdx/tdx.c: In function 'tdx_map_gpa':
>> arch/x86/coco/tdx/tdx.c:733:27: error: implicit declaration of function '__tdx_hypercall_ret'; did you mean '__tdx_hypercall'? [-Werror=implicit-function-declaration]
     733 |                 u64 ret = __tdx_hypercall_ret(&args);
         |                           ^~~~~~~~~~~~~~~~~~~
         |                           __tdx_hypercall
   cc1: some warnings being treated as errors


vim +733 arch/x86/coco/tdx/tdx.c

7dbde763162989 Kirill A. Shutemov 2022-04-06  707  
7dbde763162989 Kirill A. Shutemov 2022-04-06  708  /*
019b383d1132e4 Dexuan Cui         2023-08-10  709   * Notify the VMM about page mapping conversion. More info about ABI
019b383d1132e4 Dexuan Cui         2023-08-10  710   * can be found in TDX Guest-Host-Communication Interface (GHCI),
019b383d1132e4 Dexuan Cui         2023-08-10  711   * section "TDG.VP.VMCALL<MapGPA>".
7dbde763162989 Kirill A. Shutemov 2022-04-06  712   */
019b383d1132e4 Dexuan Cui         2023-08-10  713  static bool tdx_map_gpa(phys_addr_t start, phys_addr_t end, bool enc)
7dbde763162989 Kirill A. Shutemov 2022-04-06  714  {
019b383d1132e4 Dexuan Cui         2023-08-10  715  	/* Retrying the hypercall a second time should succeed; use 3 just in case */
019b383d1132e4 Dexuan Cui         2023-08-10  716  	const int max_retries_per_page = 3;
019b383d1132e4 Dexuan Cui         2023-08-10  717  	int retry_count = 0;
7dbde763162989 Kirill A. Shutemov 2022-04-06  718  
7dbde763162989 Kirill A. Shutemov 2022-04-06  719  	if (!enc) {
7dbde763162989 Kirill A. Shutemov 2022-04-06  720  		/* Set the shared (decrypted) bits: */
7dbde763162989 Kirill A. Shutemov 2022-04-06  721  		start |= cc_mkdec(0);
7dbde763162989 Kirill A. Shutemov 2022-04-06  722  		end   |= cc_mkdec(0);
7dbde763162989 Kirill A. Shutemov 2022-04-06  723  	}
7dbde763162989 Kirill A. Shutemov 2022-04-06  724  
019b383d1132e4 Dexuan Cui         2023-08-10  725  	while (retry_count < max_retries_per_page) {
019b383d1132e4 Dexuan Cui         2023-08-10  726  		struct tdx_hypercall_args args = {
019b383d1132e4 Dexuan Cui         2023-08-10  727  			.r10 = TDX_HYPERCALL_STANDARD,
019b383d1132e4 Dexuan Cui         2023-08-10  728  			.r11 = TDVMCALL_MAP_GPA,
019b383d1132e4 Dexuan Cui         2023-08-10  729  			.r12 = start,
019b383d1132e4 Dexuan Cui         2023-08-10  730  			.r13 = end - start };
019b383d1132e4 Dexuan Cui         2023-08-10  731  
019b383d1132e4 Dexuan Cui         2023-08-10  732  		u64 map_fail_paddr;
019b383d1132e4 Dexuan Cui         2023-08-10 @733  		u64 ret = __tdx_hypercall_ret(&args);
019b383d1132e4 Dexuan Cui         2023-08-10  734  
019b383d1132e4 Dexuan Cui         2023-08-10  735  		if (ret != TDVMCALL_STATUS_RETRY)
019b383d1132e4 Dexuan Cui         2023-08-10  736  			return !ret;
7dbde763162989 Kirill A. Shutemov 2022-04-06  737  		/*
019b383d1132e4 Dexuan Cui         2023-08-10  738  		 * The guest must retry the operation for the pages in the
019b383d1132e4 Dexuan Cui         2023-08-10  739  		 * region starting at the GPA specified in R11. R11 comes
019b383d1132e4 Dexuan Cui         2023-08-10  740  		 * from the untrusted VMM. Sanity check it.
7dbde763162989 Kirill A. Shutemov 2022-04-06  741  		 */
019b383d1132e4 Dexuan Cui         2023-08-10  742  		map_fail_paddr = args.r11;
019b383d1132e4 Dexuan Cui         2023-08-10  743  		if (map_fail_paddr < start || map_fail_paddr >= end)
019b383d1132e4 Dexuan Cui         2023-08-10  744  			return false;
019b383d1132e4 Dexuan Cui         2023-08-10  745  
019b383d1132e4 Dexuan Cui         2023-08-10  746  		/* "Consume" a retry without forward progress */
019b383d1132e4 Dexuan Cui         2023-08-10  747  		if (map_fail_paddr == start) {
019b383d1132e4 Dexuan Cui         2023-08-10  748  			retry_count++;
019b383d1132e4 Dexuan Cui         2023-08-10  749  			continue;
019b383d1132e4 Dexuan Cui         2023-08-10  750  		}
019b383d1132e4 Dexuan Cui         2023-08-10  751  
019b383d1132e4 Dexuan Cui         2023-08-10  752  		start = map_fail_paddr;
019b383d1132e4 Dexuan Cui         2023-08-10  753  		retry_count = 0;
019b383d1132e4 Dexuan Cui         2023-08-10  754  	}
019b383d1132e4 Dexuan Cui         2023-08-10  755  
019b383d1132e4 Dexuan Cui         2023-08-10  756  	return false;
019b383d1132e4 Dexuan Cui         2023-08-10  757  }
019b383d1132e4 Dexuan Cui         2023-08-10  758  

:::::: The code at line 733 was first introduced by commit
:::::: 019b383d1132e4051de0d2e43254454b86538cf4 x86/tdx: Retry partially-completed page conversion hypercalls

:::::: TO: Dexuan Cui <decui@microsoft.com>
:::::: CC: Dave Hansen <dave.hansen@linux.intel.com>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

             reply	other threads:[~2023-09-12 22:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-12 22:32 kernel test robot [this message]
2023-09-12 23:25 ` [tip:x86/tdx 8/12] arch/x86/coco/tdx/tdx.c:733:27: error: implicit declaration of function '__tdx_hypercall_ret'; did you mean '__tdx_hypercall'? Huang, Kai

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=202309130622.Ba60ODDl-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=kai.huang@intel.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=x86@kernel.org \
    /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.