Re: [PATCH] omap: iommu: disallow mapping NULL address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 7, 2011 at 9:25 PM, Guzman Lugo, Fernando
<fernando.lugo@xxxxxx> wrote:
> On Mon, Mar 7, 2011 at 1:19 PM, David Cohen <dacohen@xxxxxxxxx> wrote:
>> On Mon, Mar 7, 2011 at 9:17 PM, Guzman Lugo, Fernando
>> <fernando.lugo@xxxxxx> wrote:
>>> On Mon, Mar 7, 2011 at 7:10 AM, Michael Jones
>>> <michael.jones@xxxxxxxxxxxxxxxx> wrote:
>>>> From e7dbe4c4b64eb114f9b0804d6af3a3ca0e78acc8 Mon Sep 17 00:00:00 2001
>>>> From: Michael Jones <michael.jones@xxxxxxxxxxxxxxxx>
>>>> Date: Mon, 7 Mar 2011 13:36:15 +0100
>>>> Subject: [PATCH] omap: iommu: disallow mapping NULL address
>>>>
>>>> commit c7f4ab26e3bcdaeb3e19ec658e3ad9092f1a6ceb allowed mapping
>>>> the NULL address if da_start==0. ÂForce da_start to exclude the
>>>> first page.
>>>
>>> what about devices that uses page 0? ipu after reset always starts
>>> from 0x00000000 how could we map that address??
>>
>> from 0x0? The driver sees da == 0 as error. May I ask you why do you want it?
>
> unlike DSP that you can load a register with the addres the DSP will
> boot, IPU core always starts from address 0x00000000, so if you take
> IPU out of reset it will try to access address 0x0 if not map it,
> there will be a mmu fault.

Hm. Looks like the iommu should not restrict any da. The valid da
range should rely only on pdata.
Michael, what about just update ISP's da_start on omap-iommu.c file?
Set it to 0x1000.

Hiroshi, any opinion?

Br,

David

>
> Regards,
> Fernando.
>
>>
>> Br,
>>
>> David
>>
>>>
>>> Regards,
>>> Fernando.
>>>
>>>>
>>>> Signed-off-by: Michael Jones <michael.jones@xxxxxxxxxxxxxxxx>
>>>> ---
>>>> Âarch/arm/plat-omap/iommu.c | Â Â6 ++++--
>>>> Â1 files changed, 4 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c
>>>> index 5990ea6..dcb5513 100644
>>>> --- a/arch/arm/plat-omap/iommu.c
>>>> +++ b/arch/arm/plat-omap/iommu.c
>>>> @@ -850,7 +850,7 @@ int iommu_set_da_range(struct iommu *obj, u32 start, u32 end)
>>>> Â Â Â Âif (end < start || !PAGE_ALIGN(start | end))
>>>> Â Â Â Â Â Â Â Âreturn -EINVAL;
>>>>
>>>> - Â Â Â obj->da_start = start;
>>>> + Â Â Â obj->da_start = max(start, (u32)PAGE_SIZE);
>>>> Â Â Â Âobj->da_end = end;
>>>>
>>>> Â Â Â Âreturn 0;
>>>> @@ -950,7 +950,9 @@ static int __devinit omap_iommu_probe(struct platform_device *pdev)
>>>> Â Â Â Âobj->name = pdata->name;
>>>> Â Â Â Âobj->dev = &pdev->dev;
>>>> Â Â Â Âobj->ctx = (void *)obj + sizeof(*obj);
>>>> - Â Â Â obj->da_start = pdata->da_start;
>>>> +
>>>> + Â Â Â /* reserve the first page for NULL */
>>>> + Â Â Â obj->da_start = max(pdata->da_start, (u32)PAGE_SIZE);
>>>> Â Â Â Âobj->da_end = pdata->da_end;
>>>>
>>>> Â Â Â Âmutex_init(&obj->iommu_lock);
>>>> --
>>>> 1.7.4.1
>>>>
>>>>
>>>> MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler
>>>> Registergericht: Amtsgericht Stuttgart, HRB 271090
>>>> Geschaeftsfuehrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner
>>>>
>>>
>>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux