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)
Mon, Nov 11, 4:03 AM
Unknown Object (File)
Tue, Nov 5, 2:41 PM
Unknown Object (File)
Wed, Oct 23, 2:47 PM
Unknown Object (File)
Oct 7 2024, 6:26 PM
Unknown Object (File)
Oct 7 2024, 6:22 AM
Unknown Object (File)
Sep 25 2024, 9:21 AM
Unknown Object (File)
Sep 25 2024, 9:14 AM
Unknown Object (File)
Sep 25 2024, 7:23 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