All of lore.kernel.org
 help / color / mirror / Atom feed
* [intel-tdx:kvm 17/94] arch/x86/kvm/boot/seam/tdx_common.c:175:13: warning: no previous prototype for 'tdx_seamcall_error_name'
@ 2021-07-02  7:16 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-07-02  7:16 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 4597 bytes --]

tree:   https://github.com/intel/tdx.git kvm
head:   a9119ab747d6880e39258627c6b6c693b803f794
commit: df869f0b661fc05ca0c284714c01bb6172fb8173 [17/94] KVM: TDX: Print the name of SEAMCALL status code
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/intel/tdx/commit/df869f0b661fc05ca0c284714c01bb6172fb8173
        git remote add intel-tdx https://github.com/intel/tdx.git
        git fetch --no-tags intel-tdx kvm
        git checkout df869f0b661fc05ca0c284714c01bb6172fb8173
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

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/boot/seam/tdx_common.c:75:12: warning: no previous prototype for 'init_package_masters' [-Wmissing-prototypes]
      75 | int __init init_package_masters(void)
         |            ^~~~~~~~~~~~~~~~~~~~
>> arch/x86/kvm/boot/seam/tdx_common.c:175:13: warning: no previous prototype for 'tdx_seamcall_error_name' [-Wmissing-prototypes]
     175 | const char *tdx_seamcall_error_name(u64 error_code)
         |             ^~~~~~~~~~~~~~~~~~~~~~~


vim +/tdx_seamcall_error_name +175 arch/x86/kvm/boot/seam/tdx_common.c

    70	
    71	/*
    72	 * Setup one-cpu-per-pkg array to do package-scoped SEAMCALLs. The array is
    73	 * only necessary if there are multiple packages.
    74	 */
  > 75	int __init init_package_masters(void)
    76	{
    77		int cpu, pkg, nr_filled, nr_pkgs;
    78	
    79		nr_pkgs = topology_max_packages();
    80		if (nr_pkgs == 1)
    81			return 0;
    82	
    83		tdx_package_masters = kcalloc(nr_pkgs, sizeof(int), GFP_KERNEL);
    84		if (!tdx_package_masters)
    85			return -ENOMEM;
    86	
    87		memset(tdx_package_masters, -1, nr_pkgs * sizeof(int));
    88	
    89		nr_filled = 0;
    90		for_each_online_cpu(cpu) {
    91			pkg = topology_physical_package_id(cpu);
    92			if (tdx_package_masters[pkg] >= 0)
    93				continue;
    94	
    95			tdx_package_masters[pkg] = cpu;
    96			if (++nr_filled == topology_max_packages())
    97				break;
    98		}
    99	
   100		if (WARN_ON(nr_filled != topology_max_packages())) {
   101			kfree(tdx_package_masters);
   102			return -EIO;
   103		}
   104	
   105		if (cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, "tdx/cpu:starting",
   106					      tdx_starting_cpu, tdx_dying_cpu) < 0) {
   107			kfree(tdx_package_masters);
   108			return -EIO;
   109		}
   110	
   111		return 0;
   112	}
   113	
   114	int tdx_seamcall_on_each_pkg(int (*fn)(void *), void *param)
   115	{
   116		int ret = 0;
   117		int i;
   118	
   119		cpus_read_lock();
   120		if (!tdx_package_masters) {
   121			ret = fn(param);
   122			goto out;
   123		}
   124	
   125		for (i = 0; i < topology_max_packages(); i++) {
   126			ret = smp_call_on_cpu(tdx_package_masters[i], fn, param, 1);
   127			if (ret)
   128				break;
   129		}
   130	
   131	out:
   132		cpus_read_unlock();
   133		return ret;
   134	}
   135	EXPORT_SYMBOL_GPL(tdx_seamcall_on_each_pkg);
   136	
   137	const struct tdsysinfo_struct *tdx_get_sysinfo(void)
   138	{
   139		if (boot_cpu_has(X86_FEATURE_TDX))
   140			return &tdx_tdsysinfo;
   141	
   142		return NULL;
   143	}
   144	EXPORT_SYMBOL_GPL(tdx_get_sysinfo);
   145	
   146	int tdx_keyid_alloc(void)
   147	{
   148		if (!boot_cpu_has(X86_FEATURE_TDX))
   149			return -EINVAL;
   150	
   151		if (WARN_ON_ONCE(!tdx_keyids_start || !tdx_nr_keyids))
   152			return -EINVAL;
   153	
   154		/* The first keyID is reserved for the global key. */
   155		return ida_alloc_range(&tdx_keyid_pool, tdx_keyids_start + 1,
   156				       tdx_keyids_start + tdx_nr_keyids - 1,
   157				       GFP_KERNEL);
   158	}
   159	EXPORT_SYMBOL_GPL(tdx_keyid_alloc);
   160	
   161	void tdx_keyid_free(int keyid)
   162	{
   163		if (!keyid || keyid < 0)
   164			return;
   165	
   166		ida_free(&tdx_keyid_pool, keyid);
   167	}
   168	EXPORT_SYMBOL_GPL(tdx_keyid_free);
   169	
   170	static struct tdx_seamcall_status {
   171		u64 err_code;
   172		const char *err_name;
   173	} tdx_seamcall_status_codes[] = {TDX_SEAMCALL_STATUS_CODES};
   174	
 > 175	const char *tdx_seamcall_error_name(u64 error_code)

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 65609 bytes --]

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

only message in thread, other threads:[~2021-07-02  7:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-02  7:16 [intel-tdx:kvm 17/94] arch/x86/kvm/boot/seam/tdx_common.c:175:13: warning: no previous prototype for 'tdx_seamcall_error_name' 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.