Commit Graph

554 Commits

Author SHA1 Message Date
58c50c4be7 X86 instruction FTST was incorrectly overwriting ST0 instead of FT0 (#1372)
* X86 instruction FTST was incorrectly overwriting ST0 instead of FT0

* credits update
2021-05-08 18:45:14 +08:00
b0f1e46f61 Fix fpip (#1385)
* Revert partial #74

* Import fix from https://lists.nongnu.org/archive/html/qemu-devel/2021-04/msg02868.html

* Fix capstone usage
2021-04-26 00:32:42 +08:00
811e77c7aa Support querying architecture mode besides arm (#1389) 2021-04-26 00:31:29 +08:00
21ec6e8f83 Add ARM BE8 support (#1369)
Co-authored-by: w4kfu <gw4kfu@gmail.com>
2021-03-31 21:22:35 +08:00
34ddafcbcf Fix pausing within Thumb2 ITE blocks (#853) (#880)
Co-authored-by: Rami Ali <flowergrass@users.noreply.github.com>
2021-03-29 22:54:45 +08:00
7ca7e8a79d qemu_getauxval FreeBSD implementation backport (#1366) 2020-12-31 18:53:36 +08:00
4b34042e02 Make Unicorn buildable with MinGW (#1364)
* [WIN32] Allow to build also with MinGW

* [WIN32] Fix build for MinGW
2020-12-23 13:27:06 +08:00
95bc0bdc21 Fix build with LLVM on powerpc64(le) (#1347)
Conflicting symbols need to be undefined before including altivec.h.
2020-10-25 07:34:57 +08:00
644da9babc Fix setjmp/longjmp on native Windows (#1331)
* Add setjmp wrapper

* Add to projects

* Use wrapper on x64

* Always build on x64 and exclude on win32

* Fix signature

* Add comments

* Add comments for os-win32.h

* Add extern decleration

* Support cmake Windows build

* Fix for MinGW
2020-09-22 02:02:43 +08:00
225f6f2889 Return 'indefinite integer value' for invalid SSE fp->int conversions (#1306)
Merge from qemu commit 1e8a98b53867f61da9ca09f411288e2085d323c4.
1e8a98b538
2020-09-21 10:39:00 +08:00
748aceb760 Add qemu_ prefix to bitmap_set and bitmap_clear to avoid conflicts. (#1326)
When unicorn and systemd are combined into a single binary the 2
libraries conflict on bitmap_set and bitmap_clear functions which breaks
unicorn.

Co-authored-by: Nicolae Mogoreanu <mogo@google.com>
2020-09-16 17:09:10 +08:00
c1c0baec7d Fix IP value for UC_MODE_16 (#1321) 2020-09-10 10:02:22 +08:00
a9025c58a4 fixes an issue with ARM APSR register handling: (#1317)
- Q flag / GE flag were not included in APSR register (read/write)
  - UC_ARM_REG_APSR_NZCV register constant was ignored completely.
  - regression test added
2020-08-20 23:24:04 +08:00
3134f33029 fix 64-bit fstenv (#1300)
* fix 64-bit fstenv

* fix fstenv
2020-06-28 01:43:14 +08:00
7ea04acbdc fix some uninitialized vars in fpu 2020-06-07 11:22:18 +08:00
2e0f753e6f save cpu->jmp_env in saving context, so uc_emu_start() can be reentrant. also improved Python binding on handling context 2020-06-05 20:12:44 +08:00
a4784cc96c fix error handling of mmap() calls (#1283) 2020-06-05 10:30:23 +08:00
71a4ab4a6f Removes some bugs found by oss-fuzz (#1266)
Leak on breakpoints
Undefined shift in ARM
2020-05-26 20:52:40 +08:00
6cad700b69 fix recursive UC_HOOK_MEM callbacks for cross pages access (#1113)
Co-authored-by: bruno <bruno>
Co-authored-by: Nguyen Anh Quynh <aquynh@gmail.com>
2020-05-25 16:22:28 +08:00
690ada5f6a Oss-fuzz ideal integration (#1265)
* Adds oss-fuzz badge

* Generic fix for watchpoints leak
2020-05-23 09:59:30 +08:00
17cfef0e56 fix some oss-fuzz (#1259)
* fix oss-fuzz 22107.

* fix oss-fuzz 22112.

* clean up build target.

* fix oss-fuzz 22226.

* fix oss-fuzz 22227.

* fix oss-fuzz 11640.

* fix oss-fuzz 20772.

* remove warning.

* fix oss-fuzz 10459.
2020-05-22 21:58:39 +08:00
216c348c35 Oss-fuzz ideal integration (#1262)
* Fix watchpoint leak in ARM

* Builds fuzz targets with sanitizer support

* Builds fuzz targets with directory driver

* Adds script to dowlonad public corpus

* Adds CIfuzz

To checks Pull Requests with fuzzing

* Use static library for fuzz targets

* Less verbose logs for fuzz driver directory
2020-05-21 16:15:12 +08:00
2c66acf4ee fix #1246 (#1254)
* fix finding python path which only has python3.

* fix #1246, arm host issue.

* skip assembler tests on non-x86 host.

* update macro of dummy value.

* fix MSVC macro.

* update dummy array value macro.

* restore to original qemu code.
2020-05-18 19:57:44 +08:00
08240d5453 fix some oss-fuzz (#1258)
* fix oss-fuzz 22107.

* fix oss-fuzz 22112.

* clean up build target.

* fix oss-fuzz 22226.

* fix oss-fuzz 22227.

* fix oss-fuzz 11640.

* fix oss-fuzz 20772.
2020-05-16 10:38:16 +08:00
18a187b8f8 fix some oss-fuzz (#1255)
* fix oss-fuzz 22107.

* fix oss-fuzz 22112.

* clean up build target.
2020-05-12 01:27:47 +08:00
f988a41369 x86: support read/write to ST registers 2020-05-11 00:24:58 +08:00
149121539b [arm64] Add some cool registers (#1253)
I've added the following registers to the API:

 * PSTATE
 * Exception link registers (ELR_ELx)
 * Stack pointers registers (SP_ELx)
 * MMU (TTBRn_EL1)
 * Exception syndrom registers (ESR_ELx)
 * Faulting virtual address registers (FAR_ELx)
 * PAR (PAR_EL1)
 * MAIR (MAIR_EL1)
 * Vector base address registers (VBAR_ELx)
2020-05-10 21:50:00 +08:00
881e08da01 Fix UAF when deleting hook while in hook callback #1127 (#1130)
* Handle the cpu context save in a more pythonic way, so the context can be serialized and reuse in an other process using the same emulator architecture and modes

* Fix type error ; mistakes a size_t uint64_t ; breaks in 32bit...

* Fix the UAF situation when deleting a hook while being in a hook callback. Added an attribute 'to_delete' to hooks, and a list hooks_to_del to delay the free of the hooks

* Minor fixes ; forgot return type of clear_deleted_hooks ; do not declare variable in for predicate
2020-05-07 14:24:48 +08:00
f435efd4a7 fix some oss-fuzz (#1249)
* fix oss-fuzz 21012.

* fix oss-fuzz 21741.

* fix oss-fuzz 21743.
2020-05-05 11:11:59 +08:00
625399774c X64 base regs (#1166)
* x86: setup FS & GS base

* Fixed base register writes for x64, removed then for x16/x32 (the don't exist there?)

* FS reg comes before GS so the base regs do so, too

* added shebang to const_generator.py

* Added base regs to and added 'all' support to const_generator

Co-authored-by: naq <aquynh@gmail.com>
2020-05-05 08:34:51 +08:00
b7e64f3c99 Fix block hooks being called twice after an early exit from execution. (#1194)
Ensure the TCG exit flag is cleared at the end of cpu_exec. This ensures
that subsequent calls are not polluted by the prior call to request an
early exit. The symptoms of the problem being addressed here are that
after a cpu_exit call triggered within a hook there may still be a
pending tcg_exit_req flag set. This then causes a block to start its
execution and then be aborted (from which point it'll continue because
there's no other condition to service). The start of the execution
causes the block hook to be called, no actual code to be run, and then
the block started again with another block hook call.

This change is discussed in ticket 1193:
    https://github.com/unicorn-engine/unicorn/issues/1193
2020-05-05 08:32:12 +08:00
0cd66bab8a fix qemu/scripts/qapi-build.sh 2020-04-30 14:00:48 +08:00
00bbe2ce7d we do not need Python to build anymore 2020-04-30 13:58:33 +08:00
27167a8ccb delete unused qemu/scripts/qapi-event.py 2020-04-30 11:13:28 +08:00
0d93f055b4 cleanup qemu/configure 2020-04-28 16:46:41 +08:00
2b13230a4d qemu/Makefile cleanup 2020-04-28 13:50:50 +08:00
21b5c122a3 qemu/Makefile cleanup 2020-04-28 13:34:16 +08:00
06d741242d qemu/Makefile cleanup 2020-04-28 13:30:18 +08:00
414c230b59 fix m68k func name (#1245)
* fix finding python path which only has python3.

* fix m68k func name.
2020-04-28 09:51:45 +08:00
9a70675975 qemu/Makefile cleanup 2020-04-28 09:39:10 +08:00
49473d7780 Merge branch 'master' of github.com:unicorn-engine/unicorn 2020-04-28 08:58:41 +08:00
709d081972 more qemu/Makefile* cleanup 2020-04-28 02:38:51 +08:00
dd28727e99 more qemu/Makefile* cleanup 2020-04-28 01:53:39 +08:00
cdd9340113 cleanup qemu Makefile* 2020-04-27 23:01:26 +08:00
d2c66b8386 cleanup qemu/configure 2020-04-27 20:44:11 +08:00
8905ecd5e4 move some operations after hook callback (#1243)
* fix finding python path which only has python3.

* move some operations after hook callback.
2020-04-27 19:54:58 +08:00
5826b1fa54 Merge branch 'master' of github.com:unicorn-engine/unicorn 2020-04-27 01:51:59 +08:00
cc5bfbc844 delete unused file i386-softmmu.mak 2020-04-27 01:31:39 +08:00
0ac28359a3 Makefile cleanup 2020-04-25 17:54:14 +08:00
d947b5f76f cleanup qemu Makefile 2020-04-24 18:06:21 +08:00