Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1423782 > unrolled thread

[RFC PATCH 1/2] KVM: x86: always use "acknowledge interrupt on exit"

Started byPaolo Bonzini <pbonzini@redhat.com>
First post2016-06-16 10:30 +0200
Last post2016-06-17 00:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [RFC PATCH 1/2] KVM: x86: always use "acknowledge interrupt on exit" Paolo Bonzini <pbonzini@redhat.com> - 2016-06-16 10:30 +0200
    Re: [RFC PATCH 1/2] KVM: x86: always use "acknowledge interrupt on exit" Bandan Das <bsd@redhat.com> - 2016-06-17 00:00 +0200

#1423782 — [RFC PATCH 1/2] KVM: x86: always use "acknowledge interrupt on exit"

FromPaolo Bonzini <pbonzini@redhat.com>
Date2016-06-16 10:30 +0200
Subject[RFC PATCH 1/2] KVM: x86: always use "acknowledge interrupt on exit"
Message-ID<rKAQy-5Ue-17@gated-at.bofh.it>
This is necessary to simplify handle_external_intr in the next patch.
It means that nested KVM will require 3.16 on the host (or 3.17 if you
have APICv enabled).

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

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index e185649fb8b7..4e9657730bf6 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3362,12 +3362,12 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf)
 		      vmx_capability.ept, vmx_capability.vpid);
 	}
 
-	min = VM_EXIT_SAVE_DEBUG_CONTROLS;
+	min = VM_EXIT_SAVE_DEBUG_CONTROLS | VM_EXIT_ACK_INTR_ON_EXIT;
 #ifdef CONFIG_X86_64
 	min |= VM_EXIT_HOST_ADDR_SPACE_SIZE;
 #endif
 	opt = VM_EXIT_SAVE_IA32_PAT | VM_EXIT_LOAD_IA32_PAT |
-		VM_EXIT_ACK_INTR_ON_EXIT | VM_EXIT_CLEAR_BNDCFGS;
+		VM_EXIT_CLEAR_BNDCFGS;
 	if (adjust_vmx_controls(min, opt, MSR_IA32_VMX_EXIT_CTLS,
 				&_vmexit_control) < 0)
 		return -EIO;
@@ -3380,8 +3380,7 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf)
 		return -EIO;
 
 	if (!(_cpu_based_2nd_exec_control &
-		SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY) ||
-		!(_vmexit_control & VM_EXIT_ACK_INTR_ON_EXIT))
+		SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY))
 		_pin_based_exec_control &= ~PIN_BASED_POSTED_INTR;
 
 	min = VM_ENTRY_LOAD_DEBUG_CONTROLS;
-- 
1.8.3.1

[toc] | [next] | [standalone]


#1424493

FromBandan Das <bsd@redhat.com>
Date2016-06-17 00:00 +0200
Message-ID<rKNup-5dJ-11@gated-at.bofh.it>
In reply to#1423782
Paolo Bonzini <pbonzini@redhat.com> writes:

> This is necessary to simplify handle_external_intr in the next patch.
> It means that nested KVM will require 3.16 on the host (or 3.17 if you
> have APICv enabled).
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  arch/x86/kvm/vmx.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index e185649fb8b7..4e9657730bf6 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -3362,12 +3362,12 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf)
>  		      vmx_capability.ept, vmx_capability.vpid);
>  	}
>  
> -	min = VM_EXIT_SAVE_DEBUG_CONTROLS;
> +	min = VM_EXIT_SAVE_DEBUG_CONTROLS | VM_EXIT_ACK_INTR_ON_EXIT;
>  #ifdef CONFIG_X86_64
>  	min |= VM_EXIT_HOST_ADDR_SPACE_SIZE;
>  #endif
>  	opt = VM_EXIT_SAVE_IA32_PAT | VM_EXIT_LOAD_IA32_PAT |
> -		VM_EXIT_ACK_INTR_ON_EXIT | VM_EXIT_CLEAR_BNDCFGS;
> +		VM_EXIT_CLEAR_BNDCFGS;
>  	if (adjust_vmx_controls(min, opt, MSR_IA32_VMX_EXIT_CTLS,
>  				&_vmexit_control) < 0)
>  		return -EIO;

Even if it breaks, this will complain quite loudly for the user to
upgrade. Maybe, a ack_intr specific message would be more direct (since that
is the one we are breaking) but imo it's fine either way.

Bandan


> @@ -3380,8 +3380,7 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf)
>  		return -EIO;
>  
>  	if (!(_cpu_based_2nd_exec_control &
> -		SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY) ||
> -		!(_vmexit_control & VM_EXIT_ACK_INTR_ON_EXIT))
> +		SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY))
>  		_pin_based_exec_control &= ~PIN_BASED_POSTED_INTR;
>  
>  	min = VM_ENTRY_LOAD_DEBUG_CONTROLS;

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web