HomeFreeBSD

powerpc: Use MAX() macro instead of max() inline function to calculate Maxmem

Description

powerpc: Use MAX() macro instead of max() inline function to calculate Maxmem

Maxmem is the highest address for physical memory in the system. It's
measured in pages which, since max() returns a u_int, should allow for up to
2^44 bytes of memory addressable by the system. However, on POWER9 systems
at least, memory addressed by additional socketed CPUs begins at addresses
far above the 2^44 mark, causing issues with memory accesses and DMA, when
memory is addressed on the auxiliary CPUs. Use the MAX() macro instead,
which doesn't convert arguments, so retains Maxmem and all calculations as
its defined long type (64-bit on powerpc64), keeping the maximum address
correct.

Submitted by: mmacy

Details

Provenance
jhibbitsAuthored on
Parents
rS340311: Do not ignore arc_adjust() return value.
Branches
Unknown
Tags
Unknown