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
F102394532: D33161.diff
Mon, Nov 11, 4:23 PM
Unknown Object (File)
Thu, Oct 31, 4:34 PM
Unknown Object (File)
Mon, Oct 21, 3:28 PM
Unknown Object (File)
Thu, Oct 17, 1:28 PM
Unknown Object (File)
Wed, Oct 16, 9:04 PM
Unknown Object (File)
Mon, Oct 14, 10:50 PM
Unknown Object (File)
Mon, Oct 14, 10:50 PM
Unknown Object (File)
Mon, Oct 14, 6:09 AM

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.