Gleb Natapov wrote:
+       u8 event_exit_inst_len;
+
Can we simply read the field when we need, instead of a new field?

Usually relying on vm exit information to be valid before vm entry
is wrong because migration can happen in a meantime. In this particular
case it is not so obvious since we don't want to migrate pending soft
interrupt, but re-execute instruction instead (we could migrate it
theoretically and may be we should, but when migrating from AMD to
Intel we don't have this info anyway). Another case where instruction
length as read from vmx may be outdated at interrupt injection time is
if exception happened during interrupt delivery and exception should be
re-injected first.

Note that in some cases we do keep things in vmcs/vmcb fields -- the registers, segments, etc. This is because we have per-vendor accessors for them, so we maintain a "virtual data structure" that common code can access.

We could do something similar with the interrupt queue - keep part of it in the vmcs/vmcb and use accessors to modify it. But I don't think it's worthwhile; for vmx we have to read and write it anyway (since, unlike the registers, the exit and entry fields are different) and for svm it's in memory anyway so reading and writing it back is very cheap.

--
Do not meddle in the internals of kernels, for they are subtle and quick to 
panic.

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

Reply via email to