lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 9 Jul 2019 07:23:16 -0700
From:   Sean Christopherson <sean.j.christopherson@...el.com>
To:     Yi Wang <wang.yi59@....com.cn>
Cc:     pbonzini@...hat.com, rkrcmar@...hat.com, tglx@...utronix.de,
        mingo@...hat.com, bp@...en8.de, hpa@...or.com, x86@...nel.org,
        kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
        xue.zhihong@....com.cn, up2wing@...il.com, wang.liang82@....com.cn
Subject: Re: [PATCH] kvm: x86: Fix -Wmissing-prototypes warnings

On Sat, Jul 06, 2019 at 04:29:50PM +0800, Yi Wang wrote:
> We get a warning when build kernel W=1:
> 
> arch/x86/kvm/../../../virt/kvm/eventfd.c:48:1: warning: no previous prototype for ‘kvm_arch_irqfd_allowed’ [-Wmissing-prototypes]
>  kvm_arch_irqfd_allowed(struct kvm *kvm, struct kvm_irqfd *args)
>  ^
> 
> The reason is kvm_arch_irqfd_allowed is declared in arch/x86/kvm/irq.h,
> which is not included by eventfd.c. Remove the declaration to kvm_host.h
> can fix this.

It'd be nice to note in the changelog that kvm_arch_irqfd_allowed() is a
weakly defined function in eventfd.c.  Without that info, one might wonder
why it's ok to move a function declaration from x86 code to generic code.

Reviewed-by: Sean Christopherson <sean.j.christopherson@...el.com>

> 
> Signed-off-by: Yi Wang <wang.yi59@....com.cn>
> ---
>  arch/x86/kvm/irq.h       | 1 -
>  include/linux/kvm_host.h | 1 +
>  2 files changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/irq.h b/arch/x86/kvm/irq.h
> index d6519a3..7c6233d 100644
> --- a/arch/x86/kvm/irq.h
> +++ b/arch/x86/kvm/irq.h
> @@ -102,7 +102,6 @@ static inline int irqchip_in_kernel(struct kvm *kvm)
>  	return mode != KVM_IRQCHIP_NONE;
>  }
>  
> -bool kvm_arch_irqfd_allowed(struct kvm *kvm, struct kvm_irqfd *args);
>  void kvm_inject_pending_timer_irqs(struct kvm_vcpu *vcpu);
>  void kvm_inject_apic_timer_irqs(struct kvm_vcpu *vcpu);
>  void kvm_apic_nmi_wd_deliver(struct kvm_vcpu *vcpu);
> diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
> index d1ad38a..5f04005 100644
> --- a/include/linux/kvm_host.h
> +++ b/include/linux/kvm_host.h
> @@ -990,6 +990,7 @@ void kvm_unregister_irq_ack_notifier(struct kvm *kvm,
>  				   struct kvm_irq_ack_notifier *kian);
>  int kvm_request_irq_source_id(struct kvm *kvm);
>  void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id);
> +bool kvm_arch_irqfd_allowed(struct kvm *kvm, struct kvm_irqfd *args);
>  
>  /*
>   * search_memslots() and __gfn_to_memslot() are here because they are
> -- 
> 1.8.3.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