Commit Graph

3781 Commits

Author SHA1 Message Date
Shwartsman
591e2aa79f bugfix: when CET was not compiled in the emulation behavior of non-CET CPU was altered
CET 'change' some x86 behavior
For example EPTP[7] become not-reserved and write to it not fail anymore
VMX doesn't check error code for CP exception if CET is enabled
These behaviors these changed even when CET was not compiled in
2023-11-21 15:35:49 +02:00
Shwartsman
bd4cb7ffa6 fixed compilation without SVM configured in 2023-11-20 19:10:46 +02:00
Shwartsman
0cc21d166d fixed compilation with CET not compiled in 2023-11-20 15:24:57 +02:00
Shwartsman
04ffb4cf03 fixed compilation with .conf.nothing 2023-11-19 23:55:52 +02:00
Shwartsman
a7a443ab46 guard SVM functions with ifdef 2023-11-19 23:24:13 +02:00
Stanislav Shwartsman
36a1a3df86 fixed FPATAN for case of |x|=|y|
but i am pretty sure same problem might still exists for other arguments :(
need to resurrect FPU functions unit testing ...
2023-11-19 22:00:46 +02:00
Stanislav Shwartsman
0b2231b799 fixed comment 2023-11-19 20:46:53 +02:00
Stanislav Shwartsman
c1c102ab04 coding style, cleanups and optimizations 2023-11-19 20:31:05 +02:00
Stanislav Shwartsman
a923880b47 fix compilation warning 2023-11-19 07:54:40 +02:00
Stanislav Shwartsman
7886369102 simplify rdrand code for future extension 2023-11-19 07:29:10 +02:00
Stanislav Shwartsman
26f60a6ea4 spelling fix in the comment 2023-11-18 21:48:42 +02:00
Stanislav Shwartsman
12ce649b42 fix GFNI instructions emulation 2023-11-18 20:15:29 +02:00
Stanislav Shwartsman
a0334ef2b2 change some consts back to defines to simplify integration of code to support variable PA length (rest of the code still WIP) 2023-11-18 16:53:44 +02:00
Stanislav Shwartsman
86082838af added missing else which caused redundant memory access for 512-bit loads 2023-11-18 14:52:55 +02:00
Stanislav Shwartsman
054767ff8c enable MOVDIRI for TigerLake 2023-11-18 12:35:28 +02:00
Stanislav Shwartsman
a3fe8c2c8d introduce get_efer_allow_mask function to avoid placing that code directly in init.cc 2023-11-17 23:40:28 +02:00
Stanislav Shwartsman
9bda4eba28 introduce GET64_FROM_HI32_LO32 to form 64-bit integer from 2 32-bit 2023-11-17 23:31:38 +02:00
Stanislav Shwartsman
a9625e949d update crregs.h with all known XSAVE/XRESTOR state information
including not implemented state
2023-11-17 23:24:00 +02:00
Stanislav Shwartsman
0730ff4c4a added a comment for future: some memory operations must be done atomically
these are include LOCKed RMW of course and also a lot of others
in the future it will be very hard to find all the cases that must be atomic so better to start marking them already now
try to mark every RMW case for atomicity requirements
no code changes, only comments
2023-11-17 23:18:43 +02:00
Stanislav Shwartsman
1ad2ee6d4c use isReadOK instead of magic arithmetic for system_read_* methods
introduce system_write_qword as well
2023-11-17 23:14:38 +02:00
Stanislav Shwartsman
01e744b507 bugfix for CET/XSAVE: XSAVE/XRESTOR wrongly determined if CTE.U is in XINIT state 2023-11-17 01:35:32 +02:00
Stanislav Shwartsman
a9d07b5a51 coding style, move variables definition closer to its use, use constants instead of defines 2023-11-14 20:14:38 +02:00
Stanislav Shwartsman
4941bb1f07 sync emulated time when linking traces 2023-11-14 19:26:56 +02:00
Stanislav Shwartsman
fde226f31c improve fix for VMCS_GUEST_PENDING_DBG_EXCEPTIONS saved on VMEXIT (should be cleared after most of VMEXITs)
handle some corner cases
2023-11-14 15:59:59 +02:00
Stanislav Shwartsman
60cc8020e8 Fixed VMCS_GUEST_PENDING_DBG_EXCEPTIONS saved on VMEXIT (should be cleared after most of VMEXITs) 2023-11-13 20:02:03 +02:00
Shwartsman
cc6f8284ff Merge branch 'master' of https://github.com/bochs-emu/Bochs 2023-11-12 17:17:01 +02:00
Shwartsman
4f739d7e88 simplification: dbg_show_symbolic with no return value 2023-11-12 13:38:59 +02:00
Shwartsman
f8c94e83ff add missing SVM VMEXIT in case of triple fault shutdown 2023-11-12 13:38:16 +02:00
Stanislav Shwartsman
f5b54a4d33
Implemented MOVDIRI instruction (#129)
Co-authored-by: Stanislav Shwartsman <sshwarts@users.sourceforge.net>
2023-11-11 20:30:12 +02:00
Stanislav Shwartsman
f85c633d3d
preserve original VMCBPTR after SVM VMLOAD/VMSAVE instructions (#128)
Co-authored-by: Stanislav Shwartsman <sshwarts@users.sourceforge.net>
2023-11-11 17:52:10 +02:00
Stanislav Shwartsman
154896d923 Revert "fix code duplication"
This reverts commit 29c7a84c08.
2023-11-11 12:44:01 +02:00
Stanislav Shwartsman
29c7a84c08 fix code duplication 2023-11-11 12:19:27 +02:00
Stanislav Shwartsman
913c8a0ac9 Merge branch 'master' of https://github.com/bochs-emu/Bochs 2023-11-09 19:15:42 +02:00
Stanislav Shwartsman
8594972389 final resolution for issue #2 : address VEXPAND* and VPSHUFBITQMB instructions 2023-11-09 19:15:32 +02:00
Shwartsman
9f27681b54 fix compilation with CPU LEVEL<6 2023-11-08 07:15:39 +02:00
Stanislav Shwartsman
b78e93c9e3 optimize handling of allowed_to_run_FPU_MMX instructios common block
now checked at decode and not at every instruction
simpler code and also 1% faster winXP boot time as bonus
other x87 and mmx heavy guests may benefit even more
2023-11-08 06:48:53 +02:00
Shwartsman
8f30812180 resolve github issue #57 + more clear variable name 2023-11-07 16:10:41 +02:00
Stanislav Shwartsman
7469bcb69a
measure host stack depth during simulation to avoid excessive chainin… (#119)
…g depth

never allow beyong 64K stack
2023-11-05 07:08:36 +02:00
Stanislav Shwartsman
975c11fe09 fix canonical address calculation broken with LASS merge 2023-10-30 07:08:44 +02:00
Stanislav Shwartsman
18deee022f
make CPU to use C++ template for implementation of CPU methods (#115)
this allow to remove a lot of code from CPU common methods
2023-10-30 06:57:16 +02:00
Stanislav Shwartsman
8cc85b1133 fixed compilation warnings from CI/DI on github 2023-10-29 23:39:32 +02:00
Stanislav Shwartsman
96b887a9bb
code refactor towards fixing issue #2 (#112)
next step new methods for VEXPANDPS_MASK_VpsWpsR and
VEXPANDPD_MASK_VpdWpdR with mask and memory operand will be introduced
with fault suppression support
legacy load methods aren't good because the loads here actually read
POPCNT(mask) elements from memory src
2023-10-28 22:21:42 +03:00
Stanislav Shwartsman
9981f76ef9 correctly advance to next instruction for MONITOR with non-WB memory type 2023-10-23 09:32:25 +03:00
Shwartsman
7568149dd8 fix compilation without EVEX 2023-10-22 15:58:28 +03:00
Shwartsman
02c4f85a89 implemented proper masked load for VPMOVSX/ZX instructions + bugfix 2023-10-20 20:13:29 +03:00
Shwartsman
5103d97ece mask use of CUT_OPMASK_TO macro instead of magic arithmetic 2023-10-19 16:59:32 +03:00
Shwartsman
63286528b5 take axv512 masted read/write helpers to separate file 2023-10-19 16:52:55 +03:00
Stanislav Shwartsman
e0cc12471c
fixed issue #95 port_e9_hack (#101)
refactoring of port_e9_hack configuration options
do not allow port e9 access for all rings if port_e9_hack is not enabled

Co-authored-by: Stanislav Shwartsman <sshwarts@users.sourceforge.net>
2023-10-18 08:19:33 +03:00
Shwartsman
133144ae41 update include dependencies for CPU, MEMORY and BX_DBG folders 2023-10-16 19:42:44 +03:00
Shwartsman
daa0e4506d add more features to configure scripts in repo (they are used for building release)
add SVM, EVEX, CET

reduce compilation dependencies
remove paramtree.h from bochs.h so many modules won't include it anymore

indentation fixes
2023-10-16 16:40:05 +03:00