diff options
author | grehan <grehan@FreeBSD.org> | 2014-08-17 01:23:52 +0000 |
---|---|---|
committer | grehan <grehan@FreeBSD.org> | 2014-08-17 01:23:52 +0000 |
commit | 46d28d66fb3e9d4bfd5383e9b2ffa437115af6e6 (patch) | |
tree | 3eccc4cc10658396ede1ae036b060d6802d92bbc /usr.sbin | |
parent | c00f011a6ecb134c74a4cf17b0cae12586601eb4 (diff) | |
download | FreeBSD-src-46d28d66fb3e9d4bfd5383e9b2ffa437115af6e6.zip FreeBSD-src-46d28d66fb3e9d4bfd5383e9b2ffa437115af6e6.tar.gz |
MFC r267311, r267330, r267811, r267884
Turn on interrupt window exiting unconditionally when an ExtINT is being
injected into the guest.
Add helper functions to populate VM exit information for rendezvous and
astpending exits.
Provide APIs to directly get 'lowmem' and 'highmem' size directly.
Expose the amount of resident and wired memory from the guest's vmspace
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bhyve/pci_emul.c | 3 | ||||
-rw-r--r-- | usr.sbin/bhyve/rtc.c | 15 | ||||
-rw-r--r-- | usr.sbin/bhyve/smbiostbl.c | 9 | ||||
-rw-r--r-- | usr.sbin/bhyveload/bhyveload.c | 4 |
4 files changed, 10 insertions, 21 deletions
diff --git a/usr.sbin/bhyve/pci_emul.c b/usr.sbin/bhyve/pci_emul.c index a2c47ec..458ba76 100644 --- a/usr.sbin/bhyve/pci_emul.c +++ b/usr.sbin/bhyve/pci_emul.c @@ -1118,8 +1118,7 @@ init_pci(struct vmctx *ctx) * Accesses to memory addresses that are not allocated to system * memory or PCI devices return 0xff's. */ - error = vm_get_memory_seg(ctx, 0, &lowmem, NULL); - assert(error == 0); + lowmem = vm_get_lowmem_size(ctx); memset(&pci_mem_hole, 0, sizeof(struct mem_range)); pci_mem_hole.name = "PCI hole"; diff --git a/usr.sbin/bhyve/rtc.c b/usr.sbin/bhyve/rtc.c index 1187747..b3631fc 100644 --- a/usr.sbin/bhyve/rtc.c +++ b/usr.sbin/bhyve/rtc.c @@ -343,19 +343,14 @@ rtc_init(struct vmctx *ctx) * 0x34/0x35 - 64KB chunks above 16MB, below 4GB * 0x5b/0x5c/0x5d - 64KB chunks above 4GB */ - err = vm_get_memory_seg(ctx, 0, &lomem, NULL); - assert(err == 0); - - lomem = (lomem - m_16MB) / m_64KB; + lomem = (vm_get_lowmem_size(ctx) - m_16MB) / m_64KB; rtc_nvram[nvoff(RTC_LMEM_LSB)] = lomem; rtc_nvram[nvoff(RTC_LMEM_MSB)] = lomem >> 8; - if (vm_get_memory_seg(ctx, m_4GB, &himem, NULL) == 0) { - himem /= m_64KB; - rtc_nvram[nvoff(RTC_HMEM_LSB)] = himem; - rtc_nvram[nvoff(RTC_HMEM_SB)] = himem >> 8; - rtc_nvram[nvoff(RTC_HMEM_MSB)] = himem >> 16; - } + himem = vm_get_highmem_size(ctx) / m_64KB; + rtc_nvram[nvoff(RTC_HMEM_LSB)] = himem; + rtc_nvram[nvoff(RTC_HMEM_SB)] = himem >> 8; + rtc_nvram[nvoff(RTC_HMEM_MSB)] = himem >> 16; } INOUT_PORT(rtc, IO_RTC, IOPORT_F_INOUT, rtc_addr_handler); diff --git a/usr.sbin/bhyve/smbiostbl.c b/usr.sbin/bhyve/smbiostbl.c index 9d1cfb3..d560f02 100644 --- a/usr.sbin/bhyve/smbiostbl.c +++ b/usr.sbin/bhyve/smbiostbl.c @@ -779,13 +779,8 @@ smbios_build(struct vmctx *ctx) int i; int err; - err = vm_get_memory_seg(ctx, 0, &guest_lomem, NULL); - if (err != 0) - return (err); - - err = vm_get_memory_seg(ctx, 4*GB, &guest_himem, NULL); - if (err != 0) - return (err); + guest_lomem = vm_get_lowmem_size(ctx); + guest_himem = vm_get_highmem_size(ctx); startaddr = paddr_guest2host(ctx, SMBIOS_BASE, SMBIOS_MAX_LENGTH); if (startaddr == NULL) { diff --git a/usr.sbin/bhyveload/bhyveload.c b/usr.sbin/bhyveload/bhyveload.c index 4442496..ff6b269 100644 --- a/usr.sbin/bhyveload/bhyveload.c +++ b/usr.sbin/bhyveload/bhyveload.c @@ -505,8 +505,8 @@ static void cb_getmem(void *arg, uint64_t *ret_lowmem, uint64_t *ret_highmem) { - vm_get_memory_seg(ctx, 0, ret_lowmem, NULL); - vm_get_memory_seg(ctx, 4 * GB, ret_highmem, NULL); + *ret_lowmem = vm_get_lowmem_size(ctx); + *ret_highmem = vm_get_highmem_size(ctx); } struct env { |