On 24 July 2015 at 08:44, Pavel Fedin <p.fe...@samsung.com> wrote: > Thanks for pointing at it, my guess was correct, i have verified > it by myself. Looks like i cannot use KVM definitions outside of > KVM-only code. And simple #include <linux/kvm.h> will not help > because this will not compile on non-Linux hosts. I will look for > another solution.
Yep, that's right. You have a couple of choices: (1) make sure the KVM definitions are only used in KVM-specific source files. This is how we handle KVM_DEV_TYPE_ARM_VGIC_V2, for instance. (2) provide QEMU versions of the constants in target-arm/kvm-consts.h. This is how we handle KVM_ARM_TARGET_* (which in non-KVM-specific code are always referred to using the QEMU_KVM_ARM_TARGET_* names which exist on all hosts.) Following how the existing GICv2 code handles this is probably a good approach. thanks -- PMM