Re: [PATCH] x86 emulator: Add 'push/pop sreg' instructions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/19/2009 03:52 PM, Mohammed Gamal wrote:

+static void emulate_push_sreg(struct x86_emulate_ctxt *ctxt, int seg)
+{
+       struct decode_cache *c =&ctxt->decode;
+       struct kvm_segment segment;
+
+       if (ctxt->mode == X86EMUL_MODE_PROT64&&    (seg != VCPU_SREG_FS ||
+                                                  seg != VCPU_SREG_GS)) {
+               kvm_queue_exception(ctxt->vcpu, UD_VECTOR);
+               return;
+       }

It's better to check at the callsite, in case the opcode is ever reused for
a new instruction.  Or even better, add a new decode flag No64 so we can do
this during the decode stage.
Good idea, but I believe it'd be better to introduce it in a separate
patch so that we can update all instructions incompatible with long
mode in one go. I'll move the checks to the call site for the time
being.

Sure.  Or do the No64 patch first.

--
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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux