Owen wrote:
Complicating the processor if the application needs/benefits from it is not an issue
Yes... but it is not really needed just an old custom and it does occupy a lot of area in the CPU core and as the number of cores does increase this area does become a drag.
And there is another problem: those additional layers do reduce speed by approximatively 15% - 30% and in a world where the CPU frequency has reached the top limits this is a further problem.
My estimate is that paging and memory protection as we know it today will be dropped and instead we will see many more simple and faster cores that can be configured to execute a single process into a "zone" by a master CPU.
This trend is already visible.
Why must the address adders be able to perform 64 bit addition? You can cut out most of the logic for the bits above 47, reduce gate delayes and speed things up
I suggest that you understand electronics and CPU architecture better.
The address calculations for the instructions and operands are performed BEFORE the paging mechanism by the CPU.
Paging is only a translation mechanism that converts a logical address into a physical address.
Hence if you think a little you will observe that the adders already perform full 64bits additions (and yeah this does slow down 64 bits long mode)
For your example: mov rax, [rsi + 4*rbx + my_offset_32]
Here I can setup values in RSI and RBX that added together will generate an linear address of your choice... with whatever bit set or reset... obviously the adder must be able to perform the addition (think about LEA) even IF later on the paging mechanism will generate an address that is not canonical and eventually an exception.
Besides the current address limitations will most likely be removed and they will not redesign the CPU with each bit of address added.
Paging in not there to simplify the CPU. Limits on the physical address canonical form are but they will be slowly removed.
Bits propagate with adders / carry and NO you can not cut off bits above 47
)
Every mode switch requires circuitry to appropriately maintain the pipelines to preserve the image of in-order execution. That's a non-trivial cost, particularly in testing
Yes but the mode change is only done once at OS startup and left in place for ever after. The circuits are bad at predicting this even today. You are required to help them a little by writing bits in control registers and performing a long jump. It is not something that is expected to happen at every instruction... not even twice in an hour ... hence not a big problem.
Stop trying to justify forcing paging on long mode from an architectural point of view. There is no logical reason to have paging forced in there... nothing other than a very small benefit and mostly because "AMD said so" when they designed long mode.
Segmentation will only be resurrected if you kill C, C++ and Fortran.
Well you do not understand the concept of segmentation.
It is already "resurrected" in the new Cell CPU's and in Sun's CPU's. They have a "zone" that is pretty much the same as a segment (and more) reserved for the process / CPU. yeah the compilers have to adapt a little (more for Cell but less for SUN)... Not much to change if the segments are FLAT. Practically the application does not know or care but the security is better.
Our applications compile in C/C++ with no problem on Sun CPU's... no change is required in code for this feature hence I think you are considering segmentation like something you have learned about the 8086 real mode in 1990 ...
those things evolve you know
Hence there is no connection with killing C/C++ or whatever HLL programming language of your choice.
Well... C was the fastest growing programming language this year. I think you may be waiting a while here...
I do program every day in C ... it is my job
Even on new architectures, backwards compatibility is king.
Yes of course unless it is not... modern segmentation does not break any backward compatibility. Paging is also transparent to applications and even to ASM code hence with or without it the application land does not care...
But you do have a point in the fact that most mainstream OS rely heavy on paging for memory management. However this can be changed underneath (as IBM does or did it) and the gain in CPU speed and simplicity might be worth complicating the OS memory management code a little... and it will allow more cores per CPU ... we will see.
As for my claim of unpaged access existing for backwards compatibility - you just proved my point! No mainstream OS requires it, therefore there is no reason to complicate the processor supporting it in new models.
Yes, I agree that probably this was the reason behing AMD dropping it. And yes there is a minimal gain... a very small gain in the front end of the CPU.
But your claim that it complicates things does not stand beacuse this "mode" is the simple base on witch the "paging" mode is build.
Hence long mode is just do not giving the "user" access to the more simple mode but it has to have this mode inside the CPU as a basement for the more complicated paging mode to exist
I will give you a much "better" argument: you can enable paging BUT make it identity mapped in order to simulate non-paging access ...
(of course that this also has a problem but a much smaller one)
Really, paging eats up a lot of resources in both speed / latency / delays and in CPU die areas ... and this is NO longer acceptable with the top limit we have on CPU speeds... hence in time it will disappear. The Simple Address Space research made by Microsoft with Singularity shows this trend.
In consequence I would not base my OS architecture on paging and /or on memory protection schemes of today.