From: kernel test robot <lkp@intel.com>
To: David Woodhouse <dwmw2@infradead.org>, kvm@vger.kernel.org
Cc: kbuild-all@lists.01.org, Paolo Bonzini <pbonzini@redhat.com>,
Ankur Arora <ankur.a.arora@oracle.com>,
Joao Martins <joao.m.martins@oracle.com>,
Boris Ostrovsky <boris.ostrovsky@oracle.com>,
Sean Christopherson <seanjc@google.com>,
graf@amazon.com, iaslan@amazon.de
Subject: Re: [PATCH v2 03/16] KVM: x86/xen: intercept xen hypercalls if enabled
Date: Fri, 11 Dec 2020 00:01:20 +0800 [thread overview]
Message-ID: <202012102306.SlIcIqB7-lkp@intel.com> (raw)
In-Reply-To: <20201206110327.175629-4-dwmw2@infradead.org>
[-- Attachment #1: Type: text/plain, Size: 3920 bytes --]
Hi David,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on vhost/linux-next]
[also build test WARNING on v5.10-rc7]
[cannot apply to xen-tip/linux-next kvm/linux-next next-20201210]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/David-Woodhouse/KVM-Add-Xen-hypercall-and-shared-info-pages/20201206-190926
base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
config: x86_64-randconfig-s021-20201210 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-179-ga00755aa-dirty
# https://github.com/0day-ci/linux/commit/ac2b425f8c484a711fe7b2a01e875fd95248ac20
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review David-Woodhouse/KVM-Add-Xen-hypercall-and-shared-info-pages/20201206-190926
git checkout ac2b425f8c484a711fe7b2a01e875fd95248ac20
# 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/kvm/xen.c:67:46: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __user * @@ got unsigned char [usertype] * @@
arch/x86/kvm/xen.c:67:46: sparse: expected void const [noderef] __user *
arch/x86/kvm/xen.c:67:46: sparse: got unsigned char [usertype] *
vim +67 arch/x86/kvm/xen.c
17
18 int kvm_xen_hvm_config(struct kvm_vcpu *vcpu, u64 data)
19 {
20 struct kvm *kvm = vcpu->kvm;
21 u32 page_num = data & ~PAGE_MASK;
22 u64 page_addr = data & PAGE_MASK;
23
24 /*
25 * If Xen hypercall intercept is enabled, fill the hypercall
26 * page with VMCALL/VMMCALL instructions since that's what
27 * we catch. Else the VMM has provided the hypercall pages
28 * with instructions of its own choosing, so use those.
29 */
30 if (kvm_xen_hypercall_enabled(kvm)) {
31 u8 instructions[32];
32 int i;
33
34 if (page_num)
35 return 1;
36
37 /* mov imm32, %eax */
38 instructions[0] = 0xb8;
39
40 /* vmcall / vmmcall */
41 kvm_x86_ops.patch_hypercall(vcpu, instructions + 5);
42
43 /* ret */
44 instructions[8] = 0xc3;
45
46 /* int3 to pad */
47 memset(instructions + 9, 0xcc, sizeof(instructions) - 9);
48
49 for (i = 0; i < PAGE_SIZE / sizeof(instructions); i++) {
50 *(u32 *)&instructions[1] = i;
51 if (kvm_vcpu_write_guest(vcpu,
52 page_addr + (i * sizeof(instructions)),
53 instructions, sizeof(instructions)))
54 return 1;
55 }
56 } else {
57 int lm = is_long_mode(vcpu);
58 u8 *blob_addr = lm ? (u8 *)(long)kvm->arch.xen_hvm_config.blob_addr_64
59 : (u8 *)(long)kvm->arch.xen_hvm_config.blob_addr_32;
60 u8 blob_size = lm ? kvm->arch.xen_hvm_config.blob_size_64
61 : kvm->arch.xen_hvm_config.blob_size_32;
62 u8 *page;
63
64 if (page_num >= blob_size)
65 return 1;
66
> 67 page = memdup_user(blob_addr + (page_num * PAGE_SIZE), PAGE_SIZE);
68 if (IS_ERR(page))
69 return PTR_ERR(page);
70
71 if (kvm_vcpu_write_guest(vcpu, page_addr, page, PAGE_SIZE)) {
72 kfree(page);
73 return 1;
74 }
75 }
76 return 0;
77 }
78
---
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: 37948 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v2 03/16] KVM: x86/xen: intercept xen hypercalls if enabled
Date: Fri, 11 Dec 2020 00:01:20 +0800 [thread overview]
Message-ID: <202012102306.SlIcIqB7-lkp@intel.com> (raw)
In-Reply-To: <20201206110327.175629-4-dwmw2@infradead.org>
[-- Attachment #1: Type: text/plain, Size: 4024 bytes --]
Hi David,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on vhost/linux-next]
[also build test WARNING on v5.10-rc7]
[cannot apply to xen-tip/linux-next kvm/linux-next next-20201210]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/David-Woodhouse/KVM-Add-Xen-hypercall-and-shared-info-pages/20201206-190926
base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
config: x86_64-randconfig-s021-20201210 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-179-ga00755aa-dirty
# https://github.com/0day-ci/linux/commit/ac2b425f8c484a711fe7b2a01e875fd95248ac20
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review David-Woodhouse/KVM-Add-Xen-hypercall-and-shared-info-pages/20201206-190926
git checkout ac2b425f8c484a711fe7b2a01e875fd95248ac20
# 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/kvm/xen.c:67:46: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __user * @@ got unsigned char [usertype] * @@
arch/x86/kvm/xen.c:67:46: sparse: expected void const [noderef] __user *
arch/x86/kvm/xen.c:67:46: sparse: got unsigned char [usertype] *
vim +67 arch/x86/kvm/xen.c
17
18 int kvm_xen_hvm_config(struct kvm_vcpu *vcpu, u64 data)
19 {
20 struct kvm *kvm = vcpu->kvm;
21 u32 page_num = data & ~PAGE_MASK;
22 u64 page_addr = data & PAGE_MASK;
23
24 /*
25 * If Xen hypercall intercept is enabled, fill the hypercall
26 * page with VMCALL/VMMCALL instructions since that's what
27 * we catch. Else the VMM has provided the hypercall pages
28 * with instructions of its own choosing, so use those.
29 */
30 if (kvm_xen_hypercall_enabled(kvm)) {
31 u8 instructions[32];
32 int i;
33
34 if (page_num)
35 return 1;
36
37 /* mov imm32, %eax */
38 instructions[0] = 0xb8;
39
40 /* vmcall / vmmcall */
41 kvm_x86_ops.patch_hypercall(vcpu, instructions + 5);
42
43 /* ret */
44 instructions[8] = 0xc3;
45
46 /* int3 to pad */
47 memset(instructions + 9, 0xcc, sizeof(instructions) - 9);
48
49 for (i = 0; i < PAGE_SIZE / sizeof(instructions); i++) {
50 *(u32 *)&instructions[1] = i;
51 if (kvm_vcpu_write_guest(vcpu,
52 page_addr + (i * sizeof(instructions)),
53 instructions, sizeof(instructions)))
54 return 1;
55 }
56 } else {
57 int lm = is_long_mode(vcpu);
58 u8 *blob_addr = lm ? (u8 *)(long)kvm->arch.xen_hvm_config.blob_addr_64
59 : (u8 *)(long)kvm->arch.xen_hvm_config.blob_addr_32;
60 u8 blob_size = lm ? kvm->arch.xen_hvm_config.blob_size_64
61 : kvm->arch.xen_hvm_config.blob_size_32;
62 u8 *page;
63
64 if (page_num >= blob_size)
65 return 1;
66
> 67 page = memdup_user(blob_addr + (page_num * PAGE_SIZE), PAGE_SIZE);
68 if (IS_ERR(page))
69 return PTR_ERR(page);
70
71 if (kvm_vcpu_write_guest(vcpu, page_addr, page, PAGE_SIZE)) {
72 kfree(page);
73 return 1;
74 }
75 }
76 return 0;
77 }
78
---
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: 37948 bytes --]
next prev parent reply other threads:[~2020-12-10 16:35 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-06 11:03 [PATCH v2 00/16] KVM: Add Xen hypercall and shared info pages David Woodhouse
2020-12-06 11:03 ` [PATCH v2 01/16] KVM: Fix arguments to kvm_{un,}map_gfn() David Woodhouse
2020-12-06 11:03 ` [PATCH v2 02/16] KVM: x86/xen: fix Xen hypercall page msr handling David Woodhouse
2020-12-06 11:03 ` [PATCH v2 03/16] KVM: x86/xen: intercept xen hypercalls if enabled David Woodhouse
2020-12-10 16:01 ` kernel test robot [this message]
2020-12-10 16:01 ` kernel test robot
2020-12-06 11:03 ` [PATCH v2 04/16] KVM: x86/xen: Fix coexistence of Xen and Hyper-V hypercalls David Woodhouse
2020-12-06 11:03 ` [PATCH v2 05/16] KVM: x86/xen: add KVM_XEN_HVM_SET_ATTR/KVM_XEN_HVM_GET_ATTR David Woodhouse
2020-12-06 11:03 ` [PATCH v2 06/16] KVM: x86/xen: latch long_mode when hypercall page is set up David Woodhouse
2020-12-06 11:03 ` [PATCH v2 07/16] KVM: x86/xen: add definitions of compat_shared_info, compat_vcpu_info David Woodhouse
2020-12-06 11:03 ` [PATCH v2 08/16] KVM: x86/xen: register shared_info page David Woodhouse
2020-12-06 11:03 ` [PATCH v2 09/16] KVM: x86/xen: setup pvclock updates David Woodhouse
2020-12-12 0:01 ` David Woodhouse
2020-12-06 11:03 ` [PATCH v2 10/16] xen: add wc_sec_hi to struct shared_info David Woodhouse
2020-12-06 11:03 ` [PATCH v2 11/16] KVM: x86/xen: update wallclock region David Woodhouse
2020-12-06 11:03 ` [PATCH v2 12/16] KVM: x86/xen: register vcpu info David Woodhouse
2020-12-06 11:03 ` [PATCH v2 13/16] KVM: x86/xen: register vcpu time info region David Woodhouse
2020-12-06 11:03 ` [PATCH v2 14/16] KVM: x86/xen: register runstate info David Woodhouse
2020-12-09 19:17 ` David Woodhouse
2020-12-06 11:03 ` [PATCH v2 15/16] KVM: x86: declare Xen HVM shared info capability and add test case David Woodhouse
2020-12-22 5:06 ` [KVM] fdd90b978b: WARNING:suspicious_RCU_usage kernel test robot
2020-12-22 5:06 ` kernel test robot
2020-12-22 9:42 ` David Woodhouse
2020-12-22 9:42 ` David Woodhouse
2020-12-06 11:03 ` [PATCH v2 16/16] KVM: Add documentation for Xen hypercall and shared_info updates David Woodhouse
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=202012102306.SlIcIqB7-lkp@intel.com \
--to=lkp@intel.com \
--cc=ankur.a.arora@oracle.com \
--cc=boris.ostrovsky@oracle.com \
--cc=dwmw2@infradead.org \
--cc=graf@amazon.com \
--cc=iaslan@amazon.de \
--cc=joao.m.martins@oracle.com \
--cc=kbuild-all@lists.01.org \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
/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.