1. 14 4月, 2013 4 次提交
    • J
      KVM: nVMX: Fix conditions for interrupt injection · e8457c67
      Jan Kiszka 提交于
      If we are entering guest mode, we do not want L0 to interrupt this
      vmentry with all its side effects on the vmcs. Therefore, injection
      shall be disallowed during L1->L2 transitions, as in the previous
      version. However, this check is conceptually independent of
      nested_exit_on_intr, so decouple it.
      
      If L1 traps external interrupts, we can kick the guest from L2 to L1,
      also just like the previous code worked. But we no longer need to
      consider L1's idt_vectoring_info_field. It will always be empty at this
      point. Instead, if L2 has pending events, those are now found in the
      architectural queues and will, thus, prevent vmx_interrupt_allowed from
      being called at all.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NGleb Natapov <gleb@redhat.com>
      e8457c67
    • J
      KVM: nVMX: Rework event injection and recovery · 5f3d5799
      Jan Kiszka 提交于
      The basic idea is to always transfer the pending event injection on
      vmexit into the architectural state of the VCPU and then drop it from
      there if it turns out that we left L2 to enter L1, i.e. if we enter
      prepare_vmcs12.
      
      vmcs12_save_pending_events takes care to transfer pending L0 events into
      the queue of L1. That is mandatory as L1 may decide to switch the guest
      state completely, invalidating or preserving the pending events for
      later injection (including on a different node, once we support
      migration).
      
      This concept is based on the rule that a pending vmlaunch/vmresume is
      not canceled. Otherwise, we would risk to lose injected events or leak
      them into the wrong queues. Encode this rule via a WARN_ON_ONCE at the
      entry of nested_vmx_vmexit.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NGleb Natapov <gleb@redhat.com>
      5f3d5799
    • J
      KVM: nVMX: Fix injection of PENDING_INTERRUPT and NMI_WINDOW exits to L1 · 3b656cf7
      Jan Kiszka 提交于
      Check if the interrupt or NMI window exit is for L1 by testing if it has
      the corresponding controls enabled. This is required when we allow
      direct injection from L0 to L2
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Reviewed-by: NGleb Natapov <gleb@redhat.com>
      Signed-off-by: NGleb Natapov <gleb@redhat.com>
      3b656cf7
    • G
      KVM: VMX: do not try to reexecute failed instruction while emulating invalid guest state · 991eebf9
      Gleb Natapov 提交于
      During invalid guest state emulation vcpu cannot enter guest mode to try
      to reexecute instruction that emulator failed to emulate, so emulation
      will happen again and again.  Prevent that by telling the emulator that
      instruction reexecution should not be attempted.
      Signed-off-by: NGleb Natapov <gleb@redhat.com>
      991eebf9
  2. 08 4月, 2013 2 次提交
  3. 07 4月, 2013 1 次提交
  4. 21 3月, 2013 1 次提交
  5. 19 3月, 2013 1 次提交
  6. 14 3月, 2013 2 次提交
  7. 13 3月, 2013 2 次提交
    • J
      KVM: nVMX: Clean up and fix pin-based execution controls · eabeaacc
      Jan Kiszka 提交于
      Only interrupt and NMI exiting are mandatory for KVM to work, thus can
      be exposed to the guest unconditionally, virtual NMI exiting is
      optional. So we must not advertise it unless the host supports it.
      
      Introduce the symbolic constant PIN_BASED_ALWAYSON_WITHOUT_TRUE_MSR at
      this chance.
      Reviewed-by: N: Paolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NGleb Natapov <gleb@redhat.com>
      eabeaacc
    • J
      KVM: x86: Rework INIT and SIPI handling · 66450a21
      Jan Kiszka 提交于
      A VCPU sending INIT or SIPI to some other VCPU races for setting the
      remote VCPU's mp_state. When we were unlucky, KVM_MP_STATE_INIT_RECEIVED
      was overwritten by kvm_emulate_halt and, thus, got lost.
      
      This introduces APIC events for those two signals, keeping them in
      kvm_apic until kvm_apic_accept_events is run over the target vcpu
      context. kvm_apic_has_events reports to kvm_arch_vcpu_runnable if there
      are pending events, thus if vcpu blocking should end.
      
      The patch comes with the side effect of effectively obsoleting
      KVM_MP_STATE_SIPI_RECEIVED. We still accept it from user space, but
      immediately translate it to KVM_MP_STATE_INIT_RECEIVED + KVM_APIC_SIPI.
      The vcpu itself will no longer enter the KVM_MP_STATE_SIPI_RECEIVED
      state. That also means we no longer exit to user space after receiving a
      SIPI event.
      
      Furthermore, we already reset the VCPU on INIT, only fixing up the code
      segment later on when SIPI arrives. Moreover, we fix INIT handling for
      the BSP: it never enter wait-for-SIPI but directly starts over on INIT.
      Tested-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NGleb Natapov <gleb@redhat.com>
      66450a21
  8. 12 3月, 2013 1 次提交
  9. 11 3月, 2013 1 次提交
  10. 08 3月, 2013 2 次提交
  11. 06 3月, 2013 1 次提交
  12. 05 3月, 2013 2 次提交
  13. 28 2月, 2013 2 次提交
  14. 27 2月, 2013 4 次提交
  15. 22 2月, 2013 2 次提交
  16. 14 2月, 2013 1 次提交
  17. 11 2月, 2013 1 次提交
  18. 07 2月, 2013 1 次提交
  19. 06 2月, 2013 1 次提交
  20. 29 1月, 2013 3 次提交
  21. 24 1月, 2013 5 次提交