Commit Graph

97 Commits

Author SHA1 Message Date
Denis Drakhnia f43cc408fb e2k: move e2k_psp_new to cpu.c
Signed-off-by: Denis Drakhnia <numas13@gmail.com>
2022-06-18 15:03:07 +03:00
Denis Drakhnia bcc04e0c5b e2k: Increase the number of NR to 224.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:20 +03:00
Denis Drakhnia 75583b5082 e2k: Reorg cpu dump.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:20 +03:00
Denis Drakhnia 48290cb80c e2k: Update get/set state regs.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:20 +03:00
Denis Drakhnia c8ed74f626 e2k: Add tags and force_save_alc_dst properties.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:20 +03:00
Denis Drakhnia 0914c72c8b e2k: Fix segfault.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:20 +03:00
Denis Drakhnia 52e67df3a1 e2k: Reorg usage of registers.
Till then we had separate stage to write results of
an operations to registers. Now operations will write
result immediately to a destination register. Registers
will be saved to a temporary location if following
operations in a bundle must read them.

The change elliminates additional branches for
conditional operations in the write stage and reduces
data movements.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:20 +03:00
Denis Drakhnia ba89b350dc e2k: signals: Save and restore more state.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:20 +03:00
Denis Drakhnia 1d0e52b6a0 e2k: Bug fixes.
Fix time fields in stat64.

Restore and save a breakpoint frame in a signal
handler. This will fix a segfault if a signal will
be raised while a cpu is in a breakpoint.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:20 +03:00
Denis Drakhnia 8f4de9d485 e2k: Implement basic v5 support.
Add gdb xml files for e2k.
Tags are partially disabled for better performance.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 6fb98e718e e2k: Move TCG translation parts into single file.
The TCG translation was splitted into multiple files and
it was painful because it has a lot of cross references.

Reorg FX helpers.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 17be44b21b e2k: Use one large array for registers.
Previously was used two separate arrays for low and
high halves of a register. Now we can pass direct
pointer to a register into helpers instead of copying
the halves into a temporary buffer and pass pointer to
that buffer.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia bed634d944 e2k: Use %pfpfr for f32 and f64 operations.
%fpcr and %fpsr have been used for the operations but
%pfpfr must be used instead.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia b0a1af39c6 e2k: Add a fake atomic execution.
QEMU has cpu_exec_step_atomic function to run
one instruction in an exclusive mode but we need
to execute multiple instructions in that mode.
I don't want to modify the function.

