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, pdurrant@amazon.com,
aagch@amazon.com
Subject: Re: [PATCH v5 02/16] KVM: x86/xen: intercept xen hypercalls if enabled
Date: Tue, 12 Jan 2021 07:42:56 +0800 [thread overview]
Message-ID: <202101120749.dXC0rufq-lkp@intel.com> (raw)
In-Reply-To: <20210111195725.4601-3-dwmw2@infradead.org>
[-- Attachment #1: Type: text/plain, Size: 3887 bytes --]
Hi David,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on v5.11-rc3]
[also build test WARNING on next-20210111]
[cannot apply to kvm/linux-next xen-tip/linux-next vhost/linux-next]
[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-minimal-support-for-Xen-HVM-guests/20210112-040054
base: 7c53f6b671f4aba70ff15e1b05148b10d58c2837
config: x86_64-randconfig-s022-20210111 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-208-g46a52ca4-dirty
# https://github.com/0day-ci/linux/commit/9e109a13c92b207e4edbaf4b8ccb22a32ffcb587
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review David-Woodhouse/KVM-Add-minimal-support-for-Xen-HVM-guests/20210112-040054
git checkout 9e109a13c92b207e4edbaf4b8ccb22a32ffcb587
# 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: 42302 bytes --]
next prev parent reply other threads:[~2021-01-12 0:33 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-11 19:57 [PATCH v5 00/16] KVM: Add minimal support for Xen HVM guests David Woodhouse
2021-01-11 19:57 ` [PATCH v5 01/16] KVM: x86/xen: fix Xen hypercall page msr handling David Woodhouse
2021-01-11 19:57 ` [PATCH v5 02/16] KVM: x86/xen: intercept xen hypercalls if enabled David Woodhouse
2021-01-11 23:42 ` kernel test robot [this message]
2021-01-28 12:21 ` Paolo Bonzini
2021-01-11 19:57 ` [PATCH v5 03/16] KVM: x86/xen: Fix coexistence of Xen and Hyper-V hypercalls David Woodhouse
2021-01-11 19:57 ` [PATCH v5 04/16] KVM: x86/xen: add KVM_XEN_HVM_SET_ATTR/KVM_XEN_HVM_GET_ATTR David Woodhouse
2021-01-11 19:57 ` [PATCH v5 05/16] KVM: x86/xen: latch long_mode when hypercall page is set up David Woodhouse
2021-01-11 19:57 ` [PATCH v5 06/16] KVM: x86/xen: add definitions of compat_shared_info, compat_vcpu_info David Woodhouse
2021-01-11 19:57 ` [PATCH v5 07/16] KVM: x86/xen: register shared_info page David Woodhouse
2021-01-11 19:57 ` [PATCH v5 08/16] xen: add wc_sec_hi to struct shared_info David Woodhouse
2021-01-11 19:57 ` [PATCH v5 09/16] KVM: x86/xen: update wallclock region David Woodhouse
2021-01-11 19:57 ` [PATCH v5 10/16] KVM: x86/xen: register vcpu info David Woodhouse
2021-01-11 19:57 ` [PATCH v5 11/16] KVM: x86/xen: setup pvclock updates David Woodhouse
2021-01-11 19:57 ` [PATCH v5 12/16] KVM: x86/xen: register vcpu time info region David Woodhouse
2021-01-11 19:57 ` [PATCH v5 13/16] KVM: x86/xen: register runstate info David Woodhouse
2021-01-28 12:15 ` Paolo Bonzini
2021-01-11 19:57 ` [PATCH v5 14/16] KVM: x86: declare Xen HVM shared info capability and add test case David Woodhouse
2021-01-11 19:57 ` [PATCH v5 15/16] KVM: Add documentation for Xen hypercall and shared_info updates David Woodhouse
2021-01-28 12:18 ` Paolo Bonzini
2021-01-28 16:49 ` David Woodhouse
2021-01-28 17:06 ` Paolo Bonzini
[not found] ` <f9b2b4e613ea4e6dd1f253f5092254d121c93c07.camel@infradead.org>
2021-01-29 7:59 ` Paolo Bonzini
2021-01-11 19:57 ` [PATCH v5 16/16] KVM: x86/xen: Add event channel interrupt vector upcall David Woodhouse
2021-01-28 12:43 ` Paolo Bonzini
2021-01-28 15:35 ` David Woodhouse
2021-01-28 17:01 ` Paolo Bonzini
2021-01-29 17:33 ` David Woodhouse
2021-01-29 19:19 ` Paolo Bonzini
2021-01-30 13:01 ` David Woodhouse
2021-01-21 11:56 ` [PATCH v5 17/16] KVM: x86/xen: Fix initialisation of gfn caches for Xen shared pages David Woodhouse
2021-01-28 12:45 ` [PATCH v5 00/16] KVM: Add minimal support for Xen HVM guests Paolo Bonzini
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=202101120749.dXC0rufq-lkp@intel.com \
--to=lkp@intel.com \
--cc=aagch@amazon.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=pdurrant@amazon.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 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).