Commit 76f598ba authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull kvm fixes from Paolo Bonzini:
 "PPC:
   - Hide KVM_CAP_IRQFD_RESAMPLE if XIVE is enabled

  s390:
   - Fix handling of external interrupts in protected guests

  x86:
   - Resample the pending state of IOAPIC interrupts when unmasking them

   - Fix usage of Hyper-V "enlightened TLB" on AMD

   - Small fixes to real mode exceptions

   - Suppress pending MMIO write exits if emulator detects exception

  Documentation:
   - Fix rST syntax"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  docs: kvm: x86: Fix broken field list
  KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE platform dependent
  KVM: s390: pv: fix external interruption loop not always detected
  KVM: nVMX: Do not report error code when synthesizing VM-Exit from Real Mode
  KVM: x86: Clear "has_error_code", not "error_code", for RM exception injection
  KVM: x86: Suppress pending MMIO write exits if emulator detects exception
  KVM: x86/ioapic: Resample the pending state of an IRQ when unmasking
  KVM: irqfd: Make resampler_list an RCU list
  KVM: SVM: Flush Hyper-V TLB when required
parents ceeea1b7 fb5015bc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -8296,11 +8296,11 @@ ENOSYS for the others.
8.35 KVM_CAP_PMU_CAPABILITY
---------------------------

:Capability KVM_CAP_PMU_CAPABILITY
:Capability: KVM_CAP_PMU_CAPABILITY
:Architectures: x86
:Type: vm
:Parameters: arg[0] is bitmask of PMU virtualization capabilities.
:Returns 0 on success, -EINVAL when arg[0] contains invalid bits
:Returns: 0 on success, -EINVAL when arg[0] contains invalid bits

This capability alters PMU virtualization in KVM.

+1 −0
Original line number Diff line number Diff line
@@ -220,6 +220,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
	case KVM_CAP_VCPU_ATTRIBUTES:
	case KVM_CAP_PTP_KVM:
	case KVM_CAP_ARM_SYSTEM_SUSPEND:
	case KVM_CAP_IRQFD_RESAMPLE:
		r = 1;
		break;
	case KVM_CAP_SET_GUEST_DEBUG2:
+6 −0
Original line number Diff line number Diff line
@@ -576,6 +576,12 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
		break;
#endif

#ifdef CONFIG_HAVE_KVM_IRQFD
	case KVM_CAP_IRQFD_RESAMPLE:
		r = !xive_enabled();
		break;
#endif

	case KVM_CAP_PPC_ALLOC_HTAB:
		r = hv_enabled;
		break;
+24 −8
Original line number Diff line number Diff line
@@ -271,10 +271,18 @@ static int handle_prog(struct kvm_vcpu *vcpu)
 * handle_external_interrupt - used for external interruption interceptions
 * @vcpu: virtual cpu
 *
 * This interception only occurs if the CPUSTAT_EXT_INT bit was set, or if
 * the new PSW does not have external interrupts disabled. In the first case,
 * we've got to deliver the interrupt manually, and in the second case, we
 * drop to userspace to handle the situation there.
 * This interception occurs if:
 * - the CPUSTAT_EXT_INT bit was already set when the external interrupt
 *   occurred. In this case, the interrupt needs to be injected manually to
 *   preserve interrupt priority.
 * - the external new PSW has external interrupts enabled, which will cause an
 *   interruption loop. We drop to userspace in this case.
 *
 * The latter case can be detected by inspecting the external mask bit in the
 * external new psw.
 *
 * Under PV, only the latter case can occur, since interrupt priorities are
 * handled in the ultravisor.
 */
static int handle_external_interrupt(struct kvm_vcpu *vcpu)
{
@@ -285,10 +293,18 @@ static int handle_external_interrupt(struct kvm_vcpu *vcpu)

	vcpu->stat.exit_external_interrupt++;

	if (kvm_s390_pv_cpu_is_protected(vcpu)) {
		newpsw = vcpu->arch.sie_block->gpsw;
	} else {
		rc = read_guest_lc(vcpu, __LC_EXT_NEW_PSW, &newpsw, sizeof(psw_t));
		if (rc)
			return rc;
	/* We can not handle clock comparator or timer interrupt with bad PSW */
	}

	/*
	 * Clock comparator or timer interrupt with external interrupt enabled
	 * will cause interrupt loop. Drop to userspace.
	 */
	if ((eic == EXT_IRQ_CLK_COMP || eic == EXT_IRQ_CPU_TIMER) &&
	    (newpsw.mask & PSW_MASK_EXT))
		return -EOPNOTSUPP;
+1 −0
Original line number Diff line number Diff line
@@ -573,6 +573,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
	case KVM_CAP_S390_VCPU_RESETS:
	case KVM_CAP_SET_GUEST_DEBUG:
	case KVM_CAP_S390_DIAG318:
	case KVM_CAP_IRQFD_RESAMPLE:
		r = 1;
		break;
	case KVM_CAP_SET_GUEST_DEBUG2:
Loading