Subject: mips32 kernel memory mapping

From: "Srinivas Kommu" <[email-masked]>
Date: Fri, 23 Jul 2004 00:49:13 -0700

Can a 32-bit mips kernel access beyond KSEG0 contiguously? I have a Sibyte 
1250 with 1 Gig RAM, but only 256 MB is located at phyical 0x0. The rest is 
all located at 0x8000_0000. Does that mean the kernel can access only 256 
meg contiguously? Do I need to enabled CONFIG_HIGHMEM to even reach the 
remaining RAM? It appears Highmem gives me only a 4 meg window at a time. 
Can't I set up a page mapping into KSEG2 for the rest of the memory? KSEG2 
seems to be unused from what I read.

Since the user space has a 2 Gig address space, it should be able to access 
it, right? Does the kernel allocate from the whole 1 Gig when the process 
issues a malloc()?

thanks!
Srini

_________________________________________________________________
Is your PC infected? Get a FREE online computer virus scan from McAfee® 
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

---

From: "Maciej W. Rozycki" <[email-masked]>
Date: Fri, 23 Jul 2004 13:51:34 +0200 (CEST)

> remaining RAM? It appears Highmem gives me only a 4 meg window at a time. 

 The BCM1250A is a 64-bit processor.  What's the problem with using 64-bit
Linux avoiding the hassle altogether?

> seems to be unused from what I read.

 KSEG2 is used for modules.

  Maciej

---

From: Ralf Baechle <[email-masked]>
Date: Fri, 23 Jul 2004 22:24:39 +0200

> Linux avoiding the hassle altogether?

There is a general perception among Linux users that 64-bit is new an
not really needed which in part I blame on the bs Intel is spreading to
hide the fact that for a long time they simply had no 64-bit roadmap at
all.

>  KSEG2 is used for modules.

There are still improvments to be made for BCM1250 support.  Somebody
thought scattering the first 1GB of memory through the lowest 4GB of
physical address space like a three year old his toys over the floor
was a good thing ...  The resulting holes in the memory map are wasting
significant amounts of memory for unused memory; the worst case number
that is reached for 64-bit kernel on a system with > 1GB of RAM is 96MB!
                                                                                
>  KSEG2 is used for modules.
                                                                                
Right.  A part of KSEG2 could be used for mapping more low-memory but
that's only really an interesting option for 32-bit processors and would
only raise the theoretical limit from 512MB (256 on BCM1250) to somewhat
less than 1.5GB (BCM1250: 1.25GB) at the cost of address space for
vmalloc & ioremap.  It's a pretty pointless exercise when there are
still terabytes of unmapped 64-bit address space available.
                                                                                
  Ralf

---

From: Geert Uytterhoeven <[email-masked]>
Date: Fri, 23 Jul 2004 22:34:35 +0200 (MEST)

> that is reached for 64-bit kernel on a system with > 1GB of RAM is 96MB!

Perhaps you want to start using virtually mapped zones, like m68k?

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email-masked]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

---

From: Ralf Baechle <[email-masked]>
Date: Sat, 24 Jul 2004 02:32:44 +0200

> Perhaps you want to start using virtually mapped zones, like m68k?

We could do that, yes.  In the cases that would gain most such as the
BCM1250 it'd not be possible though - there simply is not enough virtual
address space left in KSEG2/3.

  Ralf

---

From: "Maciej W. Rozycki" <[email-masked]>
Date: Mon, 26 Jul 2004 13:23:41 +0200 (CEST)

> hide the fact that for a long time they simply had no 64-bit roadmap at

 Huh?  How's Intel's policy related to 64-bit Linux?  Especially for other
processors, like MIPS.

 Linux has supported 64-bit operation since ~1995 and around 1998 when I
had an opportunity to use it on DEC Alpha, it (2.0.x) was already stable
enough for regular use.  That is the generic core and the Alpha bits, of
course -- the maturity of other processor support may vary, but for MIPS
it's not worse than the 32-bit support.

> that is reached for 64-bit kernel on a system with > 1GB of RAM is 96MB!

 Well, there are some resons given in the manual.  Anyway, memory seems to
be remappable to 0x100000000 in the DRAM controller.  Still we probably
have to keep low 256MB mapped and registered within Linux at 0 for bounce
buffers for broken PCI hardware ("hidden" mapping for exception handlers 
and kernel segments would be easier).

 With only 256MB installed in my system it would be tough for me to code
anything interesting, though.  Perhaps another time.

  Maciej