@@ -40,6 +40,7 @@ enum mmio_type {
MMIO_READ_ZERO_EXTEND,
MMIO_READ_SIGN_EXTEND,
MMIO_MOVS,
+ MMIO_IGNORE,
};
enum mmio_type insn_decode_mmio(struct insn *insn, int *bytes);
@@ -698,6 +698,9 @@ static enum es_result vc_handle_mmio(struct ghcb *ghcb, struct es_em_ctxt *ctxt)
if (mmio == MMIO_DECODE_FAILED)
return ES_DECODE_FAILED;
+ if (mmio == MMIO_IGNORE)
+ return ES_OK;
+
if (mmio != MMIO_WRITE_IMM && mmio != MMIO_MOVS) {
reg_data = insn_get_modrm_reg_ptr(insn, ctxt->regs);
if (!reg_data)
@@ -898,6 +898,13 @@ enum mmio_type insn_decode_mmio(struct insn *insn, int *bytes)
*bytes = 2;
type = MMIO_READ_SIGN_EXTEND;
break;
+ case 0xae: /* CLFLUSH */
+ /*
+ * Ignore CLFLUSHes - those go to emulated MMIO anyway and the
+ * hypervisor is responsible for cache management.
+ */
+ type = MMIO_IGNORE;
+ break;
}
break;
}