From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38282) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SC8uY-0003x3-Hj for qemu-devel@nongnu.org; Mon, 26 Mar 2012 08:20:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SC8uT-0000DW-F6 for qemu-devel@nongnu.org; Mon, 26 Mar 2012 08:20:34 -0400 Received: from smtp.citrix.com ([66.165.176.89]:17197) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SC8uT-0000D5-BO for qemu-devel@nongnu.org; Mon, 26 Mar 2012 08:20:29 -0400 Message-ID: <4F705F12.1050308@citrix.com> Date: Mon, 26 Mar 2012 13:20:34 +0100 From: Julien Grall MIME-Version: 1.0 References: <869b10d6ef10def49aa8a94524c2949e6a6039f0.1332430810.git.julien.grall@citrix.com> <4F6C426B020000780007A722@nat28.tlf.novell.com> In-Reply-To: <4F6C426B020000780007A722@nat28.tlf.novell.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Xen-devel] [XEN][RFC PATCH 03/15] hvm-pci: Handle PCI config space in Xen List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Beulich Cc: "qemu-devel@nongnu.org" , xen-devel , Julian Pidancet , Stefano Stabellini On 03/23/2012 08:29 AM, Jan Beulich wrote: > Is there a reasonably low enforced boundary on the number > of devices? Otherwise, a linear lookup would seem overly > simple to me. > The maximum of bdf is 2^16 => 65536. Which kind of structure do you advice ? Array ? Hash Table ? > Further, with how PCI_CMP_BDF() is defined, you're doing the > wrong thing here anyway - bit 31 is required to be set for the > port CFC access to be a config space one. Plus there's an AMD > extension to this interface, so I think other than shifting out > the low 8 bits and checking that the high bit is set, you shouldn't > do any other masking here. > Actually in config address register the 24-30 bits are reserved. So, do I need to mask it ? Moreover what is the AMD extension ? > Jan > > >> + >> + /* We just fill the ioreq, hvm_send_assist_req will send the request */ >> + if (unlikely(pci == NULL)) >> + { >> + *val = ~0; >> + rc = X86EMUL_OKAY; >> + goto end_handle; >> + } >> + >> + p->type = IOREQ_TYPE_PCI_CONFIG; >> + p->addr = (pci_cf8& ~3) + (p->addr& 3); >> + >> + set_ioreq(v,&pci->server->ioreq, p); >> + >> +end_handle: >> + spin_unlock(&v->domain->arch.hvm_domain.pci_root.pci_lock); >> + return rc; >> +} >> > >