[kvm-unit-tests PATCH 14/39] x86/access: Don't write page tables if desired PTE is same as current PTE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux