Subject: Memory Management HAndling

From: <[email-masked]>
Date: Fri, 11 Mar 2005 10:55:43 +0530

Hi,

I have been working on MMU of Linux Port of 2.4.20 kernel for MIPS Port.

I have found that MACROS like

#define __pa(x)		((unsigned long) (x) - PAGE_OFFSET)
#define __va(x)		((void *)((unsigned long) (x) + PAGE_OFFSET))
#define virt_to_page(kaddr)	(mem_map + (__pa(kaddr) >> PAGE_SHIFT))

These macros can handle memory pages in KSEG0. Any suggestions on how
can they be changed for addressing memory present in HIGHMEM. Since VA
will not be in linear relation with mem_map.
Rishabh Kumar Goel
Software Engineer

SoCrates Software India Pvt. Ltd.
a TOSHIBA Group Company
#10, Industrial Layout,
Prestige Atlanta,
III Block, Koramangala,
Bangalore - 560034

Ph. 080-51101669

The information contained in this e-mail message and in any annexure is
confidential to the  recipient and may contain privileged information. If you are not
the intended recipient, please notify the sender and delete the message along with
any annexure. You should not disclose, copy or otherwise use the information contained
in the message or any annexure. Any views expressed in this e-mail are those of the
individual sender except where the sender specifically states them to be the views of
SoCrates Software India Pvt Ltd., Bangalore.

---

From: Alan Cox <[email-masked]>
Date: Fri, 11 Mar 2005 13:36:31 +0000

> will not be in linear relation with mem_map.

Take a look at how kmap() works on x86 and how the mappings are used.

---

From: Ralf Baechle <[email-masked]>
Date: Fri, 11 Mar 2005 15:58:23 +0000

> I have been working on MMU of Linux Port of 2.4.20 kernel for MIPS Port.

You may want to change to a kernel that has less than 52 months worth of
bugs and security holes.

> will not be in linear relation with mem_map.

That's normal for highmem.  These macros will only work for lowmem.

  Ralf

---

From: Ralf Baechle <[email-masked]>
Date: Fri, 11 Mar 2005 15:59:24 +0000

> Take a look at how kmap() works on x86 and how the mappings are used.

Highmem is supported for MIPS since ~ 2.4.18 or so.

  Ralf

---

From: Manish Lachwani <[email-masked]>
Date: Fri, 11 Mar 2005 09:06:42 -0800

>Highmem is supported for MIPS since ~ 2.4.18 or so.
Right, I had the 2.4.21 HIGHMEM working on PMC-Sierra Yosemite. Also, at 
that time, Sibyte supported HIGHMEM.

Thanks
Manish Lachwani

---

From: Ralf Baechle <[email-masked]>
Date: Fri, 11 Mar 2005 17:22:28 +0000

> that time, Sibyte supported HIGHMEM.

It's going to work for any CPU that doesn't have cache aliases.

  Ralf