diff mbox series

selftests: KVM: Don't clobber XMM register when read

Message ID 20210927223621.50178-1-oupton@google.com (mailing list archive)
State New, archived
Headers show
Series selftests: KVM: Don't clobber XMM register when read | expand

Commit Message

Oliver Upton Sept. 27, 2021, 10:36 p.m. UTC
There is no need to clobber a register that is only being read from.
Oops. Drop the XMM register from the clobbers list.

Signed-off-by: Oliver Upton <oupton@google.com>
---
 tools/testing/selftests/kvm/include/x86_64/processor.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paolo Bonzini Sept. 28, 2021, 3:31 p.m. UTC | #1
On 28/09/21 00:36, Oliver Upton wrote:
> There is no need to clobber a register that is only being read from.
> Oops. Drop the XMM register from the clobbers list.
> 
> Signed-off-by: Oliver Upton <oupton@google.com>
> ---
>   tools/testing/selftests/kvm/include/x86_64/processor.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/kvm/include/x86_64/processor.h b/tools/testing/selftests/kvm/include/x86_64/processor.h
> index eba8bd08293e..05e65ca1c30c 100644
> --- a/tools/testing/selftests/kvm/include/x86_64/processor.h
> +++ b/tools/testing/selftests/kvm/include/x86_64/processor.h
> @@ -315,7 +315,7 @@ static inline void set_xmm(int n, unsigned long val)
>   #define GET_XMM(__xmm)							\
>   ({									\
>   	unsigned long __val;						\
> -	asm volatile("movq %%"#__xmm", %0" : "=r"(__val) : : #__xmm);	\
> +	asm volatile("movq %%"#__xmm", %0" : "=r"(__val));		\
>   	__val;								\
>   })
>   
> 

Queued, thnaks.

Paolo
diff mbox series

Patch

diff --git a/tools/testing/selftests/kvm/include/x86_64/processor.h b/tools/testing/selftests/kvm/include/x86_64/processor.h
index eba8bd08293e..05e65ca1c30c 100644
--- a/tools/testing/selftests/kvm/include/x86_64/processor.h
+++ b/tools/testing/selftests/kvm/include/x86_64/processor.h
@@ -315,7 +315,7 @@  static inline void set_xmm(int n, unsigned long val)
 #define GET_XMM(__xmm)							\
 ({									\
 	unsigned long __val;						\
-	asm volatile("movq %%"#__xmm", %0" : "=r"(__val) : : #__xmm);	\
+	asm volatile("movq %%"#__xmm", %0" : "=r"(__val));		\
 	__val;								\
 })