From: kernel test robot <lkp@intel.com>
To: Tianyu Lan <Tianyu.Lan@microsoft.com>
Cc: kbuild-all@lists.01.org,
Linux Memory Management List <linux-mm@kvack.org>,
Wei Liu <wei.liu@kernel.org>,
Michael Kelley <mikelley@microsoft.com>
Subject: [linux-next:master 11131/11937] arch/x86/hyperv/hv_init.c:70:30: sparse: sparse: incorrect type in initializer (different address spaces)
Date: Thu, 28 Oct 2021 01:50:45 +0800 [thread overview]
Message-ID: <202110280135.7PuJwLAe-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 5914 bytes --]
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@intel.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
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@microsoft.com>
:::::: CC: Wei Liu <wei.liu@kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 36038 bytes --]
reply other threads:[~2021-10-27 17:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202110280135.7PuJwLAe-lkp@intel.com \
--to=lkp@intel.com \
--cc=Tianyu.Lan@microsoft.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-mm@kvack.org \
--cc=mikelley@microsoft.com \
--cc=wei.liu@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).