diff mbox series

[SRU,FOCAL,1/1] kvm: svm: Update svm_xsaves_supported

Message ID 5497bdafa699ea1ac4d6ae4d3df5230445259d7f.1600200606.git.william.gray@canonical.com
State New
Headers show
Series kvm: svm: Update svm_xsaves_supported | expand

Commit Message

William Breathitt Gray Sept. 15, 2020, 8:53 p.m. UTC
From: Aaron Lewis <aaronlewis@google.com>

AMD CPUs now support XSAVES in a limited fashion (they require IA32_XSS
to be zero).

AMD has no equivalent of Intel's "Enable XSAVES/XRSTORS" VM-execution
control. Instead, XSAVES is always available to the guest when supported
on the host.

Reviewed-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Aaron Lewis <aaronlewis@google.com>
Change-Id: I40dc2c682eb0d38c2208d95d5eb7bbb6c47f6317
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
BugLink: https://bugs.launchpad.net/bugs/1887490
(cherry-picked from commit 52297436199dde85be557ee6bc779f5b96082f74)
Signed-off-by: William Breathitt Gray <william.gray@canonical.com>
---
 arch/x86/kvm/svm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kleber Souza Sept. 16, 2020, 9:19 a.m. UTC | #1
On 15.09.20 22:53, William Breathitt Gray wrote:
> From: Aaron Lewis <aaronlewis@google.co>

The BugLink generally is added here as the first line of the commit message:

BugLink: https://bugs.launchpad.net/bugs/1887490
 
> AMD CPUs now support XSAVES in a limited fashion (they require IA32_XSS
> to be zero).
> 
> AMD has no equivalent of Intel's "Enable XSAVES/XRSTORS" VM-execution
> control. Instead, XSAVES is always available to the guest when supported
> on the host.
> 
> Reviewed-by: Jim Mattson <jmattson@google.com>
> Signed-off-by: Aaron Lewis <aaronlewis@google.com>
> Change-Id: I40dc2c682eb0d38c2208d95d5eb7bbb6c47f6317
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> BugLink: https://bugs.launchpad.net/bugs/1887490

We should move the BugLink to the top ^.

> (cherry-picked from commit 52297436199dde85be557ee6bc779f5b96082f74)

The above line should follow the pattern added by the '-x' flag from
'git cherry-pick':

(cherry picked from commit ...)

This can all be fixed when applying the patch.

Otherwise the change looks good to me, clean cherry-pick:

Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>


Thanks. 

> Signed-off-by: William Breathitt Gray <william.gray@canonical.com>
> ---
>  arch/x86/kvm/svm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
> index 3243a80ea32c..027004daec56 100644
> --- a/arch/x86/kvm/svm.c
> +++ b/arch/x86/kvm/svm.c
> @@ -6019,7 +6019,7 @@ static bool svm_mpx_supported(void)
>  
>  static bool svm_xsaves_supported(void)
>  {
> -	return false;
> +	return boot_cpu_has(X86_FEATURE_XSAVES);
>  }
>  
>  static bool svm_umip_emulated(void)
>
Kleber Souza Sept. 16, 2020, 9:21 a.m. UTC | #2
I should have added "/cmnt" to the first "ACK" reply...

On 16.09.20 11:19, Kleber Souza wrote:
> On 15.09.20 22:53, William Breathitt Gray wrote:
>> From: Aaron Lewis <aaronlewis@google.co>
> 
> The BugLink generally is added here as the first line of the commit message:
> 
> BugLink: https://bugs.launchpad.net/bugs/1887490
>  
>> AMD CPUs now support XSAVES in a limited fashion (they require IA32_XSS
>> to be zero).
>>
>> AMD has no equivalent of Intel's "Enable XSAVES/XRSTORS" VM-execution
>> control. Instead, XSAVES is always available to the guest when supported
>> on the host.
>>
>> Reviewed-by: Jim Mattson <jmattson@google.com>
>> Signed-off-by: Aaron Lewis <aaronlewis@google.com>
>> Change-Id: I40dc2c682eb0d38c2208d95d5eb7bbb6c47f6317
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> BugLink: https://bugs.launchpad.net/bugs/1887490
> 
> We should move the BugLink to the top ^.
> 
>> (cherry-picked from commit 52297436199dde85be557ee6bc779f5b96082f74)
> 
> The above line should follow the pattern added by the '-x' flag from
> 'git cherry-pick':
> 
> (cherry picked from commit ...)
> 
> This can all be fixed when applying the patch.
> 
> Otherwise the change looks good to me, clean cherry-pick:
> 
> Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
> 
> 
> Thanks. 
> 
>> Signed-off-by: William Breathitt Gray <william.gray@canonical.com>
>> ---
>>  arch/x86/kvm/svm.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
>> index 3243a80ea32c..027004daec56 100644
>> --- a/arch/x86/kvm/svm.c
>> +++ b/arch/x86/kvm/svm.c
>> @@ -6019,7 +6019,7 @@ static bool svm_mpx_supported(void)
>>  
>>  static bool svm_xsaves_supported(void)
>>  {
>> -	return false;
>> +	return boot_cpu_has(X86_FEATURE_XSAVES);
>>  }
>>  
>>  static bool svm_umip_emulated(void)
>>
>
Stefan Bader Sept. 16, 2020, 3:26 p.m. UTC | #3
On 15.09.20 22:53, William Breathitt Gray wrote:
> From: Aaron Lewis <aaronlewis@google.com>
> 
> AMD CPUs now support XSAVES in a limited fashion (they require IA32_XSS
> to be zero).
> 
> AMD has no equivalent of Intel's "Enable XSAVES/XRSTORS" VM-execution
> control. Instead, XSAVES is always available to the guest when supported
> on the host.
> 
> Reviewed-by: Jim Mattson <jmattson@google.com>
> Signed-off-by: Aaron Lewis <aaronlewis@google.com>
> Change-Id: I40dc2c682eb0d38c2208d95d5eb7bbb6c47f6317
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> BugLink: https://bugs.launchpad.net/bugs/1887490
> (cherry-picked from commit 52297436199dde85be557ee6bc779f5b96082f74)
> Signed-off-by: William Breathitt Gray <william.gray@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
> ---

