Skip to contentSkip to conversation

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

PATCH In review Oliver Upton 2 participants 2 messages Sep 27, 2021 – Sep 28, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests: KVM: Don't clobber XMM register when read

There is no need to clobber a register that is only being read from. Oops. Drop the XMM register from the clobbers list.

---
 tools/testing/selftests/kvm/include/x86_64/processor.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/kvm/include/x86_64/processor.h +1 -1
index eba8bd08293e..05e65ca1c30c 100644
@@ -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;								\
 })
 
Signature · 1 line
2.33.0.685.g46640cef36-goog
maintainer
#1 lore raw
Quoted 14 lines · Oliver Upton

There is no need to clobber a register that is only being read from. Oops. Drop the XMM register from the clobbers list.

---
  tools/testing/selftests/kvm/include/x86_64/processor.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/kvm/include/x86_64/processor.h +0 -0
index eba8bd08293e..05e65ca1c30c 100644

tools/testing/selftests/kvm/include/x86_64/processor.h static inline void set_xmm(int n, unsigned long val) · line 321

Quoted 8 lines
tools/testing/selftests/kvm/include/x86_64/processor.h +1 -1
@@ -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