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:19:20 +0300 Message-ID: <4C73B8C8.3040209@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> <20100824121632.GG1971@kt> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Isaku Yamahata , Ken CC , kvm@vger.kernel.org, qemu-devel@nongnu.org, "Michael S. Tsirkin" To: Chen Cao Return-path: Received: from mx1.redhat.com ([209.132.183.28]:34535 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751460Ab0HXMT3 (ORCPT ); Tue, 24 Aug 2010 08:19:29 -0400 In-Reply-To: <20100824121632.GG1971@kt> Sender: kvm-owner@vger.kernel.org List-ID: On 08/24/2010 03:16 PM, Chen Cao 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. >> > PCIBUS_MAX_DEVICES is the size of PCIBus.devices[], I have added it in > the first patch at the defination of struct PCIBus, line 50 hw/pci.c. > so i think the better name of the macro should be PCIBUS_MAX_FN, > right? Or make it 32 and scale it by PCI_FUNCTIONS_PER_DEVICE. PCIBus.devices[] should be renamed to functions[] (later). -- 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=50805 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OnsTR-0003OL-I7 for qemu-devel@nongnu.org; Tue, 24 Aug 2010 08:19:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OnsTQ-0007lO-CO for qemu-devel@nongnu.org; Tue, 24 Aug 2010 08:19:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47166) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OnsTQ-0007lH-6G for qemu-devel@nongnu.org; Tue, 24 Aug 2010 08:19:28 -0400 Message-ID: <4C73B8C8.3040209@redhat.com> Date: Tue, 24 Aug 2010 15:19:20 +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> <20100824121632.GG1971@kt> In-Reply-To: <20100824121632.GG1971@kt> 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: Chen Cao Cc: Isaku Yamahata , Ken CC , qemu-devel@nongnu.org, kvm@vger.kernel.org, "Michael S. Tsirkin" On 08/24/2010 03:16 PM, Chen Cao 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. >> > PCIBUS_MAX_DEVICES is the size of PCIBus.devices[], I have added it in > the first patch at the defination of struct PCIBus, line 50 hw/pci.c. > so i think the better name of the macro should be PCIBUS_MAX_FN, > right? Or make it 32 and scale it by PCI_FUNCTIONS_PER_DEVICE. PCIBus.devices[] should be renamed to functions[] (later). -- error compiling committee.c: too many arguments to function