Commit graph

129 commits

Author SHA1 Message Date
Fabian 75dbbbc55a Update rustfmt 2020-12-31 19:14:30 -06:00
Fabian ca2409b024 Pass asize_32 and get_seg_prefix to string instructions 2020-12-31 19:14:30 -06:00
Fabian 2c5fc9ee40 Make dbg_trace pub 2020-12-31 19:14:30 -06:00
Fabian 6eed301779 Don't use is_osize_32 in instructions 2020-12-31 19:14:30 -06:00
Fabian 8c8f42902b Move state out of instructions_0f.rs 2020-12-31 19:14:29 -06:00
Fabian 653f56726b c2rust cleanup: Remove cast in comparison with constant 2020-12-31 19:14:29 -06:00
Fabian 80a69939a1 c2rust cleanup: Use bool 2020-12-31 19:14:29 -06:00
Fabian 034ecd5390 c2rust cleanup: Remove unnecessary type annotations on let bindings 2020-12-31 19:14:29 -06:00
Fabian 764879bad1 s/reg32s/reg32 2020-12-31 19:14:29 -06:00
Fabian 5821ffae16 Remove safe_{read,write} optimisation in non-jit mode 2020-12-31 19:14:29 -06:00
Fabian b7f9662655 Add FORCE_DISABLE_JIT configure flag 2020-12-31 19:14:29 -06:00
Fabian 47034fe588 Fix: Set CS to 16-bit mode correctly 2020-12-31 19:14:29 -06:00
Fabian ae3a652333 jit_add_seg_offset: Assert that segment is not null 2020-12-31 19:14:29 -06:00
Fabian 0b80ec5f82 Remove dead 2020-12-31 19:14:29 -06:00
Fabian 011ccce9bb Remove protected mode check (exceptions can also happen in real mode) 2020-12-31 19:14:29 -06:00
Fabian 6986519fbb Use get_seg_ss/get_seg_cs from JS 2020-12-31 19:14:29 -06:00
Fabian 390bd6d3d5 set_cr0: Be less noisy 2020-12-31 19:14:29 -06:00
Fabian b5def60fb4 Clean up 2020-12-31 19:14:29 -06:00
Fabian c84a814610 Remove unused A20 stuff 2020-12-31 19:14:29 -06:00
Fabian 4bfd024366 Simplify gen_safe_read_write by removing fallback function 2020-12-31 19:14:29 -06:00
Fabian 9a38e6a654 nasmtests: Check exception eip 2020-12-31 19:14:29 -06:00
Fabian 85e846480f Assert that TSC changes so that do_many_cycles_native is guaranteed to make progress 2020-12-31 19:14:29 -06:00
Fabian e2eecc7295 task_switch_test*_jit: assert that jit agrees 2020-12-31 19:14:29 -06:00
Fabian 492a2cf78e Update previous_ip only if page fault is going to happen 2020-12-31 19:14:29 -06:00
Fabian 0c922cea95 Add config::LOG_PAGE_FAULTS 2020-12-31 19:14:29 -06:00
Fabian f98f423d1b Comment 2020-12-31 19:14:28 -06:00
Fabian 0e8c8a1dda More opstats 2020-12-31 19:14:28 -06:00
Fabian c04ca292b9 Run latest rustfmt 2020-12-31 19:14:28 -06:00
Fabian 7c4ed66c20 Cleanup: Rename trigger_gp_non_raising to trigger_gp 2020-08-30 19:37:15 -05:00
Fabian 724090b319 Reduce code size by removing register restoring around safe_{read,write}*_jit 2020-08-30 19:37:15 -05:00
Fabian 799171ba03 Refactor do_page_translation into do_page_walk which does the page walk without calling in case of a fault 2020-08-30 19:37:15 -05:00
Fabian 56dc1af7cc Split SAFE_WRITE stat into WRITE and READ_WRITE 2020-08-30 19:37:15 -05:00
Fabian 8838e263c3 Profiler: Track number of page faults and wasm bytes generated 2020-08-30 19:37:15 -05:00
Fabian 04281702ed Track jit exits to same/different page 2020-08-30 19:37:15 -05:00
Fabian 2c23ffc2cf Use get_eflags_no_arith over flags[0] (minor performance) 2020-08-30 19:37:15 -05:00
Fabian 2837ccd06b Support for gen_safe_read128 and code generation for MOVDQU (F30F6F) 2020-08-30 19:37:15 -05:00
Fabian 70cc242eb1 Simplify call_interrupt_vector from js 2020-08-30 19:37:15 -05:00
Fabian 440b67eda5 Support for gen_safe_write128 and code generation for MOVAPS/MOVDQA (0F29/660F7F) 2020-08-30 19:37:15 -05:00
Fabian e2ab5eabdd Code generation for missing memory operations (8-bit shifts, shrd, shld, xadd) 2020-08-30 19:37:15 -05:00
Fabian f797ce10c9 64-bit operations for gen_safe_{read,write,read_write} 2020-08-30 19:37:15 -05:00
Amaan Cheval 3eb15d328d cpu: Update iret for minor fixes from manual
Citations for these changes:

  https://imgur.com/a/QgNekKL
2020-08-30 19:37:15 -05:00
Amaan Cheval 1d5e0052b4 cpu: Port iret, iret16, iret32 to Rust 2020-08-30 19:37:15 -05:00
Amaan Cheval 8aa06b54e0 cpu: Port switch_cs_real_mode to Rust 2020-08-30 19:37:15 -05:00
Fabian cb0ca91f58 Resolve some internal imports directly 2020-08-30 19:29:54 -05:00
Fabian 53bd41614f Fix minor problem with Rust port of call_interrupt_vector 2020-08-30 19:29:54 -05:00
Amaan Cheval b6b55e5644 cpu: Refactor get_tss_stack_addr to simplify things 2020-08-30 19:29:54 -05:00
Amaan Cheval 0bf4e4faf6 cpu: Port get_tss_stack_addr to Rust 2020-08-30 19:29:54 -05:00
Amaan Cheval de8411f184 Minor: Inline has_error_code 2020-08-30 19:29:54 -05:00
Amaan Cheval 3b94c5f9d3 cpu: Refactor to use error_code: Option<i32> for call_interrupt_vector 2020-08-30 19:29:54 -05:00
Amaan Cheval ce090cfb4e cpu: Inline into InterruptDescriptor and clean call_interrupt_vector 2020-08-30 19:29:54 -05:00