lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202111200141.ysyTEbYn-lkp@intel.com>
Date:   Sat, 20 Nov 2021 01:35:57 +0800
From:   kernel test robot <lkp@...el.com>
To:     Tianyu Lan <Tianyu.Lan@...rosoft.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Wei Liu <wei.liu@...nel.org>,
        Michael Kelley <mikelley@...rosoft.com>
Subject: arch/x86/hyperv/hv_init.c:70:30: sparse: sparse: incorrect type in
 initializer (different address spaces)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   4c388a8e740d3235a194f330c8ef327deef710f6
commit: faff44069ff538ccdfef187c4d7ec83d22dfb3a4 x86/hyperv: Add Write/Read MSR registers via ghcb page
date:   3 weeks ago
config: i386-randconfig-s002-20211109 (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/torvalds/linux.git/commit/?id=faff44069ff538ccdfef187c4d7ec83d22dfb3a4
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout faff44069ff538ccdfef187c4d7ec83d22dfb3a4
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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


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

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

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

:::::: TO: Tianyu Lan <Tianyu.Lan@...rosoft.com>
:::::: CC: Wei Liu <wei.liu@...nel.org>

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

Download attachment ".config.gz" of type "application/gzip" (37887 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