Skip to content

Commit

Permalink
op_helper: switch to symb mode in fxrstor on symbolic data
Browse files Browse the repository at this point in the history
Signed-off-by: Vitaly Chipounov <vitaly@cyberhaven.io>
  • Loading branch information
vitaly-cyberhaven committed May 23, 2019
1 parent 01eec93 commit 5e4ee0b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/cpu/se_libcpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ struct se_libcpu_interface_t {
uint64_t (*read_mem_io_vaddr)(int masked);
int (*is_port_symbolic)(uint64_t port);
int (*is_mmio_symbolic)(uint64_t phys_addr, unsigned size);
int (*is_vmem_symbolic)(uint64_t vaddr, unsigned size);

uintptr_t (*get_host_address)(uint64_t paddr);

Expand Down
6 changes: 6 additions & 0 deletions src/target-i386/op_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -4623,6 +4623,12 @@ void helper_fxrstor(target_ulong ptr, int data64) {
raise_exception(EXCP0D_GPF);
}

#if defined(CONFIG_SYMBEX) && !defined(SYMBEX_LLVM_LIB)
if (g_sqi.mem.is_vmem_symbolic(ptr, 0x200)) {
g_sqi.exec.switch_to_symbolic(GETPC());
}
#endif

FPUC_W(lduw(ptr));
fpus = lduw(ptr + 2);
fptag = lduw(ptr + 4);
Expand Down

0 comments on commit 5e4ee0b

Please sign in to comment.