diff options
author | neel <neel@FreeBSD.org> | 2014-06-24 02:02:51 +0000 |
---|---|---|
committer | neel <neel@FreeBSD.org> | 2014-06-24 02:02:51 +0000 |
commit | 921bfc7679df9cf30854447c544da55773e33c68 (patch) | |
tree | 052db2d099ae0ee24a9afe6f405800312938c422 /lib/libvmmapi/vmmapi.c | |
parent | d94b51f5b9d2ec82746ffdf57ecb15252cca123e (diff) | |
download | FreeBSD-src-921bfc7679df9cf30854447c544da55773e33c68.zip FreeBSD-src-921bfc7679df9cf30854447c544da55773e33c68.tar.gz |
Provide APIs to directly get 'lowmem' and 'highmem' size directly.
Previously the sizes were inferred indirectly based on the size of the mappings
at 0 and 4GB respectively. This works fine as long as size of the allocation is
identical to the size of the mapping in the guest's address space. However, if
the mapping is disjoint then this assumption falls apart (e.g., due to the
legacy BIOS hole between 640KB and 1MB).
Diffstat (limited to 'lib/libvmmapi/vmmapi.c')
-rw-r--r-- | lib/libvmmapi/vmmapi.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/libvmmapi/vmmapi.c b/lib/libvmmapi/vmmapi.c index 5ce3d8e..9fb2308 100644 --- a/lib/libvmmapi/vmmapi.c +++ b/lib/libvmmapi/vmmapi.c @@ -274,6 +274,20 @@ vm_map_gpa(struct vmctx *ctx, vm_paddr_t gaddr, size_t len) return (NULL); } +size_t +vm_get_lowmem_size(struct vmctx *ctx) +{ + + return (ctx->lowmem); +} + +size_t +vm_get_highmem_size(struct vmctx *ctx) +{ + + return (ctx->highmem); +} + int vm_set_desc(struct vmctx *ctx, int vcpu, int reg, uint64_t base, uint32_t limit, uint32_t access) |