What is the maximum physical RAM for a 32bit MIPS core?
I am just trying to fill in some more MIPS knowledge here. With a 32-bit MIPS processor, we are forever limited to a userspace of 2GB in size thanks to the kuser region. kseg0/1 map the same 512MB of physical memory. kseg2 is 1GB in size and hence it could address another 1GB of RAM. So, is the maximum amount of RAM for a 32bit MIPS core:
1) 1.5GB = 0.5GB kseg0/1 + 1.0GB kseg2
2) 4.0GB = largest 32-bit address
3) Something larger than 4.0GB by adding fancy external HW logic
Also, for choice #3, while it would be a hit in performance, could you use the fp registers for 64-bit pointers to address larger than 4.0GB?
Thanks in advance.
-Steve
Signature · 1 line
Steven J. Hill - Embedded SW Engineer
You have to distinguish between physical and virtual memory. The MIPS32 architecture supports implementations with up to 36 bits of physical address space, however the virtual address space in kernel and user mode is as you describe below.
One note: Many MIPS32 implementations choose not to implement all 36 PA bits, but limit themselves to 32 bits. This saves a few bits in the TLB and a few address lines.
And no to the FP thing: FP registers can only be used to hold FP values. All addressing is done through integer registers. And any given process can only see 2GB anyway.
/Hartvig
Quoted 23 lines · Steven J. Hill
I am just trying to fill in some more MIPS knowledge here. With a 32-bit MIPS processor, we are forever limited to a userspace of 2GB in size thanks to the kuser region. kseg0/1 map the same 512MB of physical memory. kseg2 is 1GB in size and hence it could address another 1GB of RAM. So, is the maximum amount of RAM for a 32bit MIPS core:
1) 1.5GB = 0.5GB kseg0/1 + 1.0GB kseg2
2) 4.0GB = largest 32-bit address
3) Something larger than 4.0GB by adding fancy external HW logic
Also, for choice #3, while it would be a hit in performance, could you use the fp registers for 64-bit pointers to address larger than 4.0GB?
Thanks in advance.
-Steve
Signature · 1 line
Steven J. Hill - Embedded SW Engineer
Signature · 4 lines
_ _ _____ ____ Hartvig Ekner Mailto:[email protected] |\ /| | |____)(____ Direct: +45 4486 5503 | \/ | | | _____) MIPS Denmark Switch: +45 4486 5555 T E C H N O L O G I E S http://www.mips.com Fax...: +45 4486 5556
Quoted 6 lines · Hartvig Ekner
You have to distinguish between physical and virtual memory. The MIPS32 architecture supports implementations with up to 36 bits of physical address space, however the virtual address space in kernel and user mode is as you describe below.
I wasn't talking about the MIP32[tm] cores specifically, I was using a generalization of 32bit. However, this is good to know. All of the data sheets that I just downloaded from the MIPS site for the R4k[X] cores don't mention the 36-bit PA item. Care to elaborate?
Quoted 4 lines
One note: Many MIPS32 implementations choose not to implement all 36 PA bits, but limit themselves to 32 bits. This saves a few bits in the TLB and a few address lines.
So, if someone did want 36 PA bits on Linux, the TLB exception handlers and a little of the page table construction/management code would have to change. The userspace contraints and such would still remain. Cool.
-Steve
Signature · 1 line
Steven J. Hill - Embedded SW Engineer
Hi,
Quoted 8 lines · Steven J. Hill
Quoted 6 lines · Hartvig Ekner
You have to distinguish between physical and virtual memory. The MIPS32 architecture supports implementations with up to 36 bits of physical address space, however the virtual address space in kernel and user mode is as you describe below.
Quoted 4 lines
I wasn't talking about the MIP32[tm] cores specifically, I was using a generalization of 32bit. However, this is good to know. All of the data sheets that I just downloaded from the MIPS site for the R4k[X] cores don't mention the 36-bit PA item. Care to elaborate?
Sure. All the 4K, 4KE and 4KS families (all MIPS32 cores) from MTI only provide 32 bits of PA. The 5K and 20K families (MIPS64 implementations) both provide 36 bit of PA.
Also note that all of the above is only relevant for cores which have a TLB. The low-end 4K/4KE/4KS cores all come in variants without TLB (to save die area) and these can of course only generate 32-bits of PA regardless.
/Hartvig
Quoted 12 lines · Steven J. Hill
Quoted 6 lines · Hartvig Ekner
You have to distinguish between physical and virtual memory. The MIPS32 architecture supports implementations with up to 36 bits of physical address space, however the virtual address space in kernel and user mode is as you describe below.
I wasn't talking about the MIP32[tm] cores specifically, I was using a generalization of 32bit. However, this is good to know. All of the data sheets that I just downloaded from the MIPS site for the R4k[X] cores don't mention the 36-bit PA item. Care to elaborate?
Quoted 7 lines
Quoted 4 lines
One note: Many MIPS32 implementations choose not to implement all 36 PA bits, but limit themselves to 32 bits. This saves a few bits in the TLB and a few address lines.
So, if someone did want 36 PA bits on Linux, the TLB exception handlers and a little of the page table construction/management code would have to change. The userspace contraints and such would still remain. Cool.
I'm not sure if it's a "little" though. Ralf has already done the work for 64bit memory support on 32bit kernels, but that only works currently on 64bit CPUs. I started hacking on the 64bit memory patch to get it to work on 32bit processors, but had to put that aside for a few weeks. I hope to get back to it soon.
Pete
Quoted 7 lines · Pete Popov
I'm not sure if it's a "little" though. Ralf has already done the work for 64bit memory support on 32bit kernels, but that only works currently on 64bit CPUs. I started hacking on the 64bit memory patch to get it to work on 32bit processors, but had to put that aside for a few weeks. I hope to get back to it soon.
Sure, the "little" is a relative term. As far as your patch is concerned, you are essentially trying to use a true 32-bit processor (my definition being that it is not a 64-bit processor running in 32-bit mode), to address address more than 4GB of physical memory. I don't see how that is possible with just the MMU and TLB unless you are using chip selects and customm logic.
-Steve
Signature · 1 line
Steven J. Hill - Embedded SW Engineer
Quoted 8 lines · Steven J. Hill
Quoted 7 lines · Pete Popov
I'm not sure if it's a "little" though. Ralf has already done the work for 64bit memory support on 32bit kernels, but that only works currently on 64bit CPUs. I started hacking on the 64bit memory patch to get it to work on 32bit processors, but had to put that aside for a few weeks. I hope to get back to it soon.
Quoted 6 lines
Sure, the "little" is a relative term. As far as your patch is concerned, you are essentially trying to use a true 32-bit processor (my definition being that it is not a 64-bit processor running in 32-bit mode), to address address more than 4GB of physical memory. I don't see how that is possible with just the MMU and TLB unless you are using chip selects and customm logic.
I failed to mention that the additional patch, once working, would be for MIPS32 (as in the MIPS Tech's MIPS32 spec, not just any 32 bit CPU) CPUs that implemented the full 36 bit physical address space. So the support really won't be 64bit, it will be 36bit.
Pete
----- Original Message -----
From: "Steven J. Hill" <[email protected]>
To: "Pete Popov" <[email protected]>
Cc: "Hartvig Ekner" <[email protected]>; "linux-mips" <[email protected]>
Sent: Tuesday, February 05, 2002 4:24 PM
Subject: Re: What is the maximum physical RAM for a 32bit MIPS core?
Quoted 11 lines
Quoted 7 lines · Pete Popov
I'm not sure if it's a "little" though. Ralf has already done the work for 64bit memory support on 32bit kernels, but that only works currently on 64bit CPUs. I started hacking on the 64bit memory patch to get it to work on 32bit processors, but had to put that aside for a few weeks. I hope to get back to it soon.
Sure, the "little" is a relative term. As far as your patch is concerned, you are essentially trying to use a true 32-bit processor (my definition being that it is not a 64-bit processor running in 32-bit mode), to
address
Quoted 3 lines
address more than 4GB of physical memory. I don't see how that is possible with just the MMU and TLB unless you are using chip selects and customm logic.
As already mentioned, a MIPS TLB entry typically can point with 36 bits (that's 67TB of address space?) at physical memory. If you have more than 2^31 bytes of physical memory, then a single process can't map all of physical memory into it's address space, but it can map in pages (using TLB entries) from anywhere within the 36-bit physical memory space.
In other words, process address space doesn't limit physical address space. Only TLB capability limits physical address space.
And right, KSEG0 and KSEG1 can only get at the low 0.5GB of physical memory. You can imagine that KSEG0 is implemented with a single hardwired TLB entry that maps virtual address 0x80000000 to physical address 0x0, 0.5GB wide.
The only way to get to physical memory above 0.5GB is through a TLB entry.
Regards,
Brad
Quoted 2 lines · Bradley D. LaRonde
As already mentioned, a MIPS TLB entry typically can point with 36 bits (that's 67TB of address space?) at physical memory. If you have more than
At bit less: 64 GiB or approx. 69 GB :-)
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
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
The fact that idiot marketoids in some moronic HD maker decided "GB" ment "billion bytes" is not a good excuse for useing the term to refer to anything that has never been polluted this way. It's not an excuse to use it to refer to things that have been polluted this way either, but that won't stop ppl. How bout you say GB is gigabits and claim ~549 of your mythical "GB"?
Nick
Quoted 17 lines · Geert Uytterhoeven
Quoted 2 lines · Bradley D. LaRonde
As already mentioned, a MIPS TLB entry typically can point with 36 bits (that's 67TB of address space?) at physical memory. If you have more than
At bit less: 64 GiB or approx. 69 GB :-)
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] 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
Quoted 6 lines · On Wed, 6 Feb 2002 [email protected] wrote:
The fact that idiot marketoids in some moronic HD maker decided "GB" ment "billion bytes" is not a good excuse for useing the term to refer to anything that has never been polluted this way. It's not an excuse to use it to refer to things that have been polluted this way either, but that won't stop ppl. How bout you say GB is gigabits and claim ~549 of your mythical "GB"?
Then I would say `Gb' (lower case b).
Quoted 6 lines · Geert Uytterhoeven
Quoted 5 lines · Bradley D. LaRonde
Quoted 2 lines
As already mentioned, a MIPS TLB entry typically can point with 36 bits (that's 67TB of address space?) at physical memory. If you have more than
At bit less: 64 GiB or approx. 69 GB :-)
But the main issue here was: tera vs. giga.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
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
----- Original Message -----
From: "Geert Uytterhoeven" <[email protected]>
To: "Bradley D. LaRonde" <[email protected]>
Cc: <[email protected]>; "linux-mips" <[email protected]>
Sent: Wednesday, February 06, 2002 3:49 AM
Subject: Re: What is the maximum physical RAM for a 32bit MIPS core?
Quoted 3 lines · Bradley D. LaRonde
Quoted 2 lines
As already mentioned, a MIPS TLB entry typically can point with 36 bits (that's 67TB of address space?) at physical memory. If you have more
than
Quoted 2 lines
At bit less: 64 GiB or approx. 69 GB :-)
Oops, yeah. 67TB seemed a little high. :-P
Regards,
Brad
Quoted 7 lines · Steven J. Hill
Quoted 4 lines
One note: Many MIPS32 implementations choose not to implement all 36 PA bits, but limit themselves to 32 bits. This saves a few bits in the TLB and a few address lines.
So, if someone did want 36 PA bits on Linux, the TLB exception handlers and a little of the page table construction/management code would have to change. The userspace contraints and such would still remain. Cool.
Basically the whole code is already in place except a few bugs fixes that still need to go in.
Ralf
Quoted 4 lines · Steven J. Hill
I am just trying to fill in some more MIPS knowledge here. With a 32-bit MIPS processor, we are forever limited to a userspace of 2GB in size thanks to the kuser region. kseg0/1 map the same 512MB of physical memory. kseg2 is 1GB in size and hence it could address another 1GB of RAM. So, is the
2gb virtual memory per process. In theory physical memory is limited by the size of the address bus with highmem; the practical limit for highmem should be in the range of 16-32gb RAM.
Ralf
Quoted 4 lines · Steven J. Hill
Quoted 4 lines
I am just trying to fill in some more MIPS knowledge here. With a 32-bit MIPS processor, we are forever limited to a userspace of 2GB in size thanks to the kuser region. kseg0/1 map the same 512MB of physical memory. kseg2 is 1GB in size and hence it could address another 1GB of RAM. So, is the
Quoted 3 lines · Ralf Baechle
2gb virtual memory per process. In theory physical memory is limited by the size of the address bus with highmem; the practical limit for highmem should be in the range of 16-32gb RAM.
I'm aware that some of those issues have to do with boot-time allocations proportional to memory size filling the direct-mapped portion of the kernel virtual address space. Do you have in mind others? I'm just generally curious.
Thanks,
Bill