From: Andrew Cooper Date: Thu, 10 May 2018 13:18:22 +0000 (+0100) Subject: x86: mov to/from sreg can be encoded with a memory operand X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=bc35269fccd1926302b83c3a4f96d7c54c16d7fa;p=people%2Fandrewcoop%2Fxen-test-framework.git x86: mov to/from sreg can be encoded with a memory operand Signed-off-by: Andrew Cooper --- diff --git a/arch/x86/include/arch/lib.h b/arch/x86/include/arch/lib.h index 0045902..6bd0eb6 100644 --- a/arch/x86/include/arch/lib.h +++ b/arch/x86/include/arch/lib.h @@ -125,7 +125,7 @@ static inline unsigned int read_cs(void) { unsigned int cs; - asm volatile ("mov %%cs, %0" : "=r" (cs)); + asm volatile ("mov %%cs, %0" : "=rm" (cs)); return cs; } @@ -134,7 +134,7 @@ static inline unsigned int read_ds(void) { unsigned int ds; - asm volatile ("mov %%ds, %0" : "=r" (ds)); + asm volatile ("mov %%ds, %0" : "=rm" (ds)); return ds; } @@ -143,7 +143,7 @@ static inline unsigned int read_es(void) { unsigned int es; - asm volatile ("mov %%es, %0" : "=r" (es)); + asm volatile ("mov %%es, %0" : "=rm" (es)); return es; } @@ -152,7 +152,7 @@ static inline unsigned int read_fs(void) { unsigned int fs; - asm volatile ("mov %%fs, %0" : "=r" (fs)); + asm volatile ("mov %%fs, %0" : "=rm" (fs)); return fs; } @@ -161,7 +161,7 @@ static inline unsigned int read_gs(void) { unsigned int gs; - asm volatile ("mov %%gs, %0" : "=r" (gs)); + asm volatile ("mov %%gs, %0" : "=rm" (gs)); return gs; } @@ -170,7 +170,7 @@ static inline unsigned int read_ss(void) { unsigned int ss; - asm volatile ("mov %%ss, %0" : "=r" (ss)); + asm volatile ("mov %%ss, %0" : "=rm" (ss)); return ss; } @@ -188,27 +188,27 @@ static inline void write_cs(unsigned int cs) static inline void write_ds(unsigned int ds) { - asm volatile ("mov %0, %%ds" :: "r" (ds)); + asm volatile ("mov %0, %%ds" :: "rm" (ds)); } static inline void write_es(unsigned int es) { - asm volatile ("mov %0, %%es" :: "r" (es)); + asm volatile ("mov %0, %%es" :: "rm" (es)); } static inline void write_fs(unsigned int fs) { - asm volatile ("mov %0, %%fs" :: "r" (fs)); + asm volatile ("mov %0, %%fs" :: "rm" (fs)); } static inline void write_gs(unsigned int gs) { - asm volatile ("mov %0, %%gs" :: "r" (gs)); + asm volatile ("mov %0, %%gs" :: "rm" (gs)); } static inline void write_ss(unsigned int ss) { - asm volatile ("mov %0, %%ss" :: "r" (ss)); + asm volatile ("mov %0, %%ss" :: "rm" (ss)); } static inline unsigned long read_cr0(void)