The solution provides a correct execution of
atomic operations like on real CPU but needs
more testing to prove that it works correctly
in all cases.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 374e658eb1 e2k: Add access_hw_stacks and backtrace syscalls.
Special system calls for managing hardware stacks.
Required for C++ exceptions.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia e440ebc3db e2k: Basic impl of e2k32-linux-user.
Fix target_stat64 field types in 32-bit mode.
Basic impl of getpl.
Basic impl of ldgd{b,h,w,d}.
Basic impl of stgd{b,h,w,d}.
Add e2k exceptions.
Add Dynamic hw stacks expansion.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 7198f44549 e2k: Always SPILL/FILL in FX window mode.
It will fix 'finish' command in gdb.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 47c93f9dec e2k: Skip breakpoints into fake kernel address space.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 3cf004027d e2k: Increase PCS and PS sizes.
Dynamically expanding the stack has not yet been
implemented, but sometimes applications require
larger stacks.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 5e66da5f7d e2k: Delete top CRs from cpu state.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
2022-06-10 11:48:19 +03:00
Denis Drakhnia 26b9e9a1e4 e2k: Impl basic unix signals support. 2022-06-10 11:48:19 +03:00
Denis Drakhnia 8a56f792b7 e2k: Probe AAU read access once per page. 2022-06-10 11:48:18 +03:00
Denis Drakhnia 00502466f2 e2k: Always ignore lock load. 2022-06-10 11:48:18 +03:00
Alibek Omarov 400947bba3 e2k: implement fsqrttd/fxsqrttxx through ignoring what fsqrtid/fxsqrt{i,u}xx does 2022-06-10 11:48:18 +03:00
Denis Drakhnia 65675ac1cf e2k: Check address before MOVA memory read. 2022-06-10 11:48:18 +03:00
Denis Drakhnia 7c4ff94e5f e2k: Impl basic init thread support. 2022-06-10 11:48:18 +03:00
Alibek Omarov f56cad7923 e2k: implement detecting ISA version by ELF flags, throw an error for protected mode and x86 recompiled binaries for now 2022-06-10 11:48:18 +03:00
Denis Drakhnia 23a0139ee6 e2k: Remove control.c 2022-06-10 11:48:17 +03:00
Denis Drakhnia 0b7f461be7 e2k: Remove pshtp and window base. 2022-06-10 11:48:17 +03:00
Denis Drakhnia 89aa3a80c1 e2k: Remove {GET,SET}_FIELD macros. 2022-06-10 11:48:17 +03:00
Denis Drakhnia d37ee639b1 e2k: Add {u,s}{div,mod}x instrs. 2022-06-10 11:48:17 +03:00
Denis Drakhnia e4e22e089c e2k: Prepare to remove CRs from env. 2022-06-10 11:48:16 +03:00
Denis Drakhnia 06df1e9168 e2k: Impl e2k_longjmp2 syscall. 2022-06-10 11:48:16 +03:00
Denis Drakhnia 60faf17466 target: e2k: HACK: Unlock mem addr forces %MLOCK condition. 2022-06-10 11:48:16 +03:00
Denis Drakhnia 1a52b6054b target: e2k: Add temps for FX/SIMD ops. 2022-06-10 11:48:15 +03:00
Denis Drakhnia 8881486b62 target: e2k: Remove rptr and tptr from state. 2022-06-10 11:48:15 +03:00
Alibek Omarov ebb2b2485f target: e2k: add basic fpu instructions 2022-06-10 11:48:15 +03:00
Denis Drakhnia 21b39b8206 target: e2k: Delete hack for saving USD registers on proc call/ret. 2022-06-10 11:48:15 +03:00
Denis Drakhnia 4646e43803 target: e2k: Add tlb_fill handler. 2022-06-10 11:48:15 +03:00
Denis Drakhnia d402c52f4a target: e2k: %cr0 must hold pregs and ip of previous procedure. 2022-06-10 11:48:15 +03:00
Denis Drakhnia ad6bc687e4 target: e2k: HACK: Tag storage for procedure stack. 2022-06-10 11:48:15 +03:00
Denis Drakhnia 5b444c9356 target: e2k: Add dbl window modifier. 2022-06-10 11:48:15 +03:00
Denis Drakhnia 381868f71a target: e2k: Return aligned pointer from getsp. 2022-06-10 11:48:15 +03:00
Denis Drakhnia 83e2503867 target: e2k: HACK: Add stack for USD registers.
CPU must restore `USD` after calls but I don't know how it should be implemented.
2022-06-10 11:48:15 +03:00
Denis Drakhnia 4a572f8263 target: e2k: Add xregs. 2022-06-10 11:48:14 +03:00
Denis Drakhnia 65ffbc6d30 target: e2k: Reading %ilcr for gdb. 2022-06-10 11:48:14 +03:00
Denis Drakhnia 1c03415d9e target: e2k: Restricted loop_mode implementation. 2022-06-10 11:48:14 +03:00
Denis Drakhnia 31e084720a target: e2k: Add basic mova{b,h,w,d} impl. 2022-06-10 11:48:14 +03:00
Denis Drakhnia bd6208c09f target: e2k: Fix ctpr size. 2022-06-10 11:48:14 +03:00
Denis Drakhnia 93acd43783 target: e2k: Add staa{b,h} instrs. 2022-06-10 11:48:14 +03:00