Project

General

Profile

Actions

Bug #13064

closed

bhyve should not waste extra page for VMCS

Added by Patrick Mooney about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Category:
bhyve
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
bhyve
Gerrit CR:

Description

When bhyve was ported to illumos, the allocation for the VMCS was expanded for an extra page (per vCPU!) in order to store some extra state (the physical address of the VMCS) which was hard to access in certain contexts:

struct vmcs {
        uint32_t        identifier;
        uint32_t        abort_code;
        char            _impl_specific[PAGE_SIZE - sizeof(uint32_t) * 2];
#ifndef __FreeBSD__
        /*
         * Keep the physical address of the VMCS cached adjacent for the
         * structure so it can be referenced in contexts which are too delicate
         * for a call into the HAT.  For the moment it means wasting a whole
         * page on padding for the PA value to maintain alignment, but it
         * allows the consumers of 'struct vmcs *' to easily access the value
         * without a significant change to the interface.
         */
        uint64_t        vmcs_pa;
        char            _pa_pad[PAGE_SIZE - sizeof (vm_paddr_t)];
#endif
};

As we're cleaning up the VMCS interfaces in #13063, it would be nice to fix this as well.


Related issues

Related to illumos gate - Bug #13063: clarify VMCS interfaces in bhyveClosedPatrick Mooney

Actions
Actions #1

Updated by Patrick Mooney about 1 year ago

  • Subject changed from bhyve should not waste extra page for vmcs to bhyve should not waste extra page for VMCS
Actions #2

Updated by Electric Monk about 1 year ago

  • Gerrit CR set to 860
Actions #3

Updated by Dan McDonald about 1 year ago

  • Related to Bug #13063: clarify VMCS interfaces in bhyve added
Actions #4

Updated by Dan McDonald about 1 year ago

Testing for this was included in the testing of #13063.

Actions #5

Updated by Electric Monk about 1 year ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit 007ca33219ffdc49281657f5f8a9ee1bbfc367ab

commit  007ca33219ffdc49281657f5f8a9ee1bbfc367ab
Author: Patrick Mooney <pmooney@pfmooney.com>
Date:   2020-08-28T18:28:42.000Z

    13063 clarify VMCS interfaces in bhyve
    13064 bhyve should not waste extra page for VMCS
    Reviewed by: Robert Mustacchi <rm@fingolfin.org>
    Reviewed by: Mike Zeller <mike.zeller@joyent.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF