diff mbox

[kvm-unit-tests,2/2] vmx: actually test vmptrld, not vmclear

Message ID 1404840317-32361-3-git-send-email-pbonzini@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Paolo Bonzini July 8, 2014, 5:25 p.m. UTC
test_vmptrld was actually invoking vmclear.  make_vmcs_current is
the wrapper for vmptrld, not vmcs_clear!

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 x86/vmx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Bandan Das July 8, 2014, 5:35 p.m. UTC | #1
Paolo Bonzini <pbonzini@redhat.com> writes:

> test_vmptrld was actually invoking vmclear.  make_vmcs_current is
> the wrapper for vmptrld, not vmcs_clear!

Oops, this was my fault, sorry!!

> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  x86/vmx.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/x86/vmx.c b/x86/vmx.c
> index cc2598f..ef9caca 100644
> --- a/x86/vmx.c
> +++ b/x86/vmx.c
> @@ -702,18 +702,18 @@ static void test_vmptrld(void)
>  	/* Unaligned page access */
>  	tmp_root = (struct vmcs *)((intptr_t)vmcs + 1);
>  	report("test vmptrld with unaligned vmcs",
> -	       vmcs_clear(tmp_root) == 1);
> +	       make_vmcs_current(tmp_root) == 1);
>  
>  	/* gpa bits beyond physical address width are set*/
>  	tmp_root = (struct vmcs *)((intptr_t)vmcs |
>  				   ((u64)1 << (width+1)));
>  	report("test vmptrld with vmcs address bits set beyond physical address width",
> -	       vmcs_clear(tmp_root) == 1);
> +	       make_vmcs_current(tmp_root) == 1);
>  
>  	/* Pass VMXON region */
>  	tmp_root = (struct vmcs *)vmxon_region;
>  	report("test vmptrld with vmxon region",
> -	       vmcs_clear(tmp_root) == 1);
> +	       make_vmcs_current(tmp_root) == 1);
>  
>  	report("test vmptrld with valid vmcs region", make_vmcs_current(vmcs) == 0);
>  }
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/x86/vmx.c b/x86/vmx.c
index cc2598f..ef9caca 100644
--- a/x86/vmx.c
+++ b/x86/vmx.c
@@ -702,18 +702,18 @@  static void test_vmptrld(void)
 	/* Unaligned page access */
 	tmp_root = (struct vmcs *)((intptr_t)vmcs + 1);
 	report("test vmptrld with unaligned vmcs",
-	       vmcs_clear(tmp_root) == 1);
+	       make_vmcs_current(tmp_root) == 1);
 
 	/* gpa bits beyond physical address width are set*/
 	tmp_root = (struct vmcs *)((intptr_t)vmcs |
 				   ((u64)1 << (width+1)));
 	report("test vmptrld with vmcs address bits set beyond physical address width",
-	       vmcs_clear(tmp_root) == 1);
+	       make_vmcs_current(tmp_root) == 1);
 
 	/* Pass VMXON region */
 	tmp_root = (struct vmcs *)vmxon_region;
 	report("test vmptrld with vmxon region",
-	       vmcs_clear(tmp_root) == 1);
+	       make_vmcs_current(tmp_root) == 1);
 
 	report("test vmptrld with valid vmcs region", make_vmcs_current(vmcs) == 0);
 }