* Re: how to use TLB to prevent Linux accessing a particular memory region
2007-10-16 13:36 how to use TLB to prevent Linux accessing a particular memory region veerasena reddy
@ 2007-10-16 14:13 ` J. Scott Kasten
2007-10-16 14:53 ` linux-os (Dick Johnson)
1 sibling, 0 replies; 3+ messages in thread
From: J. Scott Kasten @ 2007-10-16 14:13 UTC (permalink / raw)
To: veerasena reddy; +Cc: linux-kernel.org, linux-mips
Really, it sounds more like you want a custom driver that "owns" that
region of memory so it's marked as used and this driver is the gate
keeper. I wonder if the console frame buffer driver for the mips ip32
arch might be a good example for you as it swallows a several meg chunk of
memory for the display.
-S-
On Tue, 16 Oct 2007, veerasena reddy wrote:
> Hi,
>
> I have a board, which has two processors ( one is MIPS
> on which Linux-2.6.18 kernel runs and another is DSP
> based processor) and 32MB DDR.
>
> Out of 32MB of DDR 8MB is reserved for use by DSP
> processor. But the MIPS processor downloads firmware
> into this reserved memory for the DSP.
>
> Now, is it possible to use the TLB to prevent Linux
> from accessing the reserved memory after the firmware
> has been downloaded?
>
> Also we'd need to remove those TLB entries if the
> firmware would ever need to be reloaded to the DSP'
> memory region.
>
> What are the APIs to be used to achieve the above?
>
>
> Thanks in advance.
>
> Regards,
> Veerasena.
>
>
> 5, 50, 500, 5000 - Store N number of mails in your inbox. Go to http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: how to use TLB to prevent Linux accessing a particular memory region
2007-10-16 13:36 how to use TLB to prevent Linux accessing a particular memory region veerasena reddy
2007-10-16 14:13 ` J. Scott Kasten
@ 2007-10-16 14:53 ` linux-os (Dick Johnson)
1 sibling, 0 replies; 3+ messages in thread
From: linux-os (Dick Johnson) @ 2007-10-16 14:53 UTC (permalink / raw)
To: veerasena reddy; +Cc: linux-kernel.org, linux-mips
On Tue, 16 Oct 2007, veerasena reddy wrote:
> Hi,
>
> I have a board, which has two processors ( one is MIPS
> on which Linux-2.6.18 kernel runs and another is DSP
> based processor) and 32MB DDR.
>
> Out of 32MB of DDR 8MB is reserved for use by DSP
> processor. But the MIPS processor downloads firmware
> into this reserved memory for the DSP.
>
> Now, is it possible to use the TLB to prevent Linux
> from accessing the reserved memory after the firmware
> has been downloaded?
>
> Also we'd need to remove those TLB entries if the
> firmware would ever need to be reloaded to the DSP'
> memory region.
>
> What are the APIs to be used to achieve the above?
>
>
> Thanks in advance.
>
> Regards,
> Veerasena.
>
>
> 5, 50, 500, 5000 - Store N number of mails in your inbox. Go to http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html
> -
Can't you just memory-map the area you need? That reserves it
until it's unmapped. You don't need to directly touch the TLB.
If you need a physical location, use ioremap_nocache() in your
driver. If you can't get your physical location because the
kernel already uses it, boot the kernel with mem=xxx on the
command-line to prevent the kernel from using memory you
want to reserve for your DSP. You can use num_physpages
(an integer) to find out the last page the kernel uses.
BTW, if this is a new design, most DSP devices put their
RAM on their own board so you don't have these problems.
That RAM gets mmaped to user-space as needed for access,
that address being set asside in PCI space.
Cheers,
Dick Johnson
Penguin : Linux version 2.6.16.24 on an i686 machine (5592.59 BogoMips).
My book : http://www.AbominableFirebug.com/
_
****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to DeliveryErrors@analogic.com - and destroy all copies of this information, including any attachments, without reading or disclosing them.
Thank you.
^ permalink raw reply [flat|nested] 3+ messages in thread