From: Linus Torvalds Date: Sun, 5 May 2013 21:47:31 +0000 (-0700) Subject: Merge tag 'kvm-3.10-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm X-Git-Tag: Ubuntu-snapdragon-4.4.0-1029.32~11010 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=01227a889ed56ae53aeebb9f93be9d54dd8b2de8;p=mirror_ubuntu-zesty-kernel.git Merge tag 'kvm-3.10-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm updates from Gleb Natapov: "Highlights of the updates are: general: - new emulated device API - legacy device assignment is now optional - irqfd interface is more generic and can be shared between arches x86: - VMCS shadow support and other nested VMX improvements - APIC virtualization and Posted Interrupt hardware support - Optimize mmio spte zapping ppc: - BookE: in-kernel MPIC emulation with irqfd support - Book3S: in-kernel XICS emulation (incomplete) - Book3S: HV: migration fixes - BookE: more debug support preparation - BookE: e6500 support ARM: - reworking of Hyp idmaps s390: - ioeventfd for virtio-ccw And many other bug fixes, cleanups and improvements" * tag 'kvm-3.10-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (204 commits) kvm: Add compat_ioctl for device control API KVM: x86: Account for failing enable_irq_window for NMI window request KVM: PPC: Book3S: Add API for in-kernel XICS emulation kvm/ppc/mpic: fix missing unlock in set_base_addr() kvm/ppc: Hold srcu lock when calling kvm_io_bus_read/write kvm/ppc/mpic: remove users kvm/ppc/mpic: fix mmio region lists when multiple guests used kvm/ppc/mpic: remove default routes from documentation kvm: KVM_CAP_IOMMU only available with device assignment ARM: KVM: iterate over all CPUs for CPU compatibility check KVM: ARM: Fix spelling in error message ARM: KVM: define KVM_ARM_MAX_VCPUS unconditionally KVM: ARM: Fix API documentation for ONE_REG encoding ARM: KVM: promote vfp_host pointer to generic host cpu context ARM: KVM: add architecture specific hook for capabilities ARM: KVM: perform HYP initilization for hotplugged CPUs ARM: KVM: switch to a dual-step HYP init code ARM: KVM: rework HYP page table freeing ARM: KVM: enforce maximum size for identity mapped code ARM: KVM: move to a KVM provided HYP idmap ... --- 01227a889ed56ae53aeebb9f93be9d54dd8b2de8 diff --cc arch/x86/kvm/lapic.c index f77df1c5de6e,e29883c604ff..e1adbb4aca75 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@@ -1857,9 -1854,37 +1854,37 @@@ int kvm_lapic_enable_pv_eoi(struct kvm_ if (!pv_eoi_enabled(vcpu)) return 0; return kvm_gfn_to_hva_cache_init(vcpu->kvm, &vcpu->arch.pv_eoi.data, - addr); + addr, sizeof(u8)); } + void kvm_apic_accept_events(struct kvm_vcpu *vcpu) + { + struct kvm_lapic *apic = vcpu->arch.apic; + unsigned int sipi_vector; + + if (!kvm_vcpu_has_lapic(vcpu)) + return; + + if (test_and_clear_bit(KVM_APIC_INIT, &apic->pending_events)) { + kvm_lapic_reset(vcpu); + kvm_vcpu_reset(vcpu); + if (kvm_vcpu_is_bsp(apic->vcpu)) + vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE; + else + vcpu->arch.mp_state = KVM_MP_STATE_INIT_RECEIVED; + } + if (test_and_clear_bit(KVM_APIC_SIPI, &apic->pending_events) && + vcpu->arch.mp_state == KVM_MP_STATE_INIT_RECEIVED) { + /* evaluate pending_events before reading the vector */ + smp_rmb(); + sipi_vector = apic->sipi_vector; + pr_debug("vcpu %d received sipi with vector # %x\n", + vcpu->vcpu_id, sipi_vector); + kvm_vcpu_deliver_sipi_vector(vcpu, sipi_vector); + vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE; + } + } + void kvm_lapic_init(void) { /* do not patch jump label more than once per second */ diff --cc drivers/s390/kvm/virtio_ccw.c index fb877b59ec57,5948f2a7b080..779dc5136291 --- a/drivers/s390/kvm/virtio_ccw.c +++ b/drivers/s390/kvm/virtio_ccw.c @@@ -166,7 -170,8 +170,7 @@@ static void virtio_ccw_kvm_notify(struc vcdev = to_vc_device(info->vq->vdev); ccw_device_get_schid(vcdev->cdev, &schid); - do_kvm_notify(schid, vq->index); - info->cookie = do_kvm_notify(schid, virtqueue_get_queue_index(vq), - info->cookie); ++ info->cookie = do_kvm_notify(schid, vq->index, info->cookie); } static int virtio_ccw_read_vq_conf(struct virtio_ccw_device *vcdev,