[kvm-unit-tests 5/5] x86: vmx: don't explicitly split identity EPT map

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

 



Since install_ept_entry automatically splits large EPTEs, it's no
longer necessary to explicitly pave the EPT identity map with 4K
entries mapping [base_addr1, base_addr1 + PAGE_SIZE_2M). I.e.,
install_ept(data_page1, data_page2) does the paving before installing
the 4k data_page1 -> data_page2 mapping.

The other setup_ept_range call was unnecessary.

Note that there was benign bug in the deleted code. The third argument
of setup_ept_range is length not end! Thus the range of GPA mappings
being split was [base_addr1, base_addr1 * 2 + PAGE_SIZE_2M).

Signed-off-by: Peter Feiner <pfeiner@xxxxxxxxxx>
---
 x86/vmx_tests.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
index bb65c06..4ef2247 100644
--- a/x86/vmx_tests.c
+++ b/x86/vmx_tests.c
@@ -954,7 +954,6 @@ static int apic_version;
 
 static int ept_init()
 {
-	unsigned long base_addr1, base_addr2;
 	u32 ctrl_cpu[2];
 
 	if (!(ctrl_cpu_rev[0].clr & CPU_SECONDARY) ||
@@ -979,12 +978,6 @@ static int ept_init()
 	memset(data_page2, 0x0, PAGE_SIZE);
 	*((u32 *)data_page1) = MAGIC_VAL_1;
 	*((u32 *)data_page2) = MAGIC_VAL_2;
-	base_addr1 = (unsigned long)data_page1 & PAGE_MASK_2M;
-	base_addr2 = (unsigned long)data_page2 & PAGE_MASK_2M;
-	setup_ept_range(pml4, base_addr1, base_addr1 + PAGE_SIZE_2M, 0, 0,
-			EPT_WA | EPT_RA | EPT_EA);
-	setup_ept_range(pml4, base_addr2, base_addr2 + PAGE_SIZE_2M, 0, 0,
-			EPT_WA | EPT_RA | EPT_EA);
 	install_ept(pml4, (unsigned long)data_page1, (unsigned long)data_page2,
 			EPT_RA | EPT_WA | EPT_EA);
 
-- 
2.7.0.rc3.207.g0ac5344

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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