On 04/12/18 15:45, Peter Maydell wrote: > kvm_enabled() does a similar thing to what hax_enabled() does, > but this works out OK because it takes care to avoid > providing the #define-to-0 implementation except in the > case where it is building a target-specific file for a > target where KVM is not enabled; for common files it > will provide the function prototype which will end up > linking to a stub implementation. So we could handle hax > like that too.
Yes, the KVM one is the correct way to do it. The #define-to-0 implementation is used so that the compiler can optimize out more code, the function acts as a fallback. Paolo