These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / arch / x86 / include / asm / kvm_emulate.h
index 57a9d94..e9cd7be 100644 (file)
@@ -111,6 +111,16 @@ struct x86_emulate_ops {
                        unsigned int bytes,
                        struct x86_exception *fault);
 
+       /*
+        * read_phys: Read bytes of standard (non-emulated/special) memory.
+        *            Used for descriptor reading.
+        *  @addr:  [IN ] Physical address from which to read.
+        *  @val:   [OUT] Value read from memory.
+        *  @bytes: [IN ] Number of bytes to read from memory.
+        */
+       int (*read_phys)(struct x86_emulate_ctxt *ctxt, unsigned long addr,
+                       void *val, unsigned int bytes);
+
        /*
         * write_std: Write bytes of standard (non-emulated/special) memory.
         *            Used for descriptor writing.
@@ -193,6 +203,8 @@ struct x86_emulate_ops {
        int (*cpl)(struct x86_emulate_ctxt *ctxt);
        int (*get_dr)(struct x86_emulate_ctxt *ctxt, int dr, ulong *dest);
        int (*set_dr)(struct x86_emulate_ctxt *ctxt, int dr, ulong value);
+       u64 (*get_smbase)(struct x86_emulate_ctxt *ctxt);
+       void (*set_smbase)(struct x86_emulate_ctxt *ctxt, u64 smbase);
        int (*set_msr)(struct x86_emulate_ctxt *ctxt, u32 msr_index, u64 data);
        int (*get_msr)(struct x86_emulate_ctxt *ctxt, u32 msr_index, u64 *pdata);
        int (*check_pmc)(struct x86_emulate_ctxt *ctxt, u32 pmc);
@@ -262,6 +274,11 @@ enum x86emul_mode {
        X86EMUL_MODE_PROT64,    /* 64-bit (long) mode.    */
 };
 
+/* These match some of the HF_* flags defined in kvm_host.h  */
+#define X86EMUL_GUEST_MASK           (1 << 5) /* VCPU is in guest-mode */
+#define X86EMUL_SMM_MASK             (1 << 6)
+#define X86EMUL_SMM_INSIDE_NMI_MASK  (1 << 7)
+
 struct x86_emulate_ctxt {
        const struct x86_emulate_ops *ops;
 
@@ -273,8 +290,8 @@ struct x86_emulate_ctxt {
 
        /* interruptibility state, as a result of execution of STI or MOV SS */
        int interruptibility;
+       int emul_flags;
 
-       bool guest_mode; /* guest running a nested guest */
        bool perm_ok; /* do not check permissions if true */
        bool ud;        /* inject an #UD if host doesn't support insn */