From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [Qemu-devel] [PATCH 3/3] Check pci slot number in parse_pci_devfn Date: Tue, 24 Aug 2010 15:16:16 +0300 Message-ID: <4C73B810.5040307@redhat.com> References: <20100824063307.GA10815@kt> <20100824064927.GB11495@kt> <20100824113521.GA7201@valinux.co.jp> <4C73B01A.1050908@redhat.com> <20100824120745.GC7201@valinux.co.jp> <4C73B55C.3050800@redhat.com> <20100824122438.GA7547@valinux.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Ken CC , kvm@vger.kernel.org, qemu-devel@nongnu.org, "Michael S. Tsirkin" To: Isaku Yamahata Return-path: Received: from mx1.redhat.com ([209.132.183.28]:21097 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752255Ab0HXMQX (ORCPT ); Tue, 24 Aug 2010 08:16:23 -0400 In-Reply-To: <20100824122438.GA7547@valinux.co.jp> Sender: kvm-owner@vger.kernel.org List-ID: On 08/24/2010 03:24 PM, Isaku Yamahata wrote: > On Tue, Aug 24, 2010 at 03:04:44PM +0300, Avi Kivity wrote: >> On 08/24/2010 03:07 PM, Isaku Yamahata wrote: >>> On Tue, Aug 24, 2010 at 02:42:18PM +0300, Avi Kivity wrote: >>>> On 08/24/2010 02:35 PM, Isaku Yamahata wrote: >>>>> Add Cc: mst@redhat.com. >>>>> >>>>> MAX_PCI_SLOTS should be in pci.h instead of qdev.h? >>>>> And the name should be start with PCI_ prefix for consistency? >>>>> >>>>> Except that, the patches look okay. >>>>> >>>> These aren't slots, are they? They are functions. >>> The function checks if given $slot.$fn (or $slot) is valid. >>> So it's slots. max 32. >> + assert(devfn< PCIBUS_MAX_DEVICES); >> >> >> Looks like we're comparing a function number to PCIBUS_MAX_DEVICES. > Ah, you're talking about 2/3. I talked about 3/3. > You're right. The name is misleading. > PCIBUS_MAX_FUNCTIONS? Or suggestions? Or assert(devfn / 8 < PCIBUS_MAX_DEVICES) (and change that to be 32). -- error compiling committee.c: too many arguments to function From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=34333 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OnsQQ-0001G9-3G for qemu-devel@nongnu.org; Tue, 24 Aug 2010 08:16:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OnsQN-0007NJ-Vu for qemu-devel@nongnu.org; Tue, 24 Aug 2010 08:16:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34015) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OnsQN-0007N1-Pv for qemu-devel@nongnu.org; Tue, 24 Aug 2010 08:16:19 -0400 Message-ID: <4C73B810.5040307@redhat.com> Date: Tue, 24 Aug 2010 15:16:16 +0300 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 3/3] Check pci slot number in parse_pci_devfn References: <20100824063307.GA10815@kt> <20100824064927.GB11495@kt> <20100824113521.GA7201@valinux.co.jp> <4C73B01A.1050908@redhat.com> <20100824120745.GC7201@valinux.co.jp> <4C73B55C.3050800@redhat.com> <20100824122438.GA7547@valinux.co.jp> In-Reply-To: <20100824122438.GA7547@valinux.co.jp> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: Ken CC , qemu-devel@nongnu.org, kvm@vger.kernel.org, "Michael S. Tsirkin" On 08/24/2010 03:24 PM, Isaku Yamahata wrote: > On Tue, Aug 24, 2010 at 03:04:44PM +0300, Avi Kivity wrote: >> On 08/24/2010 03:07 PM, Isaku Yamahata wrote: >>> On Tue, Aug 24, 2010 at 02:42:18PM +0300, Avi Kivity wrote: >>>> On 08/24/2010 02:35 PM, Isaku Yamahata wrote: >>>>> Add Cc: mst@redhat.com. >>>>> >>>>> MAX_PCI_SLOTS should be in pci.h instead of qdev.h? >>>>> And the name should be start with PCI_ prefix for consistency? >>>>> >>>>> Except that, the patches look okay. >>>>> >>>> These aren't slots, are they? They are functions. >>> The function checks if given $slot.$fn (or $slot) is valid. >>> So it's slots. max 32. >> + assert(devfn< PCIBUS_MAX_DEVICES); >> >> >> Looks like we're comparing a function number to PCIBUS_MAX_DEVICES. > Ah, you're talking about 2/3. I talked about 3/3. > You're right. The name is misleading. > PCIBUS_MAX_FUNCTIONS? Or suggestions? Or assert(devfn / 8 < PCIBUS_MAX_DEVICES) (and change that to be 32). -- error compiling committee.c: too many arguments to function