#include <asm/hvm/grant_table.h>
#include <asm/pv/grant_table.h>
+#include "pv/emulate.h"
+
/* Override macros from asm/page.h to make them work with mfn_t */
#undef mfn_to_page
#define mfn_to_page(mfn) __mfn_to_page(mfn_x(mfn))
container_of(ctxt, struct ptwr_emulate_ctxt, ctxt));
}
-static int pv_emul_is_mem_write(const struct x86_emulate_state *state,
- struct x86_emulate_ctxt *ctxt)
-{
- return x86_insn_is_mem_write(state, ctxt) ? X86EMUL_OKAY
- : X86EMUL_UNHANDLEABLE;
-}
-
static const struct x86_emulate_ops ptwr_emulate_ops = {
.read = ptwr_emulated_read,
.insn_fetch = ptwr_emulated_read,
#ifndef __PV_EMULATE_H__
#define __PV_EMULATE_H__
+#include <asm/x86_emulate.h>
+
int pv_emul_read_descriptor(unsigned int sel, const struct vcpu *v,
unsigned long *base, unsigned long *limit,
unsigned int *ar, bool insn_fetch);
void pv_emul_instruction_done(struct cpu_user_regs *regs, unsigned long rip);
+static inline int pv_emul_is_mem_write(const struct x86_emulate_state *state,
+ struct x86_emulate_ctxt *ctxt)
+{
+ return x86_insn_is_mem_write(state, ctxt) ? X86EMUL_OKAY
+ : X86EMUL_UNHANDLEABLE;
+}
+
#endif /* __PV_EMULATE_H__ */