I would not insist on the location of the BugLink line but "cherry picked"
should be used and when adding that we can as well move the BugLink. Personally
I would leave one empty line between the old sob block and the new one but that
is opinion as well.

-Stefan

>  arch/x86/kvm/svm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
> index 3243a80ea32c..027004daec56 100644
> --- a/arch/x86/kvm/svm.c
> +++ b/arch/x86/kvm/svm.c
> @@ -6019,7 +6019,7 @@ static bool svm_mpx_supported(void)
>  
>  static bool svm_xsaves_supported(void)
>  {
> -	return false;
> +	return boot_cpu_has(X86_FEATURE_XSAVES);
>  }
>  
>  static bool svm_umip_emulated(void)
>
William Breathitt Gray Sept. 16, 2020, 3:34 p.m. UTC | #4
On Wed, Sep 16, 2020 at 05:26:34PM +0200, Stefan Bader wrote:
> On 15.09.20 22:53, William Breathitt Gray wrote:
> > From: Aaron Lewis <aaronlewis@google.com>
> > 
> > AMD CPUs now support XSAVES in a limited fashion (they require IA32_XSS
> > to be zero).
> > 
> > AMD has no equivalent of Intel's "Enable XSAVES/XRSTORS" VM-execution
> > control. Instead, XSAVES is always available to the guest when supported
> > on the host.
> > 
> > Reviewed-by: Jim Mattson <jmattson@google.com>
> > Signed-off-by: Aaron Lewis <aaronlewis@google.com>
> > Change-Id: I40dc2c682eb0d38c2208d95d5eb7bbb6c47f6317
> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> > BugLink: https://bugs.launchpad.net/bugs/1887490
> > (cherry-picked from commit 52297436199dde85be557ee6bc779f5b96082f74)
> > Signed-off-by: William Breathitt Gray <william.gray@canonical.com>
> Acked-by: Stefan Bader <stefan.bader@canonical.com>
> > ---
> 
> I would not insist on the location of the BugLink line but "cherry picked"
> should be used and when adding that we can as well move the BugLink. Personally
> I would leave one empty line between the old sob block and the new one but that
> is opinion as well.
> 
> -Stefan

I think it makes sense to keep the BugLink line together with the new
sob block (an empty line seperation is also a good idea); this should
make it obvious that the new block of information is not part of the
original upstream patch. I don't feel too strongly about it though, so I
can go either way.

William Breathitt Gray

> 
> >  arch/x86/kvm/svm.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
> > index 3243a80ea32c..027004daec56 100644
> > --- a/arch/x86/kvm/svm.c
> > +++ b/arch/x86/kvm/svm.c
> > @@ -6019,7 +6019,7 @@ static bool svm_mpx_supported(void)
> >  
> >  static bool svm_xsaves_supported(void)
> >  {
> > -	return false;
> > +	return boot_cpu_has(X86_FEATURE_XSAVES);
> >  }
> >  
> >  static bool svm_umip_emulated(void)
> > 
> 
> 




> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
diff mbox series

Patch

diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 3243a80ea32c..027004daec56 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -6019,7 +6019,7 @@  static bool svm_mpx_supported(void)
 
 static bool svm_xsaves_supported(void)
 {
-	return false;
+	return boot_cpu_has(X86_FEATURE_XSAVES);
 }
 
 static bool svm_umip_emulated(void)