Commit Graph

3680 Commits

Author SHA1 Message Date
Stanislav Shwartsman
8285b6b51b regen Makefile include dependencies for CPU and internal debugger 2021-01-30 20:17:15 +00:00
Stanislav Shwartsman
1089e470e9 remove bochs-memory.h from bochs.h and include it only where required 2021-01-30 20:13:34 +00:00
Stanislav Shwartsman
6d6ff0e06b regen Makefile include dependencies for CPU, MEMORY and internal debugger 2021-01-30 19:44:41 +00:00
Stanislav Shwartsman
7cc9cffeed remove siminterface.h from bochs.h and include it only where required 2021-01-30 19:40:18 +00:00
Stanislav Shwartsman
0b83259417 regen include dep lists for cpu and memory - need to regen for all others 2021-01-30 18:57:45 +00:00
Stanislav Shwartsman
99e7b71540 remove gui.h from bochs.h and include it only where required 2021-01-30 18:47:25 +00:00
Stanislav Shwartsman
c878933057 remove pc_system.h from bochs.h and include it only where required
next step: same for gui.h
2021-01-30 18:29:28 +00:00
Stanislav Shwartsman
f79d6df458 strip redundant info from tigerlake cpuid text file 2021-01-30 08:45:34 +00:00
Stanislav Shwartsman
1bf18b8aae ! CPUID: Added TigerLake CPU definition (features CET and CLWB support)
- CPU code refactor, remove uses of bx_bool datatype and use C++ classic bool instead.
  This enable better compiler optimizations and reduce binary size
