Commit 6777885
KVM: x86/mmu: Track possible NX huge pages separately for TDP vs. Shadow MMU
Track possible NX huge pages for the TDP MMU separately from Shadow MMUs
in anticipation of doing recovery for the TDP MMU while holding mmu_lock
for read instead of write.
Use a small structure to hold the list of pages along with the number of
pages/entries in the list, as relying on kvm->stat.nx_lpage_splits to
calculating the number of pages to recover would result in over-zapping
when both TDP and Shadow MMUs are active.
Suggested-by: Sean Christopherson <seanjc@google.com>
Suggested-by: David Matlack <dmatlack@google.com>
Signed-off-by: Vipin Sharma <vipinsh@google.com>
Co-developed-by: James Houghton <jthoughton@google.com>
Signed-off-by: James Houghton <jthoughton@google.com>
Link: https://lore.kernel.org/r/20250707224720.4016504-2-jthoughton@google.com
[sean: rewrite changelog, use #ifdef instead of dummy KVM_TDP_MMU #define]
Signed-off-by: Sean Christopherson <seanjc@google.com>1 parent c17b750 commit 6777885
File tree
4 files changed
+72
-36
lines changed- arch/x86
- include/asm
- kvm/mmu
4 files changed
+72
-36
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1348 | 1348 | | |
1349 | 1349 | | |
1350 | 1350 | | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
1351 | 1375 | | |
1352 | 1376 | | |
1353 | 1377 | | |
| |||
1360 | 1384 | | |
1361 | 1385 | | |
1362 | 1386 | | |
1363 | | - | |
1364 | | - | |
1365 | | - | |
1366 | | - | |
1367 | | - | |
1368 | | - | |
1369 | | - | |
1370 | | - | |
1371 | | - | |
1372 | | - | |
1373 | | - | |
1374 | | - | |
| 1387 | + | |
1375 | 1388 | | |
1376 | 1389 | | |
1377 | 1390 | | |
| |||
1526 | 1539 | | |
1527 | 1540 | | |
1528 | 1541 | | |
1529 | | - | |
| 1542 | + | |
1530 | 1543 | | |
1531 | 1544 | | |
1532 | 1545 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
776 | 776 | | |
777 | 777 | | |
778 | 778 | | |
779 | | - | |
| 779 | + | |
| 780 | + | |
780 | 781 | | |
781 | 782 | | |
782 | 783 | | |
| |||
790 | 791 | | |
791 | 792 | | |
792 | 793 | | |
| 794 | + | |
793 | 795 | | |
794 | | - | |
| 796 | + | |
795 | 797 | | |
796 | 798 | | |
797 | 799 | | |
| |||
800 | 802 | | |
801 | 803 | | |
802 | 804 | | |
803 | | - | |
| 805 | + | |
804 | 806 | | |
805 | 807 | | |
806 | 808 | | |
| |||
819 | 821 | | |
820 | 822 | | |
821 | 823 | | |
822 | | - | |
| 824 | + | |
| 825 | + | |
823 | 826 | | |
824 | 827 | | |
825 | 828 | | |
826 | 829 | | |
827 | 830 | | |
| 831 | + | |
828 | 832 | | |
829 | 833 | | |
830 | 834 | | |
831 | 835 | | |
832 | 836 | | |
833 | 837 | | |
834 | 838 | | |
835 | | - | |
| 839 | + | |
836 | 840 | | |
837 | 841 | | |
838 | 842 | | |
| |||
6737 | 6741 | | |
6738 | 6742 | | |
6739 | 6743 | | |
6740 | | - | |
| 6744 | + | |
6741 | 6745 | | |
6742 | 6746 | | |
6743 | 6747 | | |
6744 | | - | |
| 6748 | + | |
| 6749 | + | |
6745 | 6750 | | |
6746 | 6751 | | |
6747 | 6752 | | |
| |||
7582 | 7587 | | |
7583 | 7588 | | |
7584 | 7589 | | |
7585 | | - | |
| 7590 | + | |
| 7591 | + | |
7586 | 7592 | | |
7587 | | - | |
| 7593 | + | |
| 7594 | + | |
| 7595 | + | |
| 7596 | + | |
| 7597 | + | |
| 7598 | + | |
| 7599 | + | |
| 7600 | + | |
| 7601 | + | |
| 7602 | + | |
| 7603 | + | |
| 7604 | + | |
| 7605 | + | |
| 7606 | + | |
| 7607 | + | |
| 7608 | + | |
7588 | 7609 | | |
7589 | | - | |
7590 | 7610 | | |
7591 | | - | |
7592 | 7611 | | |
7593 | 7612 | | |
7594 | | - | |
| 7613 | + | |
| 7614 | + | |
| 7615 | + | |
7595 | 7616 | | |
7596 | 7617 | | |
7597 | 7618 | | |
| |||
7603 | 7624 | | |
7604 | 7625 | | |
7605 | 7626 | | |
7606 | | - | |
7607 | | - | |
7608 | 7627 | | |
7609 | | - | |
| 7628 | + | |
7610 | 7629 | | |
7611 | 7630 | | |
7612 | 7631 | | |
| |||
7616 | 7635 | | |
7617 | 7636 | | |
7618 | 7637 | | |
7619 | | - | |
| 7638 | + | |
7620 | 7639 | | |
7621 | 7640 | | |
7622 | 7641 | | |
| |||
7653 | 7672 | | |
7654 | 7673 | | |
7655 | 7674 | | |
7656 | | - | |
| 7675 | + | |
7657 | 7676 | | |
7658 | 7677 | | |
7659 | 7678 | | |
| |||
7684 | 7703 | | |
7685 | 7704 | | |
7686 | 7705 | | |
| 7706 | + | |
7687 | 7707 | | |
7688 | 7708 | | |
7689 | | - | |
| 7709 | + | |
7690 | 7710 | | |
7691 | 7711 | | |
7692 | 7712 | | |
| |||
7701 | 7721 | | |
7702 | 7722 | | |
7703 | 7723 | | |
7704 | | - | |
| 7724 | + | |
| 7725 | + | |
7705 | 7726 | | |
7706 | 7727 | | |
7707 | 7728 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
419 | | - | |
420 | | - | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
421 | 423 | | |
422 | 424 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
358 | | - | |
| 358 | + | |
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
| |||
1303 | 1303 | | |
1304 | 1304 | | |
1305 | 1305 | | |
1306 | | - | |
| 1306 | + | |
1307 | 1307 | | |
1308 | 1308 | | |
1309 | 1309 | | |
| |||
0 commit comments