Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Daniel Axtens <dja@axtens.net>
To: Paul Mackerras <paulus@ozlabs.org>
Cc: linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org,
	kvm-ppc@vger.kernel.org
Subject: Re: [PATCH 2/2] KVM: PPC: sparse: prototypes for functions called from assembler
Date: Mon, 10 Oct 2016 13:52:41 +1100	[thread overview]
Message-ID: <87a8ecykxy.fsf@possimpible.ozlabs.ibm.com> (raw)
In-Reply-To: <20161010023415.GA18173@fergus.ozlabs.ibm.com>

Paul Mackerras <paulus@ozlabs.org> writes:

> On Mon, Oct 10, 2016 at 11:31:20AM +1100, Daniel Axtens wrote:
>> A bunch of KVM functions are only called from assembler.
>> Give them prototypes in asm-prototypes.h
>> This reduces sparse warnings.
>> 
>> Signed-off-by: Daniel Axtens <dja@axtens.net>
>> ---
>>  arch/powerpc/include/asm/asm-prototypes.h | 44 +++++++++++++++++++++++++++++++
>>  arch/powerpc/kvm/book3s_64_vio_hv.c       |  1 +
>>  arch/powerpc/kvm/book3s_hv_builtin.c      |  1 +
>>  arch/powerpc/kvm/book3s_hv_ras.c          |  1 +
>>  arch/powerpc/kvm/book3s_hv_rm_mmu.c       |  1 +
>>  arch/powerpc/kvm/book3s_hv_rm_xics.c      |  1 +
>>  6 files changed, 49 insertions(+)
>> 
>> diff --git a/arch/powerpc/include/asm/asm-prototypes.h b/arch/powerpc/include/asm/asm-prototypes.h
>> index d1492736d852..6c853bcd11fa 100644
>> --- a/arch/powerpc/include/asm/asm-prototypes.h
>> +++ b/arch/powerpc/include/asm/asm-prototypes.h
>> @@ -14,6 +14,9 @@
>>  
>>  #include <linux/threads.h>
>>  #include <linux/kprobes.h>
>> +#ifdef CONFIG_KVM
>> +#include <linux/kvm_host.h>
>> +#endif
>>  
>>  #include <uapi/asm/ucontext.h>
>>  
>> @@ -109,4 +112,45 @@ void early_setup_secondary(void);
>>  /* time */
>>  void accumulate_stolen_time(void);
>>  
>> +/* kvm */
>> +#ifdef CONFIG_KVM
>
> Why do we need this ifdef?  Does the compilation break without it when
> CONFIG_KVM = n?

Yes it does - the 0day build bot picked it up when I did v1 without the
ifdef.

See: https://lists.01.org/pipermail/kbuild-all/2016-September/024742.html

For example:

   arch/powerpc/include/asm/asm-prototypes.h:82:7: error: 'struct kvm_vcpu' declared inside parameter list [-Werror]
          unsigned long tce_list, unsigned long npages);
          ^
   arch/powerpc/include/asm/asm-prototypes.h:85:7: error: 'struct kvm_vcpu' declared inside parameter list [-Werror]
          unsigned long tce_value, unsigned long npages);
          ^
   arch/powerpc/include/asm/asm-prototypes.h:87:29: error: 'struct kvm_vcpu' declared inside parameter list [-Werror]
                                unsigned int yield_count);
                                ^
   arch/powerpc/include/asm/asm-prototypes.h:88:29: error: 'struct kvm_vcpu' declared inside parameter list [-Werror]
    long kvmppc_h_random(struct kvm_vcpu *vcpu);


Regards,
Daniel

  reply	other threads:[~2016-10-10  2:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-10  0:31 [PATCH 1/2] KVM: PPC: Fix sparse static warning Daniel Axtens
2016-10-10  0:31 ` [PATCH 2/2] KVM: PPC: sparse: prototypes for functions called from assembler Daniel Axtens
2016-10-10  2:34   ` Paul Mackerras
2016-10-10  2:52     ` Daniel Axtens [this message]
2016-11-21  5:05   ` Paul Mackerras
2016-11-21  5:04 ` [PATCH 1/2] KVM: PPC: Fix sparse static warning Paul Mackerras

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=87a8ecykxy.fsf@possimpible.ozlabs.ibm.com \
    --to=dja@axtens.net \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@ozlabs.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