3 ms·
Segmentation is really nice, and should have been carried on, IMO. Half the issue with Spectre is that there isn't a clean way to describe to the processor dif
by monocasa 7y ago
Segmentation is really nice, and should have been carried on, IMO. Half the issue with Spectre is that there isn't a clean way to describe to the processor different memory security contexts except with a page table pointer swap. Better segmentation support could have allowed you to sandbox memory without having to jump in and out of the kernel on transitions. Hence why VMWare, and Chrome's NaCL used segmentation hardware on x86-32 when they still could.
- adwn 7y agoOne major issue was that the segments overlapped, so two different pointers could actually point to the same address. > Half the issue with Spectre is that there isn't a clean way to describe to the processor different memory security contexts except with a page table pointer swap. You don't need segments for that. A flat address space where the 2 MSBs (or however many you need) of a pointer encode the context would also work.
- monocasa 7y agoI mean, that's just a reimplementation of segments.
- weinzierl 7y ago> Segmentation is really nice, and should have been carried on, IMO. Are you serious and are you talking about x86 memory segmentation? Honest question. As far as I'm concerned thinking about CS, DS and ES still gives me shivers and I don't remember to ever have met anyone back then who loved segmentation. The only thing I hated more was the bit planes stuff on the graphics card...
- monocasa 7y agoThe 16-bit segments weren't great because you were forced to jump through all these hoops in order access the full addressable space. 32-bit segments that weren't crippled led to a lot of really interesting applications that weren't able to be replicated with what we have now. Hence why there's this gap of amd64 CPUs where there's no virtualization support in long mode but 32bit OSes could on the same chips.
- weinzierl 7y agoInteresting, I wasn't aware that you could use them in protected mode and they were 32-bits wide from the 386 on-wards. It also reminded me of something else: I think Tanenbaum discussed the advantages of the segmented memory model in his operating systems book, but I never paid attention because coming from the 16-bit word I immediately dismissed that idea. I might have to reread that chapter...
- Taniwha 7y agoIt's worse than that, you can set up 32-bit segments in 32-bit mode, then switch back to 16-bit mode and have them do vaguely sensible things .... This wasn't defined by Intel, but Windows went on to depend on this feature in order to boot (to access PCI) (I was once involved in an x86 clone project)
- EvanAnderson 7y agoFor anybody who is curious, this is colloquially referred-to as "unreal mode": https://en.m.wikipedia.org/wiki/Unreal_mode https://en.m.wikipedia.org/wiki/Unreal_mode
- jabl 7y ago> Half the issue with Spectre is that there isn't a clean way to describe to the processor different memory security contexts except with a page table pointer swap. There are ways to make page table swapping cheaper. E.g. SPARC and S390 always had separate page tables for user and kernel space, with an "ASID (address space identifier)" to avoid having to flush them when switching. I believe decently modern x86 CPU's also have this in the form of "PCID".
- monocasa 7y agoEven with ASIDs, it's still orders of magnitude more expensive to round trip through the kernel rather than call (even far call).
- beagle3 7y agoYou are describing segmentation from the 286 protected mode and later. Real mode segmentation, originally introduced in the 8086/8088, is and always was an abomination, even if you don't compare it to the elegance of the contemporary 68000/68008.
- monocasa 7y agoWell, and GE-645 (ie. the special purpose MULTICS machine), the iAPX 432 (that Intel chip that gets a bad rap), the Plessey 250, and the CAP computer off the top of my head. ie. anywhere that describes the segment base, limit, and permissions on a separate privileged table.
- tempguy9999 7y ago> that Intel chip that gets a bad rap I wonder why. <<<According to the New York Times, "the i432 ran 5 to 10 times more slowly than its competitor, the Motorola 68000" >>> https://en.wikipedia.org/wiki/Intel_iAPX_432#The_project%27s_failures https://en.wikipedia.org/wiki/Intel_iAPX_432#The_project%27s... From memory a quote from a user of it, something like: "on a good day it walked, on a bad day it crawled" IIRC every main memory access needed 3 pointer derefs and 3 array lookups (from memory).