arch: x86-64: Add missing End of Table entry

The OVMF firmware loops around looking for an entry marking the end of
the table. Without this entry processing the tables is an infinite loop.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2020-06-29 15:55:58 +01:00 committed by Sebastien Boeuf
parent 2c3c335de6
commit fbbe348447

View File

@ -164,6 +164,7 @@ pub fn setup_smbios(mem: &GuestMemoryMmap) -> Result<()> {
let physptr = GuestAddress(SMBIOS_START)
.checked_add(mem::size_of::<Smbios30Entrypoint>() as u64)
.ok_or(Error::NotEnoughMemory)?;
eprintln!("{:x}", physptr.0);
let mut curptr = physptr;
let mut handle = 0;
@ -197,6 +198,16 @@ pub fn setup_smbios(mem: &GuestMemoryMmap) -> Result<()> {
curptr = write_and_incr(mem, 0 as u8, curptr)?;
}
{
handle += 1;
let mut smbios_sysinfo = SmbiosSysInfo::default();
smbios_sysinfo.typ = 127;
smbios_sysinfo.length = mem::size_of::<SmbiosSysInfo>() as u8;
smbios_sysinfo.handle = handle;
curptr = write_and_incr(mem, smbios_sysinfo, curptr)?;
curptr = write_and_incr(mem, 0 as u8, curptr)?;
}
{
let mut smbios_ep = Smbios30Entrypoint::default();
smbios_ep.signature = *SM3_MAGIC_IDENT;