Skip to content
  • Paolo Bonzini's avatar
    target/i386: introduce generic feature dependency mechanism · 99e24dbd
    Paolo Bonzini authored
    
    
    Sometimes a CPU feature does not make sense unless another is
    present.  In the case of VMX features, KVM does not even allow
    setting the VMX controls to some invalid combinations.
    
    Therefore, this patch adds a generic mechanism that looks for bits
    that the user explicitly cleared, and uses them to remove other bits
    from the expanded CPU definition.  If these dependent bits were also
    explicitly *set* by the user, this will be a warning for "-cpu check"
    and an error for "-cpu enforce".  If not, then the dependent bits are
    cleared silently, for convenience.
    
    With VMX features, this will be used so that for example
    "-cpu host,-rdrand" will also hide support for RDRAND exiting.
    
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    99e24dbd