linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: nVMX: expose "load IA32_PERF_GLOBAL_CTRL" controls
@ 2019-11-21 14:29 Paolo Bonzini
  2019-11-21 18:42 ` Krish Sadhukhan
  0 siblings, 1 reply; 5+ messages in thread
From: Paolo Bonzini @ 2019-11-21 14:29 UTC (permalink / raw)
  To: linux-kernel, kvm; +Cc: Oliver Upton

These controls were added by the recent commit 03a8871add95 ("KVM:
nVMX: Expose load IA32_PERF_GLOBAL_CTRL VM-{Entry,Exit} control",
2019-11-13), so we should advertise them to userspace from
KVM_GET_MSR_FEATURE_INDEX_LIST, as well.

Cc: Oliver Upton <oupton@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 arch/x86/kvm/vmx/nested.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
index 4aea7d304beb..4b4ce6a804ff 100644
--- a/arch/x86/kvm/vmx/nested.c
+++ b/arch/x86/kvm/vmx/nested.c
@@ -5982,6 +5982,7 @@ void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps,
 #ifdef CONFIG_X86_64
 		VM_EXIT_HOST_ADDR_SPACE_SIZE |
 #endif
+		VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL |
 		VM_EXIT_LOAD_IA32_PAT | VM_EXIT_SAVE_IA32_PAT;
 	msrs->exit_ctls_high |=
 		VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR |
@@ -6001,6 +6002,7 @@ void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps,
 #ifdef CONFIG_X86_64
 		VM_ENTRY_IA32E_MODE |
 #endif
+		VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL |
 		VM_ENTRY_LOAD_IA32_PAT;
 	msrs->entry_ctls_high |=
 		(VM_ENTRY_ALWAYSON_WITHOUT_TRUE_MSR | VM_ENTRY_LOAD_IA32_EFER);
-- 
1.8.3.1


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

* Re: [PATCH] KVM: nVMX: expose "load IA32_PERF_GLOBAL_CTRL" controls
  2019-11-21 14:29 [PATCH] KVM: nVMX: expose "load IA32_PERF_GLOBAL_CTRL" controls Paolo Bonzini
@ 2019-11-21 18:42 ` Krish Sadhukhan
  2019-12-06 18:53   ` Oliver Upton
  0 siblings, 1 reply; 5+ messages in thread
From: Krish Sadhukhan @ 2019-11-21 18:42 UTC (permalink / raw)
  To: Paolo Bonzini, linux-kernel, kvm; +Cc: Oliver Upton


On 11/21/19 6:29 AM, Paolo Bonzini wrote:
> These controls were added by the recent commit 03a8871add95 ("KVM:
> nVMX: Expose load IA32_PERF_GLOBAL_CTRL VM-{Entry,Exit} control",
> 2019-11-13), so we should advertise them to userspace from
> KVM_GET_MSR_FEATURE_INDEX_LIST, as well.
>
> Cc: Oliver Upton <oupton@google.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   arch/x86/kvm/vmx/nested.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
> index 4aea7d304beb..4b4ce6a804ff 100644
> --- a/arch/x86/kvm/vmx/nested.c
> +++ b/arch/x86/kvm/vmx/nested.c
> @@ -5982,6 +5982,7 @@ void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps,
>   #ifdef CONFIG_X86_64
>   		VM_EXIT_HOST_ADDR_SPACE_SIZE |
>   #endif
> +		VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL |
>   		VM_EXIT_LOAD_IA32_PAT | VM_EXIT_SAVE_IA32_PAT;
>   	msrs->exit_ctls_high |=
>   		VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR |
> @@ -6001,6 +6002,7 @@ void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps,
>   #ifdef CONFIG_X86_64
>   		VM_ENTRY_IA32E_MODE |
>   #endif
> +		VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL |
>   		VM_ENTRY_LOAD_IA32_PAT;
>   	msrs->entry_ctls_high |=
>   		(VM_ENTRY_ALWAYSON_WITHOUT_TRUE_MSR | VM_ENTRY_LOAD_IA32_EFER);
Reviewed-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>

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

* Re: [PATCH] KVM: nVMX: expose "load IA32_PERF_GLOBAL_CTRL" controls
  2019-11-21 18:42 ` Krish Sadhukhan
