summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@kernel.org>2016-04-06 10:34:58 -0700
committerAndy Lutomirski <luto@kernel.org>2016-04-06 10:34:58 -0700
commit5a1fb94300458ea05826f5d01e822e4aa0ddf92d (patch)
tree3615266e6c8609f2196610f36d8d0a38c8d47789
parent9e19bba010cb7e750260d291f3300f0e2b61150e (diff)
downloadmisc-tests-5a1fb94300458ea05826f5d01e822e4aa0ddf92d.tar.gz
timing_test: Add more segment modes
-rw-r--r--timing_test.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/timing_test.cc b/timing_test.cc
index d54849d..3477b9a 100644
--- a/timing_test.cc
+++ b/timing_test.cc
@@ -164,6 +164,14 @@ int main(int argc, char **argv)
} else if (!strcmp(mode, "mov_to_ds")) {
for (size_t i = 0; i < loops; ++i)
asm volatile ("mov %0, %%ds" : : "rm" (0));
+ } else if (!strcmp(mode, "zero_gs")) {
+ for (size_t i = 0; i < loops; ++i)
+ asm volatile ("mov %0, %%gs" : : "rm" (0));
+ } else if (!strcmp(mode, "nonzero_gs")) {
+ unsigned short sel;
+ asm ("mov %%ss, %0" : "=rm" (sel));
+ for (size_t i = 0; i < loops; ++i)
+ asm volatile ("mov %0, %%gs" : : "rm" (sel));
} else if (!strcmp(mode, "sgdt")) {
struct {
unsigned short limit;