Avoid spurious PTE writes, KVM doesn't check if old==new when handling write-protected SPTEs and triggers an MMU sync when using shadow paging even if the SPTE is unchanged. Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx> --- x86/access.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x86/access.c b/x86/access.c index abc6590..53b1221 100644 --- a/x86/access.c +++ b/x86/access.c @@ -704,7 +704,8 @@ static void __ac_setup_specific_pages(ac_test_t *at, u64 pd_page, u64 pt_page) assert(0); } - *ptep = pte; + if (pte != *ptep) + *ptep = pte; parent_pte = pte; } -- 2.34.0.rc2.393.gf8c9666880-goog