|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [RFC v1 2/7] x86/hvm: Introduce hvm_emulate_one_ctxt
This is like hvm_emulate_one_insn() but takes an existing
hvm_emulate_ctxt as a parameter. This will be needed to merge the
instruction emulator and VMEXIT fast paths.
Signed-off-by: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
---
xen/arch/x86/hvm/io.c | 17 +++++++++++------
xen/arch/x86/include/asm/hvm/emulate.h | 1 +
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index d9838c36d330..7dc6f64b646e 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -53,27 +53,32 @@ void send_timeoffset_req(unsigned long timeoff)
bool hvm_emulate_one_insn(hvm_emulate_validate_t *validate, const char *descr)
{
struct hvm_emulate_ctxt ctxt;
- int rc;
hvm_emulate_init_once(&ctxt, validate, descr, guest_cpu_user_regs());
+ return hvm_emulate_one_ctxt(&ctxt);
+}
- switch ( rc = hvm_emulate_one(&ctxt, VIO_no_completion) )
+bool hvm_emulate_one_ctxt(struct hvm_emulate_ctxt *ctxt)
+{
+ int rc = hvm_emulate_one(ctxt, VIO_no_completion);
+
+ switch ( rc )
{
case X86EMUL_UNHANDLEABLE:
- hvm_dump_emulation_state(XENLOG_G_WARNING, ctxt.descr, &ctxt, rc);
+ hvm_dump_emulation_state(XENLOG_G_WARNING, ctxt->descr, ctxt, rc);
return false;
case X86EMUL_UNRECOGNIZED:
- hvm_dump_emulation_state(XENLOG_G_WARNING, ctxt.descr, &ctxt, rc);
+ hvm_dump_emulation_state(XENLOG_G_WARNING, ctxt->descr, ctxt, rc);
hvm_inject_hw_exception(X86_EXC_UD, X86_EVENT_NO_EC);
break;
case X86EMUL_EXCEPTION:
- hvm_inject_event(&ctxt.ctxt.event);
+ hvm_inject_event(&ctxt->ctxt.event);
break;
}
- hvm_emulate_writeback(&ctxt);
+ hvm_emulate_writeback(ctxt);
return true;
}
diff --git a/xen/arch/x86/include/asm/hvm/emulate.h
b/xen/arch/x86/include/asm/hvm/emulate.h
index 2801d14d5455..084e2bd90588 100644
--- a/xen/arch/x86/include/asm/hvm/emulate.h
+++ b/xen/arch/x86/include/asm/hvm/emulate.h
@@ -65,6 +65,7 @@ enum emul_kind {
bool __nonnull(1, 2) hvm_emulate_one_insn(
hvm_emulate_validate_t *validate,
const char *descr);
+bool hvm_emulate_one_ctxt(struct hvm_emulate_ctxt *ctxt);
int hvm_emulate_one(
struct hvm_emulate_ctxt *hvmemul_ctxt,
enum vio_completion completion);
--
2.53.0
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |