Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JIT ARM64-SVE: Add Sve.LoadVector*FirstFaulting APIs #104964

Merged
merged 108 commits into from
Aug 8, 2024
Merged
Changes from 1 commit
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
d0efc9e
Initial work
TIHan Jul 2, 2024
42148fd
Merge remote-tracking branch 'upstream/main' into sve-ffr-part1
TIHan Jul 2, 2024
a7773ac
FirstFaulting partially works
TIHan Jul 2, 2024
76b42bd
Added template
TIHan Jul 2, 2024
bb01e37
Trying to test first-faulting behavior
TIHan Jul 4, 2024
a602b24
Using BoundedMemory to test FirstFaulting behavior for LoadVector.
TIHan Jul 6, 2024
60d410a
Fix size in validation
TIHan Jul 6, 2024
aee87d7
Added more helper functions. Added conditional select tests for LoadV…
TIHan Jul 8, 2024
7f3bb3c
Added first-faulting behavior tests for GatherVectorFirstFaulting
TIHan Jul 8, 2024
d952ff1
Merging with main
TIHan Jul 8, 2024
3923946
Added GetFfr suffix-style APIs
TIHan Jul 8, 2024
461b6a3
Fixing GatherVector tests
TIHan Jul 8, 2024
d5b8675
Formatting
TIHan Jul 8, 2024
07833e3
Feedback
TIHan Jul 9, 2024
ce5a9bd
Merge remote-tracking branch 'upstream/main' into sve-ffr-part1
TIHan Jul 9, 2024
05fb46d
Feedback
TIHan Jul 9, 2024
c63f878
Ensure the P/Invokes are blittable
tannergooding Jul 10, 2024
a4533fe
Merging
TIHan Jul 11, 2024
72d1dea
Merge remote-tracking branch 'upstream/main' into sve-ffr-part1
TIHan Jul 12, 2024
6c28927
Fix build
TIHan Jul 13, 2024
fb2012e
Remove checking for zeroes after the fault
TIHan Jul 13, 2024
aca6759
Added GatherVectorFirstFaultingVectorBases test template, but current…
TIHan Jul 16, 2024
fc90b2e
JIT ARM64-SVE: Add Sve.LoadVector*FirstFaulting APIs
mikabl-arm Jul 15, 2024
d9436e4
Merge main into sve-loadvectorff
mikabl-arm Jul 16, 2024
0f06c24
Remove HW_Flag_SpecialSideEffectMask for LoadVector*FirstFaulting
mikabl-arm Jul 16, 2024
80e9c05
cleanup: remove [Xarray, Xindex] instruction variant from the comment…
mikabl-arm Jul 16, 2024
76abc01
cleanup: arrange the tests alphabetically
mikabl-arm Jul 16, 2024
7d7d8e0
Add ci legs to test SVE using AltJit
kunalspathak Jul 16, 2024
1737e6f
fix a check for HWIntrinsic
kunalspathak Jul 16, 2024
ca23305
add gentree.cpp for now
kunalspathak Jul 16, 2024
0ef018f
Revert "add gentree.cpp for now"
kunalspathak Jul 16, 2024
d781fdc
Mark GetFfr methods as side-effectful
TIHan Jul 16, 2024
c864900
review feedback
kunalspathak Jul 17, 2024
7cb8096
Merge remote-tracking branch 'origin/main' into sve-loadvectorff
mikabl-arm Jul 17, 2024
6ff0a0c
Merge remote-tracking branch 'kunalspathak/sve-pipeline' into sve-loa…
mikabl-arm Jul 17, 2024
fcf7214
Merge remote-tracking branch 'TIHan/sve-ffr-part1' into sve-loadvectorff
mikabl-arm Jul 17, 2024
f7e2a2c
Addressing review comments.
mikabl-arm Jul 17, 2024
a73fe35
Verifying expected fault result. Test weaks.
TIHan Jul 19, 2024
81882a4
Merging with main
TIHan Jul 19, 2024
ad5ec2e
Fix build
TIHan Jul 20, 2024
0e5c251
Merge remote-tracking branch 'origin/main' into sve-loadvectorff
mikabl-arm Jul 22, 2024
e9f9cc0
Merge remote-tracking branch 'TIHan/sve-ffr-part1' into sve-loadvectorff
mikabl-arm Jul 22, 2024
4639346
fixup: revert to using the span's length for ValidateFirstFaultingResult
mikabl-arm Jul 22, 2024
0f88d8e
Add tracking of FFR register
kunalspathak Jul 19, 2024
10cf342
Change condition for PhysReg
kunalspathak Jul 23, 2024
e7507bb
jit format
kunalspathak Jul 23, 2024
aef79cd
Fix PoisonPage configuration while creating BoundedMemory
SwapnilGaikwad Jul 23, 2024
690e7ad
Use mmap() instead of memalign() for memory allocation
SwapnilGaikwad Jul 23, 2024
b23fac7
review feedback
kunalspathak Jul 23, 2024
0c8b688
unspill for LoadVectorFirstFaulting as well
kunalspathak Jul 23, 2024
3184b77
Merging with Kunal's FFR changes
TIHan Jul 24, 2024
b4a3495
Merge remote-tracking branch 'TIHan/sve-ffr-part1' into sve-loadvectorff
mikabl-arm Jul 24, 2024
35fe791
fixup: revert a check of faulted elements
mikabl-arm Jul 24, 2024
5bb0b3d
Show error codes on failing failure
SwapnilGaikwad Jul 24, 2024
823e847
Merging with main
TIHan Jul 26, 2024
86715e5
Feedback
TIHan Jul 26, 2024
8b0f000
Feedback
TIHan Jul 26, 2024
044dbda
Feedback
TIHan Jul 26, 2024
0655d4b
Feedback
TIHan Jul 26, 2024
055205b
Merge remote-tracking branch 'TIHan/sve-ffr-part1' into sve-loadvectorff
mikabl-arm Jul 26, 2024
9d7f22f
Handle FFR correctly
kunalspathak Jul 26, 2024
18f8f52
reuse some of the code
kunalspathak Jul 26, 2024
0755372
Handle the special effect for SetFfr
kunalspathak Jul 26, 2024
567a442
some fixes + test coverage
kunalspathak Jul 26, 2024
3ac987d
do not zero init lvaFfrRegister
kunalspathak Jul 26, 2024
e8f7fcd
reverted local change
kunalspathak Jul 26, 2024
77ec96c
fix build break
kunalspathak Jul 26, 2024
df0d4be
Fixing flags for OSX
TIHan Jul 28, 2024
54ae1b2
Fixup unix impl
TIHan Jul 28, 2024
62f29eb
Trying to fix build
TIHan Jul 28, 2024
04c988a
Fix osx calls
TIHan Jul 28, 2024
34b0aa1
Fix unix impl - forgot to use 'value'
TIHan Jul 28, 2024
9c9d975
Added default impl
TIHan Jul 28, 2024
921b047
Updating error messages
TIHan Jul 28, 2024
50a9790
Attempt mprotect to determine which MAP_ANONYMOUS value to use
TIHan Jul 29, 2024
bf292ce
Attempt mprotect to determine which MAP_ANONYMOUS value to use
TIHan Jul 29, 2024
59ebe26
Add a way to query MAP_ANONYMOUS
TIHan Jul 29, 2024
489b919
Add a way to query MAP_ANONYMOUS
TIHan Jul 29, 2024
b3922ff
trying to figure out cmake reference
TIHan Jul 29, 2024
5c49435
trying to figure out cmake reference
TIHan Jul 29, 2024
8b49576
trying to figure out cmake reference
TIHan Jul 29, 2024
754b1b5
forgot to add cpp files
TIHan Jul 29, 2024
dbaa496
Use MemoryMappedFile and then use mprotect
TIHan Jul 29, 2024
6081591
Minor cleanup
TIHan Jul 29, 2024
eab17ff
Merge remote-tracking branch 'TIHan/sve-ffr-part1' into sve-loadvectorff
mikabl-arm Jul 31, 2024
9219e35
Merging
TIHan Jul 31, 2024
7e3057a
Added XplatVirtualAlloc, hopefully it will work
TIHan Jul 31, 2024
3b25182
Fix build
TIHan Jul 31, 2024
6c432b5
Merging with main
TIHan Jul 31, 2024
5ce9738
Fix build
TIHan Jul 31, 2024
ff0fd39
Update hwintrinsiccodegenarm64.cpp
TIHan Jul 31, 2024
eda7fc4
Trying to fix build
TIHan Aug 1, 2024
2fe1c8f
Merging with main
TIHan Aug 1, 2024
801cbc4
Merging with main
TIHan Aug 1, 2024
2d71632
Use SystemNative
TIHan Aug 1, 2024
929b13b
fix pinvoke
TIHan Aug 1, 2024
0a327c6
Get rid of writeline
TIHan Aug 1, 2024
631e69c
Merge remote-tracking branch 'upstream/main' into sve-ffr-part1
TIHan Aug 1, 2024
e716ae5
Add mono check
TIHan Aug 1, 2024
028b2c7
Fix misspelled word
TIHan Aug 1, 2024
2b5215b
Check for wasm
TIHan Aug 1, 2024
8924c6c
Fix build
TIHan Aug 1, 2024
5e53a97
Use IsBrowser
TIHan Aug 1, 2024
8ab8d61
Merge remote-tracking branch 'TIHan/sve-ffr-part1' into sve-loadvectorff
mikabl-arm Aug 2, 2024
14a90b5
Merge remote-tracking branch 'origin/main' into sve-loadvectorff
mikabl-arm Aug 5, 2024
703ef9d
Merge remote-tracking branch 'origin/main' into sve-loadvectorff
mikabl-arm Aug 5, 2024
badf788
fixup: various fixes after merging with main
mikabl-arm Aug 6, 2024
1ef21b7
fixup: restore FFR register
mikabl-arm Aug 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Minor cleanup
TIHan committed Jul 29, 2024
commit 6081591b7ac37b6e3c1714e8f51be269ef3ecd35
Original file line number Diff line number Diff line change
@@ -136,16 +136,11 @@ internal static MmfHandle Allocate(nint byteLength, PoisonPagePlacement placemen
// Allocate number of pages to incorporate required (byteLength bytes of) memory and an additional page to create a poison page.
int pageSize = Environment.SystemPageSize;
int allocationSize = (int)(((byteLength / pageSize) + ((byteLength % pageSize) == 0 ? 0 : 1) + 1) * pageSize);

var mmf = MemoryMappedFile.CreateNew(null, (long)allocationSize, MemoryMappedFileAccess.ReadWrite);
var view = mmf.CreateViewAccessor();

IntPtr buffer = view.SafeMemoryMappedViewHandle.DangerousGetHandle();

if (buffer == IntPtr.Zero)
{
throw new InvalidOperationException($"Memory allocation failed with error {Marshal.GetLastPInvokeError()}.");
}

// Depending on the PoisonPagePlacement requirement (before/after) initialise the baseAddress and poisonPageAddress to point to the location
// in the buffer. Here the baseAddress points to the first valid allocation and poisonPageAddress points to the first invalid location.
// For `PoisonPagePlacement.Before` the first page is made inaccessible using mprotect and baseAddress points to the start of the second page.