All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] x86/PCI: never allocate PCI MMIO resources below   BIOS_END
@ 2010-04-26 23:02 H. Peter Anvin
  2010-04-26 23:25 ` Jesse Barnes
  0 siblings, 1 reply; 32+ messages in thread
From: H. Peter Anvin @ 2010-04-26 23:02 UTC (permalink / raw)
  To: Jesse Barnes
  Cc: Bjorn Helgaas, Andy Isaacson, R. Andrew Bailey, Yinghai,
	Thomas Gleixner, Ingo Molnar, guenter.roeck, Linus Torvalds,
	linux-pci, x86, linux-kernel, Thomas Renninger, yaneti

[-- Attachment #1: Type: text/plain, Size: 1395 bytes --]

I don't think it's sufficient, actually.  We regularly see machines where devices point into e820_reserved memory above 1 MB - because it's a platform device or because firmware (e.g. smm) is touching the device.  I think Bjorn's fix is great for .34, but longer term I think we need to structure the code to actually handle reserved regions differently from occupied/forbidden regions.

"Jesse Barnes" <jbarnes@virtuousgeek.org> wrote:

>On Mon, 26 Apr 2010 14:44:50 -0700
>"H. Peter Anvin" <hpa@zytor.com> wrote:
>
>> >
>> > Agreed.  The trickier part is handling any platform devices that
>> > request_resource against that space.  But maybe we don't need to do
>> > anything special; just making sure we avoid it in the PCI "BIOS" code
>> > as Bjorn did may be sufficient.
>> >
>> 
>> Why is that hard?  If a platform device does a request_resource against
>> that space, it's a request for specific address space and it should be
>> granted.
>
>I was thinking if we made it a special resource type we'd have to
>change any platform drivers to use it; i.e. it wouldn't be
>IORESOURCE_MEM or IORESOURCE_IO but IORESOURCE_DRAGONS.  That way it
>wouldn't be part of the normal resource space.
>
>But that's definitely overkill.  I think Bjorn's fix is sufficient.
>
>-- 
>Jesse Barnes, Intel Open Source Technology Center

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

^ permalink raw reply	[flat|nested] 32+ messages in thread
* Re: [PATCH] x86/PCI: never allocate PCI MMIO resources below    BIOS_END
@ 2010-04-27  2:02 H. Peter Anvin
  0 siblings, 0 replies; 32+ messages in thread
From: H. Peter Anvin @ 2010-04-27  2:02 UTC (permalink / raw)
  To: Jesse Barnes, Linus Torvalds
  Cc: Bjorn Helgaas, Andy Isaacson, R. Andrew Bailey, Yinghai,
	Thomas Gleixner, Ingo Molnar, guenter.roeck, linux-pci, x86,
	linux-kernel, Thomas Renninger, yaneti

[-- Attachment #1: Type: text/plain, Size: 1621 bytes --]

The 1 MB range is only one case of a prereserved space.  It's special only in the sense that it is *always* reserved, even if the map doesn't mark it as such.  Fixed (or SMM-used) resources in reserved space above 1 MB are exactly the same issue.

"Jesse Barnes" <jbarnes@virtuousgeek.org> wrote:

>On Mon, 26 Apr 2010 18:27:27 -0700 (PDT)
>Linus Torvalds <torvalds@linux-foundation.org> wrote:
>
>> 
>> 
>> On Mon, 26 Apr 2010, Jesse Barnes wrote:
>> > 
>> > Glad we agree.  As I said (and echoing Bjorn), I think it would be best
>> > to reserve this space in a way that doesn't just use IORESOURCE_BUSY.
>> > We want and need to do allocations from the special region, so we
>> > should mark it as such.
>> 
>> I think Bjorn's patch to pcibios_align_resource() is really good and 
>> clever, and I think it should take care of the need for IORESOURCE_BUSY, 
>> no? We do want to let devices that are _already_ allocated there insert 
>> their resources, it's just that we never want to allocate new ones in the 
>> low 1M region.
>> 
>> Do we actually have a regression left with Bjorn's patch?
>
>No, I think we're covered.  But it sounded like Peter was also
>concerned about making new allocations from the 1M space, which would
>mean we'd need something other than the IORESOURCE_BUSY bit.  But maybe
>Bjorn's patch plus simply removing the IORESOURCE_BUSY line is
>sufficient for that.  The downside there is that it doesn't clearly
>communicate the special nature of the 1M region.
>
>-- 
>Jesse Barnes, Intel Open Source Technology Center

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

^ permalink raw reply	[flat|nested] 32+ messages in thread
* Re: [PATCH -v2 1/2] x86: Reserve [0xa0000, 0x100000] in e820 map
@ 2010-04-13 21:42 Yinghai
  2010-04-21  5:33 ` [PATCH -v4 1/3] " Yinghai
  0 siblings, 1 reply; 32+ messages in thread
