Skip to content

Commit

Permalink
KVM: Fix GSI number space limit
Browse files Browse the repository at this point in the history
KVM tells us the number of GSIs it can handle inside the kernel. That value is
basically KVM_MAX_IRQ_ROUTES. However when we try to set the GSI mapping table,
it checks for

    r = -EINVAL;
    if (routing.nr >= KVM_MAX_IRQ_ROUTES)
        goto out;

erroring out even when we're only using all of the GSIs. To make sure we never
hit that limit, let's reduce the number of GSIs we get from KVM by one.

Cc: qemu-stable@nongnu.org
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 0000841)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
  • Loading branch information
agraf authored and mdroth committed Jul 16, 2014
1 parent f0c609d commit b47506f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kvm-all.c
Expand Up @@ -965,7 +965,7 @@ void kvm_init_irq_routing(KVMState *s)
{
int gsi_count, i;

gsi_count = kvm_check_extension(s, KVM_CAP_IRQ_ROUTING);
gsi_count = kvm_check_extension(s, KVM_CAP_IRQ_ROUTING) - 1;
if (gsi_count > 0) {
unsigned int gsi_bits, i;

Expand Down

0 comments on commit b47506f

Please sign in to comment.