2021-01-30 08:35:35 +00:00
Stanislav Shwartsman
b7855153a0 new disasm: print branch target in 32-bit mode as 32-bit value 2021-01-02 16:48:13 +00:00
Stanislav Shwartsman
e15012cfcf fix code duplication in <limiting max cpuid leaf to 0x02 for winnt> feature 2021-01-02 16:28:51 +00:00
Stanislav Shwartsman
c33308731e fixed disasm of shift/rotate with implicit shift count=1 2021-01-02 15:12:29 +00:00
Stanislav Shwartsman
1a20dbc7f7 fixed bug in new disasm 2021-01-02 14:32:52 +00:00
Stanislav Shwartsman
980cfc1903 fixed compilation with no debugger configured in 2021-01-02 14:09:03 +00:00
Stanislav Shwartsman
bea432dacb fixed compilation with no debugger configured in 2021-01-02 14:04:35 +00:00
Stanislav Shwartsman
41ea50ba22 complete transition to new disasm, remove old disasm from source code 2021-01-02 13:43:10 +00:00
Stanislav Shwartsman
2f3adf849c enable syntax switch with new disasm also in GUI debugger, switch to new disasm by default everywhere 2021-01-02 12:04:52 +00:00
Stanislav Shwartsman
22774a0534 support for AT&T (GAS) disasm style in new disassembler 2021-01-02 11:12:23 +00:00
Stanislav Shwartsman
a4a2562c8d fixed compilation with no debugger enabled - will be cleaned up later 2020-12-30 16:58:17 +00:00
Stanislav Shwartsman
d2896bbd2a fixed compilation with no debugger enabled 2020-12-30 14:48:34 +00:00
Stanislav Shwartsman
bb568997c9 use new disasm wrapper method in more place 2020-12-30 14:09:25 +00:00
Stanislav Shwartsman
72db10d766 fix symbols display within disasm for new disassember, integrate new disasm with GUI debugger properly 2020-12-30 12:23:19 +00:00
Stanislav Shwartsman
79db3896d4 enable symbols for branch targets and JMP/CALL direct ptr instructions in new disassembler (still to be tested), attempt to use new disassembler in GUI debugger 2020-12-30 11:36:33 +00:00
Stanislav Shwartsman
e6822c81a1 fixed behavior of MMX PSRAW/PSRAD instructions when shift count is zero - still has to invalidate x87 tags for dest register 2020-12-15 20:05:54 +00:00
Stanislav Shwartsman
1df9bc0070 Fixed buffer overflow in LOAD_Wdq method when MXCSR.MM=1 -> thanks new gcc10 warning 2020-10-03 09:37:06 +00:00
Stanislav Shwartsman
c6050a99d1 implemented AVX encoded VNNI instructions published in recent SDM - not tested yet 2020-10-03 09:23:28 +00:00
Stanislav Shwartsman
a378441254 update CPUID bits and CR bits according to recently published SDM documents by Intel 2020-10-03 07:59:47 +00:00
Stanislav Shwartsman
d540e5b040 rename VMCS control enum 2020-05-29 12:55:56 +00:00
Stanislav Shwartsman
baa39a1b40 fixed comment 2020-05-29 12:52:26 +00:00
Stanislav Shwartsman
4023b640d6 Protection Keys: Implemented Supervisor-Mode Protection Keys (PKS) 2020-05-29 12:35:30 +00:00
Stanislav Shwartsman
b891789c3d implemented (experimental) TSC Adjust MSR 2020-05-21 19:58:16 +00:00
Stanislav Shwartsman
dd3849b9e0 extract Bit128 arithmetic to separate wide_int.cc/wide_int.h compiled independently of long mode emulation 2020-05-19 16:01:23 +00:00
Stanislav Shwartsman
e50a3f8169 fixup code duplication in apic code 2020-05-17 19:32:14 +00:00
Stanislav Shwartsman
f97b20ddce deactivate apic timer when globally disabled 2020-05-17 19:03:39 +00:00
Stanislav Shwartsman
da169c0044 when apic is globally disabled - reset some fields to defaults 2020-05-17 18:57:27 +00:00
Stanislav Shwartsman
7a5fef764b fix for effcetive TSC compute when TSC multiplier is enabled 2020-05-17 18:39:52 +00:00
Stanislav Shwartsman
6ae26b39b3 fixed Sub-Page-Protection EPT violation (was triggered exactly opposite that excpected due to typo) 2020-05-17 14:12:29 +00:00
Stanislav Shwartsman
8e4a29fb0e reorg vmcs fields enabling based on their numeric order 2020-05-15 19:27:45 +00:00
Stanislav Shwartsman
499b138227 enable access to XSS_EXITING_BITMAP VMCS field 2020-05-15 19:05:41 +00:00
Stanislav Shwartsman
355c06e396 add defines for CPUID bits recently announced 2020-04-01 06:15:54 +00:00
Stanislav Shwartsman
81edc636d4 remove duplicate opcodes from decoder definitions 2020-03-28 14:36:27 +00:00
Stanislav Shwartsman
b686c8d423 add into ia_opcodes.def disasm field for every instruction 2020-03-28 14:23:54 +00:00
Stanislav Shwartsman
7d989b34a3 fixed recent segoverride assignment bug in SVN 2020-02-28 15:03:52 +00:00
Stanislav Shwartsman
6e2541daa6 CET: DS Seg override is kept for CET Endranch suppress hint even if overridden by other prefixes later 2020-02-21 19:38:23 +00:00
Stanislav Shwartsman
086f2779f5 fixed compilation with avx but without EVEX 2020-02-20 05:29:13 +00:00
Stanislav Shwartsman
1b208b0e93 fixed compilation under Visual Studio 2020-02-02 07:25:00 +00:00
Stanislav Shwartsman
6b691257dd fixed compilation with VMX off 2020-01-17 11:55:59 +00:00
Stanislav Shwartsman
a24b562e32 now when bios knows to set msr ia32_feature_ctrl, no need to initialize from reset code 2020-01-15 17:18:10 +00:00
Stanislav Shwartsman
5620a4968b set msr IA32_FEATURE_CTRL lock bit to ensure VMX is enabled - normally this should be done in Bios but init.cc can w/a 2020-01-11 07:04:44 +00:00
Stanislav Shwartsman
902ff1ef52 Part of the SF patch #548: Support Windows Hyper-V in Bochs by Xinyang
When BX_SUPPORT_SMP is not defined, clear the bit in CPUID.[EAX=1].Bit[28] to indicate Hyper-Threading is unavailable.
2020-01-11 06:18:13 +00:00
Stanislav Shwartsman
50bde4a38c flush TLBs on CR4.CET change 2020-01-10 20:04:22 +00:00
Stanislav Shwartsman
72dffd320d fixed CET fault on task switch when SSP is not 8-byte aligned. Bochs did #GP whiel SDM says #TS 2020-01-07 18:17:34 +00:00
Stanislav Shwartsman
694112732b use default base CPUID class method to detemine values of 0x80000008 leaf for IceLake CPUID 2020-01-03 19:53:20 +00:00
Stanislav Shwartsman
b69f2b052a extract calculation of MSR_IA32_XSS supported bits to a function 2020-01-03 19:33:16 +00:00
Stanislav Shwartsman
45a25a2b67 CET: make sure enbranch64 and enbranch32 do the right thing when mode mismatch 2020-01-03 18:55:17 +00:00
Stanislav Shwartsman
495206650b fixed CET wrmsr reserved bit checking 2020-01-03 18:44:15 +00:00
Stanislav Shwartsman
ea6b0c766c added more VMX reasons to enum according to Intel SDM 2020-01-03 17:35:02 +00:00
Stanislav Shwartsman
bac9104f73 fixed compilation of init.cc for old CPU models 2020-01-03 05:29:45 +00:00
Stanislav Shwartsman
9a35c6de79 fix and simplify combined_access handling in EPT page walk 2019-12-29 21:00:35 +00:00
Stanislav Shwartsman
016aa349e5 handle supervisor-shadow-stack protection feature in the EPT 2019-12-29 20:40:18 +00:00
Stanislav Shwartsman
4f7aa4bd76 fixed compilation issue 2019-12-28 15:20:38 +00:00
Stanislav Shwartsman
f56e1aab86 VMX: save CET state to VMCS only if CET is supported 2019-12-28 15:18:55 +00:00
Stanislav Shwartsman
bcafd5bb7a fix non-printable characters and add more verbose error messages 2019-12-28 15:08:53 +00:00
Stanislav Shwartsman
d091e3bda6 simplify XRSTOR* code 2019-12-28 14:03:54 +00:00
Stanislav Shwartsman
126ae0d0b4 more verbose debug print 2019-12-28 13:36:43 +00:00
Stanislav Shwartsman
9458e25486 reverting commit 13737 and doing correct fix 2019-12-28 13:11:13 +00:00
Stanislav Shwartsman
5d7c6d46b0 fixed compilation after prev commit 2019-12-28 13:02:02 +00:00
Stanislav Shwartsman
7f72252223 fixes in XSAVE/XRSTOR handling 2019-12-28 12:57:31 +00:00
Stanislav Shwartsman
b09126aa34 use enums for assign_srcs error output - help with debugging unexpected #UD cases 2019-12-27 19:34:32 +00:00
Stanislav Shwartsman
6879feebf5 SHA: SHA instructions in 128-bit memory operand require to be explicitly aligned 2019-12-27 14:24:43 +00:00
Stanislav Shwartsman
5c45f6b324 AVX512: EVEX.Z is forbidden for any vector instruction using opmask as source or destination (should cause #UD) 2019-12-27 14:23:53 +00:00
Stanislav Shwartsman
8bd5272591 correctly handle CET Enbranch override prefix 0x3E in 64-bit mode 2019-12-27 13:44:57 +00:00
Stanislav Shwartsman
596c197cea fix decoder: SHA1RNDS4 instruction should be with no SSE prefix 2019-12-27 13:08:20 +00:00
Stanislav Shwartsman
a2be16873c VMX: save guest CET state to VMCS on vmexit 2019-12-27 13:02:30 +00:00
Stanislav Shwartsman
8e2391c44b fixed compilation when compiling without EVEX 2019-12-26 20:12:40 +00:00
Stanislav Shwartsman
ff167d0f65 change a bit more defines to const with type 2019-12-26 16:48:33 +00:00
Stanislav Shwartsman
d6c3dcf033 revert for full vector read until figured out the right behavior for VPSHUFBITQMB 2019-12-24 20:08:33 +00:00
Stanislav Shwartsman
edcdce927c added ability to configure hidden VMCS field mapping through CPUID 2019-12-22 18:53:07 +00:00
Stanislav Shwartsman
fc1dbe68bc update dependencies in Mafefile.in 2019-12-21 21:42:35 +00:00
Stanislav Shwartsman
e593bb0084 CPUDB: Allow Icelake-U CPU model to exists without EVEX 2019-12-21 21:06:34 +00:00
Stanislav Shwartsman
e38cca20be disable fault suppression for VPEXPAND* until fugured out how it should work in real life 2019-12-21 20:54:45 +00:00
Stanislav Shwartsman
f99258a2fd fixed copy-paste issue 2019-12-21 20:30:15 +00:00
Stanislav Shwartsman
c16816485e use optimized function for broadcastss 2019-12-21 20:20:33 +00:00
Stanislav Shwartsman
1a0237e9af make order in AVX512 broadcast handlers, extract them into separate file 2019-12-21 20:07:03 +00:00
Stanislav Shwartsman
11585e4982 AVX512: VPBROADCASTB/W/D/Q with GPR source are only reg/reg 2019-12-21 18:29:51 +00:00
Stanislav Shwartsman
afa3626eb3 AVX512: fixed compressed immediate size (and memory access size) for VPBROADCASTB_Eb form 2019-12-21 18:17:51 +00:00
Stanislav Shwartsman
0169605f79 seems like GFNI VGF2P8AFFINEQB and VGF2P8AFFINEINVQB do not have fault suppression 2019-12-21 18:01:58 +00:00
Stanislav Shwartsman
4ac2122f3a rename function to correct English, add broadcast and fault suppression support for EVEX encoded GFNI instructions 2019-12-21 16:12:06 +00:00
Stanislav Shwartsman
dd1ab303df rename function to correct English 2019-12-21 15:54:52 +00:00
Stanislav Shwartsman
723554d535 AVX512: Allow masked fault suppression for many AVX512 instructions - not all cases reviewed yet, more to come 2019-12-21 15:47:29 +00:00
Stanislav Shwartsman
74c73e5a76 AVX512: Allow masked fault suppression for many AVX512 instructions - not all cases reviewed yet, more to come 2019-12-20 15:34:14 +00:00
Stanislav Shwartsman
0e5d843597 AVX512: Allow masked fault suppression for many AVX512 instructions - not all cases reviewed yet, more to come 2019-12-20 14:58:56 +00:00
Stanislav Shwartsman
cff6a67adb AVX512: Allow masked fault suppression for many AVX512 instructions - not all cases reviewed yet, more to come 2019-12-20 14:57:42 +00:00
Stanislav Shwartsman
9fbf974e6b AVX512: Allow masked fault suppression for many AVX512 instructions - not all cases reviewed yet, more to come 2019-12-20 13:45:00 +00:00
Stanislav Shwartsman
222185ad11 AVX512: Allow masked fault suppression for many AVX512 instructions - not all cases reviewed yet, more to come 2019-12-20 13:42:59 +00:00
Stanislav Shwartsman
553a9471d1 fixed push error check for VMX injecting event vector 21 on configuration that doesn't support CET 2019-12-20 13:27:18 +00:00
Stanislav Shwartsman
ec5f526ac0 ENBRANCH and RDSSP should remain NOP when CET not enabled, this means they not require an specifical CPU feature to be decoded into the hnadler 2019-12-20 13:16:52 +00:00
Stanislav Shwartsman
f90e5f4f44 Add initial implementation of the CET (Control Flow Enforcement Technology) emulation according to SDM071
Only missing items (to be added soon):
  - Supervisor Shadow Stack EPT Control is not implemented yet
  - SMM placing for SSP
Currently have to be added manually to some CPUID model, for example to ICL-U
To enable configure with --enable-cet
2019-12-20 07:42:07 +00:00
Stanislav Shwartsman
9c98d68f87 AVX512_VBMI2: Fixed shift count from register source for VBMI2 shift instructions (VPSHRDVD/VPSHLDVD/VPSHRDVQ/VPSHLDVQ) 2019-12-19 21:55:46 +00:00
Stanislav Shwartsman
1b9e0081b4 fixed bugs in recently implemented load methods with fault suppression support 2019-12-19 21:36:13 +00:00