From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Williamson Subject: Re: [PATCH] kvm: device-assignment: Catch GSI overflow Date: Thu, 07 May 2009 11:16:53 -0600 Message-ID: <1241716613.23680.31.camel@bling> References: <20090507170834.26367.91907.stgit@dl380g6-3.ned.telco.ned.telco> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit To: kvm@vger.kernel.org Return-path: Received: from g4t0016.houston.hp.com ([15.201.24.19]:36238 "EHLO g4t0016.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751778AbZEGRQ6 (ORCPT ); Thu, 7 May 2009 13:16:58 -0400 Received: from g5t0029.atlanta.hp.com (g5t0029.atlanta.hp.com [16.228.8.141]) by g4t0016.houston.hp.com (Postfix) with ESMTP id C499F14536 for ; Thu, 7 May 2009 17:16:59 +0000 (UTC) Received: from ldl.fc.hp.com (ldl.fc.hp.com [15.11.146.30]) by g5t0029.atlanta.hp.com (Postfix) with ESMTP id 98ABD100AB for ; Thu, 7 May 2009 17:16:59 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl.fc.hp.com (Postfix) with ESMTP id 2ED5939C003 for ; Thu, 7 May 2009 11:16:59 -0600 (MDT) Received: from ldl.fc.hp.com ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8Xy8pg+JsbiU for ; Thu, 7 May 2009 11:16:56 -0600 (MDT) Received: from [192.168.1.60] (g3t0027.americas.hpqcorp.net [16.232.34.131]) by ldl.fc.hp.com (Postfix) with ESMTP id AA88C39C001 for ; Thu, 7 May 2009 11:16:55 -0600 (MDT) In-Reply-To: <20090507170834.26367.91907.stgit@dl380g6-3.ned.telco.ned.telco> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, 2009-05-07 at 11:09 -0600, Alex Williamson wrote: > Fix the index at which we return -ENOSPC since the kernel side will > reject a GSI >= KVM_MAX_IRQ_ROUTES. Also, mask as a signed int before > testing for error. Even with this, there still seems to be a fundamental problem with our consumption of GSIs in kvm. For example, every time a guest writes to the MSI capabilities area and enables MSI support, we call kvm_get_irq_route_gsi() to get a new max_used_gsi + 1 value, then call kvm_add_routing_entry(), which updates max_used_gsi. It doesn't take too long before we exhaust the GSI space and the device no longer works. This seems to happen within a minute or two of booting a guest with an e1000e device sitting idle on a busy network. Do we need to keep a bitmap of used GSIs or maybe just attempt to reuse the GSI we've gotten previously for the device? Thanks, Alex