Project

General

Profile

Bug #13064

bhyve should not waste extra page for VMCS

Added by Patrick Mooney 8 months ago. Updated 8 months 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
#1

Updated by Patrick Mooney 8 months ago

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

Updated by Electric Monk 8 months ago

  • Gerrit CR set to 860
#3

Updated by Dan McDonald 8 months ago

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

Updated by Dan McDonald 8 months ago

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

#5

Updated by Electric Monk 8 months 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>

Also available in: Atom PDF