Commit 01dd4d3
committed
KVM: x86/mmu: Apply retry protection to "fast nTDP unprotect" path
Move the anti-infinite-loop protection provided by last_retry_{eip,addr}
into kvm_mmu_write_protect_fault() so that it guards unprotect+retry that
never hits the emulator, as well as reexecute_instruction(), which is the
last ditch "might as well try it" logic that kicks in when emulation fails
on an instruction that faulted on a write-protected gfn.
Add a new helper, kvm_mmu_unprotect_gfn_and_retry(), to set the retry
fields and deduplicate other code (with more to come).
Link: https://lore.kernel.org/r/20240831001538.336683-9-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>1 parent 9c19129 commit 01dd4d3
3 files changed
Lines changed: 40 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2133 | 2133 | | |
2134 | 2134 | | |
2135 | 2135 | | |
| 2136 | + | |
2136 | 2137 | | |
2137 | 2138 | | |
2138 | 2139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2713 | 2713 | | |
2714 | 2714 | | |
2715 | 2715 | | |
| 2716 | + | |
| 2717 | + | |
| 2718 | + | |
| 2719 | + | |
| 2720 | + | |
| 2721 | + | |
| 2722 | + | |
| 2723 | + | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
| 2730 | + | |
| 2731 | + | |
2716 | 2732 | | |
2717 | 2733 | | |
2718 | 2734 | | |
| |||
5956 | 5972 | | |
5957 | 5973 | | |
5958 | 5974 | | |
| 5975 | + | |
| 5976 | + | |
| 5977 | + | |
| 5978 | + | |
| 5979 | + | |
| 5980 | + | |
| 5981 | + | |
| 5982 | + | |
| 5983 | + | |
| 5984 | + | |
| 5985 | + | |
| 5986 | + | |
| 5987 | + | |
| 5988 | + | |
| 5989 | + | |
| 5990 | + | |
| 5991 | + | |
| 5992 | + | |
| 5993 | + | |
| 5994 | + | |
| 5995 | + | |
5959 | 5996 | | |
5960 | 5997 | | |
5961 | 5998 | | |
| |||
5986 | 6023 | | |
5987 | 6024 | | |
5988 | 6025 | | |
5989 | | - | |
| 6026 | + | |
5990 | 6027 | | |
5991 | 6028 | | |
5992 | 6029 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8932 | 8932 | | |
8933 | 8933 | | |
8934 | 8934 | | |
8935 | | - | |
8936 | | - | |
8937 | | - | |
8938 | | - | |
8939 | | - | |
8940 | 8935 | | |
8941 | 8936 | | |
8942 | 8937 | | |
8943 | 8938 | | |
8944 | 8939 | | |
8945 | 8940 | | |
8946 | | - | |
8947 | | - | |
8948 | | - | |
8949 | | - | |
8950 | | - | |
8951 | | - | |
8952 | | - | |
8953 | 8941 | | |
8954 | | - | |
8955 | | - | |
8956 | 8942 | | |
8957 | 8943 | | |
8958 | 8944 | | |
| |||
8963 | 8949 | | |
8964 | 8950 | | |
8965 | 8951 | | |
8966 | | - | |
8967 | | - | |
8968 | | - | |
8969 | | - | |
8970 | | - | |
8971 | | - | |
8972 | | - | |
8973 | | - | |
8974 | | - | |
8975 | | - | |
8976 | | - | |
8977 | | - | |
| 8952 | + | |
8978 | 8953 | | |
8979 | 8954 | | |
8980 | 8955 | | |
| |||
0 commit comments