Commit d0c6574
fix: use MMIO-safe copy for goldfish gralloc writes and prefer RW mmap
The AVC encode test crashed with SIGSEGV when writing to goldfish
address space memory via Go's copy(), which emits AVX2 VMOVDQU
instructions that fault on uncacheable PCI BAR (MMIO) memory.
Two fixes:
- Add CopyToMMIO for scalar writes to MMIO regions (matching the
existing copyFromMMIO for reads)
- Reorder mmap strategies to try PROT_READ|PROT_WRITE before
PROT_READ, so buffers are writable when the kernel allows it1 parent 2f783c8 commit d0c6574
2 files changed
Lines changed: 31 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
70 | 69 | | |
71 | | - | |
| 70 | + | |
72 | 71 | | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
343 | 367 | | |
344 | 368 | | |
345 | 369 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
914 | 914 | | |
915 | 915 | | |
916 | 916 | | |
917 | | - | |
918 | | - | |
919 | | - | |
920 | | - | |
921 | | - | |
922 | | - | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
923 | 922 | | |
924 | 923 | | |
925 | 924 | | |
| |||
0 commit comments