]> xenbits.xensource.com Git - people/andrewcoop/xen-test-framework.git/commitdiff
memop-seg: Have %fs/%gs loaded unconditionally
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 13 Sep 2024 16:25:30 +0000 (17:25 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 13 Sep 2024 17:42:29 +0000 (18:42 +0100)
There are a lot of testcase steps; it's safe and faster.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
tests/memop-seg/asm.S
tests/memop-seg/main.c

index 698661425bcdc9c181b235e323c2460e06c6e986..08e87b2ea2ee27765076a9e6c44b981dfd421281 100644 (file)
@@ -155,7 +155,7 @@ ENDFUNC(stub_\seg\()_\reg)
  */
 .local seg_mask, seg_idx, reg_mask, reg_idx
 #ifdef __i386__
-    seg_mask = 0b1100111
+    seg_mask = 0b1100100
 #else
     seg_mask = 0
 #endif
index 82ee9f44fd8fe93a366f2dcd93cc3f309cb34d39..ce79225e80c242d690a075f5897de8aa6aa90a78 100644 (file)
@@ -269,6 +269,10 @@ void test_main(void)
         update_desc(&gdt[GDTE_AVAIL1],
                     GDTE_SYM(0, 0x7ffff, COMMON, DATA, DPL3, B, W));
         exec_user_ss = GDTE_AVAIL1 << 3 | 3;
+
+        /* Load %fs/%gs unconditionally. */
+        write_fs(exec_user_ss);
+        write_gs(exec_user_ss);
     }
 
     for ( i = 0; i < ARRAY_SIZE(tests); ++i )