On 03/28/2011 12:46 PM, Joerg Roedel wrote:
This patch adds code to check for IOIO intercepts on
instructions decoded by the KVM instruction emulator.


@@ -3926,6 +3926,10 @@ static struct __x86_intercept {
        [x86_intercept_iret]            = PRE_EX(SVM_EXIT_IRET),
        [x86_intercept_icebp]           = PRE_EX(SVM_EXIT_ICEBP),
        [x86_intercept_hlt]             = POST_EX(SVM_EXIT_HLT),
+       [x86_intercept_in]              = POST_EX(SVM_EXIT_IOIO),
+       [x86_intercept_ins]             = POST_EX(SVM_EXIT_IOIO),
+       [x86_intercept_out]             = POST_EX(SVM_EXIT_IOIO),
+       [x86_intercept_outs]            = POST_EX(SVM_EXIT_IOIO),
  };

The spec indicates we need to check the TSS and IOPL based permissions before the intercept (vmx agrees). With the code as is, it happens afterwards.

One way to do this is to have an ExtraChecks bit in the opcode::flags. Then opcode::u.xcheck->perms() is the pre-intercept check and opcode::u.xcheck->execute() is the post-intercept execution. Should work for monitor/mwait/rdtsc(p)/rdpmc/other crap x86 throws at us.

--
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to