public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: kbuild test robot <fengguang.wu@intel.com>
Cc: kbuild-all@01.org, Paolo Bonzini <pbonzini@redhat.com>,
	Gleb Natapov <gleb@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [kvm:master 1/1] arch/x86/kvm/../../../virt/kvm/kvm_main.c:2062:25: sparse: incorrect type in assignment (different address spaces)
Date: Mon, 19 Jan 2015 20:35:37 +0100	[thread overview]
Message-ID: <54BD5C89.1000205@de.ibm.com> (raw)
In-Reply-To: <201501192223.rdrTzdYB%fengguang.wu@intel.com>

Am 19.01.2015 um 15:33 schrieb kbuild test robot:
> tree:   git://git.kernel.org/pub/scm/virt/kvm/kvm.git master
> head:   cdef511985374dd042a40bb32c1c346c2662c9dc
> commit: cdef511985374dd042a40bb32c1c346c2662c9dc [1/1] KVM: fix sparse warning in include/trace/events/kvm.h
> reproduce:
>   # apt-get install sparse
>   git checkout cdef511985374dd042a40bb32c1c346c2662c9dc
>   make ARCH=x86_64 allmodconfig
>   make C=1 CF=-D__CHECK_ENDIAN__
> 
> 
> sparse warnings: (new ones prefixed by >>)

FWIW,

looks like my previous fix re-enabled sparse for that code. It bailed out previously due to the 
".include/trace/events/kvm.h:163:1: error: directive in argument list
include/trace/events/kvm.h:167:1: error: directive in argument list
include/trace/events/kvm.h:169:1: error: directive in argument list"
errors.

Since that was fixed with commit: cdef511985374dd042a40bb32c1c346c2662c9dc [1/1] KVM: fix sparse warning in include/trace/events/kvm.h, we now we have more sparse errors than before and still its an improvement :-)

Christian

