Recognized in debug builds of the hypervisor only.
+### hvm\_fep
+> `= <boolean>`
+
+> Default: `false`
+
+Allow use of the Forced Emulation Prefix in HVM guests, to allow emulation of
+arbitrary instructions.
+
+This option is intended for development purposes, and is only available in
+debug builds of the hypervisor.
+
### hvm\_port80
> `= <boolean>`
static bool_t __initdata opt_hap_enabled = 1;
boolean_param("hap", opt_hap_enabled);
+#ifndef opt_hvm_fep
+bool_t opt_hvm_fep;
+boolean_param("hvm_fep", opt_hvm_fep);
+#endif
+
static int cpu_callback(
struct notifier_block *nfb, unsigned long action, void *hcpu)
{
struct hvm_emulate_ctxt ctxt;
int rc;
+ if ( opt_hvm_fep )
+ {
+ char sig[5]; /* ud2; .ascii "xen" */
+
+ if ( (hvm_fetch_from_guest_virt_nofault(
+ sig, regs->eip, sizeof(sig), 0) == HVMCOPY_okay) &&
+ (memcmp(sig, "\xf\xbxen", sizeof(sig)) == 0) )
+ {
+ regs->eip += sizeof(sig);
+ regs->eflags &= ~X86_EFLAGS_RF;
+ }
+ }
+
hvm_emulate_prepare(&ctxt, regs);
rc = hvm_emulate_one(&ctxt);
struct hvm_emulate_ctxt ctxt;
int rc;
+ if ( opt_hvm_fep )
+ {
+ char sig[5]; /* ud2; .ascii "xen" */
+
+ if ( (hvm_fetch_from_guest_virt_nofault(
+ sig, regs->eip, sizeof(sig), 0) == HVMCOPY_okay) &&
+ (memcmp(sig, "\xf\xbxen", sizeof(sig)) == 0) )
+ {
+ regs->eip += sizeof(sig);
+ regs->eflags &= ~X86_EFLAGS_RF;
+ }
+ }
+
hvm_emulate_prepare(&ctxt, regs);
rc = hvm_emulate_one(&ctxt);
/* interrupt */
enum hvm_intblk nhvm_interrupt_blocked(struct vcpu *v);
+#ifndef NDEBUG
+/* Permit use of the Forced Emulation Prefix in HVM guests */
+extern bool_t opt_hvm_fep;
+#else
+#define opt_hvm_fep 0
+#endif
+
#endif /* __ASM_X86_HVM_HVM_H__ */
/*