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)
Sun, Apr 28, 7:59 AM
Unknown Object (File)
Sun, Apr 28, 7:59 AM
Unknown Object (File)
Sun, Apr 28, 7:58 AM
Unknown Object (File)
Sat, Apr 27, 11:28 PM
Unknown Object (File)
Tue, Apr 23, 4:04 AM
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
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 52612
Build 49503: arc lint + arc unit

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
99

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