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
F99266653: D33161.id99138.diff
Mon, Oct 7, 9:00 PM
Unknown Object (File)
Sun, Oct 6, 9:32 AM
Unknown Object (File)
Fri, Oct 4, 9:52 AM
Unknown Object (File)
Fri, Oct 4, 6:16 AM
Unknown Object (File)
Thu, Oct 3, 5:24 AM
Unknown Object (File)
Wed, Oct 2, 10:27 AM
Unknown Object (File)
Tue, Oct 1, 1:15 PM
Unknown Object (File)
Mon, Sep 30, 11:25 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.