On 2022-05-14 22:28:43 +0000, chris said:
> On 05/11/22 01:44, Arne Vajhøj wrote:
>>
>> P1 is only 1 GB. Or probably more relevant P1 + P0 is 2 GB as I assume
>> the stack could grow below 0x0000000040000000.
>>
>
> Those numbers were theoretical, but X86-64 will have hardware memory
> management capability for more than that. I'm using proliant G8 series
> for work, as an economical sweet spot from a cost pov, but they are
> often advertised with 16 to 64Gb typically, so one has to ask, where is
> the limitation ?, In the OS, or what ?...
Apologies on any bit-width errors latent in the following.
This posting differentiates virtual addressing from physical
addressing, and largely ignores discussions around physical addressing
including about 48-bit physical addressing limit on many recent x86-64
boxes, and the 5-level page tables (providing 57 bits, physical)
available on certain current x86-64 processors.
OpenVMS uses what amounts to segmented virtual addressing, and the
OpenVMS virtual address space design ties directly back to VAX. This
at least through OpenVMS I64, and haven't checked OpenVMS x86-64 here.
VAX had P0 user space where ~all VAX user apps and user data resides,
00000000 to 3FFFFFFF, P1 from 40000000 to 7FFFFFFF for the control
region and CLI and baggage, and the remainder for S0 system space, and
later S1 for more system space with VAX Extended Virtual Addressing.
I'll here ignore VAX Extended Physical Addressing.
Each of these P0, P1, S0, and S2 spaces are 30 bits of virtual addressing.
Alpha uses 64-bit virtual and always has, and preserves the existing
VAX 32-bit design with P0 and P1 at the lowest addresses
(00000000.00000000 to 00000000.7FFFFFFF), with S0 and S1 at the highest
(FFFFFFFF.80000000 to FFFFFFFF.FFFFFFFF, and adds P2 and S2 into the
great huge gap between those two ranges. OpenVMS Alpha V7.0 opened up
user access for P2 and S2 addressing.
As part of allowing existing 32-bit applications to continue to operate
on OpenVMS, app developers working on new apps now get to deal with
what is located where, and which API calls to use for addressing.
Apps use 64-bit pointers, but OpenVMS and its preference for upward
compatibility means existing and new apps are an aggregation of older
32- and newer 64-bit calls where needed, and all eventually
sign-extended to 64-bit virtual addresses at run-time by the processor.
As an implementation detail, all of the virtual address bits and all of
the physical address bits are not (yet) fully implemented, but we're
getting closer. Alpha provided 43 bits virtual. x86-64 now does 57-bits
physical. Etc.
This OpenVMS segmented virtual address space design works spectacularly
for those folks that are dependent on 32-bit apps and libraries and
their related APIs, but it tends to be a confusing morass for new work,
particularly for anybody familiar with 64-bit flat virtual addressing
and not having to deal with this stuff. (For those of a certain age and
experience, this is not as ugly as TKB by any stretch, but it's still
ugly.)
OpenVMS has been incrementally allowing hunks of stuff to migrate into
P2 and S2 space, though the documentation here tends to be scattershot,
and you have to find and use the necessary switches to get your code
and data out of the default P0 address range.
OpenVMS is the only operating system I'm aware of that chose this
hybrid addressing path; of both 32-bit and 64-bit APIs mixed within the
same executable images. Most other platforms decided to allow 32-bit
and 64-bit apps and processes to coexist in parallel. But not
co-resident within an app at run-time. This transition usually with a
decade or more to allow apps to be migrated to 64-bit APIs for those
platforms that have decided to deprecate and remove the older and
problematic 32-bit APIs. As an example, macOS 10.15 "Catalina" removed
32-bit app and API support, and completed the migration started back
around 10.5 "Leopard"; a ~decade ago.
I'm here ignoring the existence of so-called multi-architecture or
so-called fat binaries, which can provide 32- and 64-bit code and code
for multiple architectures within the file containing the binary. The
equivalent of the image activator picks the appropriate executable code
and maps it into virtual memory and transfers control to the
appropriate contents from those architectures available within the
binary. For this particular posting, I'm referring to the run-time
address space and run-time APIs in use. Not to multi-architecture
binaries.
Microsoft Windows further runs parallel 32- and 64-bit software
distributions, in addition to 32- and 64-bit apps.
For the long-archived 64-bit manual with some background on the topic:
http://www0.mi.infn.it/~calcolo/OpenVMS/ssb71/6467/6467ptoc.htm
There was a long discussion of this addressing topic here in
comp.os.vms newsgroup a while back, too. Which showed that a whole lot
of folks haven't yet written apps for 64-bit address space. Which is
fine. Where things get confusing is with which APIs (32-bit or 64-bit)
work where, whether API calls or descriptors or itemlists or otherwise.
And compilers and other factors, for that matter. BASIC has not yet
added support for 64-bit.
--
Pure Personal Opinion | HoffmanLabs LLC