]> xenbits.xensource.com Git - seabios.git/commit
detect physical address space size
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 31 Aug 2022 06:27:33 +0000 (08:27 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Thu, 24 Aug 2023 08:56:21 +0000 (10:56 +0200)
commit90eeb0c8558a1524836ec94aee11f4cc88b10c78
tree6ee2035cd16180a196e6e719a31babcb6cae6bd5
parentbe84867613f791ea344d565d65a9ce85238e8533
detect physical address space size

Check for pae and long mode using cpuid.  If present also read the
physical address bits.  Apply some qemu sanity checks (see below).
Record results in PhysBits and LongMode variables.  In case we are not
sure what the address space size is leave the PhysBits variable unset.

On qemu we have the problem that for historical reasons x86_64
processors advertise 40 physical address space bits by default, even in
case the host supports less than that so actually using the whole
address space will not work.

Because of that the code applies some extra sanity checks in case we
find 40 (or less) physical address space bits advertised.  Only
known-good values (which is 40 for amd processors and 36+39 for intel
processors) will be accepted as valid.

Recommendation is to use 'qemu -cpu ${name},host-phys-bits=on' to
advertise valid physical address space bits to the guest.  Some distro
builds enable this by default, and most likely the qemu default will
change in near future too.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
src/fw/paravirt.c
src/fw/paravirt.h