diff mbox series

KVM: nVMX: Consolidate nested MTF checks to helper function

Message ID 20200224202744.221487-1-oupton@google.com (mailing list archive)
State New, archived
Headers show
Series KVM: nVMX: Consolidate nested MTF checks to helper function | expand

Commit Message

Oliver Upton Feb. 24, 2020, 8:27 p.m. UTC
commit 5ef8acbdd687 ("KVM: nVMX: Emulate MTF when performing
instruction emulation") introduced a helper to check the MTF
VM-execution control in vmcs12. Change pre-existing check in
nested_vmx_exit_reflected() to instead use the helper.

Signed-off-by: Oliver Upton <oupton@google.com>
---
 arch/x86/kvm/vmx/nested.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Krish Sadhukhan Feb. 25, 2020, 12:02 a.m. UTC | #1
On 02/24/2020 12:27 PM, Oliver Upton wrote:
> commit 5ef8acbdd687 ("KVM: nVMX: Emulate MTF when performing
> instruction emulation") introduced a helper to check the MTF
> VM-execution control in vmcs12. Change pre-existing check in
> nested_vmx_exit_reflected() to instead use the helper.
>
> Signed-off-by: Oliver Upton <oupton@google.com>
> ---
>   arch/x86/kvm/vmx/nested.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
> index e920d7834d73..b9caad70ac7c 100644
> --- a/arch/x86/kvm/vmx/nested.c
> +++ b/arch/x86/kvm/vmx/nested.c
> @@ -5627,7 +5627,7 @@ bool nested_vmx_exit_reflected(struct kvm_vcpu *vcpu, u32 exit_reason)
>   	case EXIT_REASON_MWAIT_INSTRUCTION:
>   		return nested_cpu_has(vmcs12, CPU_BASED_MWAIT_EXITING);
>   	case EXIT_REASON_MONITOR_TRAP_FLAG:
> -		return nested_cpu_has(vmcs12, CPU_BASED_MONITOR_TRAP_FLAG);
> +		return nested_cpu_has_mtf(vmcs12);
>   	case EXIT_REASON_MONITOR_INSTRUCTION:
>   		return nested_cpu_has(vmcs12, CPU_BASED_MONITOR_EXITING);
>   	case EXIT_REASON_PAUSE_INSTRUCTION:
Reviewed-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Paolo Bonzini March 14, 2020, 11:14 a.m. UTC | #2
On 24/02/20 21:27, Oliver Upton wrote:
> commit 5ef8acbdd687 ("KVM: nVMX: Emulate MTF when performing
> instruction emulation") introduced a helper to check the MTF
> VM-execution control in vmcs12. Change pre-existing check in
> nested_vmx_exit_reflected() to instead use the helper.
> 
> Signed-off-by: Oliver Upton <oupton@google.com>
> ---
>  arch/x86/kvm/vmx/nested.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
> index e920d7834d73..b9caad70ac7c 100644
> --- a/arch/x86/kvm/vmx/nested.c
> +++ b/arch/x86/kvm/vmx/nested.c
> @@ -5627,7 +5627,7 @@ bool nested_vmx_exit_reflected(struct kvm_vcpu *vcpu, u32 exit_reason)
>  	case EXIT_REASON_MWAIT_INSTRUCTION:
>  		return nested_cpu_has(vmcs12, CPU_BASED_MWAIT_EXITING);
>  	case EXIT_REASON_MONITOR_TRAP_FLAG:
> -		return nested_cpu_has(vmcs12, CPU_BASED_MONITOR_TRAP_FLAG);
> +		return nested_cpu_has_mtf(vmcs12);
>  	case EXIT_REASON_MONITOR_INSTRUCTION:
>  		return nested_cpu_has(vmcs12, CPU_BASED_MONITOR_EXITING);
>  	case EXIT_REASON_PAUSE_INSTRUCTION:
> 

Queued, thanks.

Paolo
diff mbox series

Patch

diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
index e920d7834d73..b9caad70ac7c 100644
--- a/arch/x86/kvm/vmx/nested.c
+++ b/arch/x86/kvm/vmx/nested.c
@@ -5627,7 +5627,7 @@  bool nested_vmx_exit_reflected(struct kvm_vcpu *vcpu, u32 exit_reason)
 	case EXIT_REASON_MWAIT_INSTRUCTION:
 		return nested_cpu_has(vmcs12, CPU_BASED_MWAIT_EXITING);
 	case EXIT_REASON_MONITOR_TRAP_FLAG:
-		return nested_cpu_has(vmcs12, CPU_BASED_MONITOR_TRAP_FLAG);
+		return nested_cpu_has_mtf(vmcs12);
 	case EXIT_REASON_MONITOR_INSTRUCTION:
 		return nested_cpu_has(vmcs12, CPU_BASED_MONITOR_EXITING);
 	case EXIT_REASON_PAUSE_INSTRUCTION: