There is no existing way (near as I know) way to validate if a given libvirt CPU model and a set of extra CPU flags (e.g. IvyBridge with 'pcid' and 'pdpe1gb') are supported by KVM and a given specific QEMU binary.
This is an RFC requesting to add such an API.
However, what does exist today is a way to check if a given CPU + extra CPU feature flags are supported by the *host* CPU via the libvirt API virConnectCompareCPU().
Patches sent upstream for review: https://www.redhat.com/archives/libvir-list/2018-May/msg01204.html
This API is now implemented upstream by a series of patches ending with
Author: Jiri Denemark <jdenemar>
AuthorDate: Wed May 16 10:05:57 2018 +0200
Commit: Jiri Denemark <jdenemar>
CommitDate: Mon May 28 16:00:20 2018 +0200
news: Mention new CPU related APIs
Signed-off-by: Jiri Denemark <jdenemar>
Reviewed-by: Ján Tomko <jtomko>