blob: 4b645db6903930666dac6bdc7320b20e9e2c0248 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
Fix fsgsbase on hostrunner
Once https://github.com/herumi/xbyak/pull/193 is merged, rebase xbyak on latest.
Then make sure to save and restore fs/gs in the hostrunner.
This will let our unittests use wrfsbase without breaking host TLS, since it can be restored.
Example for just fs, but should include gs also:
```diff
diff --git a/Source/Tools/TestHarnessRunner/TestHarnessRunner/HostRunner.cpp b/Source/Tools/TestHarnessRunner/TestHarnessRunner/HostRunner.cpp
index 0e9b88cca..9a816ccac 100644
--- a/Source/Tools/TestHarnessRunner/TestHarnessRunner/HostRunner.cpp
+++ b/Source/Tools/TestHarnessRunner/TestHarnessRunner/HostRunner.cpp
@@ -51,7 +51,8 @@ public:
push(r13);
push(r14);
push(r15);
- sub(rsp, 8);
+ rdfsbase(rbx);
+ push(rbx);
// Save this stack pointer so we can cleanly shutdown the emulation with a long jump
// regardless of where we were in the stack
@@ -103,8 +104,8 @@ public:
ThreadStopHandlerAddress = getCurr<uint64_t>();
- add(rsp, 8);
-
+ pop(rbx);
+ wrfsbase(rbx);
pop(r15);
pop(r14);
```
|