1. 17 3月, 2020 21 次提交
  2. 23 2月, 2020 1 次提交
    • O
      KVM: nVMX: Emulate MTF when performing instruction emulation · 5ef8acbd
      Oliver Upton 提交于
      Since commit 5f3d45e7 ("kvm/x86: add support for
      MONITOR_TRAP_FLAG"), KVM has allowed an L1 guest to use the monitor trap
      flag processor-based execution control for its L2 guest. KVM simply
      forwards any MTF VM-exits to the L1 guest, which works for normal
      instruction execution.
      
      However, when KVM needs to emulate an instruction on the behalf of an L2
      guest, the monitor trap flag is not emulated. Add the necessary logic to
      kvm_skip_emulated_instruction() to synthesize an MTF VM-exit to L1 upon
      instruction emulation for L2.
      
      Fixes: 5f3d45e7 ("kvm/x86: add support for MONITOR_TRAP_FLAG")
      Signed-off-by: NOliver Upton <oupton@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      5ef8acbd
  3. 13 2月, 2020 3 次提交
  4. 12 2月, 2020 2 次提交
    • O
      KVM: x86: Deliver exception payload on KVM_GET_VCPU_EVENTS · a06230b6
      Oliver Upton 提交于
      KVM allows the deferral of exception payloads when a vCPU is in guest
      mode to allow the L1 hypervisor to intercept certain events (#PF, #DB)
      before register state has been modified. However, this behavior is
      incompatible with the KVM_{GET,SET}_VCPU_EVENTS ABI, as userspace
      expects register state to have been immediately modified. Userspace may
      opt-in for the payload deferral behavior with the
      KVM_CAP_EXCEPTION_PAYLOAD per-VM capability. As such,
      kvm_multiple_exception() will immediately manipulate guest registers if
      the capability hasn't been requested.
      
      Since the deferral is only necessary if a userspace ioctl were to be
      serviced at the same as a payload bearing exception is recognized, this
      behavior can be relaxed. Instead, opportunistically defer the payload
      from kvm_multiple_exception() and deliver the payload before completing
      a KVM_GET_VCPU_EVENTS ioctl.
      Signed-off-by: NOliver Upton <oupton@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      a06230b6
    • O
      KVM: x86: Mask off reserved bit from #DB exception payload · 307f1cfa
      Oliver Upton 提交于
      KVM defines the #DB payload as compatible with the 'pending debug
      exceptions' field under VMX, not DR6. Mask off bit 12 when applying the
      payload to DR6, as it is reserved on DR6 but not the 'pending debug
      exceptions' field.
      
      Fixes: f10c729f ("kvm: vmx: Defer setting of DR6 until #DB delivery")
      Signed-off-by: NOliver Upton <oupton@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      307f1cfa
  5. 05 2月, 2020 9 次提交
  6. 31 1月, 2020 4 次提交