[kvm-unit-test v3 3/4] 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 | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
index e5cdb4b..88d815a 100644
--- a/x86/vmx_tests.c
+++ b/x86/vmx_tests.c
@@ -3487,12 +3487,13 @@ static void test_vmcs_addr_values(const char *name,
 				  enum Encoding encoding,
 				  u64 align,
 				  bool ignored,
-				  bool xfail_beyond_mapped_ram)
+				  bool xfail_beyond_mapped_ram,
+				  u32 bit_start, u32 bit_end)
 {
 	unsigned i;
 	u64 orig_val = vmcs_read(encoding);
 
-	for (i = 0; i < 64; i++)
+	for (i = bit_start; i <= bit_end; i++)
 		test_vmcs_addr(name, encoding, align, ignored,
 			       xfail_beyond_mapped_ram, 1ul << i);
 
@@ -3540,8 +3541,9 @@ static void test_vmcs_addr_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_addr_values(field_name, field, align, false,
-			      xfail_beyond_mapped_ram);
+			      xfail_beyond_mapped_ram, 0, 63);
 	report_prefix_pop();
 
 	report_prefix_pushf("%s disabled", control_name);
@@ -3551,7 +3553,8 @@ static void test_vmcs_addr_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_addr_values(field_name, field, align, true, false);
+
+	test_vmcs_addr_values(field_name, field, align, true, false, 0, 63);
 	report_prefix_pop();
 
 	vmcs_write(field, page_addr);
@@ -3907,7 +3910,7 @@ static void test_posted_intr(void)
 
 	test_vmcs_addr_values("process-posted interrupts",
 			       POSTED_INTR_DESC_ADDR, PAGE_SIZE,
-			       false, false);
+			       false, false, 0, 63);
 
 	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