Page MenuHomeFreeBSD

bhyve: add qemu ppi emulation for tpm devices
ClosedPublic

Authored by corvink on Jun 7 2023, 12:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 9 2024, 1:00 AM
Unknown Object (File)
Mar 6 2024, 12:49 AM
Unknown Object (File)
Feb 28 2024, 10:43 AM
Unknown Object (File)
Jan 28 2024, 10:16 PM
Unknown Object (File)
Jan 2 2024, 11:11 AM
Unknown Object (File)
Dec 17 2023, 10:52 AM
Unknown Object (File)
Dec 11 2023, 12:36 AM
Unknown Object (File)
Nov 18 2023, 1:06 AM
Subscribers

Details

Summary

Windows requires a physical presence interface to recognize the tpm
device. Qemu has an implementation for the ppi which can reuse. Using
the qemu ppi makes it very easy because we don't have to implement new
ppi functionality into ovmf. The qemu implementation is already there.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

usr.sbin/bhyve/tpm_ppi_qemu.c
117

These switch statements can be replaced by calls to memcpy().

134

Same comment everywhere else.

164

mr_name is unused. There is no need to use a stack buffer for a string which is known at compile time.

201

Same bug as elsewhere, mr.name must not be a pointer to a stack buffer. Please just use a string literal.

  • use memcpy for mmio
  • remove \n from warn calls
  • add mmio registration helper

The warnx() strings do not need newlines.

usr.sbin/bhyve/tpm_ppi_qemu.c
100

If you make this a global variable, then this function isn't needed. Callers can call (un)register_mem() directly and we don't need the extra registration flag variable.

This revision is now accepted and ready to land.Aug 11 2023, 3:37 PM