summaryrefslogtreecommitdiffstats
path: root/share/examples
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2015-06-18 06:00:17 +0000
committerneel <neel@FreeBSD.org>2015-06-18 06:00:17 +0000
commit8c70d6c7af8325d488ec8dff7b0bbe7b6dfc32f9 (patch)
tree34972705799ce1ec23ee45b1e6c0c7631ad7ed98 /share/examples
parent07553194d65f7f87d0eea74f0ad0f786e9a189bb (diff)
downloadFreeBSD-src-8c70d6c7af8325d488ec8dff7b0bbe7b6dfc32f9.zip
FreeBSD-src-8c70d6c7af8325d488ec8dff7b0bbe7b6dfc32f9.tar.gz
Restructure memory allocation in bhyve to support "devmem".
devmem is used to represent MMIO devices like the boot ROM or a VESA framebuffer where doing a trap-and-emulate for every access is impractical. devmem is a hybrid of system memory (sysmem) and emulated device models. devmem is mapped in the guest address space via nested page tables similar to sysmem. However the address range where devmem is mapped may be changed by the guest at runtime (e.g. by reprogramming a PCI BAR). Also devmem is usually mapped RO or RW as compared to RWX mappings for sysmem. Each devmem segment is named (e.g. "bootrom") and this name is used to create a device node for the devmem segment (e.g. /dev/vmm/testvm.bootrom). The device node supports mmap(2) and this decouples the host mapping of devmem from its mapping in the guest address space (which can change). Reviewed by: tychon Discussed with: grehan Differential Revision: https://reviews.freebsd.org/D2762 MFC after: 4 weeks
Diffstat (limited to 'share/examples')
-rwxr-xr-xshare/examples/bhyve/vmrun.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/share/examples/bhyve/vmrun.sh b/share/examples/bhyve/vmrun.sh
index 88cbd7c..58bfa4a 100755
--- a/share/examples/bhyve/vmrun.sh
+++ b/share/examples/bhyve/vmrun.sh
@@ -87,15 +87,15 @@ console=${DEFAULT_CONSOLE}
cpus=${DEFAULT_CPUS}
tap_total=0
disk_total=0
-apic_opt=""
gdbport=0
loader_opt=""
+bhyverun_opt="-H -A -P"
pass_total=0
while getopts ac:C:d:e:g:hH:iI:m:p:t: c ; do
case $c in
a)
- apic_opt="-a"
+ bhyverun_opt="${bhyverun_opt} -a"
;;
c)
cpus=${OPTARG}
@@ -163,6 +163,12 @@ if [ -n "${host_base}" ]; then
loader_opt="${loader_opt} -h ${host_base}"
fi
+# If PCI passthru devices are configured then guest memory must be wired
+if [ ${pass_total} -gt 0 ]; then
+ loader_opt="${loader_opt} -S"
+ bhyverun_opt="${bhyverun_opt} -S"
+fi
+
make_and_check_diskdev()
{
local virtio_diskdev="$1"
@@ -263,7 +269,7 @@ while [ 1 ]; do
i=$(($i + 1))
done
- ${FBSDRUN} -c ${cpus} -m ${memsize} ${apic_opt} -A -H -P \
+ ${FBSDRUN} -c ${cpus} -m ${memsize} ${bhyverun_opt} \
-g ${gdbport} \
-s 0:0,hostbridge \
-s 1:0,lpc \
OpenPOWER on IntegriCloud