avoid packing and bitfields in bhyve VMCB
The control and state structs for the SVM VMCB in bhyve are defined as packed structs and make heavy use of C bitfields. The former attribute (packed-ness) causes gcc9 to gripe about alignment issues:
../../i86pc/io/vmm/amd/svm.c:1518:49: error: taking address of packed member of 'struct vmcb_state' may result in an unaligned pointer value [-Werror=address-of-packed-member] 1518 | handled = x86_emulate_cpuid(svm_sc->vm, vcpu, &state->rax, | ^~~~~~~~~~~
The latter (bitfield usage) goes against our style inclinations in illumos.
It would be nice to clean up the struct definitions for both
vmcb_state to address these issues.
Updated by Electric Monk over 1 year ago
- Status changed from In Progress to Closed
- % Done changed from 0 to 100
commit a517c69d55a640319d65033c3b1275bb8a9c56ab Author: Patrick Mooney <email@example.com> Date: 2020-07-15T04:47:00.000Z 12939 avoid packing and bitfields in bhyve VMCB Reviewed by: Mike Zeller <firstname.lastname@example.org> Reviewed by: Toomas Soome <email@example.com> Reviewed by: Andy Fiddaman <firstname.lastname@example.org> Approved by: Dan McDonald <email@example.com>