]> xenbits.xensource.com Git - people/aperard/xtf.git/commitdiff
Avoid "q" constraint unless necessary
authorAndrew Cooper <andrew.cooper3@citrix.com>
Sun, 16 Feb 2020 23:23:56 +0000 (23:23 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 17 Feb 2020 13:44:34 +0000 (13:44 +0000)
Several tests are better off using "r", which permits the use of
%esi/%edi/%ebp/%esp in 32bit builds.

For the XSA-170 test, jmp indirect doesn't have an immediate encoding, but
will happily accept a memory encoding.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
tests/invlpg/main.c
tests/xsa-168/main.c
tests/xsa-170/main.c
tests/xsa-183/main.c

index b300f957b5e92ec7417d114bf865e576d0136e3d..d929ef36c911e768a709cf94090e68a097b3037f 100644 (file)
@@ -123,7 +123,7 @@ static unsigned int invlpg_refill(void)
                   "mov %[zero], 0x1000;\n\t"   /* Expect refill. */
                   "mov %[zero], 0x2000;\n\t"   /* Expect no refill. */
                   :
-                  : [zero] "q" (0),
+                  : [zero] "r" (0),
                     [ad]   "i" (_PAGE_AD),
                     [pte1] "m" (pae_l1_identmap[1]),
                     [pte2] "m" (pae_l1_identmap[2]),
@@ -146,7 +146,7 @@ static unsigned int invlpg_fs_refill(void)
                   "mov %[zero], 0x1000;\n\t"  /* Expect one TLB entry to refil, */
                   "mov %[zero], 0x2000;\n\t"  /* depending on %fs base.*/
                   :
-                  : [zero] "q" (0),
+                  : [zero] "r" (0),
                     [ad]   "i" (_PAGE_AD),
                     [pte1] "m" (pae_l1_identmap[1]),
                     [pte2] "m" (pae_l1_identmap[2]),
index add7ce8ddba4c84de96b8c4cb8017e14666ff22a..f22d38ea9e91d7297f9572f380b9e6d6b13b4113 100644 (file)
@@ -42,7 +42,7 @@ void test_main(void)
      */
     asm volatile ("1: invlpg (%0); 2:"
                   _ASM_EXTABLE(1b, 2b)
-                  :: "q" (0x8000000000000000UL));
+                  :: "r" (0x8000000000000000UL));
 
     xtf_success(NULL);
 }
index 70ee510b00ae86251d06b39ff3cb25bf8242e2d5..d83f5d097cabf26ea0e8f64b12af54fbfdf3549d 100644 (file)
@@ -39,7 +39,7 @@ void wild_jump(void)
                   "1: jmp *%0;"
                   ".Lwild_fixup:"
                   _ASM_EXTABLE(1b, .Lwild_fixup)
-                  :: "qI" (0x8000000000000000ULL));
+                  :: "rm" (0x8000000000000000ULL));
 }
 
 void nop_slide(void)
@@ -53,7 +53,7 @@ void nop_slide(void)
                   ".Lnop_fixup:"
                   _ASM_EXTABLE(0x0000800000000000, .Lnop_fixup) /* Correct. */
                   _ASM_EXTABLE(0xffff800000000000, .Lnop_fixup) /* XSA-170. */
-                  :: "qI" (0x00007ffffffffff8ULL));
+                  :: "rm" (0x00007ffffffffff8ULL));
 }
 
 void test_main(void)
index 605e393399ec3e99b51a986882a64fc25e0134f6..b93cf0e6da8bab434f3f273367661d218edfa6e2 100644 (file)
@@ -58,9 +58,9 @@ void test_main(void)
                   _ASM_EXTABLE(1b, 2b)        /* selector to cause a fault. */
 
                   "mov %[curr_stk], %%esp;"   /* Restore the previous stack. */
-                  : [curr_stk] "=&q" (curr_stk),
+                  : [curr_stk] "=&r" (curr_stk),
                     [tmp] "=r" (discard)
-                  : [user_stk] "q" (&user_stack[PAGE_SIZE]),
+                  : [user_stk] "r" (&user_stack[PAGE_SIZE]),
                     [AC] "i" (X86_EFLAGS_AC));
 
     /*