[kvm-unit-test 2/3] KVM nVMX: test_vmcs_page_values() needs to accept a bit range

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

 



 ... because various addresses need to be tested for various bit ranges.

Signed-off-by: Krish Sadhukhan <krish.sadhukhan@xxxxxxxxxx>
Reviewed-by: Mihai Carabas <mihai.carabas@xxxxxxxxxx>
---
 x86/vmx_tests.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
index 76bf1f4..900dcf4 100644
--- a/x86/vmx_tests.c
+++ b/x86/vmx_tests.c
@@ -3488,12 +3488,12 @@ static void test_vmcs_page_values(const char *name,
 				  enum Encoding encoding,
 				  bool ignored,
 				  bool xfail_beyond_mapped_ram,
-				  u64 align)
+				  u64 align, u32 addr_start, u32 addr_end)
 {
 	unsigned i;
 	u64 orig_val = vmcs_read(encoding);
 
-	for (i = 0; i < 64; i++)
+	for (i = addr_start; i < addr_end; i++)
 		test_vmcs_page_addr(name, encoding, ignored,
 				    xfail_beyond_mapped_ram, 1ul << i,
 				    align);
@@ -3547,7 +3547,7 @@ static void test_vmcs_page_reference(u32 control_bit, enum Encoding field,
 		vmcs_write(CPU_EXEC_CTRL1, secondary | control_bit);
 	}
 	test_vmcs_page_values(field_name, field, false,
-			      xfail_beyond_mapped_ram, align);
+			      xfail_beyond_mapped_ram, align, 0, 64);
 	report_prefix_pop();
 
 	report_prefix_pushf("%s disabled", control_name);
@@ -3557,7 +3557,8 @@ static void test_vmcs_page_reference(u32 control_bit, enum Encoding field,
 		vmcs_write(CPU_EXEC_CTRL0, primary & ~CPU_SECONDARY);
 		vmcs_write(CPU_EXEC_CTRL1, secondary & ~control_bit);
 	}
-	test_vmcs_page_values(field_name, field, true, false, align);
+	test_vmcs_page_values(field_name, field, true, false, align,
+			      0, 64);
 	report_prefix_pop();
 
 	vmcs_write(field, page_addr);
@@ -3912,7 +3913,7 @@ static void test_posted_intr(void)
 	test_pi_desc_addr(0xc000, true);
 
 	test_vmcs_page_values("process-posted interrupts",
-	    POSTED_INTR_DESC_ADDR, false, false);
+	    POSTED_INTR_DESC_ADDR, false, false, PAGE_SIZE, 0, 64);
 
 	vmcs_write(CPU_EXEC_CTRL0, saved_primary);
 	vmcs_write(CPU_EXEC_CTRL1, saved_secondary);
-- 
2.9.5




[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