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.

+
+       u32 hflags;
 };

bool gif : 1;

(or even

bool gif;)?

+static int stgi_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
+{
+       svm->next_rip = kvm_rip_read(&svm->vcpu) + 3;
+       skip_emulated_instruction(&svm->vcpu);
+
+       if (svm->vmcb->save.cpl) {
+               printk(KERN_ERR "%s: invalid cpl 0x%x at ip 0x%lx\n",
+                      __func__, svm->vmcb->save.cpl, kvm_rip_read(&svm->vcpu));
+               kvm_queue_exception(&svm->vcpu, GP_VECTOR);
+               return 1;
+       }

Check before adjusting rip.

+static int clgi_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
+{
+       svm->next_rip = kvm_rip_read(&svm->vcpu) + 3;
+       skip_emulated_instruction(&svm->vcpu);
+
+       if (svm->vmcb->save.cpl) {
+               printk(KERN_ERR "%s: invalid cpl 0x%x at ip 0x%lx\n",
+                      __func__, svm->vmcb->save.cpl, kvm_rip_read(&svm->vcpu));
+               kvm_queue_exception(&svm->vcpu, GP_VECTOR);
+               return 1;
+       }

Ditto.

Need save/restore support as well.  Can be in a different patch, though.

--
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 [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to