Re:Linear Address Spaces: Unsafe at any speed
by Joker_vD on Sunday January 04, 2026 @03:30PM
(#46491868)
There is also a problem of nested virtualization. If the VM has its own "imaginary" page tables on top of the hypervisor's page tables, then the number of actual physical memory reads goes from 4–6 to 16–36.
Re:Linear Address Spaces: Unsafe at any speed
by nine_k on Sunday January 04, 2026 @03:32PM
(#46491888)
Indeed. Also, TLB as it exists on x64 is not free, nor is very large. A multi-level "TLB", such that a process might pick an upper level of a large stretch of lower-level pages and e.g. allocate a disjoint micro-page for each stack frame, would be cool. But it takes a rather different CPU design.
Re:Linear Address Spaces: Unsafe at any speed
by formerly_proven on Sunday January 04, 2026 @03:44PM
(#46491984)
"Please give me a segmented memory model on top of paged memory" - words which have never been uttered
Re:Linear Address Spaces: Unsafe at any speed
by nine_k on Sunday January 04, 2026 @04:03PM
(#46492189)
There is a subtle difference between "give me an option" and "thrust on me a requirement".
Re:Linear Address Spaces: Unsafe at any speed
by tliltocatl on Sunday January 04, 2026 @05:46PM
(#46493184)
But that wouldn't protect against out-of boundary access (which is the whole point of segments), would it?
Re:Linear Address Spaces: Unsafe at any speed
by convolvatron on Monday January 05, 2026 @02:49PM
(#46503820)
thats enforced by the VM hardware - we just shuffle the PTEs around to match the appropriate segment view
Re:Linear Address Spaces: Unsafe at any speed
by rep_lodsb on Tuesday January 06, 2026 @04:00AM
(#46510162)
As long as it's a linear address space, adding/subtracting a large enough value to a pointer (array, stack) could still cross into another "segment".
Re:Linear Address Spaces: Unsafe at any speed
by convolvatron on Tuesday January 06, 2026 @09:06AM
(#46512387)
but those wouldn't be mapped unless you have crossed a call gate that enabled them. the kernel call gate implementation changes the VM map (region visibility) accordingly
Re:Linear Address Spaces: Unsafe at any speed
by aforwardslash on Monday January 05, 2026 @12:26AM
(#46495607)
If I understood correctly, you'te talking about using descriptors to map segments; the issue with this approach is two-fold: it is slow (as each descriptor needs to be created for each segment - and sometimes more than one, if you need write-execute permissions), and there is a practical limit on the number of descriptors you can have - 8192 total, including call gates and whatnot. To extend this, you need to use LDTs, that - again - also require a descriptor in the GDT and are limited to 8192 entries. In a modern desktop system, 67 million segments would be both quite slow and at the same time quite limited.
Re:Linear Address Spaces: Unsafe at any speed
by convolvatron on Monday January 05, 2026 @02:49PM
(#46503813)
no, not at all. we weren't using the underlying segmentation support. we just added kernel facilities to support segment ids and ranges and augment the kernel region structure appropriately. A call gate is just a syscall that changes the processes VM tables to include or drop regions (segments) based on the policy of the call.
Re:Linear Address Spaces: Unsafe at any speed
by aforwardslash on Wednesday January 07, 2026 @11:23AM
(#46528274)
Humm very interesting approach, are there any publicly available documentation links?
getting userspace to do the right thing without upending everything is what killed that project