[PATCH] KVM: KVM_MAX_IRQ_ROUTES only defined with CONFIG_HAVE_KVM_IRQ_ROUTING
Daniel Black
daniel.black at au1.ibm.com
Wed Sep 20 15:05:34 AEST 2017
Apologies, just noticed 95e2a3b3ef177730019e3799917193595133b275 being
the revert of 36ae3c0a36b7
On 20/09/17 11:31, Daniel Black wrote:
> Commit 36ae3c0a36b7 introduced code using KVM_MAX_IRQ_ROUTES. This
> define isn't available on all platforms. As it is dependent on
> CONFIG_HAVE_KVM_IRQ_ROUTING this define is used to enable the code
> in 36ae3c0a36b7.
>
> Fixes: 36ae3c0a36b7 ("KVM: Don't accept obviously wrong gsi values via KVM_IRQFD")
> Reported-by: Abdul Haleem <abdhalee at linux.vnet.ibm.com>
> Suggested-by: Jan H. Schönherr <jschoenh at amazon.de>
> Signed-off-by: Daniel Black <daniel.black at au.ibm.com>
> ---
> virt/kvm/eventfd.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
> index c608ab4..75910dd 100644
> --- a/virt/kvm/eventfd.c
> +++ b/virt/kvm/eventfd.c
> @@ -565,8 +565,10 @@ kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args)
> {
> if (args->flags & ~(KVM_IRQFD_FLAG_DEASSIGN | KVM_IRQFD_FLAG_RESAMPLE))
> return -EINVAL;
> +#ifdef CONFIG_HAVE_KVM_IRQ_ROUTING
> if (args->gsi >= KVM_MAX_IRQ_ROUTES)
> return -EINVAL;
> +#endif
>
> if (args->flags & KVM_IRQFD_FLAG_DEASSIGN)
> return kvm_irqfd_deassign(kvm, args);
>
More information about the Linuxppc-dev
mailing list