diff options
author | Corvin Köhne <corvink@FreeBSD.org> | 2023-05-10 11:44:28 +0000 |
---|---|---|
committer | Corvin Köhne <corvink@FreeBSD.org> | 2023-08-18 07:32:08 +0000 |
commit | 50734f2ba36bb79d8472a71e6bd0ebb5399786a8 (patch) | |
tree | b3cfab22a986992e21e0d28f98f99fc429c32bd3 | |
parent | 04e774846c9d2e37287a1ddd6e7b0cde5d994ed1 (diff) | |
download | src-50734f2ba36bb79d8472a71e6bd0ebb5399786a8.tar.gz src-50734f2ba36bb79d8472a71e6bd0ebb5399786a8.zip |
bhyve: pass address of OpRegion to the guest
Don't allow access to the physical ASLS register. It contains a host
address which is meaningless for the guest. Additionally, it allows the
guest to safely rewrite this register.
This is the last commit required for GVT-d. Nevertheless, it might not
work due to missing firmware support.
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D26209
(cherry picked from commit 71fb2dcb0023d49fc048e1f7b610ad05bd2efc32)
-rw-r--r-- | usr.sbin/bhyve/pci_gvt-d.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/bhyve/pci_gvt-d.c b/usr.sbin/bhyve/pci_gvt-d.c index 4616bc84d275..35c7f30dd292 100644 --- a/usr.sbin/bhyve/pci_gvt-d.c +++ b/usr.sbin/bhyve/pci_gvt-d.c @@ -256,7 +256,10 @@ gvt_d_setup_opregion(struct pci_devinst *const pi) memcpy(opregion->gva, opregion->hva, opregion->len); - return (0); + pci_set_cfgdata32(pi, PCIR_ASLS_CTL, opregion->gpa); + + return (set_pcir_handler(sc, PCIR_ASLS_CTL, 4, passthru_cfgread_emulate, + passthru_cfgwrite_emulate)); } static int |