xen-devel
[Xen-devel] [PATCH 10 of 20] Emulation of guest VMWRITE
# HG changeset patch
# User Eddie Dong <eddie.dong@xxxxxxxxx>
# Date 1307607849 -28800
# Node ID 746c4af7fb75e7c54d9d610acd0d2be2f27fe4dc
# Parent 642c9ab2a829e8f1e5997bd8ea740a0306cb5521
Emulation of guest VMWRITE
Signed-off-by: Qing He <qing.he@xxxxxxxxx>
Signed-off-by: Eddie Dong <eddie.dong@xxxxxxxxx>
diff -r 642c9ab2a829 -r 746c4af7fb75 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
@@ -2459,12 +2459,16 @@ asmlinkage void vmx_vmexit_handler(struc
update_guest_eip();
break;
+ case EXIT_REASON_VMWRITE:
+ if ( nvmx_handle_vmwrite(regs) == X86EMUL_OKAY )
+ update_guest_eip();
+ break;
+
case EXIT_REASON_MWAIT_INSTRUCTION:
case EXIT_REASON_MONITOR_INSTRUCTION:
case EXIT_REASON_VMLAUNCH:
case EXIT_REASON_VMREAD:
case EXIT_REASON_VMRESUME:
- case EXIT_REASON_VMWRITE:
case EXIT_REASON_GETSEC:
case EXIT_REASON_INVEPT:
case EXIT_REASON_INVVPID:
diff -r 642c9ab2a829 -r 746c4af7fb75 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
@@ -548,3 +548,27 @@ out:
return X86EMUL_OKAY;
}
+int nvmx_handle_vmwrite(struct cpu_user_regs *regs)
+{
+ struct vcpu *v = current;
+ struct vmx_inst_decoded decode;
+ struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
+ u64 operandS, vmcs_encoding;
+
+ if ( decode_vmx_inst(regs, &decode, &operandS, 0)
+ != X86EMUL_OKAY )
+ return X86EMUL_EXCEPTION;
+
+ vmcs_encoding = reg_read(regs, decode.reg2);
+ __set_vvmcs(nvcpu->nv_vvmcx, vmcs_encoding, operandS);
+
+ if ( vmcs_encoding == IO_BITMAP_A || vmcs_encoding == IO_BITMAP_A_HIGH )
+ __map_io_bitmap (v, IO_BITMAP_A);
+ else if ( vmcs_encoding == IO_BITMAP_B ||
+ vmcs_encoding == IO_BITMAP_B_HIGH )
+ __map_io_bitmap (v, IO_BITMAP_B);
+
+ vmreturn(regs, VMSUCCEED);
+ return X86EMUL_OKAY;
+}
+
diff -r 642c9ab2a829 -r 746c4af7fb75 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
@@ -156,6 +156,7 @@ 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);
int nvmx_handle_vmclear(struct cpu_user_regs *regs);
+int nvmx_handle_vmwrite(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 04 of 20] Add APIs for nestedhvm_ops, (continued)
- [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
[Xen-devel] [PATCH 17 of 20] VM exit handler of n2-guest, Eddie Dong
[Xen-devel] [PATCH 16 of 20] interrupt/exception handling for n2 guest, Eddie Dong
[Xen-devel] [PATCH 18 of 20] Lazy FPU for n2 guest, Eddie Dong
|
|
|