Re: [PATCH v4 0/3] qspinlock: Introducing a 4-byte queue spinlock

From: Waiman Long
Date: Fri Feb 21 2014 - 12:03:28 EST


On 02/20/2014 02:32 PM, Raghavendra K T wrote:
On 02/20/2014 11:24 PM, Waiman Long wrote:

Now the key is how to detect if a kernel is really running in a PV
environment. I need to ask some virtualization experts on that.


For kvm you could just follow,
kvm_spinlock_init_jump() and KVM_FEATURE_* encoding in cpuid
part __do_cpuid_ent().


I saw that in the arch/x86/kernel/kvm.c file. So I think I can use the returned value of kvm_para_available() to decide if it is running in a KVM guest. However, I am not so sure of what to use in xen.

-Longman
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/