All of lore.kernel.org
 help / color / mirror / Atom feed
* Question about the dynamic sizing of the PCI hole
@ 2009-05-25  9:01 Tom Rotenberg
  2009-05-25  9:14 ` Keir Fraser
  0 siblings, 1 reply; 6+ messages in thread
From: Tom Rotenberg @ 2009-05-25  9:01 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 669 bytes --]

Hi,

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
size, but i failed to understand the following lines:

while ( (mmio_total > (pci_mem_end - pci_mem_start)) &&
            ((pci_mem_start << 1) != 0) )
        pci_mem_start <<= 1;

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
decreased (so the PCI hole will be enlarged). So, shouldn't it be:
"pci_mem_start >> = 1" ?

Thanks,
       Tom

[-- Attachment #1.2: Type: text/html, Size: 800 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Question about the dynamic sizing of the PCI hole
  2009-05-25  9:01 Question about the dynamic sizing of the PCI hole Tom Rotenberg
@ 2009-05-25  9:14 ` Keir Fraser
  2009-05-25  9:24   ` Tom Rotenberg
  0 siblings, 1 reply; 6+ messages in thread
From: Keir Fraser @ 2009-05-25  9:14 UTC (permalink / raw)
  To: Tom Rotenberg, xen-devel@lists.xensource.com

On 25/05/2009 10:01, "Tom Rotenberg" <tom.rotenberg@gmail.com> 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 size,
> but i failed to understand the following lines:
> 
> while ( (mmio_total > (pci_mem_end - pci_mem_start)) &&
>             ((pci_mem_start << 1) != 0) )
>         pci_mem_start <<= 1;
> 
> 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 decreased
> (so the PCI hole will be enlarged). So, shouldn't it be: "pci_mem_start >> =
> 1" ?

Leading bits of this 32-bit value are 1s. Hence left shift is what we want.

 -- Keir

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Question about the dynamic sizing of the PCI hole
  2009-05-25  9:14 ` Keir Fraser
@ 2009-05-25  9:24   ` Tom Rotenberg
  2009-05-25  9:42     ` Keir Fraser
  0 siblings, 1 reply; 6+ messages in thread
From: Tom Rotenberg @ 2009-05-25  9:24 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel@lists.xensource.com


