From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: Question about the dynamic sizing of the PCI hole Date: Mon, 25 May 2009 10:14:14 +0100 Message-ID: References: <8686c3cd0905250201u5eb546a5n35b7600e4b264feb@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <8686c3cd0905250201u5eb546a5n35b7600e4b264feb@mail.gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Tom Rotenberg , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 25/05/2009 10:01, "Tom Rotenberg" wrote: > I am reviewing the code of the hvmloader from Xen 3.4, and i saw that in > changeset 19021, there was a patch which added the ability to dynamically= size > the PCI hole. I have seen that this patch calculates the total memory siz= e, > but i failed to understand the following lines: >=20 > while ( (mmio_total > (pci_mem_end - pci_mem_start)) && > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ((pci_mem_start << 1) !=3D 0) ) > =A0=A0=A0=A0=A0=A0=A0 pci_mem_start <<=3D 1; >=20 > It looks as if the pci mem start will be increased if there isn't enough = space > for the PCI devices, although, as far as i understand, it should be decre= ased > (so the PCI hole will be enlarged). So, shouldn't it be: "pci_mem_start >= > =3D > 1" ? Leading bits of this 32-bit value are 1s. Hence left shift is what we want. -- Keir