[linux-next:master 11131/11937] arch/x86/hyperv/hv_init.c:70:30: sparse: sparse: incorrect type in initializer (different address spaces)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   ae5179317e794160e471db0e122c6ac811a97235
commit: 6bda810ffe494a57e2da7f87b88b17f240f90cb9 [11131/11937] x86/hyperv: Add Write/Read MSR registers via ghcb page
config: x86_64-randconfig-s022-20211027 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=6bda810ffe494a57e2da7f87b88b17f240f90cb9
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 6bda810ffe494a57e2da7f87b88b17f240f90cb9
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)
>> arch/x86/hyperv/hv_init.c:70:30: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got union hv_ghcb [noderef] __percpu ** @@
   arch/x86/hyperv/hv_init.c:70:30: sparse:     expected void const [noderef] __percpu *__vpp_verify
   arch/x86/hyperv/hv_init.c:70:30: sparse:     got union hv_ghcb [noderef] __percpu **
   arch/x86/hyperv/hv_init.c:214:36: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got union hv_ghcb [noderef] __percpu ** @@
   arch/x86/hyperv/hv_init.c:214:36: sparse:     expected void const [noderef] __percpu *__vpp_verify
   arch/x86/hyperv/hv_init.c:214:36: sparse:     got union hv_ghcb [noderef] __percpu **
   arch/x86/hyperv/hv_init.c:363:24: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got void [noderef] __percpu ** @@
   arch/x86/hyperv/hv_init.c:363:24: sparse:     expected void const [noderef] __percpu *__vpp_verify
   arch/x86/hyperv/hv_init.c:363:24: sparse:     got void [noderef] __percpu **
   arch/x86/hyperv/hv_init.c:363:21: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct hv_get_partition_id *output_page @@     got void [noderef] __percpu * @@
   arch/x86/hyperv/hv_init.c:363:21: sparse:     expected struct hv_get_partition_id *output_page
   arch/x86/hyperv/hv_init.c:363:21: sparse:     got void [noderef] __percpu *
>> arch/x86/hyperv/hv_init.c:409:28: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected union hv_ghcb [noderef] __percpu **[addressable] [toplevel] hv_ghcb_pg @@     got union hv_ghcb *[noderef] __percpu * @@
   arch/x86/hyperv/hv_init.c:409:28: sparse:     expected union hv_ghcb [noderef] __percpu **[addressable] [toplevel] hv_ghcb_pg
   arch/x86/hyperv/hv_init.c:409:28: sparse:     got union hv_ghcb *[noderef] __percpu *
>> arch/x86/hyperv/hv_init.c:510:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __percpu *__pdata @@     got union hv_ghcb [noderef] __percpu **[addressable] [toplevel] hv_ghcb_pg @@
   arch/x86/hyperv/hv_init.c:510:21: sparse:     expected void [noderef] __percpu *__pdata
   arch/x86/hyperv/hv_init.c:510:21: sparse:     got union hv_ghcb [noderef] __percpu **[addressable] [toplevel] hv_ghcb_pg

vim +70 arch/x86/hyperv/hv_init.c

a46d15cc1ae5af Vitaly Kuznetsov 2018-03-20  47  
e8883fe544e86b Tianyu Lan       2021-10-25  48  static int hyperv_init_ghcb(void)
e8883fe544e86b Tianyu Lan       2021-10-25  49  {
e8883fe544e86b Tianyu Lan       2021-10-25  50  	u64 ghcb_gpa;
e8883fe544e86b Tianyu Lan       2021-10-25  51  	void *ghcb_va;
e8883fe544e86b Tianyu Lan       2021-10-25  52  	void **ghcb_base;
e8883fe544e86b Tianyu Lan       2021-10-25  53  
e8883fe544e86b Tianyu Lan       2021-10-25  54  	if (!hv_isolation_type_snp())
e8883fe544e86b Tianyu Lan       2021-10-25  55  		return 0;
e8883fe544e86b Tianyu Lan       2021-10-25  56  
e8883fe544e86b Tianyu Lan       2021-10-25  57  	if (!hv_ghcb_pg)
e8883fe544e86b Tianyu Lan       2021-10-25  58  		return -EINVAL;
e8883fe544e86b Tianyu Lan       2021-10-25  59  
e8883fe544e86b Tianyu Lan       2021-10-25  60  	/*
e8883fe544e86b Tianyu Lan       2021-10-25  61  	 * GHCB page is allocated by paravisor. The address
e8883fe544e86b Tianyu Lan       2021-10-25  62  	 * returned by MSR_AMD64_SEV_ES_GHCB is above shared
e8883fe544e86b Tianyu Lan       2021-10-25  63  	 * memory boundary and map it here.
e8883fe544e86b Tianyu Lan       2021-10-25  64  	 */
e8883fe544e86b Tianyu Lan       2021-10-25  65  	rdmsrl(MSR_AMD64_SEV_ES_GHCB, ghcb_gpa);
e8883fe544e86b Tianyu Lan       2021-10-25  66  	ghcb_va = memremap(ghcb_gpa, HV_HYP_PAGE_SIZE, MEMREMAP_WB);
e8883fe544e86b Tianyu Lan       2021-10-25  67  	if (!ghcb_va)
e8883fe544e86b Tianyu Lan       2021-10-25  68  		return -ENOMEM;
e8883fe544e86b Tianyu Lan       2021-10-25  69  
e8883fe544e86b Tianyu Lan       2021-10-25 @70  	ghcb_base = (void **)this_cpu_ptr(hv_ghcb_pg);
e8883fe544e86b Tianyu Lan       2021-10-25  71  	*ghcb_base = ghcb_va;
e8883fe544e86b Tianyu Lan       2021-10-25  72  
e8883fe544e86b Tianyu Lan       2021-10-25  73  	return 0;
e8883fe544e86b Tianyu Lan       2021-10-25  74  }
e8883fe544e86b Tianyu Lan       2021-10-25  75  

:::::: The code at line 70 was first introduced by commit
:::::: e8883fe544e86bcbd3b7147d05c822a5e26f1d99 x86/hyperv: Initialize GHCB page in Isolation VM

:::::: TO: Tianyu Lan <Tianyu.Lan@xxxxxxxxxxxxx>
:::::: CC: Wei Liu <wei.liu@xxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux