Commit 26685f1
committed
fix: initialize all segment registers and XSAVE state for MSHV/WHP compatibility
MSHV and WHP reject vCPU state with zeroed segment registers (ES, SS,
FS, GS, LDT) and uninitialized XSAVE areas. Properly initialize all
segment registers in standard_real_mode_defaults() and add reset_xsave()
call after set_sregs() to ensure FPU state (FCW, MXCSR) is valid.
Signed-off-by: danbugs <danilochiarlone@gmail.com>1 parent 976483f commit 26685f1
2 files changed
Lines changed: 35 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
439 | 439 | | |
440 | 440 | | |
441 | 441 | | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
442 | 448 | | |
443 | 449 | | |
444 | 450 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
109 | 122 | | |
110 | 123 | | |
111 | 124 | | |
112 | 125 | | |
113 | 126 | | |
114 | | - | |
| 127 | + | |
115 | 128 | | |
116 | | - | |
| 129 | + | |
117 | 130 | | |
118 | 131 | | |
119 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
120 | 138 | | |
121 | 139 | | |
122 | 140 | | |
123 | | - | |
| 141 | + | |
124 | 142 | | |
125 | | - | |
| 143 | + | |
126 | 144 | | |
127 | 145 | | |
128 | | - | |
| 146 | + | |
129 | 147 | | |
130 | 148 | | |
131 | 149 | | |
132 | | - | |
| 150 | + | |
133 | 151 | | |
134 | | - | |
| 152 | + | |
135 | 153 | | |
136 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
137 | 158 | | |
138 | 159 | | |
139 | 160 | | |
| |||
0 commit comments