From: Yinghai on
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: H. Peter Anvin on
On 04/13/2010 02:42 PM, Yinghai wrote:
> 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.
>

That's not good (in general - for devices in this particular range it's
not such a big deal, but it is potentially really bad for devices marked
reserved for them not to be moved.)

We have talked about a need to resolve this before.

-hpa

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Yinghai on
On 04/13/2010 02:58 PM, H. Peter Anvin wrote:
> On 04/13/2010 02:42 PM, Yinghai wrote:
>> 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.
>>
>
> That's not good (in general - for devices in this particular range it's
> not such a big deal, but it is potentially really bad for devices marked
> reserved for them not to be moved.)
>
> We have talked about a need to resolve this before.

current code for mmio that is just below 4g, if some PCI BAR use that range, and those range is falling into E820_RESERVED,

those range still can be claimed, but driver can not use pci_request_region() later.

So We still
1. rely that BIOS does not reserve the [0xa0000, 0xe0000)
2. kernel only reserve the range when we make sure these is legacy device on that range.

YH
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: H. Peter Anvin on
On 04/13/2010 03:29 PM, Yinghai wrote:
>>
>> We have talked about a need to resolve this before.
>
> current code for mmio that is just below 4g, if some PCI BAR use that range, and those range is falling into E820_RESERVED,
>
> those range still can be claimed, but driver can not use pci_request_region() later.
>
> So We still
> 1. rely that BIOS does not reserve the [0xa0000, 0xe0000)
> 2. kernel only reserve the range when we make sure these is legacy device on that range.
>

This really isn't sufficient. There are systems in the field which
marks a memory range reserved in E820 because it a device pointed there,
and it doesn't want that device moved because it is used by an SMM handler.

This was reported quite a while ago (like two years.) I can dig up the
thread if it matters.

-hpa

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Yinghai on
On 04/13/2010 03:29 PM, Yinghai wrote:
> On 04/13/2010 02:58 PM, H. Peter Anvin wrote:
>> On 04/13/2010 02:42 PM, Yinghai wrote:
>>> 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.
>>>
>>
>> That's not good (in general - for devices in this particular range it's
>> not such a big deal, but it is potentially really bad for devices marked
>> reserved for them not to be moved.)
>>
>> We have talked about a need to resolve this before.
>
> current code for mmio that is just below 4g, if some PCI BAR use that range, and those range is falling into E820_RESERVED,
>
> those range still can be claimed, but driver can not use pci_request_region() later.
should be
but driver can use pci_request_region() later.

>
> So We still
> 1. rely that BIOS does not reserve the [0xa0000, 0xe0000)
> 2. kernel only reserve the range when we make sure these is legacy device on that range.
>
> YH

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/