Re: how to use TLB to prevent Linux accessing a particular memory region





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@xxxxxxxxxxxx - and destroy all copies of this information, including any attachments, without reading or disclosing them.

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



Relevant Pages

  • Re: error wince600 boot message after dowload PB6 OS to HW board
    ... This fix-up variable determines the amount of memory the BSP ... reserves for Watson dump capture. ... ; @CESYSGEN ENDIF!NK_NKNOCOMP ... Windows CE Kernel for MIPS Built on Sep 30 2007 at 22:35:49 ...
    (microsoft.public.windowsce.platbuilder)
  • Re: 32 bit vista cant address more than 3.1-3.5 GB RAM
    ... It could use more memory for its own book-keeping. ... the kernel and kernel models share the *same* address space in OS ... On other OSes, the kernel is very special, and occupies a reserved chunk of address space that normal processes aren't allowed to use. ... Now, 32-bit Windows reserves 2 GB for the kernel by default, but can be configured to reserve only 1 GB, leaving more address space for programs. ...
    (comp.sys.mac.advocacy)
  • 2.6.33 dies on modprobe
    ... The kernel starts up fine and mounts the root-filesystem, ... Freeing unused kernel memory: 408k freed ... # CPUFreq processor drivers ...
    (Linux-Kernel)
  • Re: [PATCH] intel-agp.c: Fix crash when accessing nonexistent GTT entries in i915
    ... has info that 256K is for GTT bar, so max video memory size is 256M. ... IGD DVMT/FIXED MEMORY: 32 MB ... Access kernel.org in iceweasel and the X server will crash. ... Sometimes, the kernel freezes. ...
    (Linux-Kernel)
  • Re: s2disk hang update
    ... This looks like we have run out of memory while creating a new kernel thread ... because the I/O doesn't work at this point). ... Keep 1 MB of memory free so that device drivers can allocate some pages in ...
    (Linux-Kernel)