Project

General

Profile

Actions

Bug #12749

closed

gcc10 complains about vmcb_state struct packing

Added by Patrick Mooney about 2 years ago. Updated over 1 year ago.

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

0%

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

Description

As noted in #12746, gcc10 was complaining about pointer access into the vmcb_state struct:

../../i86pc/io/vmm/amd/svm.c: In function 'svm_vmexit':
../../i86pc/io/vmm/amd/svm.c:1522:49: error: taking address of packed member of 'struct vmcb_state' may result in an unaligned pointer value [-Werror=address-of-packed-member]
 1522 |   handled = x86_emulate_cpuid(svm_sc->vm, vcpu, &state->rax,
      |                                                 ^~~~~~~~~~~
cc1: all warnings being treated as errors
Even with the CPUID issues resolved, it's still not happy about those accesses. Closer inspection of the vmcb_state struct calls into question the necessity of its packed status. We can probably remove the packed attribute, and verify its offsets with CTASSERT() to safely address the warning.

Related issues

Related to illumos gate - Bug #12746: x86_emulate_cpuid() should clear upper 32 bitsClosedPatrick Mooney

Actions
Actions #1

Updated by Patrick Mooney about 2 years ago

  • Related to Bug #12746: x86_emulate_cpuid() should clear upper 32 bits added
Actions #2

Updated by Patrick Mooney over 1 year ago

  • Status changed from New to Closed

Fixed via #12939

Actions

Also available in: Atom PDF