All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: SVM: remove unnecessary check on INIT intercept
@ 2022-08-19 16:56 Paolo Bonzini
  2022-08-21  8:27 ` Maxim Levitsky
  2022-08-30 21:46 ` Sean Christopherson
  0 siblings, 2 replies; 3+ messages in thread
From: Paolo Bonzini @ 2022-08-19 16:56 UTC (permalink / raw)
  To: linux-kernel, kvm; +Cc: Maxim Levitsky

Since svm_check_nested_events() is now handling INIT signals, there is
no need to latch it until the VMEXIT is injected.  The only condition
under which INIT signals are latched is GIF=0.

Suggested-by: Maxim Levitsky <mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 arch/x86/kvm/svm/svm.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index f3813dbacb9f..26a348389ece 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -4697,15 +4697,7 @@ static bool svm_apic_init_signal_blocked(struct kvm_vcpu *vcpu)
 {
 	struct vcpu_svm *svm = to_svm(vcpu);
 
-	/*
-	 * TODO: Last condition latch INIT signals on vCPU when
-	 * vCPU is in guest-mode and vmcb12 defines intercept on INIT.
-	 * To properly emulate the INIT intercept,
-	 * svm_check_nested_events() should call nested_svm_vmexit()
-	 * if an INIT signal is pending.
-	 */
-	return !gif_set(svm) ||
-		   (vmcb_is_intercept(&svm->vmcb->control, INTERCEPT_INIT));
+	return !gif_set(svm);
 }
 
 static void svm_vcpu_deliver_sipi_vector(struct kvm_vcpu *vcpu, u8 vector)
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: SVM: remove unnecessary check on INIT intercept
  2022-08-19 16:56 [PATCH] KVM: SVM: remove unnecessary check on INIT intercept Paolo Bonzini
@ 2022-08-21  8:27 ` Maxim Levitsky
  2022-08-30 21:46 ` Sean Christopherson
  1 sibling, 0 replies; 3+ messages in thread
From: Maxim Levitsky @ 2022-08-21  8:27 UTC (permalink / raw)
  To: Paolo Bonzini, linux-kernel, kvm

On Fri, 2022-08-19 at 12:56 -0400, Paolo Bonzini wrote:
> Since svm_check_nested_events() is now handling INIT signals, there is
> no need to latch it until the VMEXIT is injected.  The only condition
> under which INIT signals are latched is GIF=0.
> 
> Suggested-by: Maxim Levitsky <mlevitsk@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  arch/x86/kvm/svm/svm.c | 10 +---------
>  1 file changed, 1 insertion(+), 9 deletions(-)
> 
> diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
> index f3813dbacb9f..26a348389ece 100644
> --- a/arch/x86/kvm/svm/svm.c
> +++ b/arch/x86/kvm/svm/svm.c
> @@ -4697,15 +4697,7 @@ static bool svm_apic_init_signal_blocked(struct kvm_vcpu *vcpu)
>  {
>         struct vcpu_svm *svm = to_svm(vcpu);
>  
> -       /*
> -        * TODO: Last condition latch INIT signals on vCPU when
> -        * vCPU is in guest-mode and vmcb12 defines intercept on INIT.
> -        * To properly emulate the INIT intercept,
> -        * svm_check_nested_events() should call nested_svm_vmexit()
> -        * if an INIT signal is pending.
> -        */
> -       return !gif_set(svm) ||
> -                  (vmcb_is_intercept(&svm->vmcb->control, INTERCEPT_INIT));
> +       return !gif_set(svm);
>  }
>  
>  static void svm_vcpu_deliver_sipi_vector(struct kvm_vcpu *vcpu, u8 vector)

Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>

Best regards,
	Maxim Levitsky


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: SVM: remove unnecessary check on INIT intercept
  2022-08-19 16:56 [PATCH] KVM: SVM: remove unnecessary check on INIT intercept Paolo Bonzini
  2022-08-21  8:27 ` Maxim Levitsky
@ 2022-08-30 21:46 ` Sean Christopherson
  1 sibling, 0 replies; 3+ messages in thread
From: Sean Christopherson @ 2022-08-30 21:46 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: linux-kernel, kvm, Maxim Levitsky

On Fri, Aug 19, 2022, Paolo Bonzini wrote:
> Since svm_check_nested_events() is now handling INIT signals, there is
> no need to latch it until the VMEXIT is injected.  The only condition
> under which INIT signals are latched is GIF=0.
> 
> Suggested-by: Maxim Levitsky <mlevitsk@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---

Pushed to branch `for_paolo/6.1` at:

    https://github.com/sean-jc/linux.git

Unless you hear otherwise, it will make its way to kvm/queue "soon", thus completing
the circle.

Note, the commit IDs are not guaranteed to be stable.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-30 21:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-19 16:56 [PATCH] KVM: SVM: remove unnecessary check on INIT intercept Paolo Bonzini
2022-08-21  8:27 ` Maxim Levitsky
2022-08-30 21:46 ` Sean Christopherson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.