linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: nVMX: remove unnecessary vmwrite from L2->L1 vmexit
@ 2018-01-01 22:58 Paolo Bonzini
  2018-01-02  0:45 ` Jim Mattson
  2018-01-02  9:47 ` Liran Alon
  0 siblings, 2 replies; 4+ messages in thread
From: Paolo Bonzini @ 2018-01-01 22:58 UTC (permalink / raw)
  To: linux-kernel, kvm; +Cc: jmattson

The POSTED_INTR_NV field is constant (though it differs between the vmcs01 and
vmcs02), there is no need to reload it on vmexit to L1.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 arch/x86/kvm/vmx.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index e6223fe8faa1..1e184830a295 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -11610,9 +11610,6 @@ static void load_vmcs12_host_state(struct kvm_vcpu *vcpu,
 		 */
 		vmx_flush_tlb(vcpu, true);
 	}
-	/* Restore posted intr vector. */
-	if (nested_cpu_has_posted_intr(vmcs12))
-		vmcs_write16(POSTED_INTR_NV, POSTED_INTR_VECTOR);
 
 	vmcs_write32(GUEST_SYSENTER_CS, vmcs12->host_ia32_sysenter_cs);
 	vmcs_writel(GUEST_SYSENTER_ESP, vmcs12->host_ia32_sysenter_esp);
-- 
1.8.3.1

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

* Re: [PATCH] KVM: nVMX: remove unnecessary vmwrite from L2->L1 vmexit
  2018-01-01 22:58 [PATCH] KVM: nVMX: remove unnecessary vmwrite from L2->L1 vmexit Paolo Bonzini
@ 2018-01-02  0:45 ` Jim Mattson
  2018-01-02  9:47 ` Liran Alon
  1 sibling, 0 replies; 4+ messages in thread
From: Jim Mattson @ 2018-01-02  0:45 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: LKML, kvm list

Reviewed-by: Jim Mattson <jmattson@google.com>

On Mon, Jan 1, 2018 at 2:58 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> The POSTED_INTR_NV field is constant (though it differs between the vmcs01 and
> vmcs02), there is no need to reload it on vmexit to L1.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  arch/x86/kvm/vmx.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index e6223fe8faa1..1e184830a295 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -11610,9 +11610,6 @@ static void load_vmcs12_host_state(struct kvm_vcpu *vcpu,
>                  */
>                 vmx_flush_tlb(vcpu, true);
>         }
> -       /* Restore posted intr vector. */
> -       if (nested_cpu_has_posted_intr(vmcs12))
> -               vmcs_write16(POSTED_INTR_NV, POSTED_INTR_VECTOR);
>
>         vmcs_write32(GUEST_SYSENTER_CS, vmcs12->host_ia32_sysenter_cs);
>         vmcs_writel(GUEST_SYSENTER_ESP, vmcs12->host_ia32_sysenter_esp);
> --
> 1.8.3.1
>

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

* Re: [PATCH] KVM: nVMX: remove unnecessary vmwrite from L2->L1 vmexit
  2018-01-01 22:58 [PATCH] KVM: nVMX: remove unnecessary vmwrite from L2->L1 vmexit Paolo Bonzini
  2018-01-02  0:45 ` Jim Mattson
@ 2018-01-02  9:47 ` Liran Alon
  2018-01-03  6:32   ` Quan Xu
  1 sibling, 1 reply; 4+ messages in thread
From: Liran Alon @ 2018-01-02  9:47 UTC (permalink / raw)
  To: Paolo Bonzini, linux-kernel, kvm; +Cc: jmattson



On 02/01/18 00:58, Paolo Bonzini wrote:
> The POSTED_INTR_NV field is constant (though it differs between the vmcs01 and
> vmcs02), there is no need to reload it on vmexit to L1.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   arch/x86/kvm/vmx.c | 3 ---
>   1 file changed, 3 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index e6223fe8faa1..1e184830a295 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -11610,9 +11610,6 @@ static void load_vmcs12_host_state(struct kvm_vcpu *vcpu,
>   		 */
>   		vmx_flush_tlb(vcpu, true);
>   	}
> -	/* Restore posted intr vector. */
> -	if (nested_cpu_has_posted_intr(vmcs12))
> -		vmcs_write16(POSTED_INTR_NV, POSTED_INTR_VECTOR);
>
>   	vmcs_write32(GUEST_SYSENTER_CS, vmcs12->host_ia32_sysenter_cs);
>   	vmcs_writel(GUEST_SYSENTER_ESP, vmcs12->host_ia32_sysenter_esp);
>

Reviewed-by: Liran Alon <liran.alon@oracle.com>

I would also add to commit message:
Fixes: 06a5524f091b ("KVM: nVMX: Fix posted intr delivery when vcpu is 
in guest mode")

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

* Re: [PATCH] KVM: nVMX: remove unnecessary vmwrite from L2->L1 vmexit
  2018-01-02  9:47 ` Liran Alon
@ 2018-01-03  6:32   ` Quan Xu
  0 siblings, 0 replies; 4+ messages in thread
From: Quan Xu @ 2018-01-03  6:32 UTC (permalink / raw)
  To: Liran Alon, Paolo Bonzini, linux-kernel, kvm; +Cc: jmattson



On 2018/01/02 17:47, Liran Alon wrote:
>
>
> On 02/01/18 00:58, Paolo Bonzini wrote:
>> The POSTED_INTR_NV field is constant (though it differs between the 
>> vmcs01 and
>> vmcs02), there is no need to reload it on vmexit to L1.
>>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> ---
>>   arch/x86/kvm/vmx.c | 3 ---
>>   1 file changed, 3 deletions(-)
>>
>> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
>> index e6223fe8faa1..1e184830a295 100644
>> --- a/arch/x86/kvm/vmx.c
>> +++ b/arch/x86/kvm/vmx.c
>> @@ -11610,9 +11610,6 @@ static void load_vmcs12_host_state(struct 
>> kvm_vcpu *vcpu,
>>            */
>>           vmx_flush_tlb(vcpu, true);
>>       }
>> -    /* Restore posted intr vector. */
>> -    if (nested_cpu_has_posted_intr(vmcs12))
>> -        vmcs_write16(POSTED_INTR_NV, POSTED_INTR_VECTOR);
>>
>>       vmcs_write32(GUEST_SYSENTER_CS, vmcs12->host_ia32_sysenter_cs);
>>       vmcs_writel(GUEST_SYSENTER_ESP, vmcs12->host_ia32_sysenter_esp);
>>
>
> Reviewed-by: Liran Alon <liran.alon@oracle.com>
>
> I would also add to commit message:
> Fixes: 06a5524f091b ("KVM: nVMX: Fix posted intr delivery when vcpu is 
> in guest mode")
>
Reviewed-by: Quan Xu <quan.xu0@gmail.com>

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

end of thread, other threads:[~2018-01-03  6:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-01 22:58 [PATCH] KVM: nVMX: remove unnecessary vmwrite from L2->L1 vmexit Paolo Bonzini
2018-01-02  0:45 ` Jim Mattson
2018-01-02  9:47 ` Liran Alon
2018-01-03  6:32   ` Quan Xu

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).