> 
>>> arch/x86/kvm/../../../virt/kvm/kvm_main.c:2062:25: sparse: incorrect type in assignment (different address spaces)
>    arch/x86/kvm/../../../virt/kvm/kvm_main.c:2062:25:    expected struct pid *volatile <noident>
>    arch/x86/kvm/../../../virt/kvm/kvm_main.c:2062:25:    got struct pid [noderef] <asn:4>*<noident>
>>> arch/x86/kvm/../../../virt/kvm/kvm_main.c:741:9: sparse: incorrect type in assignment (different address spaces)
>    arch/x86/kvm/../../../virt/kvm/kvm_main.c:741:9:    expected struct kvm_memslots *volatile <noident>
>    arch/x86/kvm/../../../virt/kvm/kvm_main.c:741:9:    got struct kvm_memslots [noderef] <asn:4>*<noident>
>    include/linux/kvm_host.h:482:16: sparse: incompatible types in comparison expression (different address spaces)
>    include/linux/kvm_host.h:482:16: sparse: incompatible types in comparison expression (different address spaces)
>    include/linux/kvm_host.h:482:16: sparse: incompatible types in comparison expression (different address spaces)
>    include/linux/kvm_host.h:482:16: sparse: incompatible types in comparison expression (different address spaces)
>    arch/x86/kvm/../../../virt/kvm/kvm_main.c:1790:15: sparse: incompatible types in comparison expression (different address spaces)
>    arch/x86/kvm/../../../virt/kvm/kvm_main.c:2957:15: sparse: incompatible types in comparison expression (different address spaces)
>    arch/x86/kvm/../../../virt/kvm/kvm_main.c:2974:15: sparse: incompatible types in comparison expression (different address spaces)
>    arch/x86/kvm/../../../virt/kvm/kvm_main.c:3024:15: sparse: incompatible types in comparison expression (different address spaces)
> --
>>> arch/x86/kvm/../../../virt/kvm/irqchip.c:125:18: sparse: incorrect type in argument 1 (different address spaces)
>    arch/x86/kvm/../../../virt/kvm/irqchip.c:125:18:    expected void const *<noident>
>    arch/x86/kvm/../../../virt/kvm/irqchip.c:125:18:    got struct kvm_irq_routing_table [noderef] <asn:4>*irq_routing
>>> arch/x86/kvm/../../../virt/kvm/irqchip.c:201:13: sparse: incorrect type in assignment (different address spaces)
>    arch/x86/kvm/../../../virt/kvm/irqchip.c:201:13:    expected struct kvm_irq_routing_table *old
>    arch/x86/kvm/../../../virt/kvm/irqchip.c:201:13:    got struct kvm_irq_routing_table [noderef] <asn:4>*irq_routing
> --
>>> arch/x86/kvm/x86.c:495:5: sparse: symbol 'kvm_read_nested_guest_page' was not declared. Should it be static?
>>> arch/x86/kvm/x86.c:646:5: sparse: symbol '__kvm_set_xcr' was not declared. Should it be static?
>>> arch/x86/kvm/x86.c:1183:15: sparse: symbol 'max_tsc_khz' was not declared. Should it be static?
>>> arch/x86/kvm/x86.c:1237:6: sparse: symbol 'kvm_track_tsc_matching' was not declared. Should it be static?
>>> arch/x86/kvm/x86.c:1898:38: sparse: incorrect type in argument 1 (different address spaces)
>    arch/x86/kvm/x86.c:1898:38:    expected void const [noderef] <asn:1>*<noident>
>    arch/x86/kvm/x86.c:1898:38:    got unsigned char [usertype] *
>    include/linux/kvm_host.h:482:16: sparse: incompatible types in comparison expression (different address spaces)
>    include/linux/kvm_host.h:482:16: sparse: incompatible types in comparison expression (different address spaces)
>    arch/x86/kvm/x86.c:7431:15: sparse: incompatible types in comparison expression (different address spaces)
> 
> Please review and possibly fold the followup patch.
> 
> vim +2062 arch/x86/kvm/../../../virt/kvm/kvm_main.c
> 
> 2122ff5e virt/kvm/kvm_main.c    Avi Kivity            2010-05-13  2046  		return kvm_arch_vcpu_ioctl(filp, ioctl, arg);
> 2122ff5e virt/kvm/kvm_main.c    Avi Kivity            2010-05-13  2047  #endif
> 2122ff5e virt/kvm/kvm_main.c    Avi Kivity            2010-05-13  2048  
> 2122ff5e virt/kvm/kvm_main.c    Avi Kivity            2010-05-13  2049  
> 9fc77441 virt/kvm/kvm_main.c    Michael S. Tsirkin    2012-09-16  2050  	r = vcpu_load(vcpu);
> 9fc77441 virt/kvm/kvm_main.c    Michael S. Tsirkin    2012-09-16  2051  	if (r)
> 9fc77441 virt/kvm/kvm_main.c    Michael S. Tsirkin    2012-09-16  2052  		return r;
> 6aa8b732 drivers/kvm/kvm_main.c Avi Kivity            2006-12-10  2053  	switch (ioctl) {
> 9a2bb7f4 drivers/kvm/kvm_main.c Avi Kivity            2007-02-22  2054  	case KVM_RUN:
> f0fe5108 drivers/kvm/kvm_main.c Avi Kivity            2007-03-07  2055  		r = -EINVAL;
> f0fe5108 drivers/kvm/kvm_main.c Avi Kivity            2007-03-07  2056  		if (arg)
> f0fe5108 drivers/kvm/kvm_main.c Avi Kivity            2007-03-07  2057  			goto out;
> 7a72f7a1 virt/kvm/kvm_main.c    Christian Borntraeger 2014-08-05  2058  		if (unlikely(vcpu->pid != current->pids[PIDTYPE_PID].pid)) {
> 7a72f7a1 virt/kvm/kvm_main.c    Christian Borntraeger 2014-08-05  2059  			/* The thread running this VCPU changed. */
> 7a72f7a1 virt/kvm/kvm_main.c    Christian Borntraeger 2014-08-05  2060  			struct pid *oldpid = vcpu->pid;
> 7a72f7a1 virt/kvm/kvm_main.c    Christian Borntraeger 2014-08-05  2061  			struct pid *newpid = get_task_pid(current, PIDTYPE_PID);
> 7a72f7a1 virt/kvm/kvm_main.c    Christian Borntraeger 2014-08-05 @2062  			rcu_assign_pointer(vcpu->pid, newpid);
> 7a72f7a1 virt/kvm/kvm_main.c    Christian Borntraeger 2014-08-05  2063  			if (oldpid)
> 7a72f7a1 virt/kvm/kvm_main.c    Christian Borntraeger 2014-08-05  2064  				synchronize_rcu();
> 7a72f7a1 virt/kvm/kvm_main.c    Christian Borntraeger 2014-08-05  2065  			put_pid(oldpid);
> 7a72f7a1 virt/kvm/kvm_main.c    Christian Borntraeger 2014-08-05  2066  		}
> b6c7a5dc drivers/kvm/kvm_main.c Hollis Blanchard      2007-11-01  2067  		r = kvm_arch_vcpu_ioctl_run(vcpu, vcpu->run);
> 64be5007 virt/kvm/kvm_main.c    Gleb Natapov          2010-10-24  2068  		trace_kvm_userspace_exit(vcpu->run->exit_reason, r);
> 6aa8b732 drivers/kvm/kvm_main.c Avi Kivity            2006-12-10  2069  		break;
> 6aa8b732 drivers/kvm/kvm_main.c Avi Kivity            2006-12-10  2070  	case KVM_GET_REGS: {
> 
> :::::: The code at line 2062 was first introduced by commit
> :::::: 7a72f7a140bfd3a5dae73088947010bfdbcf6a40 KVM: track pid for VCPU only on KVM_RUN ioctl
> 
> :::::: TO: Christian Borntraeger <borntraeger@de.ibm.com>
> :::::: CC: Paolo Bonzini <pbonzini@redhat.com>
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation
> 



      parent reply	other threads:[~2015-01-19 19:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-19 14:33 [kvm:master 1/1] arch/x86/kvm/../../../virt/kvm/kvm_main.c:2062:25: sparse: incorrect type in assignment (different address spaces) kbuild test robot
2015-01-19 14:33 ` [PATCH kvm] KVM: kvm_read_nested_guest_page() can be static kbuild test robot
2015-01-19 19:35 ` Christian Borntraeger [this message]

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=54BD5C89.1000205@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=fengguang.wu@intel.com \
    --cc=gleb@kernel.org \
    --cc=hpa@zytor.com \
    --cc=kbuild-all@01.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@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