Commit 7657ea9
KVM: arm64: Use TLBI range-based instructions for unmap
The current implementation of the stage-2 unmap walker traverses
the given range and, as a part of break-before-make, performs
TLB invalidations with a DSB for every PTE. A multitude of this
combination could cause a performance bottleneck on some systems.
Hence, if the system supports FEAT_TLBIRANGE, defer the TLB
invalidations until the entire walk is finished, and then
use range-based instructions to invalidate the TLBs in one go.
Condition deferred TLB invalidation on the system supporting FWB,
as the optimization is entirely pointless when the unmap walker
needs to perform CMOs.
Rename stage2_put_pte() to stage2_unmap_put_pte() as the function
now serves the stage-2 unmap walker specifically, rather than
acting generic.
Signed-off-by: Raghavendra Rao Ananta <rananta@google.com>
Reviewed-by: Shaoqin Huang <shahuang@redhat.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230811045127.3308641-15-rananta@google.com1 parent defc8cc commit 7657ea9
1 file changed
Lines changed: 33 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
831 | 831 | | |
832 | 832 | | |
833 | 833 | | |
834 | | - | |
835 | | - | |
| 834 | + | |
836 | 835 | | |
837 | 836 | | |
838 | | - | |
839 | | - | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
840 | 857 | | |
841 | 858 | | |
842 | 859 | | |
843 | | - | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
844 | 864 | | |
845 | 865 | | |
846 | 866 | | |
| |||
1098 | 1118 | | |
1099 | 1119 | | |
1100 | 1120 | | |
1101 | | - | |
| 1121 | + | |
1102 | 1122 | | |
1103 | 1123 | | |
1104 | 1124 | | |
| |||
1112 | 1132 | | |
1113 | 1133 | | |
1114 | 1134 | | |
| 1135 | + | |
1115 | 1136 | | |
1116 | 1137 | | |
1117 | 1138 | | |
1118 | 1139 | | |
1119 | 1140 | | |
1120 | 1141 | | |
1121 | | - | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
1122 | 1148 | | |
1123 | 1149 | | |
1124 | 1150 | | |
| |||
0 commit comments