-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3991 from Sonicadvance1/fix_feat_lrcpc_sigbus
Arm64: Fixes SIGBUS handler for FEAT_LRCPC
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
%ifdef CONFIG | ||
{ | ||
"Env": { | ||
"FEX_TSOENABLED": "1", | ||
"FEX_TSOAUTOMIGATRION": "0" | ||
} | ||
} | ||
%endif | ||
|
||
; FEX-Emu had a bug where SIGBUS handling of unaligned loadstores using FEAT_LRCPC would accidentally try using the FEAT_LSE atomic memory operation | ||
; handlers. It wouldn't find the handler for FEAT_LRCPC instructions (because it was only supposed to handle FEAT_LSE instructions) and fault out. | ||
; This happens because FEAT_LRCPC and FEAT_LSE instructions partially share an instruction encoding and FEX forgot to check for FEAT_LRCPC first | ||
; before using the FEAT_LSE handler. | ||
mov r15, 0xe000_0000 | ||
|
||
; Atomic unaligned load across 16-byte and 64-byte granule | ||
mov rax, qword [r15 + 15] | ||
mov rbx, qword [r15 + 63] | ||
|
||
; Atomic unaligned store across 16-byte and 64-byte granule | ||
mov qword [r15 + 15], rbx | ||
mov qword [r15 + 63], rcx | ||
|
||
hlt |