kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: nVMX: don't clear mtf_pending when nested events are blocked
@ 2020-04-06 20:12 Oliver Upton
  2020-04-07  8:21 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver Upton @ 2020-04-06 20:12 UTC (permalink / raw)
  To: kvm; +Cc: Paolo Bonzini, Oliver Upton

If nested events are blocked, don't clear the mtf_pending flag to avoid
missing later delivery of the MTF VM-exit.

Fixes: 5ef8acbdd687c ("KVM: nVMX: Emulate MTF when performing instruction emulation")
Signed-off-by: Oliver Upton <oupton@google.com>
---
 arch/x86/kvm/vmx/nested.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
index de232306561a0..cbc9ea2de28f9 100644
--- a/arch/x86/kvm/vmx/nested.c
+++ b/arch/x86/kvm/vmx/nested.c
@@ -3645,7 +3645,8 @@ static int vmx_check_nested_events(struct kvm_vcpu *vcpu)
 	 * Clear the MTF state. If a higher priority VM-exit is delivered first,
 	 * this state is discarded.
 	 */
-	vmx->nested.mtf_pending = false;
+	if (!block_nested_events)
+		vmx->nested.mtf_pending = false;
 
 	if (lapic_in_kernel(vcpu) &&
 		test_bit(KVM_APIC_INIT, &apic->pending_events)) {
-- 
2.26.0.292.g33ef6b2f38-goog


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

* Re: [PATCH] KVM: nVMX: don't clear mtf_pending when nested events are blocked
  2020-04-06 20:12 [PATCH] KVM: nVMX: don't clear mtf_pending when nested events are blocked Oliver Upton
@ 2020-04-07  8:21 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2020-04-07  8:21 UTC (permalink / raw)
  To: Oliver Upton, kvm

On 06/04/20 22:12, Oliver Upton wrote:
> If nested events are blocked, don't clear the mtf_pending flag to avoid
> missing later delivery of the MTF VM-exit.
> 
> Fixes: 5ef8acbdd687c ("KVM: nVMX: Emulate MTF when performing instruction emulation")
> Signed-off-by: Oliver Upton <oupton@google.com>
> ---
>  arch/x86/kvm/vmx/nested.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
> index de232306561a0..cbc9ea2de28f9 100644
> --- a/arch/x86/kvm/vmx/nested.c
> +++ b/arch/x86/kvm/vmx/nested.c
> @@ -3645,7 +3645,8 @@ static int vmx_check_nested_events(struct kvm_vcpu *vcpu)
>  	 * Clear the MTF state. If a higher priority VM-exit is delivered first,
>  	 * this state is discarded.
>  	 */
> -	vmx->nested.mtf_pending = false;
> +	if (!block_nested_events)
> +		vmx->nested.mtf_pending = false;
>  
>  	if (lapic_in_kernel(vcpu) &&
>  		test_bit(KVM_APIC_INIT, &apic->pending_events)) {
> 

Queued, thanks.

Paolo


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

end of thread, other threads:[~2020-04-07  8:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-06 20:12 [PATCH] KVM: nVMX: don't clear mtf_pending when nested events are blocked Oliver Upton
2020-04-07  8:21 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).