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>
This commit is contained in:
Lai Jiangshan 2023-02-17 07:53:21 +08:00 • committed by Sean Christopherson
commit 19ace7d6ca
2 changed files with 11 additions and 3 deletions