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

Re: [Xen-devel] [XTF PATCH 14/16] vvmx: test vmxon in VMX root w/ CPL = 3 and w/o current VMCS



On 12/16/16 20:59 +0000, Andrew Cooper wrote:
On 16/12/16 13:43, Haozhong Zhang wrote:
Fault #GP(0) is expected in this test.

Signed-off-by: Haozhong Zhang <haozhong.zhang@xxxxxxxxx>
---
 tests/vvmx/vmxon.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/tests/vvmx/vmxon.c b/tests/vvmx/vmxon.c
index 0664a48..ec7ee7e 100644
--- a/tests/vvmx/vmxon.c
+++ b/tests/vvmx/vmxon.c
@@ -3,6 +3,7 @@
 #include "util.h"

 static uint8_t vmxon_region[PAGE_SIZE] __aligned(PAGE_SIZE);
+static uint8_t vmxon_region_2nd[PAGE_SIZE] __aligned(PAGE_SIZE);

You introduce vmxon_region_2nd here, but reference it in the previous patch.


I must have made mistakes when separating patch 13 - 16.

However, I am not sure of its purpose.  Why cant you reuse the previous
host state area?


Intel SDM says SW should not access or modify the VXMON rgion of a
logical processor between vmxon and vmxoff. Though I have tested on
real hardware whether reusing VMXON region would cause any trouble, I
still want to exclude that possibility/noise from this test.


 /**
  * vmxon with CR4.VMXE cleared
@@ -165,6 +166,31 @@ static bool test_vmxon_in_root_cpl0_novmcs(void)
                               VMXERR_VMFAIL_INVALID, 0, 0);
 }

+static unsigned long vmxon_in_root_user(void)
+{
+    exinfo_t fault;
+    unsigned long ret = vmxon((uint64_t)vmxon_region_2nd, &fault);
+
+    return (ret << 32) | fault;
+}

I have a pending patch for exec_user_param() (originally written for a
test which I subsequently reimplemented differently).

I have just pushed it for you to use.  You can have one common
user_vmxon() and pass a variable host region to it, rather than having
an almost-entirely duplicate function.


Thank you! I can use the dedicated bits in exinfo_t as you suggested
in previous patch.

Haozhong

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.