|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [PATCH 08 of 20] Emulation of guest VMPTRST
# HG changeset patch
# User Eddie Dong <eddie.dong@xxxxxxxxx>
# Date 1307607849 -28800
# Node ID 002f9d4c15841dc0b98b0427a480202b7117fdcd
# Parent c880f0642b4014b1f13b3a05ddc8ebb140c8c1a1
Emulation of guest VMPTRST
Signed-off-by: Qing He <qing.he@xxxxxxxxx>
Signed-off-by: Eddie Dong <eddie.dong@xxxxxxxxx>
diff -r c880f0642b40 -r 002f9d4c1584 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c Thu Jun 09 16:24:09 2011 +0800
+++ b/xen/arch/x86/hvm/vmx/vmx.c Thu Jun 09 16:24:09 2011 +0800
@@ -2449,11 +2449,15 @@ asmlinkage void vmx_vmexit_handler(struc
update_guest_eip();
break;
+ case EXIT_REASON_VMPTRST:
+ if ( nvmx_handle_vmptrst(regs) == X86EMUL_OKAY )
+ update_guest_eip();
+ break;
+
case EXIT_REASON_MWAIT_INSTRUCTION:
case EXIT_REASON_MONITOR_INSTRUCTION:
case EXIT_REASON_VMCLEAR:
case EXIT_REASON_VMLAUNCH:
- case EXIT_REASON_VMPTRST:
case EXIT_REASON_VMREAD:
case EXIT_REASON_VMRESUME:
case EXIT_REASON_VMWRITE:
diff -r c880f0642b40 -r 002f9d4c1584 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c Thu Jun 09 16:24:09 2011 +0800
+++ b/xen/arch/x86/hvm/vmx/vvmx.c Thu Jun 09 16:24:09 2011 +0800
@@ -456,3 +456,25 @@ out:
return X86EMUL_OKAY;
}
+int nvmx_handle_vmptrst(struct cpu_user_regs *regs)
+{
+ struct vcpu *v = current;
+ struct vmx_inst_decoded decode;
+ struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
+ unsigned long gpa = 0;
+ int rc;
+
+ rc = decode_vmx_inst(regs, &decode, &gpa, 0);
+ if ( rc != X86EMUL_OKAY )
+ return rc;
+
+ gpa = nvcpu->nv_vvmcxaddr;
+
+ rc = hvm_copy_to_guest_virt(decode.mem, &gpa, decode.len, 0);
+ if ( rc != HVMCOPY_okay )
+ return X86EMUL_EXCEPTION;
+
+ vmreturn(regs, VMSUCCEED);
+ return X86EMUL_OKAY;
+}
+
diff -r c880f0642b40 -r 002f9d4c1584 xen/include/asm-x86/hvm/vmx/vvmx.h
--- a/xen/include/asm-x86/hvm/vmx/vvmx.h Thu Jun 09 16:24:09 2011 +0800
+++ b/xen/include/asm-x86/hvm/vmx/vvmx.h Thu Jun 09 16:24:09 2011 +0800
@@ -154,6 +154,7 @@ void __set_vvmcs(void *vvmcs, u32 vmcs_e
void nvmx_destroy_vmcs(struct vcpu *v);
int nvmx_handle_vmptrld(struct cpu_user_regs *regs);
+int nvmx_handle_vmptrst(struct cpu_user_regs *regs);
#endif /* __ASM_X86_HVM_VVMX_H__ */
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-devel] [PATCH 00 of 20] Rebased Nested VMX v2, Eddie Dong
- [Xen-devel] [PATCH 01 of 20] pre-cleanup1: Extend nhvm_vmcx_guest_intercepts_trap to include errcode to, Eddie Dong
- [Xen-devel] [PATCH 02 of 20] pre-cleanup2: Move IDT_VECTORING processing code out of intr_assist, Eddie Dong
- [Xen-devel] [PATCH 03 of 20] Add data structure for nestedvmx, Eddie Dong
- [Xen-devel] [PATCH 04 of 20] Add APIs for nestedhvm_ops, Eddie Dong
- [Xen-devel] [PATCH 07 of 20] Emulation of guest vmptrld, Eddie Dong
- [Xen-devel] [PATCH 05 of 20] Emulation of guest VMXON/OFF instruction, Eddie Dong
- [Xen-devel] [PATCH 06 of 20] Define structure and access APIs for virtual VMCS, Eddie Dong
- [Xen-devel] [PATCH 09 of 20] Emulation of guest VMCLEAR, Eddie Dong
- [Xen-devel] [PATCH 08 of 20] Emulation of guest VMPTRST,
Eddie Dong <=
- [Xen-devel] [PATCH 12 of 20] Add APIs to switch n1/n2 VMCS, Eddie Dong
- [Xen-devel] [PATCH 11 of 20] Emulation of guest VMREAD, Eddie Dong
- [Xen-devel] [PATCH 14 of 20] Extend VMCS control fields for n2 guest, Eddie Dong
- [Xen-devel] [PATCH 13 of 20] Emulation of VMRESUME/VMLAUNCH, Eddie Dong
- [Xen-devel] [PATCH 10 of 20] Emulation of guest VMWRITE, Eddie Dong
- [Xen-devel] [PATCH 15 of 20] Switch shadow/virtual VMCS between n1/n2 guests, Eddie Dong
- [Xen-devel] [PATCH 20 of 20] n2 MSR handling and capability exposure, Eddie Dong
|
|
|
|
|