Page MenuHomeFreeBSD

bhyve: add ioctl to modify the second level address translation
AbandonedPublic

Authored by corvink on Nov 29 2021, 10:36 AM.
Tags
Referenced Files
F107091848: D33161.diff
Thu, Jan 9, 11:46 PM
Unknown Object (File)
Nov 25 2024, 4:37 PM
Unknown Object (File)
Nov 25 2024, 3:58 PM
Unknown Object (File)
Nov 22 2024, 1:54 PM
Unknown Object (File)
Nov 21 2024, 10:49 AM
Unknown Object (File)
Nov 13 2024, 11:37 PM
Unknown Object (File)
Nov 11 2024, 4:23 PM
Unknown Object (File)
Oct 31 2024, 4:34 PM

Details

Reviewers
manu
markj
jhb
Group Reviewers
bhyve
Summary

Second level address translation is used to create a mapping between
guest addresses and host addresses. In order to allow passthru of
mmio devices like a TPM, we need to modify the SLAT. Therefore,
add an ioctl for several modifications of the SLAT.

Note: You can take a look at https://github.com/Beckhoff/freebsd-src/commits/phab/corvink/vm_modify_slat

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

lib/libvmmapi/vmmapi.h
190

Whitespace is inconsistent.

sys/amd64/vmm/vmm.c
649

This functions return Mach error numbers, for legacy reasons. They need to be translated to errno values before a return to user mode. See vm_mmap_memseg() for an example.

sys/amd64/vmm/vmm_dev.c
550

There is no validation that the HPA actually corresponds to a SLAT...?

sys/amd64/vmm/vmm_dev.c
550

HPA isn't part of the SLAT. vm_map_mmio should add it to EPT.

This patch was required for my TPM passthrough patch (D32961). I'll change the TPM passthrough patch in the future. After that, this patch won't be required any more.