Commit 825f0ae
KVM: x86: Refactor REX prefix handling in instruction emulation
Restructure how to represent and interpret REX fields, preparing
for handling of both REX2 and VEX.
REX uses the upper four bits of a single byte as a fixed identifier,
and the lower four bits containing the data. VEX and REX2 extends this so
that the first byte identifies the prefix and the rest encode additional
bits; and while VEX only has the same four data bits as REX, eight zero
bits are a valid value for the data bits of REX2. So, stop storing the
REX byte as-is. Instead, store only the low bits of the REX prefix and
track separately whether a REX-like prefix was used.
No functional changes intended.
Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Message-ID: <20251110180131.28264-11-chang.seok.bae@intel.com>
[Extracted from APX series; removed bitfields and REX2-specific default. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Link: https://patch.msgid.link/20251114003633.60689-9-pbonzini@redhat.com
[sean: name REX_{BXRW} enum "rex_bits"]
Signed-off-by: Sean Christopherson <seanjc@google.com>1 parent 4cb21be commit 825f0ae
2 files changed
+31
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
242 | 249 | | |
243 | 250 | | |
244 | 251 | | |
| |||
919 | 926 | | |
920 | 927 | | |
921 | 928 | | |
922 | | - | |
| 929 | + | |
923 | 930 | | |
924 | 931 | | |
925 | 932 | | |
| |||
1110 | 1117 | | |
1111 | 1118 | | |
1112 | 1119 | | |
1113 | | - | |
| 1120 | + | |
1114 | 1121 | | |
1115 | 1122 | | |
1116 | 1123 | | |
| |||
1129 | 1136 | | |
1130 | 1137 | | |
1131 | 1138 | | |
1132 | | - | |
1133 | | - | |
1134 | | - | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
1135 | 1142 | | |
1136 | 1143 | | |
1137 | 1144 | | |
| |||
2464 | 2471 | | |
2465 | 2472 | | |
2466 | 2473 | | |
2467 | | - | |
| 2474 | + | |
2468 | 2475 | | |
2469 | 2476 | | |
2470 | 2477 | | |
| |||
4850 | 4857 | | |
4851 | 4858 | | |
4852 | 4859 | | |
4853 | | - | |
| 4860 | + | |
| 4861 | + | |
4854 | 4862 | | |
4855 | 4863 | | |
4856 | 4864 | | |
| |||
4864 | 4872 | | |
4865 | 4873 | | |
4866 | 4874 | | |
4867 | | - | |
4868 | | - | |
| 4875 | + | |
| 4876 | + | |
4869 | 4877 | | |
4870 | 4878 | | |
4871 | 4879 | | |
4872 | 4880 | | |
4873 | 4881 | | |
4874 | | - | |
4875 | | - | |
| 4882 | + | |
| 4883 | + | |
4876 | 4884 | | |
4877 | 4885 | | |
4878 | 4886 | | |
| |||
5138 | 5146 | | |
5139 | 5147 | | |
5140 | 5148 | | |
5141 | | - | |
| 5149 | + | |
| 5150 | + | |
5142 | 5151 | | |
5143 | 5152 | | |
5144 | 5153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
322 | 330 | | |
323 | 331 | | |
324 | 332 | | |
| |||
360 | 368 | | |
361 | 369 | | |
362 | 370 | | |
363 | | - | |
| 371 | + | |
| 372 | + | |
364 | 373 | | |
365 | 374 | | |
366 | 375 | | |
| |||
0 commit comments