Commit 825c43f
kmap_local: don't assume kmap PTEs are linear arrays in memory
The kmap_local conversion broke the ARM architecture, because the new
code assumes that all PTEs used for creating kmaps form a linear array
in memory, and uses array indexing to look up the kmap PTE belonging to
a certain kmap index.
On ARM, this cannot work, not only because the PTE pages may be
non-adjacent in memory, but also because ARM/!LPAE interleaves hardware
entries and extended entries (carrying software-only bits) in a way that
is not compatible with array indexing.
Fortunately, this only seems to affect configurations with more than 8
CPUs, due to the way the per-CPU kmap slots are organized in memory.
Work around this by permitting an architecture to set a Kconfig symbol
that signifies that the kmap PTEs do not form a lineary array in memory,
and so the only way to locate the appropriate one is to walk the page
tables.
Link: https://lore.kernel.org/linux-arm-kernel/20211026131249.3731275-1-ardb@kernel.org/
Link: https://lkml.kernel.org/r/20211116094737.7391-1-ardb@kernel.org
Fixes: 2a15ba8 ("ARM: highmem: Switch to generic kmap atomic")
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reported-by: Quanyang Wang <quanyang.wang@windriver.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>1 parent d78f385 commit 825c43f
3 files changed
+25
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1463 | 1463 | | |
1464 | 1464 | | |
1465 | 1465 | | |
| 1466 | + | |
1466 | 1467 | | |
1467 | 1468 | | |
1468 | 1469 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
890 | 890 | | |
891 | 891 | | |
892 | 892 | | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
893 | 896 | | |
894 | 897 | | |
895 | 898 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
503 | 503 | | |
504 | 504 | | |
505 | 505 | | |
506 | | - | |
| 506 | + | |
507 | 507 | | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
508 | 514 | | |
509 | 515 | | |
510 | | - | |
| 516 | + | |
511 | 517 | | |
512 | 518 | | |
513 | 519 | | |
514 | 520 | | |
515 | | - | |
| 521 | + | |
516 | 522 | | |
517 | 523 | | |
518 | 524 | | |
| |||
524 | 530 | | |
525 | 531 | | |
526 | 532 | | |
527 | | - | |
| 533 | + | |
| 534 | + | |
528 | 535 | | |
529 | | - | |
| 536 | + | |
530 | 537 | | |
531 | 538 | | |
532 | 539 | | |
| |||
559 | 566 | | |
560 | 567 | | |
561 | 568 | | |
562 | | - | |
| 569 | + | |
563 | 570 | | |
564 | 571 | | |
565 | 572 | | |
| |||
584 | 591 | | |
585 | 592 | | |
586 | 593 | | |
| 594 | + | |
587 | 595 | | |
588 | | - | |
| 596 | + | |
589 | 597 | | |
590 | 598 | | |
591 | 599 | | |
| |||
607 | 615 | | |
608 | 616 | | |
609 | 617 | | |
610 | | - | |
| 618 | + | |
611 | 619 | | |
612 | 620 | | |
613 | 621 | | |
| |||
634 | 642 | | |
635 | 643 | | |
636 | 644 | | |
| 645 | + | |
637 | 646 | | |
638 | | - | |
| 647 | + | |
639 | 648 | | |
640 | 649 | | |
641 | 650 | | |
642 | 651 | | |
643 | 652 | | |
644 | 653 | | |
645 | 654 | | |
646 | | - | |
| 655 | + | |
647 | 656 | | |
648 | 657 | | |
649 | 658 | | |
| |||
663 | 672 | | |
664 | 673 | | |
665 | 674 | | |
666 | | - | |
| 675 | + | |
| 676 | + | |
667 | 677 | | |
668 | 678 | | |
669 | 679 | | |
| |||
0 commit comments