From nobody Wed Apr 8 03:07:42 2026 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E7143C8710 for ; Tue, 10 Mar 2026 22:45:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773182753; cv=none; b=O07FnDC5aIGap5+Jrs29TavZrGmz4G71M3YY1XIdcJvk8cvRhdVRtXar2eA3EL24KLMrAU+r/hQHP1bWWFzztZyJ8BsBWWSHE90UlTSa2DFBnVg/zQ9rXCBpSdXgZ1kQ49Bt2TCVEGtZZqYuFpAMYvZuqZr7hccqPPKvnSSl5aI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773182753; c=relaxed/simple; bh=hwdW/TN+96vYflyIkm7Tl7f92iwPXejir/ZHS9EJPwg=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=da6n1uy0ry5j0CF5zPFFZr8rMrXkQq/nQ/1JgpwlnZFOhC5g6/lMqhdlkPqm3k98wQnLX/OqOQUfQhPPFaN3ayge7/agJx3qxOq6Io507HT+3itBL+6U2CdfeMcdwlXwTTwQDCpR3xZea+8ZhDG7HrF/K3E84CkC+s6TKJKKZ6A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=odWs0FJa; arc=none smtp.client-ip=209.85.214.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="odWs0FJa" Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-2ae4b96c259so3171625ad.1 for ; Tue, 10 Mar 2026 15:45:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1773182751; x=1773787551; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=aTqkjsqGILp5wYzsgkTXS8JbmjOMnXqIqMrcmBq0m48=; b=odWs0FJaPmiEfiLG7WLbrve6hB7ZqsXk4fsjjlZmmO8P+UBivjwkD3eCzNMXS/y424 Qb+53k12LZujyPP8MYTfm8wQ9I/NhxbQZvcX8LgZiUA1Og1gPT+gJgffN1XeSUanemoQ fwmenXUDXZZZjq9CfCXf8iLQIMb2B+apCtLqjwT4zQWaQWCvPEQ3WuzoHMGwqDJRWDgJ 5PHf6HTPhtMNZ1c7Wle7HPDk37ncb+kJLUTNjoOJtq22fEkonnbnCLJrpHyluIayssO3 tR1mclncIMMFBCNapkg7wEmgUUjisYMB/WRwdqJibbk5HtDYwbp4SgUEH/zFFDxd3vv2 MQaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773182751; x=1773787551; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aTqkjsqGILp5wYzsgkTXS8JbmjOMnXqIqMrcmBq0m48=; b=ureuj0WzWS8Qxv+sd5eHSZMPZlKkkEIND/radnhA8P7QR1Z+dluiEYC59lxtGvS6ME Z+ZlmD7Uvvz8UZ63LMWre4UBBMYEdvj715phdGSeo424Xo0Y2Z2D2nVuJ83OvD+8Wm8W NBRt0jiSeIKs0dYfXy/YQNTrI00OPhdxniYYso33QhcLNUQRFLASREzdOjbdsnflonnN USyX/wHuwb4Pm+wX7yta/Qtg51r93CqelzNPCAYB+JIB15xEmAyDEgcN+lwEJfquIqZb 1XAIPRhWTDxqN67GvSQ9+Xn4wdGqAbr/4Zb45v3//hLHFgvJqdMpypcMHmGKOxYLm2MY f2AA== X-Forwarded-Encrypted: i=1; AJvYcCXwlBCIIhlzuZ0ax52uq/HCDL5QP9PK8o2ibO1SlO46NraJxNuavJBmImsLLgGzpkR+9pP20USm+clLFbc=@vger.kernel.org X-Gm-Message-State: AOJu0YzzxUd0VOaKkuCASl4JIXa3p3kVljGCsQR/ExUYiEfHU+3CKGmx TuK1TSZTt3FX1c6YfhG1Bybl7Kf/PE79ixD2o0D6gtJdmZFypfwoWwDVbfT5vB8FqlCw00UFNaN y2v9t7g== X-Received: from plblc16.prod.google.com ([2002:a17:902:fa90:b0:2ae:574d:ed3f]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:f8d:b0:2ae:3a77:a1f6 with SMTP id d9443c01a7336-2aeaeb36d71mr2657625ad.6.1773182750961; Tue, 10 Mar 2026 15:45:50 -0700 (PDT) Reply-To: Sean Christopherson Date: Tue, 10 Mar 2026 15:45:45 -0700 In-Reply-To: <20260310224546.2582118-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260310224546.2582118-1-seanjc@google.com> X-Mailer: git-send-email 2.53.0.473.g4a7958ca14-goog Message-ID: <20260310224546.2582118-2-seanjc@google.com> Subject: [PATCH 1/2] KVM: x86: Move nested_run_pending to kvm_vcpu_arch From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Yosry Ahmed Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Yosry Ahmed Move nested_run_pending field present in both svm_nested_state and nested_vmx to the common kvm_vcpu_arch. This allows for common code to use without plumbing it through per-vendor helpers. nested_run_pending remains zero-initialized, as the entire kvm_vcpu struct is, and all further accesses are done through vcpu->arch instead of svm->nested or vmx->nested. No functional change intended. Suggested-by: Sean Christopherson Signed-off-by: Yosry Ahmed [sean: expand the commend in the field declaration] Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_host.h | 9 +++++++ arch/x86/kvm/svm/nested.c | 18 ++++++------- arch/x86/kvm/svm/svm.c | 16 ++++++------ arch/x86/kvm/svm/svm.h | 4 --- arch/x86/kvm/vmx/nested.c | 46 ++++++++++++++++----------------- arch/x86/kvm/vmx/vmx.c | 16 ++++++------ arch/x86/kvm/vmx/vmx.h | 3 --- 7 files changed, 57 insertions(+), 55 deletions(-) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_hos= t.h index c94556fefb75..a1bf0aaedad8 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -1099,6 +1099,15 @@ struct kvm_vcpu_arch { */ bool pdptrs_from_userspace; =20 + /* + * Set if an emulated nested VM-Enter to L2 is pending completion. KVM + * must not synthesize a VM-Exit to L1 before entering L2, as VM-Exits + * can only occur at instruction boundaries. The only exception is + * VMX's "notify" exits, which exist in large part to break the CPU out + * of infinite ucode loops, but can corrupt vCPU state in the process! + */ + bool nested_run_pending; + #if IS_ENABLED(CONFIG_HYPERV) hpa_t hv_root_tdp; #endif diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c index b191c6cab57d..782d6a34d173 100644 --- a/arch/x86/kvm/svm/nested.c +++ b/arch/x86/kvm/svm/nested.c @@ -914,7 +914,7 @@ static void nested_vmcb02_prepare_control(struct vcpu_s= vm *svm) * the CPU and/or KVM and should be used regardless of L1's support. */ if (guest_cpu_cap_has(vcpu, X86_FEATURE_NRIPS) || - !svm->nested.nested_run_pending) + !vcpu->arch.nested_run_pending) vmcb02->control.next_rip =3D vmcb12_ctrl->next_rip; =20 svm->nmi_l1_to_l2 =3D is_evtinj_nmi(vmcb02->control.event_inj); @@ -926,7 +926,7 @@ static void nested_vmcb02_prepare_control(struct vcpu_s= vm *svm) if (is_evtinj_soft(vmcb02->control.event_inj)) { svm->soft_int_injected =3D true; if (guest_cpu_cap_has(vcpu, X86_FEATURE_NRIPS) || - !svm->nested.nested_run_pending) + !vcpu->arch.nested_run_pending) svm->soft_int_next_rip =3D vmcb12_ctrl->next_rip; } =20 @@ -1131,11 +1131,11 @@ int nested_svm_vmrun(struct kvm_vcpu *vcpu) if (!npt_enabled) vmcb01->save.cr3 =3D kvm_read_cr3(vcpu); =20 - svm->nested.nested_run_pending =3D 1; + vcpu->arch.nested_run_pending =3D 1; =20 if (enter_svm_guest_mode(vcpu, vmcb12_gpa, true) || !nested_svm_merge_msrpm(vcpu)) { - svm->nested.nested_run_pending =3D 0; + vcpu->arch.nested_run_pending =3D 0; svm->nmi_l1_to_l2 =3D false; svm->soft_int_injected =3D false; =20 @@ -1277,7 +1277,7 @@ void nested_svm_vmexit(struct vcpu_svm *svm) /* Exit Guest-Mode */ leave_guest_mode(vcpu); svm->nested.vmcb12_gpa =3D 0; - WARN_ON_ONCE(svm->nested.nested_run_pending); + WARN_ON_ONCE(vcpu->arch.nested_run_pending); =20 kvm_clear_request(KVM_REQ_GET_NESTED_STATE_PAGES, vcpu); =20 @@ -1487,7 +1487,7 @@ void svm_leave_nested(struct kvm_vcpu *vcpu) struct vcpu_svm *svm =3D to_svm(vcpu); =20 if (is_guest_mode(vcpu)) { - svm->nested.nested_run_pending =3D 0; + vcpu->arch.nested_run_pending =3D 0; svm->nested.vmcb12_gpa =3D INVALID_GPA; =20 leave_guest_mode(vcpu); @@ -1672,7 +1672,7 @@ static int svm_check_nested_events(struct kvm_vcpu *v= cpu) * previously injected event, the pending exception occurred while said * event was being delivered and thus needs to be handled. */ - bool block_nested_exceptions =3D svm->nested.nested_run_pending; + bool block_nested_exceptions =3D vcpu->arch.nested_run_pending; /* * New events (not exceptions) are only recognized at instruction * boundaries. If an event needs reinjection, then KVM is handling a @@ -1847,7 +1847,7 @@ static int svm_get_nested_state(struct kvm_vcpu *vcpu, kvm_state.size +=3D KVM_STATE_NESTED_SVM_VMCB_SIZE; kvm_state.flags |=3D KVM_STATE_NESTED_GUEST_MODE; =20 - if (svm->nested.nested_run_pending) + if (vcpu->arch.nested_run_pending) kvm_state.flags |=3D KVM_STATE_NESTED_RUN_PENDING; } =20 @@ -1984,7 +1984,7 @@ static int svm_set_nested_state(struct kvm_vcpu *vcpu, =20 svm_set_gif(svm, !!(kvm_state->flags & KVM_STATE_NESTED_GIF_SET)); =20 - svm->nested.nested_run_pending =3D + vcpu->arch.nested_run_pending =3D !!(kvm_state->flags & KVM_STATE_NESTED_RUN_PENDING); =20 svm->nested.vmcb12_gpa =3D kvm_state->hdr.svm.vmcb_pa; diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index 3407deac90bd..112731515ee3 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -3831,7 +3831,7 @@ static void svm_fixup_nested_rips(struct kvm_vcpu *vc= pu) { struct vcpu_svm *svm =3D to_svm(vcpu); =20 - if (!is_guest_mode(vcpu) || !svm->nested.nested_run_pending) + if (!is_guest_mode(vcpu) || !vcpu->arch.nested_run_pending) return; =20 /* @@ -3979,7 +3979,7 @@ bool svm_nmi_blocked(struct kvm_vcpu *vcpu) static int svm_nmi_allowed(struct kvm_vcpu *vcpu, bool for_injection) { struct vcpu_svm *svm =3D to_svm(vcpu); - if (svm->nested.nested_run_pending) + if (vcpu->arch.nested_run_pending) return -EBUSY; =20 if (svm_nmi_blocked(vcpu)) @@ -4021,7 +4021,7 @@ static int svm_interrupt_allowed(struct kvm_vcpu *vcp= u, bool for_injection) { struct vcpu_svm *svm =3D to_svm(vcpu); =20 - if (svm->nested.nested_run_pending) + if (vcpu->arch.nested_run_pending) return -EBUSY; =20 if (svm_interrupt_blocked(vcpu)) @@ -4244,7 +4244,7 @@ static void svm_complete_soft_interrupt(struct kvm_vc= pu *vcpu, u8 vector, * the soft int and will reinject it via the standard injection flow, * and so KVM needs to grab the state from the pending nested VMRUN. */ - if (is_guest_mode(vcpu) && svm->nested.nested_run_pending) + if (is_guest_mode(vcpu) && vcpu->arch.nested_run_pending) svm_set_nested_run_soft_int_state(vcpu); =20 /* @@ -4547,11 +4547,11 @@ static __no_kcsan fastpath_t svm_vcpu_run(struct kv= m_vcpu *vcpu, u64 run_flags) nested_sync_control_from_vmcb02(svm); =20 /* Track VMRUNs that have made past consistency checking */ - if (svm->nested.nested_run_pending && + if (vcpu->arch.nested_run_pending && !svm_is_vmrun_failure(svm->vmcb->control.exit_code)) ++vcpu->stat.nested_run; =20 - svm->nested.nested_run_pending =3D 0; + vcpu->arch.nested_run_pending =3D 0; } =20 svm->vmcb->control.tlb_ctl =3D TLB_CONTROL_DO_NOTHING; @@ -4920,7 +4920,7 @@ bool svm_smi_blocked(struct kvm_vcpu *vcpu) static int svm_smi_allowed(struct kvm_vcpu *vcpu, bool for_injection) { struct vcpu_svm *svm =3D to_svm(vcpu); - if (svm->nested.nested_run_pending) + if (vcpu->arch.nested_run_pending) return -EBUSY; =20 if (svm_smi_blocked(vcpu)) @@ -5035,7 +5035,7 @@ static int svm_leave_smm(struct kvm_vcpu *vcpu, const= union kvm_smram *smram) if (ret) goto unmap_save; =20 - svm->nested.nested_run_pending =3D 1; + vcpu->arch.nested_run_pending =3D 1; =20 unmap_save: kvm_vcpu_unmap(vcpu, &map_save); diff --git a/arch/x86/kvm/svm/svm.h b/arch/x86/kvm/svm/svm.h index 9909bb7d2d31..1c98419be9d2 100644 --- a/arch/x86/kvm/svm/svm.h +++ b/arch/x86/kvm/svm/svm.h @@ -215,10 +215,6 @@ struct svm_nested_state { */ void *msrpm; =20 - /* A VMRUN has started but has not yet been performed, so - * we cannot inject a nested vmexit yet. */ - bool nested_run_pending; - /* cache for control fields of the guest */ struct vmcb_ctrl_area_cached ctl; =20 diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c index 101588914cbb..65e45cee871c 100644 --- a/arch/x86/kvm/vmx/nested.c +++ b/arch/x86/kvm/vmx/nested.c @@ -2273,7 +2273,7 @@ static void vmx_start_preemption_timer(struct kvm_vcp= u *vcpu, =20 static u64 nested_vmx_calc_efer(struct vcpu_vmx *vmx, struct vmcs12 *vmcs1= 2) { - if (vmx->nested.nested_run_pending && + if (vmx->vcpu.arch.nested_run_pending && (vmcs12->vm_entry_controls & VM_ENTRY_LOAD_IA32_EFER)) return vmcs12->guest_ia32_efer; else if (vmcs12->vm_entry_controls & VM_ENTRY_IA32E_MODE) @@ -2513,7 +2513,7 @@ static void prepare_vmcs02_early(struct vcpu_vmx *vmx= , struct loaded_vmcs *vmcs0 /* * Interrupt/Exception Fields */ - if (vmx->nested.nested_run_pending) { + if (vmx->vcpu.arch.nested_run_pending) { vmcs_write32(VM_ENTRY_INTR_INFO_FIELD, vmcs12->vm_entry_intr_info_field); vmcs_write32(VM_ENTRY_EXCEPTION_ERROR_CODE, @@ -2621,7 +2621,7 @@ static void prepare_vmcs02_rare(struct vcpu_vmx *vmx,= struct vmcs12 *vmcs12) vmcs_write64(GUEST_PDPTR3, vmcs12->guest_pdptr3); } =20 - if (kvm_mpx_supported() && vmx->nested.nested_run_pending && + if (kvm_mpx_supported() && vmx->vcpu.arch.nested_run_pending && (vmcs12->vm_entry_controls & VM_ENTRY_LOAD_BNDCFGS)) vmcs_write64(GUEST_BNDCFGS, vmcs12->guest_bndcfgs); } @@ -2718,7 +2718,7 @@ static int prepare_vmcs02(struct kvm_vcpu *vcpu, stru= ct vmcs12 *vmcs12, !(evmcs->hv_clean_fields & HV_VMX_ENLIGHTENED_CLEAN_FIELD_GUEST_GRP1); } =20 - if (vmx->nested.nested_run_pending && + if (vcpu->arch.nested_run_pending && (vmcs12->vm_entry_controls & VM_ENTRY_LOAD_DEBUG_CONTROLS)) { kvm_set_dr(vcpu, 7, vmcs12->guest_dr7); vmx_guest_debugctl_write(vcpu, vmcs12->guest_ia32_debugctl & @@ -2728,13 +2728,13 @@ static int prepare_vmcs02(struct kvm_vcpu *vcpu, st= ruct vmcs12 *vmcs12, vmx_guest_debugctl_write(vcpu, vmx->nested.pre_vmenter_debugctl); } =20 - if (!vmx->nested.nested_run_pending || + if (!vcpu->arch.nested_run_pending || !(vmcs12->vm_entry_controls & VM_ENTRY_LOAD_CET_STATE)) vmcs_write_cet_state(vcpu, vmx->nested.pre_vmenter_s_cet, vmx->nested.pre_vmenter_ssp, vmx->nested.pre_vmenter_ssp_tbl); =20 - if (kvm_mpx_supported() && (!vmx->nested.nested_run_pending || + if (kvm_mpx_supported() && (!vcpu->arch.nested_run_pending || !(vmcs12->vm_entry_controls & VM_ENTRY_LOAD_BNDCFGS))) vmcs_write64(GUEST_BNDCFGS, vmx->nested.pre_vmenter_bndcfgs); vmx_set_rflags(vcpu, vmcs12->guest_rflags); @@ -2747,7 +2747,7 @@ static int prepare_vmcs02(struct kvm_vcpu *vcpu, stru= ct vmcs12 *vmcs12, vcpu->arch.cr0_guest_owned_bits &=3D ~vmcs12->cr0_guest_host_mask; vmcs_writel(CR0_GUEST_HOST_MASK, ~vcpu->arch.cr0_guest_owned_bits); =20 - if (vmx->nested.nested_run_pending && + if (vcpu->arch.nested_run_pending && (vmcs12->vm_entry_controls & VM_ENTRY_LOAD_IA32_PAT)) { vmcs_write64(GUEST_IA32_PAT, vmcs12->guest_ia32_pat); vcpu->arch.pat =3D vmcs12->guest_ia32_pat; @@ -3349,7 +3349,7 @@ static int nested_vmx_check_guest_state(struct kvm_vc= pu *vcpu, * to bit 8 (LME) if bit 31 in the CR0 field (corresponding to * CR0.PG) is 1. */ - if (to_vmx(vcpu)->nested.nested_run_pending && + if (vcpu->arch.nested_run_pending && (vmcs12->vm_entry_controls & VM_ENTRY_LOAD_IA32_EFER)) { if (CC(!kvm_valid_efer(vcpu, vmcs12->guest_ia32_efer)) || CC(ia32e !=3D !!(vmcs12->guest_ia32_efer & EFER_LMA)) || @@ -3627,15 +3627,15 @@ enum nvmx_vmentry_status nested_vmx_enter_non_root_= mode(struct kvm_vcpu *vcpu, =20 kvm_service_local_tlb_flush_requests(vcpu); =20 - if (!vmx->nested.nested_run_pending || + if (!vcpu->arch.nested_run_pending || !(vmcs12->vm_entry_controls & VM_ENTRY_LOAD_DEBUG_CONTROLS)) vmx->nested.pre_vmenter_debugctl =3D vmx_guest_debugctl_read(); if (kvm_mpx_supported() && - (!vmx->nested.nested_run_pending || + (!vcpu->arch.nested_run_pending || !(vmcs12->vm_entry_controls & VM_ENTRY_LOAD_BNDCFGS))) vmx->nested.pre_vmenter_bndcfgs =3D vmcs_read64(GUEST_BNDCFGS); =20 - if (!vmx->nested.nested_run_pending || + if (!vcpu->arch.nested_run_pending || !(vmcs12->vm_entry_controls & VM_ENTRY_LOAD_CET_STATE)) vmcs_read_cet_state(vcpu, &vmx->nested.pre_vmenter_s_cet, &vmx->nested.pre_vmenter_ssp, @@ -3844,7 +3844,7 @@ static int nested_vmx_run(struct kvm_vcpu *vcpu, bool= launch) * We're finally done with prerequisite checking, and can start with * the nested entry. */ - vmx->nested.nested_run_pending =3D 1; + vcpu->arch.nested_run_pending =3D 1; vmx->nested.has_preemption_timer_deadline =3D false; status =3D nested_vmx_enter_non_root_mode(vcpu, true); if (unlikely(status !=3D NVMX_VMENTRY_SUCCESS)) @@ -3876,12 +3876,12 @@ static int nested_vmx_run(struct kvm_vcpu *vcpu, bo= ol launch) !nested_cpu_has(vmcs12, CPU_BASED_NMI_WINDOW_EXITING) && !(nested_cpu_has(vmcs12, CPU_BASED_INTR_WINDOW_EXITING) && (vmcs12->guest_rflags & X86_EFLAGS_IF))) { - vmx->nested.nested_run_pending =3D 0; + vcpu->arch.nested_run_pending =3D 0; return kvm_emulate_halt_noskip(vcpu); } break; case GUEST_ACTIVITY_WAIT_SIPI: - vmx->nested.nested_run_pending =3D 0; + vcpu->arch.nested_run_pending =3D 0; kvm_set_mp_state(vcpu, KVM_MP_STATE_INIT_RECEIVED); break; default: @@ -3891,7 +3891,7 @@ static int nested_vmx_run(struct kvm_vcpu *vcpu, bool= launch) return 1; =20 vmentry_failed: - vmx->nested.nested_run_pending =3D 0; + vcpu->arch.nested_run_pending =3D 0; if (status =3D=3D NVMX_VMENTRY_KVM_INTERNAL_ERROR) return 0; if (status =3D=3D NVMX_VMENTRY_VMEXIT) @@ -4288,7 +4288,7 @@ static int vmx_check_nested_events(struct kvm_vcpu *v= cpu) * previously injected event, the pending exception occurred while said * event was being delivered and thus needs to be handled. */ - bool block_nested_exceptions =3D vmx->nested.nested_run_pending; + bool block_nested_exceptions =3D vcpu->arch.nested_run_pending; /* * Events that don't require injection, i.e. that are virtualized by * hardware, aren't blocked by a pending VM-Enter as KVM doesn't need @@ -4657,7 +4657,7 @@ static void sync_vmcs02_to_vmcs12(struct kvm_vcpu *vc= pu, struct vmcs12 *vmcs12) =20 if (nested_cpu_has_preemption_timer(vmcs12) && vmcs12->vm_exit_controls & VM_EXIT_SAVE_VMX_PREEMPTION_TIMER && - !vmx->nested.nested_run_pending) + !vcpu->arch.nested_run_pending) vmcs12->vmx_preemption_timer_value =3D vmx_get_preemption_timer_value(vcpu); =20 @@ -5056,7 +5056,7 @@ void __nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 v= m_exit_reason, vmx->nested.mtf_pending =3D false; =20 /* trying to cancel vmlaunch/vmresume is a bug */ - WARN_ON_ONCE(vmx->nested.nested_run_pending); + WARN_ON_ONCE(vcpu->arch.nested_run_pending); =20 #ifdef CONFIG_KVM_HYPERV if (kvm_check_request(KVM_REQ_GET_NESTED_STATE_PAGES, vcpu)) { @@ -6679,7 +6679,7 @@ bool nested_vmx_reflect_vmexit(struct kvm_vcpu *vcpu) unsigned long exit_qual; u32 exit_intr_info; =20 - WARN_ON_ONCE(vmx->nested.nested_run_pending); + WARN_ON_ONCE(vcpu->arch.nested_run_pending); =20 /* * Late nested VM-Fail shares the same flow as nested VM-Exit since KVM @@ -6775,7 +6775,7 @@ static int vmx_get_nested_state(struct kvm_vcpu *vcpu, if (is_guest_mode(vcpu)) { kvm_state.flags |=3D KVM_STATE_NESTED_GUEST_MODE; =20 - if (vmx->nested.nested_run_pending) + if (vcpu->arch.nested_run_pending) kvm_state.flags |=3D KVM_STATE_NESTED_RUN_PENDING; =20 if (vmx->nested.mtf_pending) @@ -6850,7 +6850,7 @@ static int vmx_get_nested_state(struct kvm_vcpu *vcpu, void vmx_leave_nested(struct kvm_vcpu *vcpu) { if (is_guest_mode(vcpu)) { - to_vmx(vcpu)->nested.nested_run_pending =3D 0; + vcpu->arch.nested_run_pending =3D 0; nested_vmx_vmexit(vcpu, -1, 0, 0); } free_nested(vcpu); @@ -6987,7 +6987,7 @@ static int vmx_set_nested_state(struct kvm_vcpu *vcpu, if (!(kvm_state->flags & KVM_STATE_NESTED_GUEST_MODE)) return 0; =20 - vmx->nested.nested_run_pending =3D + vcpu->arch.nested_run_pending =3D !!(kvm_state->flags & KVM_STATE_NESTED_RUN_PENDING); =20 vmx->nested.mtf_pending =3D @@ -7039,7 +7039,7 @@ static int vmx_set_nested_state(struct kvm_vcpu *vcpu, return 0; =20 error_guest_mode: - vmx->nested.nested_run_pending =3D 0; + vcpu->arch.nested_run_pending =3D 0; return ret; } =20 diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index 9302c16571cd..0e7e0a17bb75 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -5170,7 +5170,7 @@ bool vmx_nmi_blocked(struct kvm_vcpu *vcpu) =20 int vmx_nmi_allowed(struct kvm_vcpu *vcpu, bool for_injection) { - if (to_vmx(vcpu)->nested.nested_run_pending) + if (vcpu->arch.nested_run_pending) return -EBUSY; =20 /* An NMI must not be injected into L2 if it's supposed to VM-Exit. */ @@ -5197,7 +5197,7 @@ bool vmx_interrupt_blocked(struct kvm_vcpu *vcpu) =20 int vmx_interrupt_allowed(struct kvm_vcpu *vcpu, bool for_injection) { - if (to_vmx(vcpu)->nested.nested_run_pending) + if (vcpu->arch.nested_run_pending) return -EBUSY; =20 /* @@ -6009,7 +6009,7 @@ static bool vmx_unhandleable_emulation_required(struc= t kvm_vcpu *vcpu) * only reachable if userspace modifies L2 guest state after KVM has * performed the nested VM-Enter consistency checks. */ - if (vmx->nested.nested_run_pending) + if (vcpu->arch.nested_run_pending) return true; =20 /* @@ -6693,7 +6693,7 @@ static int __vmx_handle_exit(struct kvm_vcpu *vcpu, f= astpath_t exit_fastpath) * invalid guest state should never happen as that means KVM knowingly * allowed a nested VM-Enter with an invalid vmcs12. More below. */ - if (KVM_BUG_ON(vmx->nested.nested_run_pending, vcpu->kvm)) + if (KVM_BUG_ON(vcpu->arch.nested_run_pending, vcpu->kvm)) return -EIO; =20 if (is_guest_mode(vcpu)) { @@ -7621,11 +7621,11 @@ fastpath_t vmx_vcpu_run(struct kvm_vcpu *vcpu, u64 = run_flags) * Track VMLAUNCH/VMRESUME that have made past guest state * checking. */ - if (vmx->nested.nested_run_pending && + if (vcpu->arch.nested_run_pending && !vmx_get_exit_reason(vcpu).failed_vmentry) ++vcpu->stat.nested_run; =20 - vmx->nested.nested_run_pending =3D 0; + vcpu->arch.nested_run_pending =3D 0; } =20 if (unlikely(vmx->fail)) @@ -8382,7 +8382,7 @@ void vmx_setup_mce(struct kvm_vcpu *vcpu) int vmx_smi_allowed(struct kvm_vcpu *vcpu, bool for_injection) { /* we need a nested vmexit to enter SMM, postpone if run is pending */ - if (to_vmx(vcpu)->nested.nested_run_pending) + if (vcpu->arch.nested_run_pending) return -EBUSY; return !is_smm(vcpu); } @@ -8423,7 +8423,7 @@ int vmx_leave_smm(struct kvm_vcpu *vcpu, const union = kvm_smram *smram) if (ret) return ret; =20 - vmx->nested.nested_run_pending =3D 1; + vcpu->arch.nested_run_pending =3D 1; vmx->nested.smm.guest_mode =3D false; } return 0; diff --git a/arch/x86/kvm/vmx/vmx.h b/arch/x86/kvm/vmx/vmx.h index 70bfe81dea54..db84e8001da5 100644 --- a/arch/x86/kvm/vmx/vmx.h +++ b/arch/x86/kvm/vmx/vmx.h @@ -138,9 +138,6 @@ struct nested_vmx { */ bool enlightened_vmcs_enabled; =20 - /* L2 must run next, and mustn't decide to exit to L1. */ - bool nested_run_pending; - /* Pending MTF VM-exit into L1. */ bool mtf_pending; =20 --=20 2.53.0.473.g4a7958ca14-goog From nobody Wed Apr 8 03:07:42 2026 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0611E3C140C for ; Tue, 10 Mar 2026 22:45:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773182756; cv=none; b=aDYvuHYkYc99dE0jjfPPODoi/tAA2rqMxgQsdakfWS+SGoOBEQflyd6auyBxEFdmuGW43t1zslB8uPWrFms/i/lP2zTusS9BlJt4a9PpmgtVU3swWm2bsAfwT9hniqnFgqajuRAEXwHZzRGKSHJRXDbSdlK7efGR6zczp1JMU3w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773182756; c=relaxed/simple; bh=FZWkyRtDd5sYp24vsvD+gZbVOVt0EAV2B3Zfqrqy1QI=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Ry/Jk6AKxdn94cKEYJ3M3lIJW4NhdNNu6GKUk0IFbK6pBxgoWW36Ps9f3sXw5ekrqcBMrcuzgtRAniZkLa995/HE5vYUqFrTJLf5NJ8sAv8sjczFbD/qGCVg8alkj3/DcUktOY4687HF5n8B1eOWCzJ2flHYQaTEK5FmKMHDYz8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=oKsB0MKT; arc=none smtp.client-ip=209.85.214.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="oKsB0MKT" Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-2ae57228f64so98569925ad.0 for ; Tue, 10 Mar 2026 15:45:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1773182753; x=1773787553; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=hvcwGyyqhhK+9ujMD1DpAI6luR3guQH7bK6OSfrMLVU=; b=oKsB0MKTMYAaEsfXUJRY59/k2J7dBzZW5a7uyLiqZftSm1n2/FDnoClcTt9Qpb4smQ SkAxwVrMrVy+JO+ewopSvvmMTTLt4DWbu/TpalHGtKQgOt0+Ym71U1MLQBEDABmyYpPx 7+nxu59KpjlP+RJo5WCKNTxXwNvmViSvLibjJn2vECICmALJb2FUl5EFg3PR4TTt4Rix Hy3ian7fkbUPXQnmzWXV45+3dHeJSDa42r79KZ+oz+1Xz671bws3FB/el+8BRGskxWsz y+8I6Y5QY8bO763UsXVtdz+aQw3l3Sf1k31URK9K0ihuXo8TdZDnWmOJ6HIN9rGz1dQx bdyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773182753; x=1773787553; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hvcwGyyqhhK+9ujMD1DpAI6luR3guQH7bK6OSfrMLVU=; b=xPRlKvnoLV+AMnoT0UI7uHCLkwcizrE+TVmBBxre1cu4yPF2YSF/LtfMtsiqQApL7q K/xiOH2r7mwWzth1oQD99IRgcUmcF+OGUI733vRlXinZEyXy7lrziChtDaMhOYe3wOvJ qm25kM9xAsN8BJmXr2p1aGOVvLc0GDvRe/plRyiaFBOR5NsB/hdC5ROyedt+q1baJgDb sS4aNm6FDYMCNStPH8kiMjh0waJgVdfTaHBAIeJGAwuOBygSWRmieWUhQK95CZlTpw0D 7WUZZiuyRD2tv2IBKWqc7V6ngGo25aPBt6Dqua4cerpB4jO8pnQiG05UQNM4IoaZZjyl sUoA== X-Forwarded-Encrypted: i=1; AJvYcCUpLA+zU4ViKK2Ne8MnZ4KmQ/yKvH0Zb4ZjkV4jbjguBv6soxt3zzCfhJlkZYX3keK0R3yd5+wEBQj5A84=@vger.kernel.org X-Gm-Message-State: AOJu0Yy67zH2WoCp2CsiVXfm+PBICz3+ql6qZKUoY6Muq5Z9PYj77ZKe 7+WrpQN7dkywL9dRTM2BKp8iiIZWa8+vyaG6zkVRDSaNwPZoRXVSEvV2UVrtF0GVmY+Z6EEAhfT NCQui+A== X-Received: from pgbdp14.prod.google.com ([2002:a05:6a02:f0e:b0:c73:84bb:9d81]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:e888:b0:2ae:467f:11d8 with SMTP id d9443c01a7336-2aeae891e96mr3395745ad.30.1773182753192; Tue, 10 Mar 2026 15:45:53 -0700 (PDT) Reply-To: Sean Christopherson Date: Tue, 10 Mar 2026 15:45:46 -0700 In-Reply-To: <20260310224546.2582118-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260310224546.2582118-1-seanjc@google.com> X-Mailer: git-send-email 2.53.0.473.g4a7958ca14-goog Message-ID: <20260310224546.2582118-3-seanjc@google.com> Subject: [PATCH 2/2] KVM: x86: Suppress WARNs on nested_run_pending after userspace exit From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Yosry Ahmed Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" To end an ongoing game of whack-a-mole between KVM and syzkaller, WARN on illegally cancelling a pending nested VM-Enter if and only if userspace has NOT gained control of the vCPU since the nested run was initiated. As proven time and time again by syzkaller, userspace can clobber vCPU state so as to force a VM-Exit that violates KVM's architectural modelling of VMRUN/VMLAUNCH/VMRESUME. To detect that userspace has gained control, while minimizing the risk of operating on stale data, convert nested_run_pending from a pure boolean to a tri-state of sorts, where '0' is still "not pending", '1' is "pending", and '2' is "pending but untrusted". Then on KVM_RUN, if the flag is in the "trusted pending" state, move it to "untrusted pending". Signed-off-by: Sean Christopherson Reviewed-by: Yosry Ahmed --- arch/x86/include/asm/kvm_host.h | 8 +++++++- arch/x86/kvm/svm/nested.c | 11 +++++++---- arch/x86/kvm/svm/svm.c | 2 +- arch/x86/kvm/vmx/nested.c | 12 +++++++----- arch/x86/kvm/vmx/vmx.c | 2 +- arch/x86/kvm/x86.c | 7 +++++++ arch/x86/kvm/x86.h | 10 ++++++++++ 7 files changed, 40 insertions(+), 12 deletions(-) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_hos= t.h index a1bf0aaedad8..acec03d7bb1e 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -1105,8 +1105,14 @@ struct kvm_vcpu_arch { * can only occur at instruction boundaries. The only exception is * VMX's "notify" exits, which exist in large part to break the CPU out * of infinite ucode loops, but can corrupt vCPU state in the process! + * + * For all intents and purposes, this is a boolean, but it's tracked as + * a u8 so that KVM can detect when userspace may have stuffed vCPU + * state and generated an architecturally-impossible VM-Exit. */ - bool nested_run_pending; +#define KVM_NESTED_RUN_PENDING 1 +#define KVM_NESTED_RUN_PENDING_UNTRUSTED 2 + u8 nested_run_pending; =20 #if IS_ENABLED(CONFIG_HYPERV) hpa_t hv_root_tdp; diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c index 782d6a34d173..af741823c08c 100644 --- a/arch/x86/kvm/svm/nested.c +++ b/arch/x86/kvm/svm/nested.c @@ -1131,7 +1131,7 @@ int nested_svm_vmrun(struct kvm_vcpu *vcpu) if (!npt_enabled) vmcb01->save.cr3 =3D kvm_read_cr3(vcpu); =20 - vcpu->arch.nested_run_pending =3D 1; + vcpu->arch.nested_run_pending =3D KVM_NESTED_RUN_PENDING; =20 if (enter_svm_guest_mode(vcpu, vmcb12_gpa, true) || !nested_svm_merge_msrpm(vcpu)) { @@ -1277,7 +1277,8 @@ void nested_svm_vmexit(struct vcpu_svm *svm) /* Exit Guest-Mode */ leave_guest_mode(vcpu); svm->nested.vmcb12_gpa =3D 0; - WARN_ON_ONCE(vcpu->arch.nested_run_pending); + + kvm_warn_on_nested_run_pending(vcpu); =20 kvm_clear_request(KVM_REQ_GET_NESTED_STATE_PAGES, vcpu); =20 @@ -1984,8 +1985,10 @@ static int svm_set_nested_state(struct kvm_vcpu *vcp= u, =20 svm_set_gif(svm, !!(kvm_state->flags & KVM_STATE_NESTED_GIF_SET)); =20 - vcpu->arch.nested_run_pending =3D - !!(kvm_state->flags & KVM_STATE_NESTED_RUN_PENDING); + if (kvm_state->flags & KVM_STATE_NESTED_RUN_PENDING) + vcpu->arch.nested_run_pending =3D KVM_NESTED_RUN_PENDING_UNTRUSTED; + else + vcpu->arch.nested_run_pending =3D 0; =20 svm->nested.vmcb12_gpa =3D kvm_state->hdr.svm.vmcb_pa; =20 diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index 112731515ee3..7de2c6621b98 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -5035,7 +5035,7 @@ static int svm_leave_smm(struct kvm_vcpu *vcpu, const= union kvm_smram *smram) if (ret) goto unmap_save; =20 - vcpu->arch.nested_run_pending =3D 1; + vcpu->arch.nested_run_pending =3D KVM_NESTED_RUN_PENDING; =20 unmap_save: kvm_vcpu_unmap(vcpu, &map_save); diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c index 65e45cee871c..6a107025e7e2 100644 --- a/arch/x86/kvm/vmx/nested.c +++ b/arch/x86/kvm/vmx/nested.c @@ -3844,7 +3844,7 @@ static int nested_vmx_run(struct kvm_vcpu *vcpu, bool= launch) * We're finally done with prerequisite checking, and can start with * the nested entry. */ - vcpu->arch.nested_run_pending =3D 1; + vcpu->arch.nested_run_pending =3D KVM_NESTED_RUN_PENDING; vmx->nested.has_preemption_timer_deadline =3D false; status =3D nested_vmx_enter_non_root_mode(vcpu, true); if (unlikely(status !=3D NVMX_VMENTRY_SUCCESS)) @@ -5056,7 +5056,7 @@ void __nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 v= m_exit_reason, vmx->nested.mtf_pending =3D false; =20 /* trying to cancel vmlaunch/vmresume is a bug */ - WARN_ON_ONCE(vcpu->arch.nested_run_pending); + kvm_warn_on_nested_run_pending(vcpu); =20 #ifdef CONFIG_KVM_HYPERV if (kvm_check_request(KVM_REQ_GET_NESTED_STATE_PAGES, vcpu)) { @@ -6679,7 +6679,7 @@ bool nested_vmx_reflect_vmexit(struct kvm_vcpu *vcpu) unsigned long exit_qual; u32 exit_intr_info; =20 - WARN_ON_ONCE(vcpu->arch.nested_run_pending); + kvm_warn_on_nested_run_pending(vcpu); =20 /* * Late nested VM-Fail shares the same flow as nested VM-Exit since KVM @@ -6987,8 +6987,10 @@ static int vmx_set_nested_state(struct kvm_vcpu *vcp= u, if (!(kvm_state->flags & KVM_STATE_NESTED_GUEST_MODE)) return 0; =20 - vcpu->arch.nested_run_pending =3D - !!(kvm_state->flags & KVM_STATE_NESTED_RUN_PENDING); + if (kvm_state->flags & KVM_STATE_NESTED_RUN_PENDING) + vcpu->arch.nested_run_pending =3D KVM_NESTED_RUN_PENDING_UNTRUSTED; + else + vcpu->arch.nested_run_pending =3D 0; =20 vmx->nested.mtf_pending =3D !!(kvm_state->flags & KVM_STATE_NESTED_MTF_PENDING); diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index 0e7e0a17bb75..dbe0f234aefb 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -8423,7 +8423,7 @@ int vmx_leave_smm(struct kvm_vcpu *vcpu, const union = kvm_smram *smram) if (ret) return ret; =20 - vcpu->arch.nested_run_pending =3D 1; + vcpu->arch.nested_run_pending =3D KVM_NESTED_RUN_PENDING; vmx->nested.smm.guest_mode =3D false; } return 0; diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 879cdeb6adde..cad16c83dcff 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -12090,6 +12090,13 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu) if (r <=3D 0) goto out; =20 + /* + * If userspace may have modified vCPU state, mark nested_run_pending + * as "untrusted" to avoid triggering false-positive WARNs. + */ + if (vcpu->arch.nested_run_pending =3D=3D KVM_NESTED_RUN_PENDING) + vcpu->arch.nested_run_pending =3D KVM_NESTED_RUN_PENDING_UNTRUSTED; + r =3D vcpu_run(vcpu); =20 out: diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h index 44a28d343d40..38a905fa86de 100644 --- a/arch/x86/kvm/x86.h +++ b/arch/x86/kvm/x86.h @@ -188,6 +188,16 @@ static inline bool kvm_can_set_cpuid_and_feature_msrs(= struct kvm_vcpu *vcpu) return vcpu->arch.last_vmentry_cpu =3D=3D -1 && !is_guest_mode(vcpu); } =20 +/* + * WARN if a nested VM-Enter is pending completion, and userspace hasn't g= ained + * control since the nested VM-Enter was initiated (in which case, userspa= ce + * may have modified vCPU state to induce an architecturally invalid VM-Ex= it). + */ +static inline void kvm_warn_on_nested_run_pending(struct kvm_vcpu *vcpu) +{ + WARN_ON_ONCE(vcpu->arch.nested_run_pending =3D=3D KVM_NESTED_RUN_PENDING); +} + static inline void kvm_set_mp_state(struct kvm_vcpu *vcpu, int mp_state) { vcpu->arch.mp_state =3D mp_state; --=20 2.53.0.473.g4a7958ca14-goog