[-- Attachment #1.1: Type: text/plain, Size: 1085 bytes --]

And, won't we have any problem if we dynamically size the PCI hole, and not
update it in the DSDT we give for the HVM (in the DSDT it's always
0xf0000...)?

2009/5/25 Keir Fraser <keir.fraser@eu.citrix.com>

> On 25/05/2009 10:01, "Tom Rotenberg" <tom.rotenberg@gmail.com> 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
> size,
> > but i failed to understand the following lines:
> >
> > while ( (mmio_total > (pci_mem_end - pci_mem_start)) &&
> >             ((pci_mem_start << 1) != 0) )
> >         pci_mem_start <<= 1;
> >
> > 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
> decreased
> > (so the PCI hole will be enlarged). So, shouldn't it be: "pci_mem_start
> >> =
> > 1" ?
>
> Leading bits of this 32-bit value are 1s. Hence left shift is what we want.
>
>  -- Keir
>
>
>

[-- Attachment #1.2: Type: text/html, Size: 1653 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Question about the dynamic sizing of the PCI hole
  2009-05-25  9:24   ` Tom Rotenberg
@ 2009-05-25  9:42     ` Keir Fraser
  2009-05-25  9:48       ` Tom Rotenberg
  0 siblings, 1 reply; 6+ messages in thread
From: Keir Fraser @ 2009-05-25  9:42 UTC (permalink / raw)
  To: Tom Rotenberg; +Cc: xen-devel@lists.xensource.com

That field is updated dynamically. Can't you fluently read ASL? ;-)

 -- Keir

On 25/05/2009 10:24, "Tom Rotenberg" <tom.rotenberg@gmail.com> wrote:

> And, won't we have any problem if we dynamically size the PCI hole, and not
> update it in the DSDT we give for the HVM (in the DSDT it's always
> 0xf0000...)?
> 
> 2009/5/25 Keir Fraser <keir.fraser@eu.citrix.com>
>> On 25/05/2009 10:01, "Tom Rotenberg" <tom.rotenberg@gmail.com> 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 size,
>>> but i failed to understand the following lines:
>>> 
>>> while ( (mmio_total > (pci_mem_end - pci_mem_start)) &&
>>>             ((pci_mem_start << 1) != 0) )
>>>         pci_mem_start <<= 1;
>>> 
>>> 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
>>> decreased
>>> (so the PCI hole will be enlarged). So, shouldn't it be: "pci_mem_start >> =
>>> 1" ?
>> 
>> Leading bits of this 32-bit value are 1s. Hence left shift is what we want.
>> 
>>  -- Keir
>> 
>> 
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Question about the dynamic sizing of the PCI hole
  2009-05-25  9:42     ` Keir Fraser
@ 2009-05-25  9:48       ` Tom Rotenberg
  2009-05-25 11:24         ` Keir Fraser
  0 siblings, 1 reply; 6+ messages in thread
From: Tom Rotenberg @ 2009-05-25  9:48 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel@lists.xensource.com


[-- Attachment #1.1: Type: text/plain, Size: 1489 bytes --]

Well, can u give me any pointer to which code updates it? (my English is
better than my ASL :)

2009/5/25 Keir Fraser <keir.fraser@eu.citrix.com>

> That field is updated dynamically. Can't you fluently read ASL? ;-)
>
>  -- Keir
>
> On 25/05/2009 10:24, "Tom Rotenberg" <tom.rotenberg@gmail.com> wrote:
>
> > And, won't we have any problem if we dynamically size the PCI hole, and
> not
> > update it in the DSDT we give for the HVM (in the DSDT it's always
> > 0xf0000...)?
> >
> > 2009/5/25 Keir Fraser <keir.fraser@eu.citrix.com>
> >> On 25/05/2009 10:01, "Tom Rotenberg" <tom.rotenberg@gmail.com> 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
> size,
> >>> but i failed to understand the following lines:
> >>>
> >>> while ( (mmio_total > (pci_mem_end - pci_mem_start)) &&
> >>>             ((pci_mem_start << 1) != 0) )
> >>>         pci_mem_start <<= 1;
> >>>
> >>> 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
> >>> decreased
> >>> (so the PCI hole will be enlarged). So, shouldn't it be: "pci_mem_start
> >> =
> >>> 1" ?
> >>
> >> Leading bits of this 32-bit value are 1s. Hence left shift is what we
> want.
> >>
> >>  -- Keir
> >>
> >>
> >
>
>
>

[-- Attachment #1.2: Type: text/html, Size: 2391 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Question about the dynamic sizing of the PCI hole
  2009-05-25  9:48       ` Tom Rotenberg
@ 2009-05-25 11:24         ` Keir Fraser
  0 siblings, 0 replies; 6+ messages in thread
From: Keir Fraser @ 2009-05-25 11:24 UTC (permalink / raw)
  To: Tom Rotenberg; +Cc: xen-devel@lists.xensource.com

On 25/05/2009 10:48, "Tom Rotenberg" <tom.rotenberg@gmail.com> wrote:

> Well, can u give me any pointer to which code updates it? (my English is
> better than my ASL :)

                CreateDWordField(PRT0, \_SB.PCI0._CRS._Y01._MIN, MMIN)
                CreateDWordField(PRT0, \_SB.PCI0._CRS._Y01._MAX, MMAX)
                CreateDWordField(PRT0, \_SB.PCI0._CRS._Y01._LEN, MLEN)

                Store(\_SB.PMIN, MMIN)
                Store(\_SB.PLEN, MLEN)
                Add(MMIN, MLEN, MMAX)
                Subtract(MMAX, One, MMAX)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-05-25 11:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-25  9:01 Question about the dynamic sizing of the PCI hole Tom Rotenberg
2009-05-25  9:14 ` Keir Fraser
2009-05-25  9:24   ` Tom Rotenberg
2009-05-25  9:42     ` Keir Fraser
2009-05-25  9:48       ` Tom Rotenberg
2009-05-25 11:24         ` Keir Fraser

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.