diff options
author | neel <neel@FreeBSD.org> | 2013-03-01 02:26:28 +0000 |
---|---|---|
committer | neel <neel@FreeBSD.org> | 2013-03-01 02:26:28 +0000 |
commit | 9c2aecf6da5fb6aafba1ce1f1488a6b13c8a3174 (patch) | |
tree | 2000067d1528e9e61ee28a8010e91859f3f23e01 /usr.sbin/bhyve/mptbl.c | |
parent | 65c312a935cde98a1292b6337cd3c1ece740b835 (diff) | |
download | FreeBSD-src-9c2aecf6da5fb6aafba1ce1f1488a6b13c8a3174.zip FreeBSD-src-9c2aecf6da5fb6aafba1ce1f1488a6b13c8a3174.tar.gz |
Specify the length of the mapping requested from 'paddr_guest2host()'.
This seems prudent to do in its own right but it also opens up the possibility
of not having to mmap the entire guest address space in the 'bhyve' process
context.
Discussed with: grehan
Obtained from: NetApp
Diffstat (limited to 'usr.sbin/bhyve/mptbl.c')
-rw-r--r-- | usr.sbin/bhyve/mptbl.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/bhyve/mptbl.c b/usr.sbin/bhyve/mptbl.c index 52790f3..9c68b3d 100644 --- a/usr.sbin/bhyve/mptbl.c +++ b/usr.sbin/bhyve/mptbl.c @@ -41,6 +41,9 @@ __FBSDID("$FreeBSD$"); #define MPTABLE_BASE 0xF0000 +/* floating pointer length + maximum length of configuration table */ +#define MPTABLE_MAX_LENGTH (65536 + 16) + #define LAPIC_PADDR 0xFEE00000 #define LAPIC_VERSION 16 @@ -346,13 +349,13 @@ mptable_build(struct vmctx *ctx, int ncpu, int ioapic) char *curraddr; char *startaddr; - if (paddr_guest2host(0) == NULL) { + startaddr = paddr_guest2host(MPTABLE_BASE, MPTABLE_MAX_LENGTH); + if (startaddr == NULL) { printf("mptable requires mapped mem\n"); return (ENOMEM); } - startaddr = curraddr = paddr_guest2host(MPTABLE_BASE); - + curraddr = startaddr; mpfp = (mpfps_t)curraddr; mpt_build_mpfp(mpfp, MPTABLE_BASE); curraddr += sizeof(*mpfp); |