Commit Graph

3043 Commits

Author SHA1 Message Date
lazymio
379791ad56
Merge pull request #1995 from apparentlymart/f-qemu-backport-wfi-umode
[QEMU backport] riscv: fix wfi exception behavior
2024-09-04 15:36:00 +08:00
Jose Martins
58f1a612e8 target/riscv: fix wfi exception behavior
The wfi exception trigger behavior should take into account user mode,
hstatus.vtw, and the fact the an wfi might raise different types of
exceptions depending on various factors:

If supervisor mode is not present:

- an illegal instruction exception should be generated if user mode
executes and wfi instruction and mstatus.tw = 1.

If supervisor mode is present:

- when a wfi instruction is executed, an illegal exception should be triggered
if either the current mode is user or the mode is supervisor and mstatus.tw is
set.

Plus, if the hypervisor extensions are enabled:

- a virtual instruction exception should be raised when a wfi is executed from
virtual-user or virtual-supervisor and hstatus.vtw is set.

Signed-off-by: Jose Martins <josemartins90@gmail.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: 20210420213656.85148-1-josemartins90@gmail.com
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2024-09-03 13:44:55 -07:00
Duncan Ogilvie
87610baa3f
Fix emulator detection (#1966)
* Add a quick test helper macro to test_x86.c

* Add regression tests for bswap and rex prefixes

* Properly ignore REX prefixes when appropriate

* Fix bswap ax emulator detection
2024-07-19 11:11:21 +08:00
BitMaskMixer
8e6499fb0b
gcc compiler warning fixes (#1977)
* fix for enum-int-mismatch

* fix for unused-variable
2024-07-19 11:09:57 +08:00
scribam
1ed4c43ff3
Update cmake minimum required to version 3.5 (#1976) 2024-07-19 11:08:13 +08:00
scribam
feb166d475
Update github workflows (#1975) 2024-07-19 11:06:53 +08:00
PhilippTakacs
7d8b06b704
snapshot restore don't remove terminating regions (#1968) 2024-06-29 22:36:02 +08:00
Arsenii es3n1n
ddd6b7c254
build: allow CMAKE_MSVC_RUNTIME_LIBRARY #1958 (#1960) 2024-06-12 14:46:13 +08:00
Bet4
abefcb2f89
Remove using of distutils (#1964)
* Remove using of distutils

* Upgrade setuptools to fix CI

* Use Python 3.7 in build_wheel.sh
2024-06-12 14:45:23 +08:00
Jordan Moore
c39e80231c
Update Zig bindings to Zig 0.12.0 (#1951)
* update zig bindings to Zig 0.12.0

* support zig package manager

* Fix zig macos ci build

* Make the macos build use 1 process instead of hitting the macos
  process limit immediately, utilize the build.zig `-Dparallel
  false` option for macos ci
* Split the macos ci into a new build stage (out of the ubuntu,
  macos build maxtrix), to allow for multiple architecture builds
  in the future after the zig bindings improve
2024-05-06 21:02:24 +08:00
Nguyen Anh Quynh
751a4d0f03 compile warning: remove some unused vars 2024-05-02 16:26:41 +08:00
mio
85b289d074
Use correct lib path 2024-04-30 18:06:30 +08:00
mio
da84208d89
Hide symbols for unicorn-common 2024-04-29 11:55:06 +08:00
Nguyễn Anh Khoa
38091b3046
Add unicorn_py3 folder to setup.py (#1942)
* Add unicorn_py3 folder to setup.py

* Run sample in CI

* Fix pip install & py2 breakage

---------

Co-authored-by: mio <mio@lazym.io>
2024-04-28 00:11:05 +08:00
Nguyen Anh Quynh
c136b6b2bf fix some compiler warnings 2024-04-22 20:03:07 +08:00
Charles Ferguson
ef34d92b2f
Add hooks doc written by @gerph 2024-04-19 18:41:28 +08:00
lazymio
cff94a4a56
Merge pull request #1932 from lockbox/rust-conditional-compilation
Rust conditional compilation
2024-03-28 19:29:23 +08:00
lockbox
c850db1125 Inherit architecture support from cfg features
While the bindings conditionally compile code based on the cfg
flags, we still include the architecture support in emitted rust
code. This patch removes the ability to refer to architectures
that cannot possibly be supported.
2024-03-27 17:30:53 -04:00
lockbox
30b99601d2 apply default rust 2021 formatting 2024-03-27 16:54:51 -04:00
lazymio
b4f2ac9aab
Merge pull request #1930 from lockbox/address-typo
Address typo in documentation of address in memory event callbacks
2024-03-20 13:52:31 +08:00
lockbox
321de00f36 [typo]: Correctly document address parameter in mem hook callbacks 2024-03-18 17:51:35 -04:00
lazymio
227ff1d8bd
Merge pull request #1928 from mlgiraud/feat/add_start_end_to_hook
Feature: Bindings: add start end to block hook
2024-03-11 19:50:46 +08:00
Mark Giraud
d4f5bf1be2
fix: Fix rust test that was missing a parameter 2024-03-11 12:31:54 +01:00
mio
e03109d8c9
Respect users' decision for UC_ERR_INSN_INVALID 2024-03-08 17:31:27 +08:00
mio
a9a54aed2f
Fix for xcode build 2024-03-08 17:28:46 +08:00
mio
4c4d582fcb
Also add _repr_ for UcReg 2024-03-08 17:07:08 +08:00
mio
13f17e5b3f
Apply repr for C structs 2024-03-08 16:48:31 +08:00
mio
9463d00c3e
Merge remote-tracking branch 'origin/dev' into dev 2024-03-08 16:20:58 +08:00
mio
dae2391bb0
Apply fix for linux2 2024-03-08 16:19:53 +08:00
mio
399f204787
Merge elicn's work 2024-03-08 16:16:12 +08:00
lazymio
0bca8df694
Merge pull request #1796 from bet4it/dylib
Fix dynamic linkage on msvc
2024-03-08 15:16:36 +08:00
lazymio
ba92f79c9e
Merge pull request #1823 from unicorn-engine/restore-py2
[RFC] Restore py2 compatibility by using 2 files
2024-03-08 15:12:24 +08:00
lazymio
d1da4de080
Merge pull request #1929 from xclusivor/master
Remove semicolons in python files
2024-03-08 15:10:58 +08:00
xclusivor
4a694d8a30 remove semicolons 2024-03-06 02:15:02 -05:00
Mark Giraud
00680412d3
feat: Add start and end address to rust block hook binding 2024-02-26 11:20:27 +01:00
mio
24f898fb58
Fix #1869 2024-02-15 15:22:32 +08:00
lazymio
8a1c8daca3
Add a comment 2024-02-13 19:11:22 +08:00
lazymio
71c729a9d7
Define HAVE_SPRR 2024-02-13 19:09:35 +08:00
lazymio
7012e4599b
Remove debugging session 2024-02-13 16:22:16 +08:00
lazymio
4245475514
Detect if we have valid pthread_jit_write_protect_np 2024-02-13 16:21:53 +08:00
lazymio
67deee7771
dbg 2024-02-13 14:46:08 +08:00
lazymio
b31081a105
Remove unused var 2024-02-13 14:38:48 +08:00
lazymio
aef3bd4a27
Fix defines in uc.c 2024-02-13 12:11:27 +08:00
lazymio
78ea3c8301
Fix m1 defines 2024-02-13 11:52:10 +08:00
lazymio
a4ba7c9dd5
Add inline 2024-02-13 11:48:24 +08:00
lazymio
591b562721
Fix defined 2024-02-13 11:38:49 +08:00
lazymio
a6fb2a6870
Save jit state before/after callback 2024-02-13 11:13:01 +08:00
lazymio
f3323469d0
Format 2024-02-12 00:10:58 +08:00
lazymio
822bb527f3
M1 W^X fully supported 2024-02-12 00:10:44 +08:00
lazymio
e915e18987
Add .cache 2024-02-12 00:10:08 +08:00