Commit 5383fc05 authored by Paolo Bonzini's avatar Paolo Bonzini
Browse files

Merge tag 'kvm-x86-fixes-6.16-rcN' of https://github.com/kvm-x86/linux into HEAD

KVM x86 fixes for 6.16-rcN

- Reject SEV{-ES} intra-host migration if one or more vCPUs are actively
  being created so as not to create a non-SEV{-ES} vCPU in an SEV{-ES} VM.

- Use a pre-allocated, per-vCPU buffer for handling de-sparsified vCPU masks
  when emulating Hyper-V hypercalls to fix a "stack frame too large" issue.

- Allow out-of-range/invalid Xen event channel ports when configuring IRQ
  routing to avoid dictating a specific ioctl() ordering to userspace.

- Conditionally reschedule when setting memory attributes to avoid soft
  lockups when userspace converts huge swaths of memory to/from private.

- Add back MWAIT as a required feature for the MONITOR/MWAIT selftest.

- Add a missing field in struct sev_data_snp_launch_start that resulted in
  the guest-visible workarounds field being filled at the wrong offset.

- Skip non-canonical address when processing Hyper-V PV TLB flushes to avoid
  VM-Fail on INVVPID.

- Advertise supported TDX TDVMCALLs to userspace.
parents 7e7a7bf2 fa787ac0
Loading
Loading
Loading
Loading
+22 −15
Original line number Diff line number Diff line
@@ -7196,6 +7196,10 @@ The valid value for 'flags' is:
					u64 leaf;
					u64 r11, r12, r13, r14;
				} get_tdvmcall_info;
				struct {
					u64 ret;
					u64 vector;
				} setup_event_notify;
			};
		} tdx;

@@ -7226,6 +7230,9 @@ status of TDVMCALLs. The output values for the given leaf should be
   placed in fields from ``r11`` to ``r14`` of the ``get_tdvmcall_info``
   field of the union.

* ``TDVMCALL_SETUP_EVENT_NOTIFY_INTERRUPT``: the guest has requested to
set up a notification interrupt for vector ``vector``.

KVM may add support for more values in the future that may cause a userspace
exit, even without calls to ``KVM_ENABLE_CAP`` or similar.  In this case,
it will enter with output fields already valid; in the common case, the
+14 −1
Original line number Diff line number Diff line
@@ -79,7 +79,20 @@ to be configured to the TDX guest.
  struct kvm_tdx_capabilities {
        __u64 supported_attrs;
        __u64 supported_xfam;
        __u64 reserved[254];

        /* TDG.VP.VMCALL hypercalls executed in kernel and forwarded to
         * userspace, respectively
         */
        __u64 kernel_tdvmcallinfo_1_r11;
        __u64 user_tdvmcallinfo_1_r11;

        /* TDG.VP.VMCALL instruction executions subfunctions executed in kernel
         * and forwarded to userspace, respectively
         */
        __u64 kernel_tdvmcallinfo_1_r12;
        __u64 user_tdvmcallinfo_1_r12;

        __u64 reserved[250];

        /* Configurable CPUID bits for userspace */
        struct kvm_cpuid2 cpuid;
+6 −1
Original line number Diff line number Diff line
@@ -700,8 +700,13 @@ struct kvm_vcpu_hv {

	struct kvm_vcpu_hv_tlb_flush_fifo tlb_flush_fifo[HV_NR_TLB_FLUSH_FIFOS];

	/* Preallocated buffer for handling hypercalls passing sparse vCPU set */
	/*
	 * Preallocated buffers for handling hypercalls that pass sparse vCPU
	 * sets (for high vCPU counts, they're too large to comfortably fit on
	 * the stack).
	 */
	u64 sparse_banks[HV_MAX_SPARSE_VCPU_BANKS];
	DECLARE_BITMAP(vcpu_mask, KVM_MAX_VCPUS);

	struct hv_vp_assist_page vp_assist_page;

+1 −0
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@
#define TDVMCALL_MAP_GPA		0x10001
#define TDVMCALL_GET_QUOTE		0x10002
#define TDVMCALL_REPORT_FATAL_ERROR	0x10003
#define TDVMCALL_SETUP_EVENT_NOTIFY_INTERRUPT 0x10004ULL

/*
 * TDG.VP.VMCALL Status Codes (returned in R10)
+7 −1
Original line number Diff line number Diff line
@@ -965,7 +965,13 @@ struct kvm_tdx_cmd {
struct kvm_tdx_capabilities {
	__u64 supported_attrs;
	__u64 supported_xfam;
	__u64 reserved[254];

	__u64 kernel_tdvmcallinfo_1_r11;
	__u64 user_tdvmcallinfo_1_r11;
	__u64 kernel_tdvmcallinfo_1_r12;
	__u64 user_tdvmcallinfo_1_r12;

	__u64 reserved[250];

	/* Configurable CPUID bits for userspace */
	struct kvm_cpuid2 cpuid;
Loading