Commit 19ace7d
KVM: x86/mmu: Skip calling mmu->sync_spte() when the spte is 0
Sync the spte only when the spte is set and avoid the indirect branch.
Signed-off-by: Lai Jiangshan <jiangshan.ljs@antgroup.com>
Link: https://lore.kernel.org/r/20230216235321.735214-5-jiangshanlai@gmail.com
[sean: add wrapper instead of open coding each check]
Signed-off-by: Sean Christopherson <seanjc@google.com>1 parent 91ca767 commit 19ace7d
2 files changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1933 | 1933 | | |
1934 | 1934 | | |
1935 | 1935 | | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
1936 | 1944 | | |
1937 | 1945 | | |
1938 | 1946 | | |
| |||
1942 | 1950 | | |
1943 | 1951 | | |
1944 | 1952 | | |
1945 | | - | |
| 1953 | + | |
1946 | 1954 | | |
1947 | 1955 | | |
1948 | 1956 | | |
| |||
5766 | 5774 | | |
5767 | 5775 | | |
5768 | 5776 | | |
5769 | | - | |
| 5777 | + | |
5770 | 5778 | | |
5771 | 5779 | | |
5772 | 5780 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
892 | 892 | | |
893 | 893 | | |
894 | 894 | | |
895 | | - | |
| 895 | + | |
896 | 896 | | |
897 | 897 | | |
898 | 898 | | |
| |||
0 commit comments