diff options
author | Gleb Natapov <gleb@redhat.com> | 2010-01-17 08:51:24 -0500 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2010-03-01 10:36:00 -0500 |
commit | c25bc1638a1211f57cccbabdd8b732813b852340 (patch) | |
tree | 84ab4bad029c31e7cf121f53d6d19010f4743944 /arch/x86/kvm/x86.c | |
parent | 10388a07164c1512b3a3d0273b9adc230f82790e (diff) |
KVM: Implement NotifyLongSpinWait HYPER-V hypercall
Windows issues this hypercall after guest was spinning on a spinlock
for too many iterations.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Vadim Rozenfeld <vrozenfe@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r-- | arch/x86/kvm/x86.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 552be51e4d84..9f72a443455b 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -1564,6 +1564,7 @@ int kvm_dev_ioctl_check_extension(long ext) | |||
1564 | case KVM_CAP_VCPU_EVENTS: | 1564 | case KVM_CAP_VCPU_EVENTS: |
1565 | case KVM_CAP_HYPERV: | 1565 | case KVM_CAP_HYPERV: |
1566 | case KVM_CAP_HYPERV_VAPIC: | 1566 | case KVM_CAP_HYPERV_VAPIC: |
1567 | case KVM_CAP_HYPERV_SPIN: | ||
1567 | r = 1; | 1568 | r = 1; |
1568 | break; | 1569 | break; |
1569 | case KVM_CAP_COALESCED_MMIO: | 1570 | case KVM_CAP_COALESCED_MMIO: |
@@ -3827,7 +3828,14 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu) | |||
3827 | 3828 | ||
3828 | trace_kvm_hv_hypercall(code, fast, rep_cnt, rep_idx, ingpa, outgpa); | 3829 | trace_kvm_hv_hypercall(code, fast, rep_cnt, rep_idx, ingpa, outgpa); |
3829 | 3830 | ||
3830 | res = HV_STATUS_INVALID_HYPERCALL_CODE; | 3831 | switch (code) { |
3832 | case HV_X64_HV_NOTIFY_LONG_SPIN_WAIT: | ||
3833 | kvm_vcpu_on_spin(vcpu); | ||
3834 | break; | ||
3835 | default: | ||
3836 | res = HV_STATUS_INVALID_HYPERCALL_CODE; | ||
3837 | break; | ||
3838 | } | ||
3831 | 3839 | ||
3832 | ret = res | (((u64)rep_done & 0xfff) << 32); | 3840 | ret = res | (((u64)rep_done & 0xfff) << 32); |
3833 | if (longmode) { | 3841 | if (longmode) { |