Commit eaadce9
arm64: mm: Force Device mappings for PCIe MMIO
PCIe device drivers may map MMIO space as Normal non-cacheable, for the
purpose of enabling write combining or unaligned accesses.
On many platforms (e.g. Ampere Altra, RK35xx), the PCIe interface cannot
support unaligned outbound transactions. This may lead to data
corruption, for instance, when a regular memcpy is performed by an
application on a GPU's VRAM BAR.
Add an option to force all software that maps PCIe MMIO space as Normal
non-cacheable memory to use Device-nGnRE instead. If the strict
alignment is not met, the CPU will raise alignment faults that can be
further handled by the kernel by enabling CONFIG_ARM64_ALIGNMENT_FIXUPS.
Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>1 parent 31fb6f4 commit eaadce9
3 files changed
+65
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1696 | 1696 | | |
1697 | 1697 | | |
1698 | 1698 | | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
1699 | 1716 | | |
1700 | 1717 | | |
1701 | 1718 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | 343 | | |
349 | 344 | | |
350 | 345 | | |
| |||
804 | 799 | | |
805 | 800 | | |
806 | 801 | | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
807 | 817 | | |
808 | 818 | | |
809 | 819 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
389 | 389 | | |
390 | 390 | | |
391 | 391 | | |
| 392 | + | |
392 | 393 | | |
393 | 394 | | |
394 | 395 | | |
| |||
566 | 567 | | |
567 | 568 | | |
568 | 569 | | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
569 | 602 | | |
570 | 603 | | |
571 | 604 | | |
| |||
0 commit comments