@ 2019-12-06 18:53   ` Oliver Upton
  0 siblings, 0 replies; 5+ messages in thread
From: Oliver Upton @ 2019-12-06 18:53 UTC (permalink / raw)
  To: Krish Sadhukhan; +Cc: Paolo Bonzini, linux-kernel, kvm

Hi Paolo,

Sorry I didn't see this earlier. Thank you for addressing this!

On Thu, Nov 21, 2019 at 10:42:18AM -0800, Krish Sadhukhan wrote:
> 
> On 11/21/19 6:29 AM, Paolo Bonzini wrote:
> > These controls were added by the recent commit 03a8871add95 ("KVM:
> > nVMX: Expose load IA32_PERF_GLOBAL_CTRL VM-{Entry,Exit} control",
> > 2019-11-13), so we should advertise them to userspace from
> > KVM_GET_MSR_FEATURE_INDEX_LIST, as well.
> > 
> > Cc: Oliver Upton <oupton@google.com>
> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> > ---
> >   arch/x86/kvm/vmx/nested.c | 2 ++
> >   1 file changed, 2 insertions(+)
> > 
> > diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
> > index 4aea7d304beb..4b4ce6a804ff 100644
> > --- a/arch/x86/kvm/vmx/nested.c
> > +++ b/arch/x86/kvm/vmx/nested.c
> > @@ -5982,6 +5982,7 @@ void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps,
> >   #ifdef CONFIG_X86_64
> >   		VM_EXIT_HOST_ADDR_SPACE_SIZE |
> >   #endif
> > +		VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL |
> >   		VM_EXIT_LOAD_IA32_PAT | VM_EXIT_SAVE_IA32_PAT;
> >   	msrs->exit_ctls_high |=
> >   		VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR |
> > @@ -6001,6 +6002,7 @@ void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps,
> >   #ifdef CONFIG_X86_64
> >   		VM_ENTRY_IA32E_MODE |
> >   #endif
> > +		VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL |
> >   		VM_ENTRY_LOAD_IA32_PAT;
> >   	msrs->entry_ctls_high |=
> >   		(VM_ENTRY_ALWAYSON_WITHOUT_TRUE_MSR | VM_ENTRY_LOAD_IA32_EFER);
> Reviewed-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Reviewed-by: Oliver Upton <oupton@google.com>

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

* Re: [PATCH] KVM: nVMX: expose "load IA32_PERF_GLOBAL_CTRL" controls
  2019-11-21 13:32 Paolo Bonzini
@ 2019-11-21 14:28 ` Paolo Bonzini
  0 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2019-11-21 14:28 UTC (permalink / raw)
  To: linux-kernel, kvm

On 21/11/19 14:32, Paolo Bonzini wrote:
> These controls have always been supported (or at least have been
> supported for longer than nested_vmx_setup_ctls_msrs has existed),
> so we should advertise them to userspace.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Nevermind, they're actually very new (lesson learnt: cut-and-paste of
commit messages is bad, especially if it leads to incorrect Cc to
stable).  Sending v2 at once...

Paolo

> ---
>  arch/x86/kvm/vmx/nested.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
> index 4aea7d304beb..4b4ce6a804ff 100644
> --- a/arch/x86/kvm/vmx/nested.c
> +++ b/arch/x86/kvm/vmx/nested.c
> @@ -5982,6 +5982,7 @@ void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps,
>  #ifdef CONFIG_X86_64
>  		VM_EXIT_HOST_ADDR_SPACE_SIZE |
>  #endif
> +		VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL |
>  		VM_EXIT_LOAD_IA32_PAT | VM_EXIT_SAVE_IA32_PAT;
>  	msrs->exit_ctls_high |=
>  		VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR |
> @@ -6001,6 +6002,7 @@ void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps,
>  #ifdef CONFIG_X86_64
>  		VM_ENTRY_IA32E_MODE |
>  #endif
> +		VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL |
>  		VM_ENTRY_LOAD_IA32_PAT;
>  	msrs->entry_ctls_high |=
>  		(VM_ENTRY_ALWAYSON_WITHOUT_TRUE_MSR | VM_ENTRY_LOAD_IA32_EFER);
> 


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

* [PATCH] KVM: nVMX: expose "load IA32_PERF_GLOBAL_CTRL" controls
@ 2019-11-21 13:32 Paolo Bonzini
  2019-11-21 14:28 ` Paolo Bonzini
  0 siblings, 1 reply; 5+ messages in thread
From: Paolo Bonzini @ 2019-11-21 13:32 UTC (permalink / raw)
  To: linux-kernel, kvm; +Cc: stable

These controls have always been supported (or at least have been
supported for longer than nested_vmx_setup_ctls_msrs has existed),
so we should advertise them to userspace.

Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 arch/x86/kvm/vmx/nested.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
index 4aea7d304beb..4b4ce6a804ff 100644
--- a/arch/x86/kvm/vmx/nested.c
+++ b/arch/x86/kvm/vmx/nested.c
@@ -5982,6 +5982,7 @@ void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps,
 #ifdef CONFIG_X86_64
 		VM_EXIT_HOST_ADDR_SPACE_SIZE |
 #endif
+		VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL |
 		VM_EXIT_LOAD_IA32_PAT | VM_EXIT_SAVE_IA32_PAT;
 	msrs->exit_ctls_high |=
 		VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR |
@@ -6001,6 +6002,7 @@ void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps,
 #ifdef CONFIG_X86_64
 		VM_ENTRY_IA32E_MODE |
 #endif
+		VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL |
 		VM_ENTRY_LOAD_IA32_PAT;
 	msrs->entry_ctls_high |=
 		(VM_ENTRY_ALWAYSON_WITHOUT_TRUE_MSR | VM_ENTRY_LOAD_IA32_EFER);
-- 
1.8.3.1


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

end of thread, other threads:[~2019-12-06 18:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-21 14:29 [PATCH] KVM: nVMX: expose "load IA32_PERF_GLOBAL_CTRL" controls Paolo Bonzini
2019-11-21 18:42 ` Krish Sadhukhan
2019-12-06 18:53   ` Oliver Upton
  -- strict thread matches above, loose matches on Subject: below --
2019-11-21 13:32 Paolo Bonzini
2019-11-21 14:28 ` 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).