Commit Graph

197 Commits

Author SHA1 Message Date
Stanislav Shwartsman
f8d1050a3f
Implemented SVM VM_CR_MSR and INIT redirection feature (#220)
Save and restore SVM MSRs
2024-01-16 07:42:28 +02:00
Shwartsman
e4deec2aca cleanups and code updates before thinking of INIT redirection implementation for AMD SVM 2024-01-14 12:55:43 +02:00
Stanislav Shwartsman
997fd85ec9 Set EFLAGS.RF on triple fault before shutdown or VMEXIT 2024-01-12 21:12:17 +02:00
Stanislav Shwartsman
6977fc05d9 VMX: adjust RFLAGS saved into guest state on VMEXIT according to VMX documentation:
For APIC-access VM exits and for VM exits caused by:
- EPT violations
- EPT misconfigurations
- page-modification log-full events or
- SPP-related events
the value saved depends on whether the VM exit occurred during delivery of an event through the IDT ...

also handle RFlags saved if VMEXIT was caused directly by an event that would normally be delivered through the IDT

should fix #215
2024-01-12 20:01:53 +02:00
Stanislav Shwartsman
0eab037907 dynamically allocate VMCB_CACHE only if SVM is actually enabled by CPU model
also reduces include dependency on svm.h
2024-01-12 00:56:09 +02:00
Shwartsman
89d992b5b8 fixed (#214) wrong MSR name typo in MSR error message
in real mode exceptions should not push error code to stack so the same should be for VMEXIT due to HW exception from unrestricted real mode guest (fixes #211)
2024-01-11 08:10:42 +02:00
Stanislav Shwartsman
47edb90b02 remove in_repeat obsolete usages 2023-11-27 20:15:00 +02:00
Shwartsman
cc4f594ede implemented process-posted-interrupts VMX extension 2023-11-27 20:15:00 +02:00
Stanislav Shwartsman
a5c6bcfd15 remove in_repeat variable and replace it with correct EFLAGS.RF management 2023-11-27 13:51:25 +02:00
Stanislav Shwartsman
ca4ca03be8 remove #ifdef around in_repeat variable, it is always needed 2023-11-26 23:21:51 +02:00
Stanislav Shwartsman
c1c102ab04 coding style, cleanups and optimizations 2023-11-19 20:31:05 +02:00
Shwartsman
f8c94e83ff add missing SVM VMEXIT in case of triple fault shutdown 2023-11-12 13:38:16 +02:00
Stanislav Shwartsman
1e4f1624c8 remove trailing whitespace from source files 2022-08-23 21:46:04 +03:00
Stanislav Shwartsman
fac15a7d03 updates to MTF code:
if VMEntry delivered an event of event happen right after VMEntry - MTF becomes pending immediatelly
2022-08-16 21:37:36 +03:00
Stanislav Shwartsman
3f65841714
use boolean constants true/false instead of 0/1 (#26)
* use boolean constants true/false instead of 0/1

* fix code comment

Co-authored-by: Stanislav Shwartsman <sshwarts@users.sourceforge.net>
2022-07-30 18:38:22 +03:00
Stanislav Shwartsman
c87ce2d11a fixed some MSVC wannings in CPU code 2021-02-08 13:06:44 +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
ff167d0f65 change a bit more defines to const with type 2019-12-26 16:48:33 +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
bcfcaf3958 unify branch_far32 and branhc_far64 methods 2019-12-14 17:20:35 +00:00
Stanislav Shwartsman
2c5588cda0 convert some defines to enums and consts 2017-03-18 21:25:06 +00:00
Stanislav Shwartsman
6fd2d32180 fixed exception error code for debugger and instrumentation 2014-12-18 19:45:03 +00:00
Stanislav Shwartsman
fea4d47830 fixed spelling in comments 2014-12-16 20:11:08 +00:00
Stanislav Shwartsman
24cb334304 fixed large code duplication in write_new_stack methods 2014-10-12 18:59:10 +00:00
Stanislav Shwartsman
d9fc472ba7 Added VMEXIT instrumentation callback
Fixed possible RSP corruption in SMP mode - the speculative_rsp variable might be not reset properly
2013-10-23 21:18:19 +00:00
Stanislav Shwartsman
4bed791ccb Added year 2013 to Copyright in all files already modified in new year 2013-01-19 20:45:03 +00:00
Stanislav Shwartsman
c337b7babb Intel Software Developers Manual rev45 was released
Added CPUID bits and preparations for newly documented VMX features
2013-01-16 16:57:48 +00:00
Stanislav Shwartsman
3cd11b02ee optimization and bugfix for prev commit 2012-10-04 21:30:50 +00:00
Stanislav Shwartsman
1b228aec32 Fixed double and triple fault detection in exception.cc. Remove errorno variable from CPU (redundant now) 2012-10-04 20:52:27 +00:00
Stanislav Shwartsman
e397a86ce0 fixed code duplication related to EXT field 2012-09-29 09:31:34 +00:00
Stanislav Shwartsman
df90b80352 set of small cpu fixes 2012-08-09 13:11:25 +00:00
Stanislav Shwartsman
e0729e32b8 fixed bug 3548108 VMEXIT instruction length Not always getting updated 2012-07-26 16:03:26 +00:00
Stanislav Shwartsman
ec06475dbf improve x86 hw breakpoint handling 2012-07-11 15:07:54 +00:00
Stanislav Shwartsman
f5d55f5eb6 - Implemented Task Switch intercept in SVM, cleanup in task switch handling code
- Changed (c) year in several cpu files
- Cleanup and indent fixes in VMX code
2012-01-11 20:21:29 +00:00
Stanislav Shwartsman
cb366e00c5 fixed code duplication in exceptions 2012-01-11 06:27:35 +00:00
Stanislav Shwartsman
ba7887f31c fixed code duplication with v86 interrupt redirection 2012-01-10 08:13:34 +00:00
Stanislav Shwartsman
8b4a2c2034 implemented some more intercepts.
fixed compilation without SVM
2011-12-26 16:33:13 +00:00
Stanislav Shwartsman
63fe52f601 accessors for DR6 and DR7 fields 2011-03-15 20:20:15 +00:00
Stanislav Shwartsman
7d80a6ebe0 Adding Id and Rev property to all files 2011-02-24 21:54:04 +00:00
Stanislav Shwartsman
8e94474e03 bug fix 2010-06-21 05:35:45 +00:00
Stanislav Shwartsman
89c87e2743 fixes 2010-04-14 17:33:19 +00:00
Stanislav Shwartsman
f5ce2a7639 split crreg access functions to separate file 2010-03-25 21:33:07 +00:00
Stanislav Shwartsman
b47c493388 fixes 2010-03-20 13:58:02 +00:00
Stanislav Shwartsman
d0bd30e4b9 optimization 2010-03-18 15:19:16 +00:00
Stanislav Shwartsman
78badcbde4 cleanup 2010-03-17 21:55:19 +00:00
Stanislav Shwartsman
1c6cc35b06 fixed TPR shadow 2010-03-15 14:18:36 +00:00
Stanislav Shwartsman
ced1e41a9f code reorg 2010-03-14 16:02:42 +00:00
Stanislav Shwartsman
cffe32dd2c remove unused param from exception() call 2010-03-14 15:51:27 +00:00
Stanislav Shwartsman
a16eb3c4bf typo fix 2010-03-05 19:52:18 +00:00
Stanislav Shwartsman
189553d702 bugfix 2010-03-05 08:54:07 +00:00