On 19.10.2008, at 11:46, Avi Kivity wrote:
Alexander Graf wrote:
This patch implements the GIF flag and the clgi and stgi
instructions that
set this flag. Only if the flag is set (default), interrupts can be
received by
the CPU.
To keep the information about that somewhere, this patch adds a new
hidden
flags vector. that is used to store information that does not go
into the
vmcb, but is SVM specific.
diff --git a/include/asm-x86/kvm_host.h b/include/asm-x86/kvm_host.h
index 4b06ca8..dc30b7b 100644
--- a/include/asm-x86/kvm_host.h
+++ b/include/asm-x86/kvm_host.h
@@ -253,6 +253,7 @@ struct kvm_vcpu_arch {
unsigned long cr3;
unsigned long cr4;
unsigned long cr8;
+ u32 hflags;
u64 pdptrs[4]; /* pae */
u64 shadow_efer;
u64 apic_base;
@@ -734,6 +735,8 @@ enum {
TASK_SWITCH_GATE = 3,
};
+#define HF_GIF_MASK (1 << 0)
+
Why not use bool for gif? It will improve code readability.
This way the code is closer to what qemu cpu emulation is doing
(probably no good reason). Also it allows for more flags to be added
later on. I originally had a VMLOAD/VMRUN/VMSAVE merging hack, that
would set the hflag - until I realized that it's not SMP safe.
Nevertheless, I thought it might be better to have something that's
easily extensible. If you think otherwise, I'd change it, but I like
the hflags idea in general.
Alex
--
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