From fbbe348447787a7ce8460b395d573f12a277cc4f Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Mon, 29 Jun 2020 15:55:58 +0100 Subject: [PATCH] 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 --- arch/src/x86_64/smbios.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/src/x86_64/smbios.rs b/arch/src/x86_64/smbios.rs index b0533c277..6dc420d27 100644 --- a/arch/src/x86_64/smbios.rs +++ b/arch/src/x86_64/smbios.rs @@ -164,6 +164,7 @@ pub fn setup_smbios(mem: &GuestMemoryMmap) -> Result<()> { let physptr = GuestAddress(SMBIOS_START) .checked_add(mem::size_of::() 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::() 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;