On 02/18/16 11:47, Ard Biesheuvel wrote: > The legacy 32-bit SMBIOS entry point has little use on AARCH64 systems, > since many such systems have no 32-bit addressable physical RAM, and so > OSes that implement SMBIOS will have to be able to deal with the 64-bit > entry point anyway. > > Given that the OS will map main memory in 1 GB chunks if it can, and that > punching a page sized hole (e.g., for SMBIOS data) into it will result in > the whole 1 GB chunk being mapped using 2 MB and 4 KB blocks instead, it > is important to group memory reservations from the OS as much as we can, > and allocating below 4 GB for no good reason interferes with that. > > This is especially important under virtualization, considering that each > *level* of lookup at stage 1 (the guest virtual page table) will result in > a full page table walk at stage 2 (the guest PA to host PA mapping). > > So expose only the 64-bit entry point when the SMBIOS tables adhere to > version 3.0 or later. > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Ard Biesheuvel <[email protected]> > --- > v2: - reworked commit log and PCD comment per Laszlo's feedback, primarily to > clarify that the PCD only takes effect if the actual version of the > SMBIOS > entry point and tables is v3.0 or later > - move PCD definition to existing [PcdsFixedAtBuild.AARCH64] section > > ArmVirtPkg/ArmVirtQemu.dsc | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc > index 7c6419fbb92f..725de864aebe 100644 > --- a/ArmVirtPkg/ArmVirtQemu.dsc > +++ b/ArmVirtPkg/ArmVirtQemu.dsc > @@ -169,6 +169,14 @@ [PcdsFixedAtBuild.AARCH64] > # support anything bigger, even if the host hardware does > gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize|40 > > + # Clearing BIT0 in this PCD prevents installing a 32-bit SMBIOS entry > point, > + # if the entry point version is >= 3.0. AARCH64 OSes cannot assume the > + # presence of the 32-bit entry point anyway (because many AARCH64 systems > + # don't have 32-bit addressable physical RAM), and the additional > allocations > + # below 4 GB needlessly fragment the memory map. So expose the 64-bit entry > + # point only, for entry point versions >= 3.0. > + gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosEntryPointProvideMethod|0x2 > + > [PcdsDynamicDefault.common] > ## If TRUE, OvmfPkg/AcpiPlatformDxe will not wait for PCI > # enumeration to complete before installing ACPI tables. >
Reviewed-by: Laszlo Ersek <[email protected]> Thanks! Laszlo _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

