Conversation
|
Status: tested on TinyCorePure64-16.2.iso and Fedora-Workstation-Live-43-1.6.x86_64.iso using turned out that both disk images do not really enable FRED and only make use of LKGS instruction. |
7e2268f to
bc46203
Compare
c81cc63 to
4c930aa
Compare
876938f to
238b32e
Compare
|
Bit64u old_RIP = RIP; It seems the logic here is reversed. According to the manual: IA32_FRED_CONFIG & ~FFFH for events that occur in ring 3 and |
Thanks, fixed this issue and also another nearby problem related to ~0xfff constant truncation. |
|
// update registers defining context #if BX_SUPPORT_CET // save state on stack It appears that an RSP -= 64 operation is missing here. According to the Intel Manual (Appendix A), the pseudocode for FRED event delivery specifically uses the term push8b to save the return state, and pop8b for the ERETS/ERETU instructions. |
Thanks, pushed the fix as well |
|
I have tested the ERETU and ERETS instructions (with CET=0), and the execution results generally align with the manual's specifications. I have also added xchg bx, bx—hope this helps.a.zip |
add fred.cc dummy file add FRED MSR enums to msr.h shape of ERETS add FRED MSR MSRs to msr.cc FRED Event Delivery initial code 64-bit CR4 support fred ISA decoding and other random stuff FRED modifies behavior of existing instructions added LKGS emulation continue implementation, mainly VMX support self use CR4 class in VMX host and guest state structures CSL is MSR_IA32_FRED_CONFIG[1:0], not extra state fixed non-printable character in comment, continue implementation support also CR4_HI print in debug dump implement loading of CS and SS in ERETU started VMX support for FRED other way of handling FredEventDelivery add (c) continue implementation mention FRED in CHANGES proper way to load CS and SS in ERETU
…n stack faults (but CS/SS setup cannot be undone)
|
FRED moved to official SDM |
Implementation of Flexible Return and Delivery (FRED) ISA extensions