From: Yinghai @ 2010-04-13 21:42 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Bjorn Helgaas, Thomas Gleixner, Ingo Molnar, Andy Isaacson,
	guenter.roeck, Linus Torvalds, linux-pci, x86, linux-kernel,
	Thomas Renninger

On 04/13/2010 02:18 PM, H. Peter Anvin wrote:
> On 04/13/2010 02:11 PM, Yinghai wrote:
>>>
>>> I guess the real question (which I haven't looked at myself) is if the
>>> E820_RESERVED -> BUSY will cause an explicitly assigned BAR from being
>>> moved.  That's bad, not so much for this particular range, but from BARs
>>> which may be assigned by SMM.  Hacking that up in a simulator
>>> (Qemu/Bochs) and testing it is probably on the to do list...
>>
>> no, if some device BAR fall in that range, it should still use that range, and will not be relocated.
>>
>> will update the change log.
>>
> 
> Good, that's what we want.

the driver for that device later can not use pci_request_region(). because that region is BUSY already.

YH


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

end of thread, other threads:[~2010-04-28 19:23 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-26 23:02 [PATCH] x86/PCI: never allocate PCI MMIO resources below BIOS_END H. Peter Anvin
2010-04-26 23:25 ` Jesse Barnes
2010-04-26 23:49   ` H. Peter Anvin
2010-04-26 23:49   ` H. Peter Anvin
2010-04-27  0:05     ` Jesse Barnes
2010-04-27  1:27       ` Linus Torvalds
2010-04-27  1:40         ` Jesse Barnes
2010-04-27  1:41         ` Yinghai
2010-04-27 15:11           ` Bjorn Helgaas
2010-04-28 16:07             ` Bjorn Helgaas
2010-04-28 17:14               ` Yinghai Lu
2010-04-28 19:06                 ` Bjorn Helgaas
2010-04-28 19:10                   ` Yinghai
2010-04-28 19:23                     ` Bjorn Helgaas
  -- strict thread matches above, loose matches on Subject: below --
2010-04-27  2:02 H. Peter Anvin
2010-04-13 21:42 [PATCH -v2 1/2] x86: Reserve [0xa0000, 0x100000] in e820 map Yinghai
2010-04-21  5:33 ` [PATCH -v4 1/3] " Yinghai
2010-04-21 19:31   ` Andy Isaacson
2010-04-23 23:05     ` [PATCH] x86/PCI: never allocate PCI MMIO resources below BIOS_END Bjorn Helgaas
2010-04-23 23:44       ` H. Peter Anvin
2010-04-24  0:36         ` Yinghai Lu
2010-04-26 12:50       ` R. Andrew Bailey
2010-04-26 15:40         ` Bjorn Helgaas
2010-04-26 18:34       ` Andy Isaacson
2010-04-26 19:31         ` Jesse Barnes
2010-04-26 20:27           ` Bjorn Helgaas
2010-04-26 20:37             ` Jesse Barnes
2010-04-26 21:07               ` Yinghai
2010-04-26 21:19                 ` H. Peter Anvin
2010-04-26 21:12               ` H. Peter Anvin
2010-04-26 21:25                 ` Jesse Barnes
2010-04-26 21:44                   ` H. Peter Anvin
2010-04-26 21:53                     ` Jesse Barnes
2010-04-26 21:59                   ` Yinghai Lu
2010-04-26 21:44                 ` jacob pan

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.