..snip.. > OK, back to the original question "what should the code do?" > > My answer is, it can behave with any of below option: > > - Be vendor agnostic and stick to x86 architecture. If CPUID enumerates a > feature, then the feature is available architecturally.
Exactly. That is what we believe Windows does. By this logic KVM is at fault for exposing this irregardless of the platform (when using -cpu host). And Sean (the KVM maintainer) agrees it is a bug. But he does not want it in the kernel due to guest ABI and hence the ask is to put this in QEMU. > > - Based on AMD spec. Ignore the bit since it's a reserved bit. (Expect a > reserved bit to be zero if not explicitly state by spec is totally wrong!) Which may change in the future as AMD may expose this CPUID in say X years. And at that point the first option you enumerated is the more safer one.