diff options
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); |